Skip to content

Add Prague/Osaka fork precompile gating#171

Merged
YoshihitoAso merged 2 commits into
dev-2.8from
fix-hf
Jul 8, 2026
Merged

Add Prague/Osaka fork precompile gating#171
YoshihitoAso merged 2 commits into
dev-2.8from
fix-hf

Conversation

@YoshihitoAso

Copy link
Copy Markdown
Member

This pull request introduces support for two new Ethereum hard forks, Prague and Osaka, by updating the chain configuration, fork activation logic, precompiled contract sets, and related tests. The changes ensure that the new forks are correctly ordered after Berlin, add their activation checks, and extend the precompile contract logic to include new contracts for these forks.

Fork support and configuration:

  • Added PragueBlock and OsakaBlock fields to the ChainConfig struct, along with corresponding activation checks (IsPrague, IsOsaka) and fork ordering validation in CheckConfigForkOrder. Also updated the string representation and compatibility checks to include these new forks.

Precompiled contracts and fork activation:

  • Refactored precompile contract maps: removed BLS precompiles from Berlin and introduced PrecompiledContractsPrague and PrecompiledContractsOsaka for the new forks. Updated the logic for active precompiles and EVM precompile lookup to include Prague and Osaka contracts when their forks are active.

Chain config presets:

  • Updated chain config presets to include the new fork fields, ensuring that all protocol change configurations are consistent with the new fork structure.

@github-actions github-actions Bot requested a review from purplesmoke05 July 8, 2026 02:16
@YoshihitoAso YoshihitoAso marked this pull request as ready for review July 8, 2026 02:36
Comment thread core/vm/contracts.go
Comment on lines 96 to +113
@@ -113,8 +105,16 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{0x11}): &bls12381MapG2{},
}

// PrecompiledContractsOsaka contains the set of pre-compiled Ethereum
// contracts activated in the Osaka fork.
var PrecompiledContractsOsaka = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{0x01, 0x00}): &p256Verify{},
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[imo]
It would be better to include all active PrecompiledContracts from 0x01 for this hardfork, if the name is based on the hardfork.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in commit dc380bd.

Comment thread core/vm/evm.go
}
}
return p, ok
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nits] It may be clearer to handle the full precompile set in the switch case for each hardfork, rather than looking up Prague and Osaka precompiles separately after the switch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in commit dc380bd.

@YoshihitoAso YoshihitoAso merged commit ade72c9 into dev-2.8 Jul 8, 2026
5 checks passed
@YoshihitoAso YoshihitoAso deleted the fix-hf branch July 8, 2026 05:06
@YoshihitoAso YoshihitoAso added the bug Something isn't working label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants