-
Notifications
You must be signed in to change notification settings - Fork 839
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
Don't cache protocol spec in block creator #4982
Don't cache protocol spec in block creator #4982
Conversation
Don't cache the protocol spec in the block creator. With the new shanghaiTimestamp the correct spec may be a function of the timestamp not just the block number. So every time we are asked to build a block re-query the spec. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
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.
LGTM
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.
Was thinking we should have a test case (maybe in MergeBlockCreatorTest?) that proves Shanghai spec gets picked up, what do you think?
@@ -154,8 +153,16 @@ protected BlockCreationResult createBlock( | |||
boolean rewardCoinbase) { | |||
|
|||
try (final MutableWorldState disposableWorldState = duplicateWorldStateAtParent()) { | |||
final ProtocolSpec newProtocolSpec = |
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.
nit: nextProtocolSpec? nextBlockProtocolSpec?
Don't cache the protocol spec in the block creator. With the new shanghaiTimestamp the correct spec may be a function of the timestamp not just the block number. So every time we are asked to build a block re-query the spec. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Don't cache protocol spec in block creator Don't cache the protocol spec in the block creator. With the new shanghaiTimestamp the correct spec may be a function of the timestamp not just the block number. So every time we are asked to build a block re-query the spec. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
* Don't cache protocol spec in block creator Don't cache the protocol spec in the block creator. With the new shanghaiTimestamp the correct spec may be a function of the timestamp not just the block number. So every time we are asked to build a block re-query the spec. Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
PR description
Don't cache the protocol spec in the block creator. With the new shanghaiTimestamp the correct spec may be a function of the timestamp not just the block number. So every time we are asked to build a block re-query the spec.
Signed-off-by: Danno Ferrin danno.ferrin@swirldslabs.com
Fixed Issue(s)
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog