|
|
@ -65,6 +65,7 @@ import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; |
|
|
|
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; |
|
|
|
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; |
|
|
|
import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams; |
|
|
|
import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams; |
|
|
|
import org.hyperledger.besu.ethereum.mainnet.ValidationResult; |
|
|
|
import org.hyperledger.besu.ethereum.mainnet.ValidationResult; |
|
|
|
|
|
|
|
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket; |
|
|
|
import org.hyperledger.besu.ethereum.transaction.TransactionInvalidReason; |
|
|
|
import org.hyperledger.besu.ethereum.transaction.TransactionInvalidReason; |
|
|
|
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; |
|
|
|
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; |
|
|
|
import org.hyperledger.besu.plugin.data.TransactionType; |
|
|
|
import org.hyperledger.besu.plugin.data.TransactionType; |
|
|
@ -133,6 +134,7 @@ public class TransactionPoolTest { |
|
|
|
TransactionPoolConfiguration.DEFAULT_PRICE_BUMP); |
|
|
|
TransactionPoolConfiguration.DEFAULT_PRICE_BUMP); |
|
|
|
when(protocolSchedule.getByBlockNumber(anyLong())).thenReturn(protocolSpec); |
|
|
|
when(protocolSchedule.getByBlockNumber(anyLong())).thenReturn(protocolSpec); |
|
|
|
when(protocolSpec.getTransactionValidator()).thenReturn(transactionValidator); |
|
|
|
when(protocolSpec.getTransactionValidator()).thenReturn(transactionValidator); |
|
|
|
|
|
|
|
when(protocolSpec.getFeeMarket()).thenReturn(Optional.of(FeeMarket.london())); |
|
|
|
genesisBlockGasLimit = executionContext.getGenesis().getHeader().getGasLimit(); |
|
|
|
genesisBlockGasLimit = executionContext.getGenesis().getHeader().getGasLimit(); |
|
|
|
syncState = mock(SyncState.class); |
|
|
|
syncState = mock(SyncState.class); |
|
|
|
when(syncState.isInSync(anyLong())).thenReturn(true); |
|
|
|
when(syncState.isInSync(anyLong())).thenReturn(true); |
|
|
@ -154,7 +156,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.of(2), |
|
|
|
Wei.of(2), |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
blockchain.observeBlockAdded(transactionPool); |
|
|
|
blockchain.observeBlockAdded(transactionPool); |
|
|
|
} |
|
|
|
} |
|
|
@ -431,7 +432,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
|
|
|
|
|
|
|
|
when(pendingTransactions.containsTransaction(transaction1.getHash())).thenReturn(true); |
|
|
|
when(pendingTransactions.containsTransaction(transaction1.getHash())).thenReturn(true); |
|
|
@ -571,7 +571,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
|
|
|
|
|
|
|
|
final TransactionTestFixture builder = new TransactionTestFixture(); |
|
|
|
final TransactionTestFixture builder = new TransactionTestFixture(); |
|
|
@ -643,7 +642,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
TransactionPoolConfiguration.DEFAULT); |
|
|
|
|
|
|
|
|
|
|
|
final TransactionTestFixture builder = new TransactionTestFixture(); |
|
|
|
final TransactionTestFixture builder = new TransactionTestFixture(); |
|
|
@ -705,7 +703,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ZERO).build()); |
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ZERO).build()); |
|
|
|
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any())) |
|
|
|
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any())) |
|
|
|
.thenReturn(valid()); |
|
|
|
.thenReturn(valid()); |
|
|
@ -743,7 +740,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ONE).build()); |
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ONE).build()); |
|
|
|
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any())) |
|
|
|
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any())) |
|
|
|
.thenReturn(valid()); |
|
|
|
.thenReturn(valid()); |
|
|
@ -786,8 +782,8 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.of(new EIP1559(100)), |
|
|
|
|
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ONE).build()); |
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(Wei.ONE).build()); |
|
|
|
|
|
|
|
when(protocolSpec.getEip1559()).thenReturn(Optional.of(new EIP1559(100L))); |
|
|
|
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any())) |
|
|
|
when(transactionValidator.validate(any(Transaction.class), any(Optional.class), any())) |
|
|
|
.thenReturn(valid()); |
|
|
|
.thenReturn(valid()); |
|
|
|
when(transactionValidator.validateForSender( |
|
|
|
when(transactionValidator.validateForSender( |
|
|
@ -830,7 +826,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(twoEthers).build()); |
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(twoEthers).build()); |
|
|
|
|
|
|
|
|
|
|
|
final TransactionTestFixture builder = new TransactionTestFixture(); |
|
|
|
final TransactionTestFixture builder = new TransactionTestFixture(); |
|
|
@ -870,7 +865,6 @@ public class TransactionPoolTest { |
|
|
|
peerPendingTransactionTracker, |
|
|
|
peerPendingTransactionTracker, |
|
|
|
Wei.ZERO, |
|
|
|
Wei.ZERO, |
|
|
|
metricsSystem, |
|
|
|
metricsSystem, |
|
|
|
Optional.empty(), |
|
|
|
|
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(twoEthers).build()); |
|
|
|
ImmutableTransactionPoolConfiguration.builder().txFeeCap(twoEthers).build()); |
|
|
|
|
|
|
|
|
|
|
|
final Transaction transaction37 = |
|
|
|
final Transaction transaction37 = |
|
|
|