Support time based forks for BFT chains#9785
Open
matthew1001 wants to merge 10 commits intohyperledger:mainfrom
Open
Support time based forks for BFT chains#9785matthew1001 wants to merge 10 commits intohyperledger:mainfrom
matthew1001 wants to merge 10 commits intohyperledger:mainfrom
Conversation
Closed
045ec55 to
bf86e32
Compare
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
bf86e32 to
6a8e3f3
Compare
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR description
This PR adds fork-type to
Forkso that wherever a fork is retrieved from aForkSchedulethe correct one is retrieved based on:block(e.g. iflondonBlockapplies at the time of the fork) ortime(e.g. ifshanghaiTimeapplies at the time of the fork)Getting a fork from
ForkSchedulenow requires the caller to pass in both the relevant block number and timestamp. In some calling contexts these will be the same, but when they are different theForkScheduleneeds to know which to use to determine the correct fork to apply.Currently the
ForkScheduleis created, then passed to the BFT protocol schedule creation. So there's a slight chicken-and-egg situation where protocol schedule is needed to apply fork types to the fork schedule - but the fork schedule is needed to create the protocol schedule.I've decided to take the approach of leaving that ordering, but updating the fork schedule with types once we have a protocol schedule.
These changes should be isolated from almost all non-PoA code.
Fixed Issue(s)
Fixes #9681
Example of manual tests run:
genesis.json:(where the time at the start of the test was
1771577257so initially thelondonEVM was applicable.