staterecovery: fix 2B block gas limit (#837)

* staterecovery: fix 2B block gas limit

* staterecovery: Add better failure message for fake client

* staterecovery: update besu image

* staterecovery: udpate traces version on coordinator file

* staterecovery: add explicit timeout in test

* staterecovery: fix CLI typo
This commit is contained in:
Fluent Crafter
2025-04-07 09:41:41 +01:00
committed by GitHub
parent 134d69641c
commit 4f5af620c5
8 changed files with 53 additions and 20 deletions

View File

@@ -12,7 +12,7 @@ fs-responses-directory = "/data/prover/v3/aggregation/responses"
[traces]
switch-to-linea-besu=true
blob-compressor-version="V1_0_1"
expected-traces-api-version-v2="beta-v2.1-rc8"
expected-traces-api-version-v2="beta-v2.1-rc14"
[traces.counters-v2]
endpoints=["http://traces-node-v2:8545/"]
request-limit-per-endpoint=1

View File

@@ -2,7 +2,7 @@ services:
l1-el-node:
container_name: l1-el-node
hostname: l1-el-node
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-402ebda}
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-02eb1e1}
profiles: [ "l1", "debug", "external-to-monorepo" ]
depends_on:
l1-node-genesis-generator:

View File

@@ -5,7 +5,7 @@ services:
sequencer:
hostname: sequencer
container_name: sequencer
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-402ebda}
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-02eb1e1}
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo" ]
ports:
- "8545:8545"
@@ -82,7 +82,7 @@ services:
l2-node-besu:
hostname: l2-node-besu
container_name: l2-node-besu
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-402ebda}
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-02eb1e1}
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo" ]
depends_on:
sequencer:
@@ -162,7 +162,7 @@ services:
traces-node-v2:
hostname: traces-node-v2
container_name: traces-node-v2
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-402ebda}
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-02eb1e1}
profiles: [ "l2", "l2-bc", "debug", "external-to-monorepo" ]
depends_on:
sequencer:
@@ -367,7 +367,7 @@ services:
- l1network
zkbesu-shomei:
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-402ebda}
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-02eb1e1}
hostname: zkbesu-shomei
container_name: zkbesu-shomei
profiles: [ "l2", "l2-bc", "external-to-monorepo" ]
@@ -583,7 +583,7 @@ services:
ipv4_address: 10.10.10.205
zkbesu-shomei-sr:
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-402ebda}
image: consensys/linea-besu-package:${BESU_PACKAGE_TAG:-devnet-02eb1e1}
hostname: zkbesu-shomei-sr
container_name: zkbesu-shomei-sr
profiles: [ "external-to-monorepo", "staterecovery" ]

View File

@@ -58,8 +58,8 @@ open class LineaStateRecoveryPlugin : BesuPlugin {
val blockchainService = serviceManager.getServiceOrThrow(BlockchainService::class.java)
val blockHeaderStaticFields = BlockHeaderStaticFields(
coinbase = config.lineaSequencerBeneficiaryAddress.toArray(),
gasLimit = blockchainService.chainHeadHeader.gasLimit.toULong(),
difficulty = 2UL // Note, this will need to change once we move to QBFT
gasLimit = config.lineaBlockGasLimit,
difficulty = config.lineaBlockDifficulty
)
this.recoveryStatusPersistence = FileBasedRecoveryStatusPersistence(
serviceManager.getServiceOrThrow(BesuConfiguration::class.java)

View File

@@ -10,6 +10,8 @@ import kotlin.time.toKotlinDuration
data class PluginConfig(
val lineaSequencerBeneficiaryAddress: Address,
val lineaBlockGasLimit: ULong,
val lineaBlockDifficulty: ULong,
val l1SmartContractAddress: Address,
val l1Endpoint: URI,
val l1PollingInterval: kotlin.time.Duration,
@@ -35,15 +37,6 @@ class PluginCliOptions {
private const val cliOptionsPrefix = "plugin-$cliPluginPrefixName"
}
@CommandLine.Option(
names = ["--$cliOptionsPrefix-l1-smart-contract-address"],
description = ["L1 smart contract address"],
required = true,
converter = [AddressConverter::class],
defaultValue = "\${env:L1_ROLLUP_CONTRACT_ADDRESS}"
)
lateinit var l1SmartContractAddress: Address
@CommandLine.Option(
names = ["--$cliOptionsPrefix-linea-sequencer-beneficiary-address"],
description = ["Linea sequencer beneficiary address"],
@@ -53,6 +46,31 @@ class PluginCliOptions {
)
lateinit var lineaSequencerBeneficiaryAddress: Address
@CommandLine.Option(
names = ["--$cliOptionsPrefix-linea-block-gas-limit"],
description = ["Linea Block gas limit. Default 2B (2_000_000_000)"],
required = false,
defaultValue = "\${env:LINEA_BLOCK_GAS_LIMIT}"
)
var lineaBlockGasLimit: Long = 2_000_000_000L
@CommandLine.Option(
names = ["--$cliOptionsPrefix-linea-block-difficulty"],
description = ["Linea Block difficulty. Default 2"],
required = false,
defaultValue = "\${env:LINEA_BLOCK_DIFFICULTY}"
)
var lineaBlockDifficulty: Long = 2
@CommandLine.Option(
names = ["--$cliOptionsPrefix-l1-smart-contract-address"],
description = ["L1 smart contract address"],
required = true,
converter = [AddressConverter::class],
defaultValue = "\${env:L1_ROLLUP_CONTRACT_ADDRESS}"
)
lateinit var l1SmartContractAddress: Address
@CommandLine.Option(
names = ["--$cliOptionsPrefix-l1-endpoint"],
description = ["L1 RPC endpoint"],
@@ -205,8 +223,17 @@ class PluginCliOptions {
require(overridingRecoveryStartBlockNumber == null || overridingRecoveryStartBlockNumber!! >= 1) {
"overridingRecoveryStartBlockNumber=$overridingRecoveryStartBlockNumber must be greater than or equal to 1"
}
require(lineaBlockGasLimit > 0) {
"lineaBlockGasLimit=$lineaBlockGasLimit must be greater than 0"
}
require(lineaBlockDifficulty >= 0) {
"lineaBlockDifficulty=$lineaBlockDifficulty must be greater than or equal to 0"
}
return PluginConfig(
lineaSequencerBeneficiaryAddress = lineaSequencerBeneficiaryAddress,
lineaBlockGasLimit = lineaBlockGasLimit.toULong(),
lineaBlockDifficulty = lineaBlockDifficulty.toULong(),
l1SmartContractAddress = l1SmartContractAddress,
l1Endpoint = l1RpcEndpoint,
l1PollingInterval = l1PollingInterval.toKotlinDuration(),

View File

@@ -96,6 +96,7 @@ class StateRecoveryWithRealBesuAndStateManagerIntTest {
"make staterecovery-replay-from-block " +
"L1_ROLLUP_CONTRACT_ADDRESS=${rollupDeploymentResult.contractAddress} " +
"STATERECOVERY_OVERRIDE_START_BLOCK_NUMBER=1",
timeout = 1.minutes,
log = log
).thenPeek {
log.info("make staterecovery-replay-from-block executed")

View File

@@ -31,7 +31,11 @@ open class FakeStateManagerClient(
open fun getStateRootHash(blockNumber: ULong): SafeFuture<ByteArray> {
return blocksStateRootHashes[blockNumber]
?.let { SafeFuture.completedFuture(it) }
?: SafeFuture.failedFuture(RuntimeException("StateRootHash not found for block=$blockNumber"))
?: SafeFuture.failedFuture(
RuntimeException(
"StateRootHash not found for block=$blockNumber. available blocks: ${blocksStateRootHashes.keys}"
)
)
}
override fun rollupGetHeadBlockNumber(): SafeFuture<ULong> {

View File

@@ -18,10 +18,11 @@ import kotlin.time.toJavaDuration
fun execCommandAndAssertSuccess(
command: String,
timeout: Duration = 1.minutes,
log: Logger
): SafeFuture<CommandResult> {
return Runner
.executeCommandFailOnNonZeroExitCode(command, log = log)
.executeCommandFailOnNonZeroExitCode(command, timeout = timeout, log = log)
.thenPeek { execResult ->
log.debug("STDOUT: {}", execResult.stdOutStr)
log.debug("STDERR: {}", execResult.stdErrStr)