-
Notifications
You must be signed in to change notification settings - Fork 85
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 marketplace upgrade type #1850
Changes from 4 commits
4be73e7
5889cf8
545bcbc
91ab69c
e6cf990
8d7de78
849d54c
2a0f407
b1c0a47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -747,13 +747,11 @@ impl BlockHeader<SeqTypes> for Header { | |
let mut validated_state = parent_state.clone(); | ||
|
||
let chain_config = if version > instance_state.current_version { | ||
match instance_state | ||
.upgrades | ||
.get(&version) | ||
.map(|upgrade| match upgrade.upgrade_type { | ||
match instance_state.upgrades.get(&version) { | ||
Some(upgrade) => match upgrade.upgrade_type { | ||
UpgradeType::ChainConfig { chain_config } => chain_config, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not looking for a change here, just trying to improve my understanding. These semantics are confusing to me. Why do we have an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm I think renaming this upgrade type to FeeUpgrade would be better. So, fee upgrade would require a new chain config that is provided in the toml file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! yes I think so too. |
||
}) { | ||
Some(cf) => cf, | ||
_ => Header::get_chain_config(&validated_state, instance_state).await, | ||
}, | ||
None => Header::get_chain_config(&validated_state, instance_state).await, | ||
} | ||
} else { | ||
|
@@ -866,13 +864,11 @@ impl BlockHeader<SeqTypes> for Header { | |
let mut validated_state = parent_state.clone(); | ||
|
||
let chain_config = if version > instance_state.current_version { | ||
match instance_state | ||
.upgrades | ||
.get(&version) | ||
.map(|upgrade| match upgrade.upgrade_type { | ||
match instance_state.upgrades.get(&version) { | ||
Some(upgrade) => match upgrade.upgrade_type { | ||
UpgradeType::ChainConfig { chain_config } => chain_config, | ||
}) { | ||
Some(cf) => cf, | ||
_ => Header::get_chain_config(&validated_state, instance_state).await, | ||
}, | ||
None => Header::get_chain_config(&validated_state, instance_state).await, | ||
} | ||
} else { | ||
|
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.
So this
Vec<&Upgrade>
holds the actions we need to perform per type per upgrade? Is that right? So we are saying that for every upgrade we need to set base_fee to the maximum base fees of all upgrades. I think implicit in this is that all base_fee can only ever increment. Just checking my understanding. thanks!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.
Vec<Upgrade>
is basically array of tables from the genesis toml file. Yes, we set base fee to max base fee if genesis toml file has fee upgrades (chain config upgrades) specified. This is required by builder as builder takes base_fee parameter which can not be updated as it doesn't know about validated state