Skip to content

Verify plugins on start#9601

Merged
fab-10 merged 22 commits intobesu-eth:mainfrom
fab-10:verify-plugins-on-start
Jan 21, 2026
Merged

Verify plugins on start#9601
fab-10 merged 22 commits intobesu-eth:mainfrom
fab-10:verify-plugins-on-start

Conversation

@fab-10
Copy link
Copy Markdown
Contributor

@fab-10 fab-10 commented Jan 5, 2026

PR description

Add comprehensive plugin verification on startup

This PR introduces plugin verification checks that run before plugin registration to ensure compatibility and prevent runtime conflicts. The verification includes:

  • Unique plugin names: Ensures no duplicate plugin names are loaded
  • Artifact catalog validation: Verifies all plugins have associated metadata catalogs
  • Besu version compatibility: Checks plugins were built against the running Besu version
  • Inter-plugin dependency conflicts: Detects when multiple plugins bring different versions of the same dependency
  • Besu dependency conflicts: Identifies plugins bundling dependencies already provided by Besu

The verification behavior is configurable via the new option plugins-verification-mode, that could take the values:

  • NONE (default): log at WARN any issue found during the verification phase, but does not prevent the start of Besu
  • FULL: log at ERROR and prevent Besu from starting in case of any issue found during the verification.

More fine grained options could to come later if needed, to further customize the verification phase

The core of the feature is implemented in these classes:

  • PluginVerifier
  • BesuPluginContextImpl

the rest of the PR consists mainly in the extensions of the tests to cover all the different scenarios

Fixed Issue(s)

fixes #8551

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?

fab-10 added 10 commits January 5, 2026 12:51
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
…su plugin

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
# Conflicts:
#	acceptance-tests/catalogless-test-plugins/build.gradle
#	acceptance-tests/tests/build.gradle
#	acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/plugins/PluginConfigurationReloadTest.java
#	app/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java
#	ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/PluginsReloadConfiguration.java
#	settings.gradle
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
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 verify-plugins-on-start branch from ad0d04f to d89adfd Compare January 8, 2026 16:54
fab-10 added 2 commits January 8, 2026 18:00
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 verify-plugins-on-start branch from 6ecf85b to f23957b Compare January 8, 2026 17:02
fab-10 added 7 commits January 8, 2026 18:02
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
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 verify-plugins-on-start branch from e1e9230 to c758f59 Compare January 9, 2026 14:22
@fab-10 fab-10 marked this pull request as ready for review January 9, 2026 16:25
Copilot AI review requested due to automatic review settings January 9, 2026 16:25
@fab-10 fab-10 added doc-change-required Indicates an issue or PR that requires doc to be updated plugins labels Jan 9, 2026
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-project-automation github-project-automation bot moved this to Backlog in Plugins API Jan 14, 2026
@fab-10 fab-10 moved this from Backlog to In review in Plugins API Jan 14, 2026
Copy link
Copy Markdown
Contributor

@usmansaleem usmansaleem left a comment

Choose a reason for hiding this comment

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

LGTM, very minor nit-pick that can be ignored.

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 enabled auto-merge (squash) January 21, 2026 09:36
@fab-10 fab-10 merged commit cc012f7 into besu-eth:main Jan 21, 2026
47 of 91 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Plugins API Jan 21, 2026
@fab-10 fab-10 deleted the verify-plugins-on-start branch January 21, 2026 11:26
@bgravenorst bgravenorst removed the doc-change-required Indicates an issue or PR that requires doc to be updated label Jan 29, 2026
macfarla pushed a commit to CPerezz/besu that referenced this pull request Feb 6, 2026
* Verify plugins before registration

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Besu should not startup if two versions of the same plugin are loaded

5 participants