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

Better Hardfork -> evm SpecId handling for L2s #6440

Open
Tracked by #8269
mattsse opened this issue Nov 27, 2023 · 3 comments
Open
Tracked by #8269

Better Hardfork -> evm SpecId handling for L2s #6440

mattsse opened this issue Nov 27, 2023 · 3 comments
Labels
C-anvil Command: anvil first issue A good way to start contributing T-feature Type: feature

Comments

@mattsse
Copy link
Member

mattsse commented Nov 27, 2023

Component

Anvil

Describe the feature you would like

currently the Hardfork to specid conversion is only handled properly for mainnet

cfg.spec_id = self.get_hardfork().into();

if no hardfork argument is provided:

if chain_id == ethers::types::Chain::Mainnet.into() {
let hardfork: Hardfork = fork_block_number.into();

we can make this smarter if we have hardfork/specid heights for L2s

TODO

gather hardfork to evm specid blockheights for commonly used L2s/networks

  • polygon
  • OP
  • Arbitrum
  • ...

Additional context

No response

@MuhtasimTanmoy
Copy link

Is this active?

@zerosnacks
Copy link
Member

I think this issue has not been resolved yet

if alloy_chains::NamedChain::Mainnet == chain_id {
let hardfork: Hardfork = fork_block_number.into();
env.handler_cfg.spec_id = hardfork.into();
self.hardfork = Some(hardfork);
}

Users are however, as stated, able to specify the hardfork

/// Sets the hardfork
#[must_use]
pub fn with_hardfork(mut self, hardfork: Option<Hardfork>) -> Self {
self.hardfork = hardfork;
self
}

@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@zerosnacks
Copy link
Member

@mattsse

Optimism recently contributed the specifying of their hardforks here: #8749

Is this sufficient or should we consider a more generalized solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil first issue A good way to start contributing T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

4 participants