Skip to content

Support multiple transaction selector plugins#9139

Merged
fab-10 merged 2 commits intobesu-eth:mainfrom
fab-10:allow-multiple-plugin-transaction-selectors
Sep 1, 2025
Merged

Support multiple transaction selector plugins#9139
fab-10 merged 2 commits intobesu-eth:mainfrom
fab-10:allow-multiple-plugin-transaction-selectors

Conversation

@fab-10
Copy link
Copy Markdown
Contributor

@fab-10 fab-10 commented Aug 29, 2025

PR description

Currently is only possible to register one PluginTransactionSelectorFactory with the TransactionSelectionService, so it is not possible to have multiple transaction selector plugins deployed at the same time.
This PR extends the registration mechanism to allow the registration of an arbitrary number of PluginTransactionSelectorFactory, thus allowing multiple transaction selector plugins to work together.

Note that at this point there is no way to force a specific order for the transaction selectors, and the order is based on the plugin registration order, a future PR will add the possibility to specify the order in which the plugin are called. For example this could be important when calling PluginTransactionSelectorFactory::selectPendingTransactions

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?

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
@fab-10 fab-10 force-pushed the allow-multiple-plugin-transaction-selectors branch from 07f846c to 8ac517e Compare August 29, 2025 15:26
@fab-10 fab-10 marked this pull request as ready for review August 29, 2025 15:26
factories.add(pluginTransactionSelectorFactory);
}

private static class AggregatedPluginTransactionSelector implements PluginTransactionSelector {
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.

intellij says this class can be a record

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.

I saw that, but in this case I do not see the need to make it a record

}
}

private static class TracerAggregator implements BlockAwareOperationTracer {
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.

intellij says this class can be a record - not sure of the impact of that

@fab-10 fab-10 enabled auto-merge (squash) September 1, 2025 07:36
@fab-10 fab-10 merged commit 29f3516 into besu-eth:main Sep 1, 2025
50 of 65 checks passed
@fab-10 fab-10 deleted the allow-multiple-plugin-transaction-selectors branch September 1, 2025 08:20
usmansaleem added a commit to usmansaleem/besu that referenced this pull request Sep 1, 2025
commit 29f3516
Author: Fabio Di Fabio <fabio.difabio@consensys.net>
Date:   Mon Sep 1 10:12:27 2025 +0200

    Support multiple transaction selector plugins (besu-eth#9139)

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

commit 2595e26
Author: Usman Saleem <usman@usmans.info>
Date:   Mon Sep 1 17:07:40 2025 +1000

    feat: TraceFrame Builder pattern with Precompile input output fields (besu-eth#9111)

    Introduce Builder for TraceFrames. Add precompile data fields in Trace Frames. Add exceptional halt and revert reason for precompile trace frame. This will be used by tracers such as CallTracers to detect and populate precompile calls to have parity with Geth. Existing tracers, such as FlatTracerGenerator doesn't need the input/output of precompiles.
    ---------

    Signed-off-by: Usman Saleem <usman@usmans.info>

Signed-off-by: Usman Saleem <usman@usmans.info>
jflo pushed a commit to jflo/besu that referenced this pull request Sep 8, 2025
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
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: jflo <justin+github@florentine.us>
georgereuben pushed a commit to georgereuben/besu that referenced this pull request Sep 16, 2025
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: georgereuben <reubengeorge101@gmail.com>
georgereuben pushed a commit to georgereuben/besu that referenced this pull request Sep 16, 2025
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: georgereuben <reubengeorge101@gmail.com>
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