Skip to content

Commit db5d2f1

Browse files
committed
Merge branch 'main' into validium_submitter
2 parents 503682e + c49aa2c commit db5d2f1

File tree

167 files changed

+10972
-3150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+10972
-3150
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ jobs:
228228
run-e2e-tests:
229229
needs:
230230
[
231+
check-and-tag-images,
231232
docker-build,
232233
get-has-changes-requiring-e2e-testing,
233234
manual-docker-build-and-e2e-tests,

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/BlobTransactionDenialTest.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@
2828
* Tests that verify the LineaTransactionValidationPlugin correctly rejects BLOB transactions from
2929
* being executed
3030
*/
31-
public class BlobTransactionDenialTest extends LineaPluginTestBasePrague {
31+
public class BlobTransactionDenialTest extends LineaPluginPoSTestBase {
3232
private Web3j web3j;
3333
private Credentials credentials;
3434
private String recipient;
3535

36-
@Override
37-
protected String getGenesisFileTemplatePath() {
38-
// We cannot use clique-prague-zero-blobs because `config.blobSchedule.prague.max = 0` will
39-
// block all blob txs
40-
return "/clique/clique-prague-one-blob.json.tpl";
41-
}
42-
4336
@Override
4437
@BeforeEach
4538
public void setup() throws Exception {

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/BlockGasLimitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.web3j.tx.TransactionManager;
2020

2121
/** This class tests the block gas limit functionality of the plugin. */
22-
public class BlockGasLimitTest extends LineaPluginTestBase {
22+
public class BlockGasLimitTest extends LineaPluginPoSTestBase {
2323

2424
private static final BigInteger GAS_PRICE = BigInteger.TEN.pow(9);
2525
private static final BigInteger VALUE = BigInteger.TWO;

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/EIP7702TransactionDenialTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* Tests that verify the LineaTransactionValidationPlugin correctly rejects EIP7702 DELEGATE_CODE
2929
* transactions from being executed
3030
*/
31-
public class EIP7702TransactionDenialTest extends LineaPluginTestBasePrague {
31+
public class EIP7702TransactionDenialTest extends LineaPluginPoSTestBase {
3232
private Web3j web3j;
3333
private Credentials credentials;
3434
private String recipient;

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/EcDataLimitsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.web3j.protocol.core.methods.response.EthSendTransaction;
3535
import org.web3j.utils.Numeric;
3636

37-
public class EcDataLimitsTest extends LineaPluginTestBase {
37+
public class EcDataLimitsTest extends LineaPluginPoSTestBase {
3838

3939
@Override
4040
public List<String> getTestCliOptions() {
@@ -49,7 +49,7 @@ public List<String> getTestCliOptions() {
4949
@Override
5050
protected GenesisConfigurationFactory.CliqueOptions getCliqueOptions() {
5151
return new GenesisConfigurationFactory.CliqueOptions(
52-
BLOCK_PERIOD_SECONDS * 2,
52+
BLOCK_PERIOD_SECONDS,
5353
GenesisConfigurationFactory.CliqueOptions.DEFAULT.epochLength(),
5454
false);
5555
}

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/ExamplePragueTest.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/ExcludedPrecompilesLimitlessTest.java

Lines changed: 3 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import java.util.Arrays;
1717
import java.util.List;
1818
import linea.plugin.acc.test.tests.web3j.generated.ExcludedPrecompiles;
19-
import org.apache.tuweni.bytes.Bytes;
2019
import org.apache.tuweni.bytes.Bytes32;
21-
import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
2220
import org.hyperledger.besu.tests.acceptance.dsl.account.Accounts;
2321
import org.junit.jupiter.api.Test;
2422
import org.web3j.abi.datatypes.generated.Bytes8;
@@ -31,7 +29,7 @@
3129
import org.web3j.tx.gas.DefaultGasProvider;
3230
import org.web3j.utils.Numeric;
3331

34-
public class ExcludedPrecompilesLimitlessTest extends LineaPluginTestBase {
32+
public class ExcludedPrecompilesLimitlessTest extends LineaPluginPoSTestBase {
3533
private static final BigInteger GAS_LIMIT = DefaultGasProvider.GAS_LIMIT;
3634
private static final BigInteger GAS_PRICE = DefaultGasProvider.GAS_PRICE;
3735

@@ -73,12 +71,12 @@ record InvalidCall(
7371
excludedPrecompiles
7472
.callRIPEMD160("I am not allowed here".getBytes(StandardCharsets.UTF_8))
7573
.encodeFunctionCall(),
76-
"Tx 0xe4648fd59d4289e59b112bf60931336440d306c85c2aac5a8b0c64ab35bc55b7 line count for module PRECOMPILE_RIPEMD_BLOCKS=2147483647 is above the limit 671"),
74+
"Tx 0xe4648fd59d4289e59b112bf60931336440d306c85c2aac5a8b0c64ab35bc55b7 line count for module PRECOMPILE_RIPEMD_BLOCKS=21 is above the limit 0"),
7775
new InvalidCall(
7876
Accounts.GENESIS_ACCOUNT_TWO_PRIVATE_KEY,
7977
0,
8078
encodedCallBlake2F(excludedPrecompiles),
81-
"Tx 0x9f457b1b5244b03c54234f7f9e8225d4253135dd3c99a46dc527d115e7ea5dac line count for module PRECOMPILE_BLAKE_EFFECTIVE_CALLS=2147483647 is above the limit 0")
79+
"Tx 0x9f457b1b5244b03c54234f7f9e8225d4253135dd3c99a46dc527d115e7ea5dac line count for module PRECOMPILE_BLAKE_EFFECTIVE_CALLS=1 is above the limit 0")
8280
};
8381

8482
final var invalidTxHashes =
@@ -136,78 +134,6 @@ record InvalidCall(
136134
.forEach(invalidCall -> assertThat(log).contains(invalidCall.expectedTraceLog));
137135
}
138136

139-
@Test
140-
public void invalidModExpCallsAreNotMined() throws Exception {
141-
final var modExp = deployModExp();
142-
143-
final var modExpSenders = new Account[3];
144-
final var foundTxHashes = new String[3];
145-
for (int i = 0; i < 3; i++) {
146-
modExpSenders[i] = accounts.createAccount("sender" + i);
147-
foundTxHashes[i] =
148-
accountTransactions
149-
.createTransfer(
150-
accounts.getSecondaryBenefactor(), modExpSenders[i], 1, BigInteger.valueOf(i))
151-
.execute(minerNode.nodeRequests())
152-
.toHexString();
153-
}
154-
Arrays.stream(foundTxHashes)
155-
.forEach(
156-
fundTxHash -> minerNode.verify(eth.expectSuccessfulTransactionReceipt(fundTxHash)));
157-
158-
final Bytes[][] invalidInputs = {
159-
{Bytes.fromHexString("0000000000000000000000000000000000000000000000000000000000000201")},
160-
{
161-
Bytes.fromHexString("00000000000000000000000000000000000000000000000000000000000003"),
162-
Bytes.fromHexString("ff")
163-
},
164-
{
165-
Bytes.fromHexString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),
166-
Bytes.fromHexString("00000000000000000000000000000000000000000000000000000000000003"),
167-
Bytes.fromHexString("ff")
168-
}
169-
};
170-
171-
for (int i = 0; i < invalidInputs.length; i++) {
172-
final var invalidCallTxHashes = new String[invalidInputs[i].length];
173-
for (int j = 0; j < invalidInputs[i].length; j++) {
174-
175-
// use always the same nonce since we expect this tx not to be mined
176-
final var mulmodOverflow =
177-
encodedCallModExp(modExp, modExpSenders[j], 0, invalidInputs[i][j]);
178-
179-
final Web3j web3j = minerNode.nodeRequests().eth();
180-
final EthSendTransaction resp =
181-
web3j.ethSendRawTransaction(Numeric.toHexString(mulmodOverflow)).send();
182-
invalidCallTxHashes[j] = resp.getTransactionHash();
183-
}
184-
185-
// transfer used as sentry to ensure a new block is mined without the invalid modexp call
186-
final var transferTxHash =
187-
accountTransactions
188-
.createTransfer(
189-
accounts.getPrimaryBenefactor(),
190-
accounts.getSecondaryBenefactor(),
191-
1,
192-
BigInteger.valueOf(i + 1))
193-
.execute(minerNode.nodeRequests());
194-
195-
// sentry is mined and the invalid modexp txs are not
196-
minerNode.verify(eth.expectSuccessfulTransactionReceipt(transferTxHash.toHexString()));
197-
final var blockLog = getAndResetLog();
198-
Arrays.stream(invalidCallTxHashes)
199-
.forEach(
200-
invalidCallTxHash -> {
201-
minerNode.verify(eth.expectNoTransactionReceipt(invalidCallTxHash));
202-
assertThat(blockLog)
203-
.contains(
204-
"Tx "
205-
+ invalidCallTxHash
206-
+ " line count for module PRECOMPILE_MODEXP_EFFECTIVE_CALLS=2147483647 is above the limit 4, removing from the txpool");
207-
});
208-
}
209-
}
210-
211137
private String encodedCallBlake2F(final ExcludedPrecompiles excludedPrecompiles) {
212138
return excludedPrecompiles
213139
.callBlake2f(

besu-plugins/linea-sequencer/acceptance-tests/src/test/java/linea/plugin/acc/test/ExcludedPrecompilesTest.java

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import java.util.Arrays;
1717
import java.util.List;
1818
import linea.plugin.acc.test.tests.web3j.generated.ExcludedPrecompiles;
19-
import org.apache.tuweni.bytes.Bytes;
2019
import org.apache.tuweni.bytes.Bytes32;
21-
import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
2220
import org.hyperledger.besu.tests.acceptance.dsl.account.Accounts;
2321
import org.junit.jupiter.api.Test;
2422
import org.web3j.abi.datatypes.generated.Bytes8;
@@ -31,7 +29,7 @@
3129
import org.web3j.tx.gas.DefaultGasProvider;
3230
import org.web3j.utils.Numeric;
3331

34-
public class ExcludedPrecompilesTest extends LineaPluginTestBase {
32+
public class ExcludedPrecompilesTest extends LineaPluginPoSTestBase {
3533
private static final BigInteger GAS_LIMIT = DefaultGasProvider.GAS_LIMIT;
3634
private static final BigInteger GAS_PRICE = DefaultGasProvider.GAS_PRICE;
3735

@@ -130,78 +128,6 @@ record InvalidCall(
130128
.forEach(invalidCall -> assertThat(log).contains(invalidCall.expectedTraceLog));
131129
}
132130

133-
@Test
134-
public void invalidModExpCallsAreNotMined() throws Exception {
135-
final var modExp = deployModExp();
136-
137-
final var modExpSenders = new Account[3];
138-
final var foundTxHashes = new String[3];
139-
for (int i = 0; i < 3; i++) {
140-
modExpSenders[i] = accounts.createAccount("sender" + i);
141-
foundTxHashes[i] =
142-
accountTransactions
143-
.createTransfer(
144-
accounts.getSecondaryBenefactor(), modExpSenders[i], 1, BigInteger.valueOf(i))
145-
.execute(minerNode.nodeRequests())
146-
.toHexString();
147-
}
148-
Arrays.stream(foundTxHashes)
149-
.forEach(
150-
fundTxHash -> minerNode.verify(eth.expectSuccessfulTransactionReceipt(fundTxHash)));
151-
152-
final Bytes[][] invalidInputs = {
153-
{Bytes.fromHexString("0000000000000000000000000000000000000000000000000000000000000201")},
154-
{
155-
Bytes.fromHexString("00000000000000000000000000000000000000000000000000000000000003"),
156-
Bytes.fromHexString("ff")
157-
},
158-
{
159-
Bytes.fromHexString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),
160-
Bytes.fromHexString("00000000000000000000000000000000000000000000000000000000000003"),
161-
Bytes.fromHexString("ff")
162-
}
163-
};
164-
165-
for (int i = 0; i < invalidInputs.length; i++) {
166-
final var invalidCallTxHashes = new String[invalidInputs[i].length];
167-
for (int j = 0; j < invalidInputs[i].length; j++) {
168-
169-
// use always the same nonce since we expect this tx not to be mined
170-
final var mulmodOverflow =
171-
encodedCallModExp(modExp, modExpSenders[j], 0, invalidInputs[i][j]);
172-
173-
final Web3j web3j = minerNode.nodeRequests().eth();
174-
final EthSendTransaction resp =
175-
web3j.ethSendRawTransaction(Numeric.toHexString(mulmodOverflow)).send();
176-
invalidCallTxHashes[j] = resp.getTransactionHash();
177-
}
178-
179-
// transfer used as sentry to ensure a new block is mined without the invalid modexp call
180-
final var transferTxHash =
181-
accountTransactions
182-
.createTransfer(
183-
accounts.getPrimaryBenefactor(),
184-
accounts.getSecondaryBenefactor(),
185-
1,
186-
BigInteger.valueOf(i + 1))
187-
.execute(minerNode.nodeRequests());
188-
189-
// sentry is mined and the invalid modexp txs are not
190-
minerNode.verify(eth.expectSuccessfulTransactionReceipt(transferTxHash.toHexString()));
191-
final var blockLog = getAndResetLog();
192-
Arrays.stream(invalidCallTxHashes)
193-
.forEach(
194-
invalidCallTxHash -> {
195-
minerNode.verify(eth.expectNoTransactionReceipt(invalidCallTxHash));
196-
assertThat(blockLog)
197-
.contains(
198-
"Tx "
199-
+ invalidCallTxHash
200-
+ " line count for module PRECOMPILE_MODEXP_EFFECTIVE_CALLS=2147483647 is above the limit 10000, removing from the txpool");
201-
});
202-
}
203-
}
204-
205131
private String encodedCallBlake2F(final ExcludedPrecompiles excludedPrecompiles) {
206132
return excludedPrecompiles
207133
.callBlake2f(

0 commit comments

Comments
 (0)