[BEEFY] Add runtime support for reporting fork voting (#4522)
Related to https://github.com/paritytech/polkadot-sdk/issues/4523 Extracting part of https://github.com/paritytech/polkadot-sdk/pull/1903 (credits to @Lederstrumpf for the high-level strategy), but also introducing significant adjustments both to the approach and to the code. The main adjustment is the fact that the `ForkVotingProof` accepts only one vote, compared to the original version which accepted a `vec![]`. With this approach more calls are needed in order to report multiple equivocated votes on the same commit, but it simplifies a lot the checking logic. We can add support for reporting multiple signatures at once in the future. There are 2 things that are missing in order to consider this issue done, but I would propose to do them in a separate PR since this one is already pretty big: - benchmarks/computing a weight for the new extrinsic (this wasn't present in https://github.com/paritytech/polkadot-sdk/pull/1903 either) - exposing an API for generating the ancestry proof. I'm not sure if we should do this in the Mmr pallet or in the Beefy pallet Co-authored-by:Robert Hambrock <roberthambrock@gmail.com> --------- Co-authored-by:
Adrian Catangiu <adrian@parity.io>
Showing
- polkadot/node/service/src/fake_runtime_api.rs 1 addition, 1 deletionpolkadot/node/service/src/fake_runtime_api.rs
- polkadot/runtime/rococo/src/lib.rs 4 additions, 3 deletionspolkadot/runtime/rococo/src/lib.rs
- polkadot/runtime/test-runtime/src/lib.rs 1 addition, 1 deletionpolkadot/runtime/test-runtime/src/lib.rs
- polkadot/runtime/westend/src/lib.rs 4 additions, 2 deletionspolkadot/runtime/westend/src/lib.rs
- prdoc/pr_4522.prdoc 39 additions, 0 deletionsprdoc/pr_4522.prdoc
- substrate/bin/node/runtime/src/lib.rs 4 additions, 3 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/client/consensus/beefy/src/fisherman.rs 3 additions, 3 deletionssubstrate/client/consensus/beefy/src/fisherman.rs
- substrate/client/consensus/beefy/src/tests.rs 1 addition, 1 deletionsubstrate/client/consensus/beefy/src/tests.rs
- substrate/client/consensus/beefy/src/worker.rs 3 additions, 3 deletionssubstrate/client/consensus/beefy/src/worker.rs
- substrate/frame/beefy-mmr/src/lib.rs 75 additions, 4 deletionssubstrate/frame/beefy-mmr/src/lib.rs
- substrate/frame/beefy-mmr/src/mock.rs 1 addition, 0 deletionssubstrate/frame/beefy-mmr/src/mock.rs
- substrate/frame/beefy-mmr/src/tests.rs 198 additions, 26 deletionssubstrate/frame/beefy-mmr/src/tests.rs
- substrate/frame/beefy/src/default_weights.rs 14 additions, 2 deletionssubstrate/frame/beefy/src/default_weights.rs
- substrate/frame/beefy/src/equivocation.rs 189 additions, 96 deletionssubstrate/frame/beefy/src/equivocation.rs
- substrate/frame/beefy/src/lib.rs 204 additions, 14 deletionssubstrate/frame/beefy/src/lib.rs
- substrate/frame/beefy/src/mock.rs 45 additions, 2 deletionssubstrate/frame/beefy/src/mock.rs
- substrate/frame/beefy/src/tests.rs 420 additions, 152 deletionssubstrate/frame/beefy/src/tests.rs
- substrate/frame/merkle-mountain-range/src/lib.rs 32 additions, 20 deletionssubstrate/frame/merkle-mountain-range/src/lib.rs
- substrate/frame/merkle-mountain-range/src/mmr/mmr.rs 36 additions, 38 deletionssubstrate/frame/merkle-mountain-range/src/mmr/mmr.rs
- substrate/frame/merkle-mountain-range/src/mmr/mod.rs 1 addition, 1 deletionsubstrate/frame/merkle-mountain-range/src/mmr/mod.rs
Please register or sign in to comment