Skip to content

feat: add BPO1 and BPO2 hardfork support#9

Merged
Gabriel-Trintinalia merged 3 commits intoConsensys:mainfrom
Gabriel-Trintinalia:feat/bpo1-bpo2-forks
Mar 16, 2026
Merged

feat: add BPO1 and BPO2 hardfork support#9
Gabriel-Trintinalia merged 3 commits intoConsensys:mainfrom
Gabriel-Trintinalia:feat/bpo1-bpo2-forks

Conversation

@Gabriel-Trintinalia
Copy link
Copy Markdown

@Gabriel-Trintinalia Gabriel-Trintinalia commented Mar 16, 2026

Summary

  • Add bpo1 and bpo2 to the SpecId enum (positioned between osaka and amsterdam)
  • Add HardforkName.BPO1 / BPO2 string constants and wire them into specIdFromString / specIdToString
  • Add blob parameter constants:
    • BLOB_BASE_FEE_UPDATE_FRACTION_BPO1 = 8346193 (EIP-7892)
    • BLOB_BASE_FEE_UPDATE_FRACTION_BPO2 = 11684671
    • MAX_BLOB_NUMBER_PER_BLOCK_BPO1 = 15
    • MAX_BLOB_NUMBER_PER_BLOCK_BPO2 = 21
  • Add BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN alias for clarity
  • Map bpo1 / bpo2 to the Osaka precompile set in PrecompileSpecId

Test plan

  • Existing unit tests pass (zig build test)
  • specIdFromString("BPO1") / specIdFromString("BPO2") resolve correctly
  • specIdToString(.bpo1) / specIdToString(.bpo2) return "BPO1" / "BPO2"
  • isEnabledIn ordering: osaka < bpo1 < bpo2 < amsterdam

🤖 Generated with Claude Code


Note

Medium Risk
Introduces new SpecId variants and updates default blob-parameter selection based on hardfork ordering, which can affect fee calculation behavior across forks if the spec mapping is incorrect. Changes are localized but touch consensus-sensitive constants and fork gating logic.

Overview
Adds support for the new blob-parameter-only hardforks bpo1 and bpo2 by extending SpecId plus string parsing/formatting (specIdFromString/specIdToString).

Updates blob-related constants (new BPO1/BPO2 base fee update fractions and max-blobs-per-block values, plus a clarified Cancun constant) and changes CfgEnv.blobBaseFeeUpdateFraction() to derive the default fraction via bpo2/bpo1/prague/cancun precedence when the config override is unset.

Treats bpo1 and bpo2 as using the Osaka precompile set by mapping them to PrecompileSpecId.Osaka in PrecompileSpecId.fromSpec().

Written by Cursor Bugbot for commit 5b439ff. This will update automatically on new commits. Configure here.

Add BPO1 (Blob Parameter Only fork 1, EIP-7892) and BPO2 SpecId variants
between Osaka and Amsterdam, with corresponding blob fraction and max blob
count constants.

- Add `bpo1` and `bpo2` to `SpecId` enum (between osaka and amsterdam)
- Add `HardforkName.BPO1`/`BPO2` string constants
- Add `specIdFromString`/`specIdToString` mappings for BPO1/BPO2
- Add `BLOB_BASE_FEE_UPDATE_FRACTION_BPO1` (8346193) and `_BPO2` (11684671)
- Add `MAX_BLOB_NUMBER_PER_BLOCK_BPO1` (15) and `_BPO2` (21)
- Add `BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN` alias for clarity
- Map bpo1/bpo2 to Osaka precompile set in `PrecompileSpecId`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The new bpo1/bpo2 SpecId variants were added but blobBaseFeeUpdateFraction
only checked for Prague, returning 3,338,477 for all post-Prague forks
instead of the correct values.

Cascade the spec check to return the correct fraction per fork:
- BPO2+:  11,684,671 (BLOB_BASE_FEE_UPDATE_FRACTION_BPO2)
- BPO1+:   8,346,193 (BLOB_BASE_FEE_UPDATE_FRACTION_BPO1)
- Osaka+:  5,007,716 (BLOB_BASE_FEE_UPDATE_FRACTION_OSAKA, EIP-7691)
- Cancun+: 3,338,477 (BLOB_BASE_FEE_UPDATE_FRACTION_CANCUN)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

Just the one error on Blob base fee update fraction - presuming I am interpreting https://eips.ethereum.org/EIPS/eip-7892 correctly

BLOB_BASE_FEE_UPDATE_FRACTION_OSAKA (5007716) is renamed to
BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE since EIP-7691 activates at
Prague, not Osaka. The redundant Prague alias for the Cancun fraction
(3338477) is removed. blobBaseFeeUpdateFraction now branches on
.prague instead of .osaka.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Copy link
Copy Markdown
Collaborator

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

🚢

@Gabriel-Trintinalia Gabriel-Trintinalia merged commit 44810d3 into Consensys:main Mar 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants