Skip to content
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

feat(ethereum-forks): remove total difficulty for hardfork check #13362

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aroralanuk
Copy link
Contributor

@aroralanuk aroralanuk commented Dec 12, 2024

(note: this PR won't be compiling right now)

@aroralanuk
Copy link
Contributor Author

@mattsse, is this how you were thinking of removing total difficulty and relying solely on the block number (given Paris is always the merge fork)?

Comment on lines -10 to -21
/// The fork is activated after a total difficulty has been reached.
TTD {
/// The block number at which TTD is reached, if it is known.
///
/// This should **NOT** be set unless you want this block advertised as [EIP-2124][eip2124]
/// `FORK_NEXT`. This is currently only the case for Sepolia and Holesky.
///
/// [eip2124]: https://eips.ethereum.org/EIPS/eip-2124
fork_block: Option<BlockNumber>,
/// The total difficulty after which the fork is activated.
total_difficulty: U256,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, this has implications on the forkid.

I think the way we should go about this is keeping this variant but requiring that it knows the block number

@Rjected @joshieDo I can't remember what the implications of the fork_block field are because we set this.
I think we can't just set the fork_block field because this messes with the forkid, for example for mainnet we must set this to none,

so to enforce a block number for ttd we should add a new field

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we need to keep one eip-2124 fork block at least. We would want another blocknum field, that is used for checking if the merge is active, but not for the forkid.

@mattsse mattsse added the C-enhancement New feature or request label Dec 13, 2024
@mattsse
Copy link
Collaborator

mattsse commented Dec 14, 2024

@aroralanuk so the way we should solve this is, we keep the TTD variant but add a new mandatory activation_block_number field, because we assume there won't be any more total difficulty hardforks and all activation numbers are known

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove extra Total difficulty argument for execution
3 participants