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

Check holocene activation based on the parent's timestamp #13060

Conversation

mininny
Copy link
Contributor

@mininny mininny commented Dec 2, 2024

It seems like, when op-reth is decoding the extraData for holocene gas fee, it is currently using the current block's timestamp to check if the holocene was activated. However, according to the spec, the check should be done on the parent block's timestamp since only holocene-activated parent would have proper extraData.

This PR modifies the behavior to check for the parent block's timestamp.

Please correct me if my understanding of reth codebase is incorrect! :)

@mattsse
Copy link
Collaborator

mattsse commented Dec 2, 2024

However, according to the spec, the check should be done on the parent

where is this mentioned?

hmm, but yeah I wonder if this is problematic for the transition block

looks like we're missing this edge case where timestamp is the activation block's timestamp @cody-wang-cb ?

@mattsse mattsse added C-bug An unexpected or incorrect behavior A-op-reth Related to Optimism and op-reth labels Dec 2, 2024
@mininny
Copy link
Contributor Author

mininny commented Dec 2, 2024

However, according to the spec, the check should be done on the parent

where is this mentioned?

hmm, but yeah I wonder if this is problematic for the transition block

looks like we're missing this edge case where timestamp is the activation block's timestamp @cody-wang-cb ?

It's mentioned here:

if Holocene is not active in parent_header.timestamp, the [prior EIP-1559 constants](https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/exec-engine.md#1559-parameters) constants are used. While parent_header.extraData is typically empty prior to Holocene, there are some legacy cases where it may be set arbitrarily, so it must not be assumed to be empty.

I think this is also how geth is implemented

@mattsse mattsse marked this pull request as ready for review December 2, 2024 16:31
// > parent_header.extraData are used.
let is_holocene_activated = self.inner.is_fork_active_at_timestamp(
reth_optimism_forks::OpHardfork::Holocene,
parent.timestamp,
Copy link
Collaborator

Choose a reason for hiding this comment

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

right, nice find

we haven't Hit this on sepolia yet because I think assume we crossed that transition via p2p blocks and not via derivation

@mattsse
Copy link
Collaborator

mattsse commented Dec 2, 2024

thanks @mininny after reading the base fee section, this is indeed the right fix, makes sense because we can only extract from parent if holocene is active at parent

@mininny
Copy link
Contributor Author

mininny commented Dec 2, 2024

thanks @mininny after reading the base fee section, this is indeed the right fix, makes sense because we can only extract from parent if holocene is active at parent

Awesome! glad we found it before mainnet 😄
Do you have any clue on when this could be released? Will it be included in the next regular release?

@mattsse
Copy link
Collaborator

mattsse commented Dec 2, 2024

definitely, targeted for early next week

@mattsse mattsse added this pull request to the merge queue Dec 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 2, 2024
Copy link

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

Could we add a regression test for this? cc @clabby @refcell

@mattsse mattsse added this pull request to the merge queue Dec 2, 2024
Merged via the queue into paradigmxyz:main with commit 6cea995 Dec 2, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-reth Related to Optimism and op-reth C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants