feat: add Amsterdam hardfork mapping and default to Osaka (#14683)#552
Conversation
feat: add Amsterdam hardfork mapping to SpecId Add EthereumHardfork::Amsterdam => SpecId::AMSTERDAM mapping in spec_id_from_ethereum_hardfork. Without this, Amsterdam would hit the unreachable!() catch-all arm. The default evm_version is already set to Osaka. Amp-Thread-ID: https://ampcode.com/threads/T-019e113f-5bda-711b-8ec5-4841042ba62c Co-authored-by: Centaur AI <ai@centaur.local>
|
@decofe is attempting to deploy a commit to the Foundry development Team on Vercel. A member of the Team first needs to authorize it. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideMaps the new Ethereum Amsterdam hardfork to its corresponding EVM SpecId and extends the hardfork-to-spec mapping test coverage to include Amsterdam, preventing the code from falling into the unreachable catch-all arm. Class diagram for Ethereum hardfork to SpecId mapping updateclassDiagram
class EthereumHardfork {
<<enum>>
Frontier
Homestead
Byzantium
Constantinople
Istanbul
Berlin
London
Shanghai
Cancun
Prague
Osaka
Amsterdam
Bpo3
Bpo4
Bpo5
}
class SpecId {
<<enum>>
FRONTIER
HOMESTEAD
BYZANTIUM
CONSTANTINOPLE
ISTANBUL
BERLIN
LONDON
SHANGHAI
CANCUN
PRAGUE
OSAKA
AMSTERDAM
}
class HardforkSpecMapper {
+spec_id_from_ethereum_hardfork(hardfork: EthereumHardfork) SpecId
}
EthereumHardfork --> HardforkSpecMapper : input
HardforkSpecMapper --> SpecId : output
HardforkSpecMapper ..> SpecId : maps Amsterdam to AMSTERDAM
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request adds support for the Amsterdam hardfork by mapping EthereumHardfork::Amsterdam to SpecId::AMSTERDAM and adding a corresponding test case. The reviewer suggested mapping the Bpo3, Bpo4, and Bpo5 variants to SpecId::AMSTERDAM as well, rather than leaving them as unimplemented, to avoid potential runtime panics.
feat: add Amsterdam hardfork mapping to SpecId
Add EthereumHardfork::Amsterdam => SpecId::AMSTERDAM mapping in spec_id_from_ethereum_hardfork. Without this, Amsterdam would hit the unreachable!() catch-all arm.
The default evm_version is already set to Osaka.
Amp-Thread-ID: https://ampcode.com/threads/T-019e113f-5bda-711b-8ec5-4841042ba62c
Motivation
Solution
PR Checklist
Summary by Sourcery
Map the Amsterdam Ethereum hardfork to its corresponding SpecId and cover it with tests.
Bug Fixes:
Tests: