Skip to content

Commit 6e0f7b1

Browse files
authored
Merge pull request #5 from status-im/feat/gasless-docker-orchestration
contracts deployment with network compose files and fixes for gasless sequencer execution
2 parents 1b611a5 + 69748c5 commit 6e0f7b1

File tree

49 files changed

+3458
-869
lines changed

Some content is hidden

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

49 files changed

+3458
-869
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
if: matrix.language != 'github-actions'
3939
uses: github/codeql-action/autobuild@v3
4040
env:
41-
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242

4343
- name: Perform CodeQL Analysis
4444
uses: github/codeql-action/analyze@v3

.github/workflows/linea-sequencer-plugin-testing.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
with:
2525
distribution: temurin
2626
java-version: 21
27+
- name: Setup Gradle cache
28+
uses: gradle/actions/setup-gradle@v3
2729
- name: spotless
2830
run: ./gradlew --no-daemon --parallel clean besu-plugins:linea-sequencer:spotlessCheck
2931

@@ -38,8 +40,8 @@ jobs:
3840
name: distributions
3941
path: besu-plugins/linea-sequencer/sequencer/build/libs
4042

41-
- name: Run unit tests
42-
run: ./gradlew besu-plugins:linea-sequencer:sequencer:test
43+
- name: Run unit tests (sequencer packages only)
44+
run: ./gradlew besu-plugins:linea-sequencer:sequencer:test --tests 'net.consensys.linea.sequencer.*'
4345
env:
4446
JAVA_OPTS: -Dorg.gradle.daemon=false
4547
- name: Upload test report
@@ -49,27 +51,3 @@ jobs:
4951
name: unit-test-report
5052
path: besu-plugins/linea-sequencer/sequencer/build/reports/tests/test/
5153

52-
run-linea-sequencer-plugins-acceptance-tests:
53-
name: "Linea Sequencer Plugin Acceptance Tests"
54-
runs-on: ubuntu-latest
55-
steps:
56-
- name: Checkout repository
57-
uses: actions/checkout@v4
58-
59-
- name: Set up JDK 21
60-
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b #v4.5.0
61-
with:
62-
java-version: 21
63-
distribution: temurin
64-
65-
- name: Run acceptance tests
66-
run: ./gradlew besu-plugins:linea-sequencer:acceptance-tests:acceptanceTests
67-
env:
68-
JAVA_OPTS: -Dorg.gradle.daemon=false
69-
70-
- name: Upload test report
71-
if: always()
72-
uses: actions/upload-artifact@v4
73-
with:
74-
name: acceptance-test-report
75-
path: besu-plugins/linea-sequencer/acceptance-tests/build/reports/tests/

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ jobs:
140140
if: ${{ needs.filter-commit-changes.outputs.has-changes-requiring-build == 'true' }}
141141
uses: ./.github/workflows/testing.yml
142142
with:
143-
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator }}
144-
linea_sequencer_changed: ${{ needs.filter-commit-changes.outputs.linea-sequencer-plugin }}
145-
postman_changed: ${{ needs.filter-commit-changes.outputs.postman }}
146-
prover_changed: ${{ needs.filter-commit-changes.outputs.prover }}
147-
smart_contracts_changed: ${{ needs.filter-commit-changes.outputs.smart-contracts }}
148-
staterecovery_changed: ${{ needs.filter-commit-changes.outputs.staterecovery }}
149-
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api }}
143+
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator || 'false' }}
144+
linea_sequencer_changed: ${{ needs.filter-commit-changes.outputs.linea-sequencer-plugin || 'false' }}
145+
postman_changed: ${{ needs.filter-commit-changes.outputs.postman || 'false' }}
146+
prover_changed: ${{ needs.filter-commit-changes.outputs.prover || 'false' }}
147+
smart_contracts_changed: ${{ needs.filter-commit-changes.outputs.smart-contracts || 'false' }}
148+
staterecovery_changed: ${{ needs.filter-commit-changes.outputs.staterecovery || 'false' }}
149+
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api || 'false' }}
150150
secrets: inherit
151151

152152
# Always complete successfully even if no tests run
@@ -160,4 +160,4 @@ jobs:
160160
echo "🎉 CI workflow completed"
161161
echo "Health check: ${{ needs.ci-health-check.result }}"
162162
echo "Testing needed: ${{ needs.filter-commit-changes.outputs.has-changes-requiring-build }}"
163-
echo "Testing result: ${{ needs.testing.result || 'skipped' }}"
163+
echo "Testing result: ${{ needs.testing.result || 'skipped' }}"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: sequencer-tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'besu-plugins/linea-sequencer/**'
7+
- '.github/workflows/sequencer-tests.yml'
8+
push:
9+
branches:
10+
- main
11+
- develop
12+
paths:
13+
- 'besu-plugins/linea-sequencer/**'
14+
- '.github/workflows/sequencer-tests.yml'
15+
16+
permissions:
17+
contents: read
18+
actions: read
19+
20+
jobs:
21+
unit:
22+
name: Sequencer Unit Tests (JDK 21)
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96
27+
28+
- name: Set up Java 21 (Temurin)
29+
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
30+
with:
31+
distribution: temurin
32+
java-version: 21
33+
34+
- name: Setup Gradle cache
35+
uses: gradle/actions/setup-gradle@v3
36+
37+
- name: Spotless check
38+
run: ./gradlew --no-daemon --parallel clean besu-plugins:linea-sequencer:spotlessCheck
39+
40+
- name: Build
41+
run: ./gradlew besu-plugins:linea-sequencer:build
42+
env:
43+
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false
44+
45+
- name: Run unit tests (sequencer packages only)
46+
run: ./gradlew besu-plugins:linea-sequencer:sequencer:test --tests 'net.consensys.linea.sequencer.*'
47+
env:
48+
JAVA_OPTS: -Dorg.gradle.daemon=false
49+
50+
- name: Upload unit test reports
51+
if: always()
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: sequencer-unit-test-report
55+
path: besu-plugins/linea-sequencer/sequencer/build/reports/tests/test/
56+
57+

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969

7070
# If all jobs are skipped, the workflow will still succeed.
7171
always_succeed:
72-
runs-on: ubuntu-24.04
72+
runs-on: ubuntu-latest
7373
if: ${{ inputs.coordinator_changed == 'false' && inputs.prover_changed == 'false' && inputs.postman_changed == 'false' && inputs.transaction_exclusion_api_changed == 'false' }}
7474
steps:
7575
- name: Ensure Workflow Success

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,6 @@ __pycache__/
143143
!prover/**/testdata/**/*.csv
144144
!prover/**/utils/profiling
145145
!prover/**/verifying_key.bin
146-
!/sdk/src/lib/compressor/bin
146+
!/sdk/src/lib/compressor/bin
147+
148+
custom-besu-package

Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,16 @@ start-env:
3838
[ "$$(docker compose -f $(COMPOSE_FILE) ps -q sequencer | xargs docker inspect -f '{{.State.Health.Status}}')" != "healthy" ]; }; do \
3939
sleep 2; \
4040
echo "Checking health status of l1-el-node and sequencer..."; \
41-
done
41+
done; \
42+
if [ "$(SKIP_L1_L2_NODE_HEALTH_CHECK)" = "false" ]; then \
43+
echo "Container health checks passed"; \
44+
echo "Performing network readiness verification..."; \
45+
./scripts/verify-network-ready.sh || { echo "❌ Network readiness verification failed"; exit 1; }; \
46+
fi
4247
if [ "$(SKIP_CONTRACTS_DEPLOYMENT)" = "true" ]; then \
4348
echo "Skipping contracts deployment"; \
4449
else \
45-
$(MAKE) deploy-contracts L1_CONTRACT_VERSION=$(L1_CONTRACT_VERSION) LINEA_PROTOCOL_CONTRACTS_ONLY=$(LINEA_PROTOCOL_CONTRACTS_ONLY); \
50+
$(MAKE) deploy-contracts L1_CONTRACT_VERSION=$(L1_CONTRACT_VERSION) LINEA_PROTOCOL_CONTRACTS_ONLY=$(LINEA_PROTOCOL_CONTRACTS_ONLY) STATUS_NETWORK_CONTRACTS_ENABLED=$${STATUS_NETWORK_CONTRACTS_ENABLED:-false}; \
4651
fi
4752

4853
start-l1:
@@ -77,6 +82,16 @@ start-env-with-staterecovery: L1_CONTRACT_VERSION:=6
7782
start-env-with-staterecovery:
7883
make start-env COMPOSE_FILE=docker/compose-tracing-v2-staterecovery-extension.yml LINEA_PROTOCOL_CONTRACTS_ONLY=true L1_CONTRACT_VERSION=$(L1_CONTRACT_VERSION) COMPOSE_PROFILES=$(COMPOSE_PROFILES)
7984

85+
start-env-with-rln:
86+
make start-env COMPOSE_FILE=docker/compose-tracing-v2-rln.yml LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
87+
88+
start-env-with-rln-and-contracts:
89+
@echo "Starting complete RLN environment with automated contract deployment..."
90+
make start-env COMPOSE_FILE=docker/compose-tracing-v2-rln.yml LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
91+
@echo "Environment started. Beginning contract deployment with automatic RLN handling..."
92+
make deploy-contracts LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
93+
@echo "Complete RLN environment with contracts is ready!"
94+
8095
staterecovery-replay-from-block: L1_ROLLUP_CONTRACT_ADDRESS:=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
8196
staterecovery-replay-from-block: STATERECOVERY_OVERRIDE_START_BLOCK_NUMBER:=1
8297
staterecovery-replay-from-block:

besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/config/LineaRlnValidatorCliOptions.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ public class LineaRlnValidatorCliOptions implements LineaCliOptions {
7777
arity = "1")
7878
private long proofWaitTimeoutMs = 1000L; // 1 second (increased from 200ms)
7979

80+
@CommandLine.Option(
81+
names = "--plugin-linea-rln-epoch-mode",
82+
description =
83+
"Epoch mode used to compute the RLN external nullifier (options: BLOCK, TIMESTAMP_1H, TEST, FIXED_FIELD_ELEMENT; default: ${DEFAULT-VALUE})",
84+
arity = "1")
85+
private String epochMode = LineaRlnValidatorConfiguration.V1_DEFAULT.defaultEpochForQuota();
86+
8087
private LineaRlnValidatorCliOptions() {}
8188

8289
public static LineaRlnValidatorCliOptions create() {
@@ -126,7 +133,7 @@ public LineaRlnValidatorConfiguration toDomainObject() {
126133
timeoutsMs, // karmaServiceTimeoutMs
127134
true, // exponentialBackoffEnabled (good default)
128135
60000L, // maxBackoffDelayMs (1 min, good default)
129-
"TIMESTAMP_1H", // defaultEpochForQuota (good default)
136+
epochMode, // defaultEpochForQuota (configurable via CLI)
130137
Optional.empty() // rlnJniLibPath (use system path)
131138
);
132139
}

besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/rpc/methods/LineaEstimateGas.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ public LineaEstimateGas.Response execute(final PluginRpcRequest request) {
250250
if (karmaInfoOpt.isPresent()) {
251251
KarmaInfo karmaInfo = karmaInfoOpt.get();
252252
boolean hasQuotaAvailable = karmaInfo.epochTxCount() < karmaInfo.dailyQuota();
253-
boolean isEligibleTier =
254-
!"Unknown".equals(karmaInfo.tier()) && karmaInfo.dailyQuota() > 0;
253+
// Consider eligibility based on positive quota. Tier name may be unspecified in some
254+
// environments (e.g., mock service), so avoid relying on tier label.
255+
boolean isEligibleTier = karmaInfo.dailyQuota() > 0;
255256

256257
log.debug(
257258
"[{}] Karma info for sender {}: Tier={}, TxCount={}, Quota={}, HasQuota={}, IsEligibleTier={}",

besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/rpc/services/LineaEstimateGasEndpointPlugin.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class LineaEstimateGasEndpointPlugin extends AbstractLineaRequiredPlugin
2525

2626
private TransactionSimulationService transactionSimulationService;
2727
private LineaEstimateGas lineaEstimateGasMethod;
28+
private net.consensys.linea.sequencer.txpoolvalidation.shared.SharedServiceManager
29+
sharedServiceManager;
2830

2931
/**
3032
* Register the RPC service.
@@ -54,12 +56,19 @@ public void doRegister(final ServiceManager serviceManager) {
5456
@Override
5557
public void beforeExternalServices() {
5658
super.beforeExternalServices();
59+
// Initialize shared gasless services (deny list, karma client) so estimateGas can use them
60+
sharedServiceManager =
61+
new net.consensys.linea.sequencer.txpoolvalidation.shared.SharedServiceManager(
62+
rlnValidatorConfiguration(), lineaRpcConfiguration());
63+
5764
lineaEstimateGasMethod.init(
5865
lineaRpcConfiguration(),
5966
transactionPoolValidatorConfiguration(),
6067
profitabilityConfiguration(),
6168
l1L2BridgeSharedConfiguration(),
62-
tracerConfiguration());
69+
tracerConfiguration(),
70+
sharedServiceManager.getDenyListManager(),
71+
sharedServiceManager.getKarmaServiceClient());
6372
}
6473

6574
@Override
@@ -68,4 +77,15 @@ public void doStart() {
6877
throw new IllegalArgumentException("L1L2 bridge settings have not been defined.");
6978
}
7079
}
80+
81+
@Override
82+
public void stop() {
83+
super.stop();
84+
if (sharedServiceManager != null) {
85+
try {
86+
sharedServiceManager.close();
87+
} catch (java.io.IOException ignored) {
88+
}
89+
}
90+
}
7191
}

0 commit comments

Comments
 (0)