-
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
[DONOTMERGE] move chain config to validated state #1492
Conversation
sequencer/src/block.rs
Outdated
@@ -54,7 +54,8 @@ impl BlockPayload for Payload<TxTableEntryWord> { | |||
txs: impl IntoIterator<Item = Self::Transaction>, | |||
instance_state: &Self::Instance, | |||
) -> Result<(Self, Self::Metadata), Self::Error> { | |||
let payload = Payload::from_txs(txs, &instance_state.chain_config)?; | |||
// TODO: ???? | |||
let payload = Payload::from_txs(txs, &instance_state.genesis_state.chain_config)?; |
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.
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.
Ugh yes we do (or equivalent). But the bigger problem is this means the builder will need to be aware of the ValidatedState at each point. This is fundamental because a parameter of block building (max size) is now being made variable.
In theory this is fine, the builder can compute the state by replaying each proposal it sees, but I don't know if it currently has all the information it needs from HotShot to call validate_and_apply_header
. We'll need to discuss this with @move47 and @nyospe
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.
I don't believe we do, and I'm not sure it will be trivial to add.
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.
Even if we maintain the state as suggested, we will need a mechanism to recover when we miss a proposal...
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.
That part is built into the sequencer implementation of ValidatedState
. validate_and_apply_header
will automatically fetch missing state as needed as long as the InstanceState
contains a valid peer URL
It occurs to me that we will need catch up for this as well. The
|
as discussed with @jbearer
|
4b3d92f
to
cfd2662
Compare
Closes #1475
Move
ChainConfig
toValidatedState
to allow updates