diff --git a/acceptance-tests/src/test/java/linea/plugin/acc/test/ProfitableTransactionTest.java b/acceptance-tests/src/test/java/linea/plugin/acc/test/ProfitableTransactionTest.java index 5ac2a6cc..ca2cf265 100644 --- a/acceptance-tests/src/test/java/linea/plugin/acc/test/ProfitableTransactionTest.java +++ b/acceptance-tests/src/test/java/linea/plugin/acc/test/ProfitableTransactionTest.java @@ -30,18 +30,12 @@ import org.web3j.tx.TransactionManager; public class ProfitableTransactionTest extends LineaPluginTestBase { - private static final int VERIFICATION_GAS_COST = 1_200_000; - private static final int VERIFICATION_CAPACITY = 90_000; - private static final int GAS_PRICE_RATIO = 15; - private static final double MIN_MARGIN = 1.0; + private static final double MIN_MARGIN = 1.5; private static final Wei MIN_GAS_PRICE = Wei.of(1_000_000_000); @Override public List getTestCliOptions() { return new TestCommandLineOptionsBuilder() - .set("--plugin-linea-verification-gas-cost=", String.valueOf(VERIFICATION_GAS_COST)) - .set("--plugin-linea-verification-capacity=", String.valueOf(VERIFICATION_CAPACITY)) - .set("--plugin-linea-gas-price-ratio=", String.valueOf(GAS_PRICE_RATIO)) .set("--plugin-linea-min-margin=", String.valueOf(MIN_MARGIN)) .build(); } @@ -70,7 +64,7 @@ public void transactionIsNotMinedWhenUnprofitable() throws Exception { final var txUnprofitable = txManager.sendTransaction( - MIN_GAS_PRICE.getAsBigInteger(), + MIN_GAS_PRICE.getAsBigInteger().divide(BigInteger.valueOf(100)), BigInteger.valueOf(MAX_TX_GAS_LIMIT / 2), credentials.getAddress(), txData.toString(), diff --git a/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasCompatibilityModeTest.java b/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasCompatibilityModeTest.java index 6c0e8aa1..623c2f1f 100644 --- a/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasCompatibilityModeTest.java +++ b/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasCompatibilityModeTest.java @@ -40,7 +40,6 @@ public List getTestCliOptions() { protected void assertIsProfitable( final Transaction tx, final Wei baseFee, - final Wei estimatedPriorityFee, final Wei estimatedMaxGasPrice, final long estimatedGasLimit) { final var minGasPrice = minerNode.getMiningParameters().getMinTransactionGasPrice(); @@ -62,6 +61,6 @@ protected void assertIsProfitable( protected void assertMinGasPriceLowerBound(final Wei baseFee, final Wei estimatedMaxGasPrice) { // since we are in compatibility mode, we want to check that returned profitable priority fee is // the min priority fee per gas * multiplier + base fee - assertIsProfitable(null, baseFee, null, estimatedMaxGasPrice, 0); + assertIsProfitable(null, baseFee, estimatedMaxGasPrice, 0); } } diff --git a/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasTest.java b/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasTest.java index 835f611a..a06891f9 100644 --- a/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasTest.java +++ b/acceptance-tests/src/test/java/linea/plugin/acc/test/rpc/linea/EstimateGasTest.java @@ -141,13 +141,12 @@ public void lineaEstimateGasIsProfitable() { .signature(LineaEstimateGas.FAKE_SIGNATURE_FOR_SIZE_CALCULATION) .build(); - assertIsProfitable(tx, baseFee, estimatedPriorityFee, estimatedMaxGasPrice, estimatedGasLimit); + assertIsProfitable(tx, baseFee, estimatedMaxGasPrice, estimatedGasLimit); } protected void assertIsProfitable( final org.hyperledger.besu.ethereum.core.Transaction tx, final Wei baseFee, - final Wei estimatedPriorityFee, final Wei estimatedMaxGasPrice, final long estimatedGasLimit) { @@ -155,17 +154,13 @@ protected void assertIsProfitable( final var profitabilityCalculator = new TransactionProfitabilityCalculator(profitabilityConf); - final var profitablePriorityFee = - profitabilityCalculator.profitablePriorityFeePerGas( - tx, profitabilityConf.txPoolMinMargin(), estimatedGasLimit, minGasPrice); - - assertThat(profitablePriorityFee.greaterThan(minGasPrice)).isTrue(); + assertThat(estimatedMaxGasPrice.greaterOrEqualThan(minGasPrice)).isTrue(); assertThat( profitabilityCalculator.isProfitable( "Test", tx, - profitabilityConf.txPoolMinMargin(), + profitabilityConf.estimateGasMinMargin(), estimatedMaxGasPrice, estimatedGasLimit, minGasPrice))