-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support time-based forking #937
Comments
I would like to take this on |
@Rjected Should the reth/crates/primitives/src/forkid.rs Lines 110 to 116 in 115e623
Same question for reth/crates/primitives/src/forkid.rs Lines 77 to 82 in 115e623
|
@leruaa I think so, that's how I've interpreted the geth change etc |
I don't understand, is this about the fork filter or the hardfork abstraction as a whole? We have special handling for Paris and Shanghai because they are not block number based, rolling it into a single abstraction makes it super hard to use. You would essentially have to replace reth/crates/primitives/src/chain_spec.rs Line 120 in 2a77e08
with something like Alternatively you would need it to take a block header instead of a block number, but then you end up having to construct dummy headers everywhere that doesn't have direct access to a header |
@onbjerg For |
@onbjerg this is most important in the fork filter / forkid calculation, and it might not be necessary to change the entire hardfork abstraction to support time-based fork activation. Forks shanghai and onwards will not be block number based, so I think it makes sense to at least include this kind of abstraction in the fork filter. Open minded to it existing / not existing elsewhere. Given that shanghai will not be activated by a block number though, how can the current signature of |
This won't work for Paris since that is used in PoW-land and it won't work for other networks since the offset in terms of timestamp will be different |
Ah ok, I was unaware that this is going to be the standard now. Perhaps we have a TTD/Number/Time enum as you suggested and the struct ForkCondition {
// current block number
number: BlockNumber,
total_difficulty: usize,
timestamp: usize
} And then you would use it like: |
Yeah, I think this could work, and is probably the best way to do it since paris is activated by ttd, not block num or timestamp Some more context on timestamp forking being the standard for now: go-ethereum#26481 |
I'm not sure to understand the diif between the fn fork_active(fork: Hardfork, kind: ForkKind) -> bool |
Oh I think I get it: |
Describe the feature
Shanghai and future forks will fork based on timestamp rather than block, and we currently only use a
BlockNumber
to distinguish between forks:reth/crates/primitives/src/chain_spec.rs
Lines 79 to 82 in 2a77e08
This could be changed to another type such as:
Additional context
The geth implementation of this has been merged in go-ethereum#25878
The text was updated successfully, but these errors were encountered: