Skip to content

Expose methods to query the hardfork in the Plugin API#8909

Merged
fab-10 merged 2 commits intobesu-eth:mainfrom
fab-10:expose-hardfork-in-plugin-api
Jul 11, 2025
Merged

Expose methods to query the hardfork in the Plugin API#8909
fab-10 merged 2 commits intobesu-eth:mainfrom
fab-10:expose-hardfork-in-plugin-api

Conversation

@fab-10
Copy link
Copy Markdown
Contributor

@fab-10 fab-10 commented Jul 3, 2025

PR description

Expose 2 new method in the Plugin API to let plugins query hardfork by blockheader or the hardfork of the next build block.

Since the HardforkId was already part of the Plugin API, it is now used internally when creating the milestone schedule in place of raw string names.

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

@fab-10 fab-10 force-pushed the expose-hardfork-in-plugin-api branch 5 times, most recently from a404b8d to aa82ffd Compare July 8, 2025 14:47
@fab-10 fab-10 marked this pull request as ready for review July 8, 2025 17:57
@fab-10 fab-10 force-pushed the expose-hardfork-in-plugin-api branch from aa82ffd to 7a25de3 Compare July 8, 2025 18:03
@fab-10 fab-10 force-pushed the expose-hardfork-in-plugin-api branch from 7a25de3 to cf02a1f Compare July 9, 2025 07:37
.put("gasUsed", "0x" + Long.toHexString(evmGas))
.put("pass", initialMessageFrame.getExceptionalHaltReason().isEmpty())
.put("fork", protocolSpec.getName());
.put("fork", protocolSpec.getHardforkId().description());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this String identical to the former getName() or a potential breaking change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, I changed the description of the HardforkId enum where needed to match the string returned by the name method

@fab-10 fab-10 force-pushed the expose-hardfork-in-plugin-api branch 2 times, most recently from 3c73327 to 7974bb6 Compare July 10, 2025 12:47
fab-10 added 2 commits July 11, 2025 10:05
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 force-pushed the expose-hardfork-in-plugin-api branch from 7974bb6 to fe19dbb Compare July 11, 2025 08:05
@fab-10 fab-10 enabled auto-merge (squash) July 11, 2025 08:16
@fab-10 fab-10 merged commit 8ddf9f0 into besu-eth:main Jul 11, 2025
49 checks passed
@fab-10 fab-10 deleted the expose-hardfork-in-plugin-api branch July 11, 2025 08:46
jflo pushed a commit to jflo/besu that referenced this pull request Sep 8, 2025
* Expose methods to query the hardfork in the Plugin API

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Add acceptance test

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

---------

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
jflo pushed a commit to jflo/besu that referenced this pull request Sep 8, 2025
* Expose methods to query the hardfork in the Plugin API

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Add acceptance test

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

---------

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: jflo <justin+github@florentine.us>
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