Merkle Mountain Range pallet (#7312)

* Add MMR pallet.

* WiP

* Working on testing.

* WiP - test

* Tests passing.

* Add proof generation.

* Generate and verify proofs.

* Allow verification of older proofs.

* Move stuff to a module.

* Split MMR stuff to it's own module.

* Add docs.

* Make parent hash optional.

* LeafData failed approach.

* Finally implement Compact stuff.

* Compact encoding WiP

* Implement remaining pieces.

* Fix tests

* Add docs to compact.

* Implement for tuples.

* Fix documentation.

* Fix warnings and address review suggestion.

* Update frame/merkle-mountain-range/src/primitives.rs

Co-authored-by: cheme <emericchevalier.pro@gmail.com>

* Address review grumbles.

* Removing missing crate.

* Fix test.

* Add some docs and test.

* Add multiple instances.

* Cargo.toml sync.

* Fix no_std compilation.

* More no_std stuff.

* Rename MMR struct.

* Addressing other grumbles.

* Fix test.

* Remove format for no_std compat.

* Add test for MMR pallet.

* Fix std feature.

* Update versions.

* Add to node/runtime.

* Add hook to insert digest.

* Make primitives public.

* Update lib.rs

tech spec/typos etc

* Use WeightInfo and benchmarks.

* Fix test.

* Fix benchmarks.

* Trait -> Config.

* Fix typo.

* Fix tests.

Co-authored-by: cheme <emericchevalier.pro@gmail.com>
Co-authored-by: Addie Wagenknecht <addie@nortd.com>
This commit is contained in:
Tomasz Drwięga
2020-12-09 16:35:13 +01:00
committed by GitHub
parent 2ed2832046
commit 02f66e8823
19 changed files with 1751 additions and 50 deletions
+32 -32
View File
@@ -1,19 +1,19 @@
[workspace]
members = [
"bin/node-template/node",
"bin/node-template/runtime",
"bin/node-template/pallets/template",
"bin/node-template/runtime",
"bin/node/bench",
"bin/node/browser-testing",
"bin/node/cli",
"bin/node/executor",
"bin/node/primitives",
"bin/node/rpc-client",
"bin/node/rpc",
"bin/node/rpc-client",
"bin/node/runtime",
"bin/node/testing",
"bin/utils/subkey",
"bin/utils/chain-spec-builder",
"bin/utils/subkey",
"client/api",
"client/authority-discovery",
"client/basic-authorship",
@@ -26,42 +26,41 @@ members = [
"client/consensus/babe",
"client/consensus/babe/rpc",
"client/consensus/common",
"client/consensus/epochs",
"client/consensus/manual-seal",
"client/consensus/pow",
"client/consensus/uncles",
"client/consensus/slots",
"client/consensus/epochs",
"client/consensus/uncles",
"client/db",
"client/executor",
"client/executor/common",
"client/executor/runtime-test",
"client/executor/wasmi",
"client/executor/wasmtime",
"client/executor/runtime-test",
"client/finality-grandpa",
"client/informant",
"client/light",
"client/tracing",
"client/keystore",
"client/light",
"client/network",
"client/network/test",
"client/network-gossip",
"client/network/test",
"client/offchain",
"client/peerset",
"client/proposer-metrics",
"client/rpc-servers",
"client/rpc",
"client/rpc-api",
"client/rpc-servers",
"client/service",
"client/service/test",
"client/state-db",
"client/sync-state-rpc",
"client/telemetry",
"client/tracing",
"client/transaction-pool",
"client/transaction-pool/graph",
"utils/prometheus",
"frame/assets",
"frame/aura",
"frame/atomic-swap",
"frame/aura",
"frame/authority-discovery",
"frame/authorship",
"frame/babe",
@@ -72,7 +71,6 @@ members = [
"frame/contracts/rpc",
"frame/contracts/rpc/runtime-api",
"frame/democracy",
"frame/elections-phragmen",
"frame/elections",
"frame/example",
"frame/example-offchain-worker",
@@ -83,6 +81,7 @@ members = [
"frame/im-online",
"frame/indices",
"frame/membership",
"frame/merkle-mountain-range",
"frame/metadata",
"frame/multisig",
"frame/nicks",
@@ -97,8 +96,8 @@ members = [
"frame/session/benchmarking",
"frame/society",
"frame/staking",
"frame/staking/reward-curve",
"frame/staking/fuzzer",
"frame/staking/reward-curve",
"frame/sudo",
"frame/support",
"frame/support/procedural",
@@ -116,59 +115,59 @@ members = [
"frame/utility",
"frame/vesting",
"primitives/allocator",
"primitives/api",
"primitives/api/proc-macro",
"primitives/api/test",
"primitives/application-crypto",
"primitives/application-crypto/test",
"primitives/arithmetic",
"primitives/arithmetic/fuzzer",
"primitives/authority-discovery",
"primitives/authorship",
"primitives/block-builder",
"primitives/blockchain",
"primitives/chain-spec",
"primitives/consensus/aura",
"primitives/consensus/babe",
"primitives/consensus/common",
"primitives/consensus/pow",
"primitives/consensus/vrf",
"primitives/core",
"primitives/chain-spec",
"primitives/database",
"primitives/debug-derive",
"primitives/storage",
"primitives/externalities",
"primitives/finality-grandpa",
"primitives/inherents",
"primitives/io",
"primitives/keyring",
"primitives/keystore",
"primitives/npos-elections",
"primitives/npos-elections/compact",
"primitives/npos-elections/fuzzer",
"primitives/offchain",
"primitives/panic-handler",
"primitives/npos-elections",
"primitives/npos-elections/fuzzer",
"primitives/npos-elections/compact",
"primitives/rpc",
"primitives/runtime",
"primitives/runtime-interface",
"primitives/runtime-interface/proc-macro",
"primitives/runtime-interface/test",
"primitives/runtime-interface/test-wasm",
"primitives/runtime-interface/test-wasm-deprecated",
"primitives/runtime-interface/test",
"primitives/sandbox",
"primitives/serializer",
"primitives/session",
"primitives/api",
"primitives/api/proc-macro",
"primitives/api/test",
"primitives/arithmetic",
"primitives/arithmetic/fuzzer",
"primitives/io",
"primitives/runtime",
"primitives/sandbox",
"primitives/staking",
"primitives/std",
"primitives/version",
"primitives/state-machine",
"primitives/std",
"primitives/storage",
"primitives/tasks",
"primitives/timestamp",
"primitives/test-primitives",
"primitives/transaction-pool",
"primitives/timestamp",
"primitives/tracing",
"primitives/transaction-pool",
"primitives/trie",
"primitives/utils",
"primitives/version",
"primitives/wasm-interface",
"test-utils/client",
"test-utils/derive",
@@ -183,6 +182,7 @@ members = [
"utils/frame/frame-utilities-cli",
"utils/frame/rpc/support",
"utils/frame/rpc/system",
"utils/prometheus",
"utils/wasm-builder",
]