-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BEEFY capabilities to the Polkadot runtime #65
Add BEEFY capabilities to the Polkadot runtime #65
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.
Enabling BEEFY on Polkadot will happen after a couple of weeks of it running on Kusama without problems, but let's get the code in a release sooner rather than later to be ready for it.
There is a GenesisBlock storage item in pallet-beefy
that defaults to None
meaning BEEFY consensus is not enabled/running.
Privileged set_new_genesis() will be called through governance at a later point when we decide to enable BEEFY.
Fellowship companion: polkadot-fellows/runtimes#65 This starts the BEEFY client by default for Polkadot nodes. Governance/sudo call is later required to enable/start consensus. Part of paritytech/parity-bridges-common#2420
Is there some specification or document detailing how Beefy works available somewhere? |
Also not yet merged anywhere but pretty comprehensive: |
Fellowship companion: polkadot-fellows/runtimes#65 This starts the BEEFY client by default for Polkadot nodes. Governance/sudo call is later required to enable/start consensus. Part of paritytech/parity-bridges-common#2420
/// Upgrade Session keys to include BEEFY key. | ||
/// When this is removed, should also remove `OldSessionKeys`. | ||
pub struct UpgradeSessionKeys; | ||
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys { | ||
fn on_runtime_upgrade() -> Weight { | ||
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys); | ||
Perbill::from_percent(50) * BlockWeights::get().max_block | ||
} | ||
} |
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.
Can this have any protection to not run twice?
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.
Take a look at https://github.com/paritytech/polkadot-sdk/pull/2265/files#diff-da220c6c064cc047fef5d3b4a594ae30b8bbf48a29b740742bc9858285c7ba57R1572 incl. try-runtime checks.
That might require more recent version of the system pallet though.
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.
Problem is that last_runtime_upgrade_spec_version()
is not in this release of polkadot-sdk AFAIK.
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.
But we can copy the try runtime stuff.
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.
CC @acatangiu
type MaxNominators = MaxNominatorRewardedPerValidator; | ||
type MaxSetIdSessionEntries = BeefySetIdSessionEntries; | ||
type OnNewValidatorSet = BeefyMmrLeaf; | ||
type WeightInfo = (); |
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.
Why does this use the default and not add Beefy to runtime benchmarks?
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.
Same question for Kusama.
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.
https://github.com/paritytech/polkadot-sdk/blob/679e45f26640b18d65d9ae2436ccc84c01383444/substrate/frame/beefy/src/default_weights.rs#L26-L56 there are no proper benchmarks yet. Similar to babe 🙈
const INDEXING_PREFIX: &'static [u8] = mmr::INDEXING_PREFIX; | ||
type Hashing = Keccak256; | ||
type OnNewRoot = pallet_beefy_mmr::DepositBeefyDigest<Runtime>; | ||
type WeightInfo = (); |
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.
Same
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.
@@ -2501,7 +2668,7 @@ mod test { | |||
|
|||
#[test] | |||
fn call_size() { | |||
RuntimeCall::assert_size_under(230); | |||
RuntimeCall::assert_size_under(256); |
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.
It probably increased from one of the pallet args? In the past we used Box
to keep it small.
/merge |
Enabled Available commands
For more information see the documentation |
9bbd9d2
into
polkadot-fellows:main
This adds BEEFY capabilities to the Polkadot runtime.
Governance/sudo call is later required to enable/start consensus.
Part of paritytech/parity-bridges-common#2420