-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expose MMR root through runtime API - use it in BEEFY client #11183
Expose MMR root through runtime API - use it in BEEFY client #11183
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Moved MMR primitives from |
f178cf0
to
449a204
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the worker should still rely on digests for fetching the MMR root. Doing it with a runtime call will make it harder for any future light client to verify BEEFY (since it requires a runtime call which a light client can't do), and this would also require changes to state pruning since validators will prune state on finality in which case the runtime call to fetch the MMR root will fail.
To be clear, I think adding the runtime API and all the other changes in this PR are good, but due to the reasons above I think it would be safer to keep using the digest. |
bot merge |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge force |
Error: pr-custom-review is not passing for paritytech/polkadot#5276 |
bot merge |
…ech#11183) * beefy-gadget: allow custom runtime api provider * beefy-gadget: use mock runtime api in tests * pallet-mmr: expose mmr root from state through runtime API * beefy-gadget: get mmr root from runtime state * pallet-beefy-mmr: remove MmrRoot from header digests * frame/mmr: move mmr primitives out of frame * frame/mmr: completely move primitives out of frame * address review comments * beefy-mmr: bring back mmr root from header digest * clippy fixes for rustc 1.60 * address review comments
…ech#11183) * beefy-gadget: allow custom runtime api provider * beefy-gadget: use mock runtime api in tests * pallet-mmr: expose mmr root from state through runtime API * beefy-gadget: get mmr root from runtime state * pallet-beefy-mmr: remove MmrRoot from header digests * frame/mmr: move mmr primitives out of frame * frame/mmr: completely move primitives out of frame * address review comments * beefy-mmr: bring back mmr root from header digest * clippy fixes for rustc 1.60 * address review comments
…ech#11183) * beefy-gadget: allow custom runtime api provider * beefy-gadget: use mock runtime api in tests * pallet-mmr: expose mmr root from state through runtime API * beefy-gadget: get mmr root from runtime state * pallet-beefy-mmr: remove MmrRoot from header digests * frame/mmr: move mmr primitives out of frame * frame/mmr: completely move primitives out of frame * address review comments * beefy-mmr: bring back mmr root from header digest * clippy fixes for rustc 1.60 * address review comments
Adds new
mmr_root()
API topallet-mmr
; doesn't change runtime storage.BEEFY client then uses this API as a backup to
MmrRoot
header digest logs.Enables removal of
MmrRoot
header digest entries in the future => lighter headers.beefy-gadget
: allow custom runtime api providerbeefy-gadget
: use mock runtime api in testspallet-mmr
: expose MMR root from state through runtime APIbeefy-gadget
: get MMR root from runtime statepallet-beefy-mmr
: remove MMR root from header digestsMoves MMR primitives from
frame/merkle-mountain-range/primitives
toprimitives/merkle-mountain-range
soMmrApi
can be used byclient
code.Fixes paritytech/grandpa-bridge-gadget#42
Fixes paritytech/grandpa-bridge-gadget#406
Polkadot companion: paritytech/polkadot#5276
Cumulus companion: paritytech/cumulus#1161