This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Return babe configuration information in the babe api epoch functions#8072
Merged
26 commits merged intomasterfrom Mar 10, 2021
Merged
Return babe configuration information in the babe api epoch functions#807226 commits merged intomasterfrom
26 commits merged intomasterfrom
Conversation
expenses
commented
Feb 8, 2021
andresilva
suggested changes
Feb 16, 2021
Contributor
andresilva
left a comment
There was a problem hiding this comment.
I think we need to have 3 storage entries:
EpochConfig: BabeEpochConfiguration- We need to make the module's genesis config (add_extra_genesis) take this as a parameter.NextEpochConfig: Option<BabeEpochConfiguration>- This represents the config for epochN+1which is already set in stone (i.e. it was already previously announced). When implementingfn next_config()we read from here, if it'sNonethen we return the value fromEpochConfigsince the config for the next epoch is the same as the current one.PendingEpochConfigChange: Option<NextConfigDescriptor>- This is the currentNextEpochConfigentry, it should be renamed to this. It represents a pending epoch config change forN+2, which will be announced once we finish the current epoch (N) and start the epochN+1by announcing the config forN+2.
b2f4332 to
120fc30
Compare
expenses
commented
Feb 17, 2021
Contributor
Author
|
We could also remove |
andresilva
suggested changes
Feb 22, 2021
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
andresilva
approved these changes
Mar 5, 2021
bkchr
approved these changes
Mar 5, 2021
bkchr
previously requested changes
Mar 5, 2021
frame/babe/src/lib.rs
Outdated
|
|
||
| struct __OldNextEpochConfig; | ||
| impl frame_support::traits::StorageInstance for __OldNextEpochConfig { | ||
| fn pallet_prefix() -> &'static str { "BabeApi" } |
Member
There was a problem hiding this comment.
This is wrong.
Currently this is Babe and not BabeApi.
Also this should probably be configurable.
Contributor
Author
There was a problem hiding this comment.
I've made it configurable, but I think it still is BabeApi. See paritytech/polkadot#2467 (comment).
bkchr
reviewed
Mar 9, 2021
bkchr
approved these changes
Mar 9, 2021
Contributor
Author
|
bot merge |
|
The PR is currently unmergeable. |
Contributor
Author
|
bot merge |
|
Trying merge. |
Open
jordy25519
pushed a commit
to cennznet/substrate
that referenced
this pull request
Sep 20, 2021
…paritytech#8072) * Make changes * Add serialize/deserialize, copy babe epoch config defaults from node runtime * Fix line widths and turn default features off for serde * Remove ser/deser from Epoch, fix node-cli * Apply suggestions * Add comment to BABE_GENESIS_EPOCH_CONFIG in bin * Apply suggestions * Add a sketchy migration function * Add a migration test * Check for PendingEpochConfigChange as well * Make epoch_config in node-cli * Move updating EpochConfig out of the if * Fix executor tests * Calculate weight for add_epoch_configurations * Fix babe test * Apply suggestions from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * Add more asserts to tests, remove unused changes to primitives/slots * Allow setting the migration pallet prefix * Rename to BabePalletPrefix Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
25 tasks
icodezjb
added a commit
to chainx-org/ChainX
that referenced
this pull request
Feb 8, 2022
gguoss
pushed a commit
to chainx-org/ChainX
that referenced
this pull request
Feb 25, 2022
* Remove VestingAccount * Fix chain specs * Update rust-toolchain * Update make test and benchmark * Update CI * Run `make format` and `make clippy` * Update CI * Quick fix * Support try-runtime * Remove pallet-randomness-collective-flip * Migrate elections-phragmen (paritytech/substrate#7040) * Migrate PalletVersion to StorageVersion (paritytech/substrate#9165) * Migrate pallet-babe epoch config (paritytech/substrate#8072) * Migrate frame-system AccountInfo to AccountInfoWithTripleRefCount (paritytech/substrate#8221) * Migrate prefix `GrandpaFinality` -> `Grandpa` * Migrate prefix `Instance1Collective` -> `Council` * Migrate prefix `Instance2Collective` -> `TechnicalCommittee` * Migrate prefix `Instance1Membership` -> `TechnicalMembership` * Migrate pallet-tips prefix from `Treasury` -> `Tips` * Migrate pallet-bounties prefix from `Treasury` -> `Bounties` * Migrate prefix from `PhragmenElection` -> `Elections` * Revert `dev` spec_name * Confirm migrations order * Use ChainX substrate patch for system migration * Run `make format` * Reset spec_name `dev` -> `chainx` * Add migrations.rs for mainnet and testnet * Bump ChainX version to `4.0.0` * Bump ChainX version to `4.0.0` * Update governance parameters for dev and malan * Update malan chainspec * Quick fix * Quick fix * Update generate_keys.sh * Adjust malan parameters * Update malan chainspec * Update malan chainspec * Update malan chainspec * Rename malan testnet name * Add bootnodes url * Run `make format` * Regenerate weights * Disable pre_release.yml CI * Regenerate benchmark weights * Run `make clippy` * Run `make format` Co-authored-by: icodezjb <icodezjb@users.noreply.github.com>
gguoss
pushed a commit
to chainx-org/ChainX
that referenced
this pull request
Feb 25, 2022
* Remove VestingAccount * Fix chain specs * Update rust-toolchain * Update make test and benchmark * Update CI * Run `make format` and `make clippy` * Update CI * Quick fix * Support try-runtime * Remove pallet-randomness-collective-flip * Migrate elections-phragmen (paritytech/substrate#7040) * Migrate PalletVersion to StorageVersion (paritytech/substrate#9165) * Migrate pallet-babe epoch config (paritytech/substrate#8072) * Migrate frame-system AccountInfo to AccountInfoWithTripleRefCount (paritytech/substrate#8221) * Migrate prefix `GrandpaFinality` -> `Grandpa` * Migrate prefix `Instance1Collective` -> `Council` * Migrate prefix `Instance2Collective` -> `TechnicalCommittee` * Migrate prefix `Instance1Membership` -> `TechnicalMembership` * Migrate pallet-tips prefix from `Treasury` -> `Tips` * Migrate pallet-bounties prefix from `Treasury` -> `Bounties` * Migrate prefix from `PhragmenElection` -> `Elections` * Revert `dev` spec_name * Confirm migrations order * Use ChainX substrate patch for system migration * Run `make format` * Reset spec_name `dev` -> `chainx` * Add migrations.rs for mainnet and testnet * Bump ChainX version to `4.0.0` * Bump ChainX version to `4.0.0` * Update governance parameters for dev and malan * Update malan chainspec * Quick fix * Quick fix * Update generate_keys.sh * Adjust malan parameters * Update malan chainspec * Update malan chainspec * Update malan chainspec * Rename malan testnet name * Add bootnodes url * Run `make format` * Regenerate weights * Disable pre_release.yml CI * Regenerate benchmark weights * Run `make clippy` * Run `make format` Co-authored-by: icodezjb <icodezjb@users.noreply.github.com>
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
polkadot companion: paritytech/polkadot#2467
This PR is an attempt to solve #8060. I'm not very familiar with
decl_storage!, so I need to figure a few things out before I can continue.