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
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: matrix.language != 'github-actions'
uses: github/codeql-action/autobuild@v3
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
30 changes: 4 additions & 26 deletions .github/workflows/linea-sequencer-plugin-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
with:
distribution: temurin
java-version: 21
- name: Setup Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: spotless
run: ./gradlew --no-daemon --parallel clean besu-plugins:linea-sequencer:spotlessCheck

Expand All @@ -38,8 +40,8 @@ jobs:
name: distributions
path: besu-plugins/linea-sequencer/sequencer/build/libs

- name: Run unit tests
run: ./gradlew besu-plugins:linea-sequencer:sequencer:test
- name: Run unit tests (sequencer packages only)
run: ./gradlew besu-plugins:linea-sequencer:sequencer:test --tests 'net.consensys.linea.sequencer.*'
env:
JAVA_OPTS: -Dorg.gradle.daemon=false
- name: Upload test report
Expand All @@ -49,27 +51,3 @@ jobs:
name: unit-test-report
path: besu-plugins/linea-sequencer/sequencer/build/reports/tests/test/

run-linea-sequencer-plugins-acceptance-tests:
name: "Linea Sequencer Plugin Acceptance Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b #v4.5.0
with:
java-version: 21
distribution: temurin

- name: Run acceptance tests
run: ./gradlew besu-plugins:linea-sequencer:acceptance-tests:acceptanceTests
env:
JAVA_OPTS: -Dorg.gradle.daemon=false

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: acceptance-test-report
path: besu-plugins/linea-sequencer/acceptance-tests/build/reports/tests/
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ jobs:
if: ${{ needs.filter-commit-changes.outputs.has-changes-requiring-build == 'true' }}
uses: ./.github/workflows/testing.yml
with:
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator }}
linea_sequencer_changed: ${{ needs.filter-commit-changes.outputs.linea-sequencer-plugin }}
postman_changed: ${{ needs.filter-commit-changes.outputs.postman }}
prover_changed: ${{ needs.filter-commit-changes.outputs.prover }}
smart_contracts_changed: ${{ needs.filter-commit-changes.outputs.smart-contracts }}
staterecovery_changed: ${{ needs.filter-commit-changes.outputs.staterecovery }}
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api }}
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator || 'false' }}
linea_sequencer_changed: ${{ needs.filter-commit-changes.outputs.linea-sequencer-plugin || 'false' }}
postman_changed: ${{ needs.filter-commit-changes.outputs.postman || 'false' }}
prover_changed: ${{ needs.filter-commit-changes.outputs.prover || 'false' }}
smart_contracts_changed: ${{ needs.filter-commit-changes.outputs.smart-contracts || 'false' }}
staterecovery_changed: ${{ needs.filter-commit-changes.outputs.staterecovery || 'false' }}
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api || 'false' }}
secrets: inherit

# Always complete successfully even if no tests run
Expand All @@ -160,4 +160,4 @@ jobs:
echo "🎉 CI workflow completed"
echo "Health check: ${{ needs.ci-health-check.result }}"
echo "Testing needed: ${{ needs.filter-commit-changes.outputs.has-changes-requiring-build }}"
echo "Testing result: ${{ needs.testing.result || 'skipped' }}"
echo "Testing result: ${{ needs.testing.result || 'skipped' }}"
57 changes: 57 additions & 0 deletions .github/workflows/sequencer-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: sequencer-tests

on:
pull_request:
paths:
- 'besu-plugins/linea-sequencer/**'
- '.github/workflows/sequencer-tests.yml'
push:
branches:
- main
- develop
paths:
- 'besu-plugins/linea-sequencer/**'
- '.github/workflows/sequencer-tests.yml'

permissions:
contents: read
actions: read

jobs:
unit:
name: Sequencer Unit Tests (JDK 21)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96

- name: Set up Java 21 (Temurin)
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: temurin
java-version: 21

- name: Setup Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: Spotless check
run: ./gradlew --no-daemon --parallel clean besu-plugins:linea-sequencer:spotlessCheck

- name: Build
run: ./gradlew besu-plugins:linea-sequencer:build
env:
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false

- name: Run unit tests (sequencer packages only)
run: ./gradlew besu-plugins:linea-sequencer:sequencer:test --tests 'net.consensys.linea.sequencer.*'
env:
JAVA_OPTS: -Dorg.gradle.daemon=false

- name: Upload unit test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: sequencer-unit-test-report
path: besu-plugins/linea-sequencer/sequencer/build/reports/tests/test/


2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

# If all jobs are skipped, the workflow will still succeed.
always_succeed:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
if: ${{ inputs.coordinator_changed == 'false' && inputs.prover_changed == 'false' && inputs.postman_changed == 'false' && inputs.transaction_exclusion_api_changed == 'false' }}
steps:
- name: Ensure Workflow Success
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,6 @@ __pycache__/
!prover/**/testdata/**/*.csv
!prover/**/utils/profiling
!prover/**/verifying_key.bin
!/sdk/src/lib/compressor/bin
!/sdk/src/lib/compressor/bin

custom-besu-package
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ start-env:
[ "$$(docker compose -f $(COMPOSE_FILE) ps -q sequencer | xargs docker inspect -f '{{.State.Health.Status}}')" != "healthy" ]; }; do \
sleep 2; \
echo "Checking health status of l1-el-node and sequencer..."; \
done
done; \
if [ "$(SKIP_L1_L2_NODE_HEALTH_CHECK)" = "false" ]; then \
echo "Container health checks passed"; \
echo "Performing network readiness verification..."; \
./scripts/verify-network-ready.sh || { echo "❌ Network readiness verification failed"; exit 1; }; \
fi
if [ "$(SKIP_CONTRACTS_DEPLOYMENT)" = "true" ]; then \
echo "Skipping contracts deployment"; \
else \
$(MAKE) deploy-contracts L1_CONTRACT_VERSION=$(L1_CONTRACT_VERSION) LINEA_PROTOCOL_CONTRACTS_ONLY=$(LINEA_PROTOCOL_CONTRACTS_ONLY); \
$(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}; \
fi

start-l1:
Expand Down Expand Up @@ -77,6 +82,16 @@ start-env-with-staterecovery: L1_CONTRACT_VERSION:=6
start-env-with-staterecovery:
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)

start-env-with-rln:
make start-env COMPOSE_FILE=docker/compose-tracing-v2-rln.yml LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true

start-env-with-rln-and-contracts:
@echo "Starting complete RLN environment with automated contract deployment..."
make start-env COMPOSE_FILE=docker/compose-tracing-v2-rln.yml LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
@echo "Environment started. Beginning contract deployment with automatic RLN handling..."
make deploy-contracts LINEA_PROTOCOL_CONTRACTS_ONLY=true STATUS_NETWORK_CONTRACTS_ENABLED=true
@echo "Complete RLN environment with contracts is ready!"

staterecovery-replay-from-block: L1_ROLLUP_CONTRACT_ADDRESS:=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
staterecovery-replay-from-block: STATERECOVERY_OVERRIDE_START_BLOCK_NUMBER:=1
staterecovery-replay-from-block:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public class LineaRlnValidatorCliOptions implements LineaCliOptions {
arity = "1")
private long proofWaitTimeoutMs = 1000L; // 1 second (increased from 200ms)

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

private LineaRlnValidatorCliOptions() {}

public static LineaRlnValidatorCliOptions create() {
Expand Down Expand Up @@ -126,7 +133,7 @@ public LineaRlnValidatorConfiguration toDomainObject() {
timeoutsMs, // karmaServiceTimeoutMs
true, // exponentialBackoffEnabled (good default)
60000L, // maxBackoffDelayMs (1 min, good default)
"TIMESTAMP_1H", // defaultEpochForQuota (good default)
epochMode, // defaultEpochForQuota (configurable via CLI)
Optional.empty() // rlnJniLibPath (use system path)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ public LineaEstimateGas.Response execute(final PluginRpcRequest request) {
if (karmaInfoOpt.isPresent()) {
KarmaInfo karmaInfo = karmaInfoOpt.get();
boolean hasQuotaAvailable = karmaInfo.epochTxCount() < karmaInfo.dailyQuota();
boolean isEligibleTier =
!"Unknown".equals(karmaInfo.tier()) && karmaInfo.dailyQuota() > 0;
// Consider eligibility based on positive quota. Tier name may be unspecified in some
// environments (e.g., mock service), so avoid relying on tier label.
boolean isEligibleTier = karmaInfo.dailyQuota() > 0;

log.debug(
"[{}] Karma info for sender {}: Tier={}, TxCount={}, Quota={}, HasQuota={}, IsEligibleTier={}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class LineaEstimateGasEndpointPlugin extends AbstractLineaRequiredPlugin

private TransactionSimulationService transactionSimulationService;
private LineaEstimateGas lineaEstimateGasMethod;
private net.consensys.linea.sequencer.txpoolvalidation.shared.SharedServiceManager
sharedServiceManager;

/**
* Register the RPC service.
Expand Down Expand Up @@ -54,12 +56,19 @@ public void doRegister(final ServiceManager serviceManager) {
@Override
public void beforeExternalServices() {
super.beforeExternalServices();
// Initialize shared gasless services (deny list, karma client) so estimateGas can use them
sharedServiceManager =
new net.consensys.linea.sequencer.txpoolvalidation.shared.SharedServiceManager(
rlnValidatorConfiguration(), lineaRpcConfiguration());

lineaEstimateGasMethod.init(
lineaRpcConfiguration(),
transactionPoolValidatorConfiguration(),
profitabilityConfiguration(),
l1L2BridgeSharedConfiguration(),
tracerConfiguration());
tracerConfiguration(),
sharedServiceManager.getDenyListManager(),
sharedServiceManager.getKarmaServiceClient());
}

@Override
Expand All @@ -68,4 +77,15 @@ public void doStart() {
throw new IllegalArgumentException("L1L2 bridge settings have not been defined.");
}
}

@Override
public void stop() {
super.stop();
if (sharedServiceManager != null) {
try {
sharedServiceManager.close();
} catch (java.io.IOException ignored) {
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public LineaTransactionPoolValidatorFactory(
public PluginTransactionPoolValidator createTransactionValidator() {
final var validatorsList = new ArrayList<PluginTransactionPoolValidator>();

// Removed GaslessFeeBypassValidator to simplify and avoid redundant logic

validatorsList.add(new AllowedAddressValidator(denied));
validatorsList.add(new GasLimitValidator(txPoolValidatorConf));
validatorsList.add(new CalldataValidator(txPoolValidatorConf));
Expand Down
Loading
Loading