Skip to content

Only apply blob schedule bpoX if bpoXTime is available as well#10166

Merged
daniellehrner merged 3 commits intobesu-eth:mainfrom
daniellehrner:fix/blob_schedule_needs_time
Apr 7, 2026
Merged

Only apply blob schedule bpoX if bpoXTime is available as well#10166
daniellehrner merged 3 commits intobesu-eth:mainfrom
daniellehrner:fix/blob_schedule_needs_time

Conversation

@daniellehrner
Copy link
Copy Markdown
Contributor

@daniellehrner daniellehrner commented Apr 2, 2026

PR description

In Hive tests we have a genesis config looking like this:

  "config": {
    "ethash": {},
    "chainID": 1,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "constantinopleFixBlock": 0,
    "istanbulBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0,
    "terminalTotalDifficulty": 0,
    "shanghaiTime": 0,
    "cancunTime": 0,
    "pragueTime": 0,
    "osakaTime": 0,
    "amsterdamTime": 0,
    "blobSchedule": {
      "cancun": {
        "target": 3,
        "max": 6,
        "baseFeeUpdateFraction": 3338477
      },
      "prague": {
        "target": 6,
        "max": 9,
        "baseFeeUpdateFraction": 5007716
      },
      "osaka": {
        "target": 6,
        "max": 9,
        "baseFeeUpdateFraction": 5007716
      },
      "bpo1": {
        "target": 10,
        "max": 15,
        "baseFeeUpdateFraction": 8346193
      },
      "bpo2": {
        "target": 14,
        "max": 21,
        "baseFeeUpdateFraction": 11684671
      },
      "bpo3": {
        "target": 9,
        "max": 14,
        "baseFeeUpdateFraction": 8832827
      },
      "bpo4": {
        "target": 9,
        "max": 14,
        "baseFeeUpdateFraction": 8832827
      },
      "bpo5": {
        "target": 9,
        "max": 14,
        "baseFeeUpdateFraction": 8832827
      }
    },
    "bpo1Time": 0,
    "bpo2Time": 0,
    "depositContractAddress": "0x00000000219ab540356cbb839cbe05303d7705fa",
    "withdrawalRequestContractAddress": "0x00000961ef480eb55e80d19ad83579a64c007002",
    "consolidationRequestContractAddress": "0x0000bbddc7ce488642fb579f8b00f3a590007251"
  }

In this config we have bpo3 - bpo5 in the blobSchedule, but we have no bpo3Time - bpo5Time entries. Right now Besu treats blob schedules without a time entry as active at genesis. This leads to a wrong calculation of the blob fees and rejects blocks with more blobs than in the inactive bpo5 blob schedule.

This PR ignores blob schedules without time and adds regression tests to avoid such subtle bugs in the future.

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

@daniellehrner daniellehrner marked this pull request as ready for review April 3, 2026 07:53
Copilot AI review requested due to automatic review settings April 3, 2026 07:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Besu’s handling of blob schedules in genesis configs by ensuring BPO blob schedules are only applied when the corresponding fork time is present, preventing inactive blob schedules from affecting fee calculations.

Changes:

  • Gate BPO1–BPO5 blob schedule application on the presence of the corresponding bpoXTime field.
  • Add a regression test to ensure inactive BPO fork blob schedules don’t override active schedules.
  • Add a new test class covering Amsterdam excess-blob-gas calculation branches and default blob gas limits.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java Only applies BPO blob schedules when the matching fork timestamp exists.
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilderTest.java Adds regression test ensuring missing bpoXTime prevents applying those blob schedules.
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/AmsterdamTargetingGasLimitCalculatorTest.java Adds Amsterdam blob gas/excess calculation tests and default gas limit assertions.
config/src/main/java/org/hyperledger/besu/config/BlobSchedule.java Adds a new BPO2_DEFAULT blob schedule constant.

Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
@daniellehrner daniellehrner force-pushed the fix/blob_schedule_needs_time branch from 53f271a to 84dbf16 Compare April 7, 2026 10:17
Copy link
Copy Markdown
Contributor

@matkt matkt left a comment

Choose a reason for hiding this comment

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

LGTM

@daniellehrner daniellehrner enabled auto-merge (squash) April 7, 2026 10:22
@daniellehrner daniellehrner merged commit 375f20c into besu-eth:main Apr 7, 2026
33 checks passed
@daniellehrner daniellehrner deleted the fix/blob_schedule_needs_time branch April 7, 2026 10:42
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.

3 participants