Сryptocurrency development analysis

Description

After the DB and networking code was extracted from `txp`, `lrc`. `update`, `delegation`, `ssc` and `block`, the remain packages are rather small and it actually makes sense to consolidate them into a single package named `chain`.

Took extra care to make sure all the tests and benchmark programs moved across as well.

* Only the `block` package had a benchmark program and that is now at `chain/bench/block-bench.hs`.
* Only `txp` `lrc, `ssc` and `block` all had test suites.

Its an unfortunately large PRs.

## Linked issue

https://iohk.myjetbrains.com/youtrack/issue/CDEC-473

## Type of change

— [ ] 🐞 Bug fix (non-breaking change which fixes an issue)
— [ ] 🛠 New feature (non-breaking change which adds functionality)
— [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
— [x] 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
— [ ] 🔨 New or improved tests for existing code
— [ ] ⛑ git-flow chore (backport, hotfix, etc)

## Developer checklist

— [ ] I have read the [style guide](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/style-guide.md) document, and my code follows the code style of this project.
— [ ] If my code deals with exceptions, it follows the [guidelines](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/exceptions.md).
— [ ] I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on [cardanodocs.com](https://github.com/input-output-hk/cardanodocs.com), amending the inline [Haddock](https://www.haskell.org/haddock/) comments, any relevant README file or one of the document listed in the [docs](https://github.com/input-output-hk/cardano-sl/tree/develop/docs) directory.

## Testing checklist

— [ ] I have added tests to cover my changes.
— [x] All new and existing tests passed.

## QA Steps

## Screenshots (if available)

You can view, comment on, or merge this pull request online at:

https://github.com/input-output-hk/cardano-sl/pull/3313

— Commit Summary —

* CDEC-473: Rename txp package to chain
* CDEC-461: Merge lrc package into chain package
* CDEC-461: Merge ssc package into chain package
* CDEC-473: Merge delegation into the chain package
* CDEC-473: Merge update into the chain package
* CDEC-473: Merge the block package into chain
* Update the cardano-sl-chain README.md

— File Changes —

M auxx/cardano-sl-auxx.cabal (7)
M auxx/src/Command/Proc.hs (2)
M auxx/src/Command/Rollback.hs (4)
M auxx/src/Command/Tx.hs (2)
M auxx/src/Command/TyProjection.hs (4)
M auxx/src/Command/Update.hs (4)
M auxx/src/Lang/Value.hs (3)
M auxx/src/Mode.hs (6)
M auxx/src/Plugin.hs (2)
D block/README.md (14)
D block/cardano-sl-block.cabal (166)
D block/src/Pos/Block/Logic.hs (6)
D block/src/Pos/Block/Slog.hs (9)
D block/test/LICENSE (20)
D block/test/cardano-sl-block-test.cabal (40)
D block/test/test.hs (9)
R chain/LICENSE (0)
A chain/README.md (27)
R chain/Setup.hs (0)
R chain/bench/block-bench.hs (24)
A chain/cardano-sl-chain.cabal (282)
R chain/src/Pos/Chain/Block/BHelpers.hs (4)
R chain/src/Pos/Chain/Block/Configuration.hs (2)
R chain/src/Pos/Chain/Block/Error.hs (2)
A chain/src/Pos/Chain/Block/Logic.hs (6)
R chain/src/Pos/Chain/Block/Logic/Integrity.hs (4)
A chain/src/Pos/Chain/Block/Slog.hs (9)
R chain/src/Pos/Chain/Block/Slog/Types.hs (2)
R chain/src/Pos/Chain/Block/Types.hs (8)
A chain/src/Pos/Chain/Delegation.hs (13)
A chain/src/Pos/Chain/Delegation/Cede.hs (11)
R chain/src/Pos/Chain/Delegation/Cede/Class.hs (4)
R chain/src/Pos/Chain/Delegation/Cede/Types.hs (4)
R chain/src/Pos/Chain/Delegation/Class.hs (4)
R chain/src/Pos/Chain/Delegation/Configuration.hs (2)
R chain/src/Pos/Chain/Delegation/Types.hs (2)
A chain/src/Pos/Chain/Lrc.hs (10)
R chain/src/Pos/Chain/Lrc/Core.hs (4)
R chain/src/Pos/Chain/Lrc/Error.hs (2)
R chain/src/Pos/Chain/Lrc/Fts.hs (2)
R chain/src/Pos/Chain/Lrc/Genesis.hs (8)
R chain/src/Pos/Chain/Lrc/RichmenComponent.hs (4)
R chain/src/Pos/Chain/Lrc/Types.hs (2)
R chain/src/Pos/Chain/Script.hs (2)
R chain/src/Pos/Chain/Script/Examples.hs (4)
A chain/src/Pos/Chain/Security.hs (6)
R chain/src/Pos/Chain/Security/Params.hs (4)
R chain/src/Pos/Chain/Security/Util.hs (6)
A chain/src/Pos/Chain/Ssc.hs (25)
R chain/src/Pos/Chain/Ssc/Base.hs (2)
R chain/src/Pos/Chain/Ssc/Behavior.hs (2)
R chain/src/Pos/Chain/Ssc/Configuration.hs (2)
A chain/src/Pos/Chain/Ssc/Error.hs (7)
R chain/src/Pos/Chain/Ssc/Error/Seed.hs (2)
R chain/src/Pos/Chain/Ssc/Error/Verify.hs (2)
R chain/src/Pos/Chain/Ssc/Functions.hs (14)
R chain/src/Pos/Chain/Ssc/Mem.hs (4)
R chain/src/Pos/Chain/Ssc/Message.hs (4)
R chain/src/Pos/Chain/Ssc/Seed.hs (9)
R chain/src/Pos/Chain/Ssc/Shares.hs (7)
A chain/src/Pos/Chain/Ssc/Toss.hs (17)
R chain/src/Pos/Chain/Ssc/Toss/Base.hs (12)
R chain/src/Pos/Chain/Ssc/Toss/Class.hs (4)
R chain/src/Pos/Chain/Ssc/Toss/Logic.hs (12)
R chain/src/Pos/Chain/Ssc/Toss/Pure.hs (17)
R chain/src/Pos/Chain/Ssc/Toss/Trans.hs (11)
R chain/src/Pos/Chain/Ssc/Toss/Types.hs (6)
R chain/src/Pos/Chain/Ssc/Types.hs (8)
R chain/src/Pos/Chain/Ssc/VssCertData.hs (2)
A chain/src/Pos/Chain/Txp.hs (19)
R chain/src/Pos/Chain/Txp/Base.hs (2)
R chain/src/Pos/Chain/Txp/Configuration.hs (2)
R chain/src/Pos/Chain/Txp/Error.hs (2)
R chain/src/Pos/Chain/Txp/GenesisUtxo.hs (4)
A chain/src/Pos/Chain/Txp/Toil.hs (15)
R chain/src/Pos/Chain/Txp/Toil/Failure.hs (6)
R chain/src/Pos/Chain/Txp/Toil/Logic.hs (23)
R chain/src/Pos/Chain/Txp/Toil/Monad.hs (7)
R chain/src/Pos/Chain/Txp/Toil/Stakes.hs (8)
R chain/src/Pos/Chain/Txp/Toil/Types.hs (2)
A chain/src/Pos/Chain/Txp/Toil/Utxo.hs (9)
R chain/src/Pos/Chain/Txp/Toil/Utxo/Functions.hs (13)
R chain/src/Pos/Chain/Txp/Toil/Utxo/Util.hs (7)
R chain/src/Pos/Chain/Txp/Topsort.hs (2)
A chain/src/Pos/Chain/Update.hs (23)
R chain/src/Pos/Chain/Update/BlockVersion.hs (2)
R chain/src/Pos/Chain/Update/Configuration.hs (2)
R chain/src/Pos/Chain/Update/Constants.hs (2)
R chain/src/Pos/Chain/Update/Params.hs (2)
A chain/src/Pos/Chain/Update/Poll.hs (13)
R chain/src/Pos/Chain/Update/Poll/Class.hs (24)
R chain/src/Pos/Chain/Update/Poll/Failure.hs (2)
R chain/src/Pos/Chain/Update/Poll/Modifier.hs (6)
R chain/src/Pos/Chain/Update/Poll/Types.hs (2)
R chain/test/LICENSE (0)
R chain/test/Setup.hs (0)
R chain/test/Spec.hs (0)
R chain/test/Test/Pos/Chain/Block/Arbitrary.hs (12)
R chain/test/Test/Pos/Chain/Block/Arbitrary/Generate.hs (6)
R chain/test/Test/Pos/Chain/Block/BlockSpec.hs (8)
R chain/test/Test/Pos/Chain/Block/CborSpec.hs (4)
R chain/test/Test/Pos/Chain/Block/SafeCopySpec.hs (4)
R chain/test/Test/Pos/Chain/Delegation/Arbitrary.hs (4)
R chain/test/Test/Pos/Chain/Lrc/Arbitrary.hs (4)
R chain/test/Test/Pos/Chain/Lrc/FtsSpec.hs (10)
R chain/test/Test/Pos/Chain/Ssc/Arbitrary.hs (15)
R chain/test/Test/Pos/Chain/Ssc/Gen.hs (6)
R chain/test/Test/Pos/Chain/Ssc/Json.hs (6)
R chain/test/Test/Pos/Chain/Txp/CoreSpec.hs (6)
R chain/test/Test/Pos/Chain/Txp/Toil/UtxoSpec.hs (22)
R chain/test/Test/Pos/Chain/Update/Arbitrary.hs (6)
R chain/test/Test/Pos/Chain/Update/Arbitrary/Core.hs (4)
R chain/test/cardano-sl-chain-test.cabal (62)
R chain/test/golden/AttackTarget_NetworkAddressTarget (0)
R chain/test/golden/AttackTarget_PubKeyAddressTarget (0)
A chain/test/test.hs (15)
M client/cardano-sl-client.cabal (9)
M client/src/Pos/Client/Txp/Balances.hs (4)
M client/src/Pos/Client/Txp/History.hs (12)
M client/src/Pos/Client/Txp/Util.hs (10)
M client/src/Pos/Client/Update/Network.hs (4)
M client/test/Test/Pos/Client/Txp/Mode.hs (4)
M client/test/Test/Pos/Client/Txp/UtilSpec.hs (2)
M db/cardano-sl-db.cabal (7)
M db/src/Pos/DB/Block.hs (5)
M db/src/Pos/DB/Block/BListener.hs (2)
M db/src/Pos/DB/Block/GState/BlockExtra.hs (2)
M db/src/Pos/DB/Block/Load.hs (2)
M db/src/Pos/DB/Block/Logic/Creation.hs (15)
M db/src/Pos/DB/Block/Logic/Header.hs (3)
M db/src/Pos/DB/Block/Logic/Internal.hs (13)
M db/src/Pos/DB/Block/Logic/Util.hs (4)
M db/src/Pos/DB/Block/Logic/VAR.hs (12)
M db/src/Pos/DB/Block/Lrc.hs (13)
M db/src/Pos/DB/Block/Slog/Context.hs (6)
M db/src/Pos/DB/Block/Slog/Logic.hs (11)
M db/src/Pos/DB/Delegation/Cede/Holders.hs (6)
M db/src/Pos/DB/Delegation/Cede/Logic.hs (6)
M db/src/Pos/DB/Delegation/Core.hs (3)
M db/src/Pos/DB/Delegation/Logic/Common.hs (5)
M db/src/Pos/DB/Delegation/Logic/Mempool.hs (9)
M db/src/Pos/DB/Delegation/Logic/VAR.hs (15)
M db/src/Pos/DB/Delegation/Var.hs (5)
M db/src/Pos/DB/Lrc/Consumer.hs (3)
M db/src/Pos/DB/Lrc/Consumer/Delegation.hs (3)
M db/src/Pos/DB/Lrc/Consumer/Ssc.hs (3)
M db/src/Pos/DB/Lrc/Consumer/Update.hs (3)
M db/src/Pos/DB/Lrc/Context.hs (2)
M db/src/Pos/DB/Lrc/Leaders.hs (2)
M db/src/Pos/DB/Lrc/Richmen.hs (7)
M db/src/Pos/DB/Lrc/RichmenBase.hs (3)
M db/src/Pos/DB/Ssc/GState.hs (4)
M db/src/Pos/DB/Ssc/Logic/Global.hs (14)
M db/src/Pos/DB/Ssc/Logic/Local.hs (29)
M db/src/Pos/DB/Ssc/Logic/VAR.hs (17)
M db/src/Pos/DB/Ssc/SecretStorage.hs (2)
M db/src/Pos/DB/Ssc/State.hs (2)
M db/src/Pos/DB/Ssc/State/Global.hs (11)
M db/src/Pos/DB/Ssc/State/Local.hs (4)
M db/src/Pos/DB/Txp/Logic/Common.hs (2)
M db/src/Pos/DB/Txp/Logic/Global.hs (14)
M db/src/Pos/DB/Txp/Logic/Local.hs (11)
M db/src/Pos/DB/Txp/MemState.hs (2)
M db/src/Pos/DB/Txp/MemState/Class.hs (5)
M db/src/Pos/DB/Txp/MemState/Metrics.hs (2)
M db/src/Pos/DB/Txp/MemState/Types.hs (2)
M db/src/Pos/DB/Txp/Settings.hs (3)
M db/src/Pos/DB/Txp/Stakes.hs (3)
M db/src/Pos/DB/Txp/Utxo.hs (4)
M db/src/Pos/DB/Update/Context.hs (2)
M db/src/Pos/DB/Update/GState.hs (17)
M db/src/Pos/DB/Update/Logic/Global.hs (11)
M db/src/Pos/DB/Update/Logic/Local.hs (12)
M db/src/Pos/DB/Update/MemState/Functions.hs (2)
M db/src/Pos/DB/Update/MemState/Types.hs (3)
M db/src/Pos/DB/Update/Poll/DBPoll.hs (5)
M db/src/Pos/DB/Update/Poll/Logic/Apply.hs (11)
M db/src/Pos/DB/Update/Poll/Logic/Base.hs (15)
M db/src/Pos/DB/Update/Poll/Logic/Normalize.hs (7)
M db/src/Pos/DB/Update/Poll/Logic/Rollback.hs (7)
M db/src/Pos/DB/Update/Poll/Logic/Softfork.hs (5)
M db/src/Pos/DB/Update/Poll/Logic/Version.hs (5)
M db/src/Pos/DB/Update/Poll/PollState.hs (7)
M db/src/Pos/DB/Update/Poll/Pure.hs (9)
M db/test/Test/Pos/DB/Block/Arbitrary.hs (5)
M db/test/Test/Pos/DB/Update/Arbitrary/MemState.hs (2)
M db/test/Test/Pos/DB/Update/Arbitrary/Poll.hs (12)
M db/test/cardano-sl-db-test.cabal (6)
D delegation/README.md (7)
D delegation/Setup.hs (2)
D delegation/src/Pos/Delegation.hs (13)
D delegation/src/Pos/Delegation/Cede.hs (11)
D delegation/test/LICENSE (20)
D delegation/test/Setup.hs (2)
D delegation/test/cardano-sl-delegation-test.cabal (32)
M explorer/cardano-sl-explorer.cabal (13)
M explorer/src/Pos/Explorer/BListener.hs (4)
M explorer/src/Pos/Explorer/DB.hs (4)
M explorer/src/Pos/Explorer/ExtraContext.hs (5)
M explorer/src/Pos/Explorer/Socket/App.hs (2)
M explorer/src/Pos/Explorer/Socket/Methods.hs (2)
M explorer/src/Pos/Explorer/TestUtil.hs (13)
M explorer/src/Pos/Explorer/Txp/Common.hs (2)
M explorer/src/Pos/Explorer/Txp/Local.hs (2)
M explorer/src/Pos/Explorer/Txp/Toil/Logic.hs (8)
M explorer/src/Pos/Explorer/Txp/Toil/Monad.hs (4)
M explorer/src/Pos/Explorer/Web/ClientTypes.hs (2)
M explorer/src/Pos/Explorer/Web/Server.hs (4)
M explorer/src/Pos/Explorer/Web/Transform.hs (8)
M explorer/test/Test/Pos/Explorer/Web/ClientTypesSpec.hs (2)
M explorer/test/Test/Pos/Explorer/Web/ServerSpec.hs (2)
M generator/cardano-sl-generator.cabal (18)
M generator/src/Pos/Generator/Block/Error.hs (2)
M generator/src/Pos/Generator/Block/Logic.hs (6)
M generator/src/Pos/Generator/Block/Mode.hs (8)
M generator/src/Pos/Generator/Block/Payload.hs (6)
M generator/src/Pos/Generator/BlockEvent.hs (4)
M generator/src/Pos/Generator/BlockEvent/DSL.hs (2)
M generator/src/Test/Pos/Block/Logic/Event.hs (2)
M generator/src/Test/Pos/Block/Logic/Mode.hs (6)
M generator/src/Test/Pos/Block/Logic/Util.hs (4)
M generator/test/Test/Pos/Block/Logic/CreationSpec.hs (16)
M generator/test/Test/Pos/Block/Logic/VarSpec.hs (6)
M generator/test/Test/Pos/Block/Property.hs (2)
M generator/test/Test/Pos/Generator/Block/LrcSpec.hs (4)
M infra/cardano-sl-infra.cabal (7)
M infra/src/Pos/Infra/Communication/Types/Relay.hs (4)
M infra/test/Test/Pos/Infra/Arbitrary/Ssc.hs (6)
M infra/test/Test/Pos/Infra/Arbitrary/Update.hs (2)
M infra/test/cardano-sl-infra-test.cabal (5)
M lib/bench/Bench/Pos/Criterion/FollowTheSatoshiBench.hs (2)
M lib/bench/Bench/Pos/Criterion/TxSigningBench.hs (4)
M lib/bench/Bench/Pos/Diffusion/BlockDownload.hs (2)
M lib/cardano-sl.cabal (26)
M lib/src/Pos/Behavior.hs (4)
M lib/src/Pos/Binary/Communication.hs (2)
M lib/src/Pos/Client/CLI/Params.hs (4)
M lib/src/Pos/Client/CLI/Util.hs (12)
M lib/src/Pos/Communication/Limits.hs (4)
M lib/src/Pos/Constants.hs (4)
M lib/src/Pos/Context/Context.hs (7)
M lib/src/Pos/DB/DB.hs (2)
M lib/src/Pos/Diffusion/Full.hs (4)
M lib/src/Pos/Diffusion/Full/Block.hs (4)
M lib/src/Pos/Diffusion/Full/Ssc.hs (4)
M lib/src/Pos/Diffusion/Full/Update.hs (2)
M lib/src/Pos/GState/Context.hs (2)
M lib/src/Pos/GState/GState.hs (2)
M lib/src/Pos/Launcher/Configuration.hs (10)
M lib/src/Pos/Launcher/Launcher.hs (2)
M lib/src/Pos/Launcher/Param.hs (6)
M lib/src/Pos/Launcher/Resource.hs (6)
M lib/src/Pos/Launcher/Runner.hs (8)
M lib/src/Pos/Launcher/Scenario.hs (7)
M lib/src/Pos/Listener/Delegation.hs (3)
M lib/src/Pos/Listener/Update.hs (3)
M lib/src/Pos/Logic/Full.hs (17)
M lib/src/Pos/Logic/Pure.hs (2)
M lib/src/Pos/Logic/Types.hs (6)
M lib/src/Pos/Network/Block/Logic.hs (6)
M lib/src/Pos/Network/Block/WorkMode.hs (7)
M lib/src/Pos/Network/Update/Download.hs (5)
M lib/src/Pos/Web/Server.hs (6)
M lib/src/Pos/WorkMode.hs (9)
M lib/src/Pos/WorkMode/Class.hs (16)
M lib/src/Pos/Worker.hs (2)
M lib/src/Pos/Worker/Block.hs (8)
M lib/src/Pos/Worker/Delegation.hs (5)
M lib/src/Pos/Worker/Ssc.hs (25)
M lib/src/Pos/Worker/Update.hs (4)
M lib/src/Test/Pos/Configuration.hs (15)
M lib/test/Test/Pos/Block/Arbitrary/Message.hs (6)
M lib/test/Test/Pos/Block/CborSpec.hs (2)
M lib/test/Test/Pos/Cbor/CborSpec.hs (14)
M lib/test/Test/Pos/ConstantsSpec.hs (2)
M lib/test/Test/Pos/Diffusion/BlockSpec.hs (2)
M lib/test/Test/Pos/Ssc/ComputeSharesSpec.hs (12)
M lib/test/Test/Pos/Ssc/SeedSpec.hs (4)
M lib/test/Test/Pos/Ssc/Toss/BaseSpec.hs (28)
M lib/test/Test/Pos/Ssc/Toss/PureSpec.hs (6)
M lib/test/Test/Pos/Ssc/VssCertDataSpec.hs (34)
M lib/test/Test/Pos/Update/Identity/SafeCopySpec.hs (4)
M lib/test/Test/Pos/Update/MemStateSpec.hs (4)
M lib/test/Test/Pos/Update/PollSpec.hs (8)
D lrc/LICENSE (20)
D lrc/README.md (7)
D lrc/Setup.hs (2)
D lrc/cardano-sl-lrc.cabal (97)
D lrc/src/Pos/Lrc.hs (15)
D lrc/test/LICENSE (20)
D lrc/test/Setup.hs (2)
D lrc/test/Test.hs (1)
D lrc/test/cardano-sl-lrc-test.cabal (42)
M networking/cardano-sl-networking.cabal (2)
M networking/src/Node/Message/Class.hs (4)
M node/Main.hs (2)
M node/cardano-sl-node.cabal (2)
M ssc/cardano-sl-ssc.cabal (29)
D ssc/src/Pos/Ssc.hs (34)
D ssc/src/Pos/Ssc/Error.hs (7)

— Patch Links —

https://github.com/input-output-hk/cardano-sl/pull/3313.patch
https://github.com/input-output-hk/cardano-sl/pull/3313.diff

Добавить комментарий