17 major breaking releases

new 21.0.0 Mar 26, 2023
20.0.0 Mar 5, 2023
19.0.0 Feb 26, 2023
18.0.0 Feb 19, 2023
0.0.0 Nov 29, 2022

#197 in Magic Beans

Download history 13/week @ 2022-12-08 165/week @ 2022-12-15 37/week @ 2022-12-22 40/week @ 2023-01-05 28/week @ 2023-01-12 24/week @ 2023-01-19 24/week @ 2023-01-26 39/week @ 2023-02-02 60/week @ 2023-02-09 58/week @ 2023-02-16 44/week @ 2023-02-23 45/week @ 2023-03-02 4/week @ 2023-03-09 42/week @ 2023-03-23

95 downloads per month


18K SLoC


Auto-generated README.md for publishing to crates.io


MMR offchain gadget

The MMR offchain gadget is run alongside pallet-mmr to assist it with offchain canonicalization of finalized MMR leaves and nodes. The gadget should only be run on nodes that have Indexing API enabled (otherwise pallet-mmr cannot write to offchain and this gadget has nothing to do).

The runtime pallet-mmr creates one new MMR leaf per block and all inner MMR parent nodes generated by the MMR when adding said leaf. MMR nodes are stored both in:

  • on-chain storage - hashes only; not full leaf content;
  • off-chain storage - via Indexing API, full leaf content (and all internal nodes as well) is saved to the Off-chain DB using a key derived from parent_hash and node index in MMR. The parent_hash is also used within the key to avoid conflicts and overwrites on forks (leaf data is only allowed to reference data coming from parent block).

This gadget is driven by block finality and in responsible for pruning stale forks from offchain db, and moving finalized forks under a "canonical" key based solely on node pos in the MMR.


~2M SLoC