Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- Holesky network is deprecated [#9437](https://github.com/hyperledger/besu/pull/9437)
- Sunsetting features - for more context on the reasoning behind the deprecation of these features, including alternative options, read [this blog post](https://www.lfdecentralizedtrust.org/blog/sunsetting-tessera-and-simplifying-hyperledger-besu)
- Proof of Work consensus (PoW)
- Plugin API
- `PluginTransactionSelectorFactory.create(final SelectorsStateManager selectorsStateManager)` is deprecated for removal
Comment thread
fab-10 marked this conversation as resolved.

### Bug fixes
- BFT forks that change block period on time-based forks don't take effect [9681](https://github.com/hyperledger/besu/issues/9681)
Expand All @@ -39,6 +41,7 @@ are provided with different values, using input as per the execution-apis spec i
- Implement `txpool_status` RPC method [#10002](https://github.com/hyperledger/besu/pull/10002)
- Support [EIP-7975](https://eips.ethereum.org/EIPS/eip-7975): eth/70 - partial block receipt lists
- Limit pooled tx requests by size and remove pre-eth/68 transaction announcement support [#9990](https://github.com/besu-eth/besu/pull/9990)
- Plugin API: pass pending block header when creating selectors [#10034](https://github.com/besu-eth/besu/pull/10034)
Comment thread
fab-10 marked this conversation as resolved.

## 26.2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public void selectPendingTransactions(

@Override
public PluginTransactionSelector create(
final ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return new PluginTransactionSelector() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public void selectPendingTransactions(

@Override
public PluginTransactionSelector create(
final ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return new PluginTransactionSelector() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ public TransactionSelectionServiceImpl() {}

@Override
public PluginTransactionSelector createPluginTransactionSelector(
final ProcessableBlockHeader processableBlockHeader,
final SelectorsStateManager selectorsStateManager) {
if (factories == null) {
return PluginTransactionSelector.ACCEPT_ALL;
}
return new AggregatedPluginTransactionSelector(
factories.stream().map(factory -> factory.create(selectorsStateManager)).toList());
factories.stream()
.map(factory -> factory.create(processableBlockHeader, selectorsStateManager))
.toList());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public BlockCreationResult createBlock(
final var pluginTransactionSelector =
miningConfiguration
.getTransactionSelectionService()
.createPluginTransactionSelector(selectorsStateManager);
.createPluginTransactionSelector(processableBlockHeader, selectorsStateManager);
final var operationTracer = pluginTransactionSelector.getOperationTracer();
operationTracer.traceStartBlock(
disposableWorldState, processableBlockHeader, miningBeneficiary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ public TransactionSelectionResult evaluateTransactionPostProcessing(
new PluginTransactionSelectorFactory() {
@Override
public PluginTransactionSelector create(
final org.hyperledger.besu.plugin.data.ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
Comment thread
fab-10 marked this conversation as resolved.
return pluginTransactionSelector;
}
Expand All @@ -717,6 +718,7 @@ public PluginTransactionSelector create(
new PluginTransactionSelectorFactory() {
@Override
public PluginTransactionSelector create(
final org.hyperledger.besu.plugin.data.ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return colletorPluginTransactionSelector;
}
Expand Down Expand Up @@ -797,6 +799,7 @@ public TransactionSelectionResult evaluateTransactionPostProcessing(
new PluginTransactionSelectorFactory() {
@Override
public PluginTransactionSelector create(
final org.hyperledger.besu.plugin.data.ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return pluginTransactionSelector;
}
Expand All @@ -808,6 +811,7 @@ public PluginTransactionSelector create(
new PluginTransactionSelectorFactory() {
@Override
public PluginTransactionSelector create(
final org.hyperledger.besu.plugin.data.ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return colletorPluginTransactionSelector;
}
Expand Down Expand Up @@ -865,7 +869,7 @@ record Mocks(
when(transactionSelector.evaluateTransactionPreProcessing(any())).thenReturn(SELECTED);
when(transactionSelector.evaluateTransactionPostProcessing(any(), any()))
.thenReturn(SELECTED);
when(transactionSelectorFactory.create(any())).thenReturn(transactionSelector);
when(transactionSelectorFactory.create(any(), any())).thenReturn(transactionSelector);
return new Mocks(transactionSelectorFactory, transactionSelector);
};

Expand Down Expand Up @@ -1163,7 +1167,7 @@ public void txEvaluationContextIsCancelledReturnsTrueOnTimeout() {

final PluginTransactionSelectorFactory transactionSelectorFactory =
mock(PluginTransactionSelectorFactory.class);
when(transactionSelectorFactory.create(any()))
when(transactionSelectorFactory.create(any(), any()))
.thenReturn(
new PluginTransactionSelector() {
@Override
Expand Down Expand Up @@ -1224,7 +1228,7 @@ public void txEvaluationContextIsCancelledReturnsTrueOnCancellation() {
final AtomicReference<BlockTransactionSelector> selector = new AtomicReference<>();
final PluginTransactionSelectorFactory transactionSelectorFactory =
mock(PluginTransactionSelectorFactory.class);
when(transactionSelectorFactory.create(any()))
when(transactionSelectorFactory.create(any(), any()))
.thenReturn(
new PluginTransactionSelector() {
@Override
Expand Down Expand Up @@ -1331,7 +1335,7 @@ private void internalBlockSelectionTimeoutSimulation(

final PluginTransactionSelectorFactory transactionSelectorFactory =
mock(PluginTransactionSelectorFactory.class);
when(transactionSelectorFactory.create(any())).thenReturn(transactionSelector);
when(transactionSelectorFactory.create(any(), any())).thenReturn(transactionSelector);

transactionSelectionService.registerPluginTransactionSelectorFactory(
transactionSelectorFactory);
Expand Down Expand Up @@ -1495,7 +1499,7 @@ private void internalBlockSelectionTimeoutSimulationInvalidTxs(

final PluginTransactionSelectorFactory transactionSelectorFactory =
mock(PluginTransactionSelectorFactory.class);
when(transactionSelectorFactory.create(any())).thenReturn(transactionSelector);
when(transactionSelectorFactory.create(any(), any())).thenReturn(transactionSelector);

transactionSelectionService.registerPluginTransactionSelectorFactory(
transactionSelectorFactory);
Expand Down Expand Up @@ -1595,7 +1599,8 @@ protected BlockTransactionSelector createBlockSelector(
miningBeneficiary,
blobGasPrice,
protocolSpec,
transactionSelectionService.createPluginTransactionSelector(selectorsStateManager),
transactionSelectionService.createPluginTransactionSelector(
blockHeader, selectorsStateManager),
ethScheduler,
selectorsStateManager,
Optional.empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public TransactionSelectionService getTransactionSelectionService() {
return new TransactionSelectionService() {
@Override
public PluginTransactionSelector createPluginTransactionSelector(
final ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return PluginTransactionSelector.ACCEPT_ALL;
}
Expand Down
2 changes: 1 addition & 1 deletion plugin-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Calculated : ${currentHash}
tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files
knownHash = '0EGHYlomDjcBMwQmKy9qhqGaLhcIxkWUthAGdYSTxNc='
knownHash = '6hDXxhwrNO1YWmdkQKoG89kPWcS8j3CBjPeoePbjms0='
}
check.dependsOn('checkAPIChanges')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public interface TransactionSelectionService extends BesuService {
/**
* Create a transaction selector plugin
*
* @param pendingBlockHeader the header of the block being created
* @param selectorsStateManager the selectors state manager
* @return the transaction selector plugin
*/
PluginTransactionSelector createPluginTransactionSelector(
SelectorsStateManager selectorsStateManager);
ProcessableBlockHeader pendingBlockHeader, SelectorsStateManager selectorsStateManager);

/**
* Called during the block creation to allow plugins to propose their own pending transactions for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,28 @@ public interface PluginTransactionSelectorFactory {
*
* @param selectorsStateManager the selectors state manager
* @return the transaction selector
* @deprecated use {@link PluginTransactionSelectorFactory#create(ProcessableBlockHeader,
* SelectorsStateManager)} instead
*/
@Deprecated(forRemoval = true)
default PluginTransactionSelector create(final SelectorsStateManager selectorsStateManager) {
return PluginTransactionSelector.ACCEPT_ALL;
}

/**
* Create a plugin transaction selector, that can be used during block creation to apply custom
* filters to proposed pending transactions
*
* @param pendingBlockHeader the header of the block being created
* @param selectorsStateManager the selectors state manager
* @return the transaction selector
*/
default PluginTransactionSelector create(
final ProcessableBlockHeader pendingBlockHeader,
final SelectorsStateManager selectorsStateManager) {
return create(selectorsStateManager);
}
Comment thread
fab-10 marked this conversation as resolved.

/**
* Called during the block creation to allow plugins to propose their own pending transactions for
* block inclusion
Expand Down
Loading