Skip to content

Commit

Permalink
Merge branch 'main' into prover/connecting-stitcher-splitter-to-full-…
Browse files Browse the repository at this point in the history
…compilation-suit
  • Loading branch information
Soleimani193 authored Jan 16, 2025
2 parents 9976b8b + fe967c7 commit 1bb8d61
Show file tree
Hide file tree
Showing 135 changed files with 5,124 additions and 549 deletions.
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ deploy-l2-evm-opcode-tester:
RPC_URL=http:\\localhost:8545/ \
npx ts-node local-deployments-artifacts/deployLondonEvmTestingFramework.ts

execute-all-opcodes:

evm-opcode-tester-execute-all-opcodes: OPCODE_TEST_CONTRACT_ADDRESS:=0x997FC3aF1F193Cbdc013060076c67A13e218980e
evm-opcode-tester-execute-all-opcodes:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
OPCODE_TEST_CONTRACT_ADDRESS=0x997FC3aF1F193Cbdc013060076c67A13e218980e \
OPCODE_TEST_CONTRACT_ADDRESS=$(OPCODE_TEST_CONTRACT_ADDRESS) \
NUMBER_OF_RUNS=3 \
PRIVATE_KEY=0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae \
RPC_URL=http:\\localhost:8545/ \
Expand Down Expand Up @@ -216,11 +218,17 @@ deploy-contracts-minimal:
cd .. && \
$(MAKE) -j6 deploy-linea-rollup-v$(L1_CONTRACT_VERSION) deploy-l2messageservice

start-all-staterecover: L1_CONTRACT_VERSION:=6
start-all-staterecover: COMPOSE_PROFILES:=l1,l2,staterecover
start-all-staterecover:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment COMPOSE_PROFILES=$(COMPOSE_PROFILES)
make deploy-contracts-minimal L1_CONTRACT_VERSION=$(L1_CONTRACT_VERSION)
fresh-start-all-staterecover: COMPOSE_PROFILES:=l1,l2,staterecover
fresh-start-all-staterecover: L1_CONTRACT_VERSION:=6
fresh-start-all-staterecover:
make clean-environment
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment-traces-v2 COMPOSE_PROFILES=$(COMPOSE_PROFILES)
$(MAKE) deploy-contracts-minimal L1_CONTRACT_VERSION=$(L1_CONTRACT_VERSION)

fresh-start-staterecover-for-replay-only: COMPOSE_PROFILES:=l1,staterecover
fresh-start-staterecover-for-replay-only:
make clean-environment
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment-traces-v2 COMPOSE_PROFILES=$(COMPOSE_PROFILES)

testnet-start-l2:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml --profile l2 up -d
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ allprojects {
systemProperty("L1_RPC_URL", "http://localhost:8445")
systemProperty("L2_RPC_URL", "http://localhost:8545")
systemProperty("L1_GENESIS", "docker/config/l1-node/el/genesis.json")
systemProperty("L2_GENESIS", "docker/config/linea-local-dev-genesis.json")
systemProperty("L2_GENESIS", "docker/config/linea-local-dev-genesis-PoA.json")

systemProperties["junit.jupiter.execution.timeout.default"] = "5 m" // 5 minutes
systemProperties["junit.jupiter.execution.parallel.enabled"] = true
Expand Down Expand Up @@ -203,7 +203,8 @@ dockerCompose {
"staterecover"
]
useComposeFiles = [
"${project.rootDir.path}/docker/compose.yml"
"${project.rootDir.path}/docker/compose.yml",
"${project.rootDir.path}/docker/compose-local-dev-traces-v2.overrides.yml"
]
waitForHealthyStateTimeout = Duration.ofMinutes(3)
waitForTcpPorts = false
Expand Down
10 changes: 5 additions & 5 deletions config/coordinator/coordinator-docker.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ fee-history-reward-percentile=15
last-hash-search-window=25
anchoring-receipt-polling-interval="PT01S"
max-receipt-retries=120
# Number of children blocks to wait before considering a won't be reverted and elegible for conflation.
# this a workaround to mitigate Geth fork issues with Clique PoA
# Number of children blocks to wait before considering they won't be reverted and elegible for conflation.
# this is a workaround to mitigate Geth fork issues with Clique PoA
# Coordinator will consider block as finalized after being included in the chain wtih children blocks-to-finalization
# Recommended: Geth sequencer minimum of 2, Besu sequencer minimum of 1, 0 is safe localy
blocks-to-finalization=0
Expand Down Expand Up @@ -155,7 +155,7 @@ aggregation-proofs-limit=3
aggregation-deadline="PT10S"
aggregation-coordinator-polling-interval="PT2S"
deadline-check-interval="PT8S"
target-end-blocks=[]
#target-end-blocks=[33, 90, 93]

[finalization-signer]
# Web3j/Web3signer
Expand Down Expand Up @@ -266,8 +266,8 @@ num-of-blocks-before-latest=4
storage-period="PT2M"

[conflation]
blocks-limit=2
conflation-deadline="PT6S" # =3*l2_block_time
blocks-limit=3
conflation-deadline="PT6S"
conflation-deadline-check-interval="PT3S"
conflation-deadline-last-block-confirmation-delay="PT2S" # recommended: at least 2 * blockInterval

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import build.linea.clients.StateManagerClientV1
import build.linea.clients.StateManagerV1JsonRpcClient
import build.linea.contract.l1.LineaRollupSmartContractClientReadOnly
import build.linea.contract.l1.Web3JLineaRollupSmartContractClientReadOnly
import build.linea.web3j.Web3JLogsClient
import io.vertx.core.Vertx
import kotlinx.datetime.Clock
import linea.encoding.BlockRLPEncoder
import net.consensys.linea.BlockNumberAndHash
import net.consensys.linea.blob.ShnarfCalculatorVersion
import net.consensys.linea.contract.Web3JL2MessageService
import net.consensys.linea.contract.Web3JL2MessageServiceLogsClient
import net.consensys.linea.contract.Web3JLogsClient
import net.consensys.linea.contract.l1.GenesisStateProvider
import net.consensys.linea.ethereum.gaspricing.BoundableFeeCalculator
import net.consensys.linea.ethereum.gaspricing.FeesCalculator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

package net.consensys.zkevm.coordinator.app

import build.linea.web3j.Web3JLogsClient
import io.vertx.junit5.Timeout
import io.vertx.junit5.VertxExtension
import io.vertx.junit5.VertxTestContext
import net.consensys.linea.contract.EIP1559GasProvider
import net.consensys.linea.contract.L2MessageService
import net.consensys.linea.contract.Web3JLogsClient
import net.consensys.toULong
import net.consensys.zkevm.ethereum.coordination.conflation.upgrade.SwitchProvider
import net.consensys.zkevm.ethereum.signing.ECKeypairSigner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ internal class ExecutionProofRequestDataDecorator(

return SafeFuture.collectAll(bridgeLogsSfList.stream())
.thenCombine(
getBlockStateRootHash(request.blocks.first().number.toULong() - 1UL)
getBlockStateRootHash(request.blocks.first().number - 1UL)
) { blocksAndBridgeLogs, previousKeccakStateRootHash ->
BatchExecutionProofRequestDto(
zkParentStateRootHash = request.type2StateData.zkParentStateRootHash.encodeHex(),
Expand Down
3 changes: 1 addition & 2 deletions coordinator/clients/smart-contract-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
implementation project(":jvm-libs:generic:extensions:kotlin")
implementation project(':jvm-libs:linea:web3j-extensions')
api project(':jvm-libs:linea:web3j-extensions')
api project(':jvm-libs:linea:clients:linea-l1-contract-client')
api 'build.linea:l2-message-service-contract-client:0.0.1'

Expand All @@ -15,5 +15,4 @@ dependencies {
implementation project(path: ':coordinator:core')
implementation project(path: ':coordinator:ethereum:common')
testImplementation "io.vertx:vertx-junit5"
testImplementation "com.github.tomakehurst:wiremock-jre8:${libs.versions.wiremock.get()}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class Web3JContractAsyncHelper(
dynamicMaxFeePerGas: ULong?,
dynamicMaxFeePerBlobGas: ULong? = null
) {
val withBlob = maxFeePerBlobGas != null && dynamicMaxFeePerBlobGas != null
val withBlob = maxFeePerBlobGas != null || dynamicMaxFeePerBlobGas != null
log.info(
"$logMessagePrefix gas price caps: " +
"blobCarrying=$withBlob " +
Expand All @@ -263,8 +263,8 @@ class Web3JContractAsyncHelper(
"maxFeePerGas=${maxFeePerGas.toGWei()} GWei, " +
"dynamicMaxFeePerGas=${dynamicMaxFeePerGas?.toGWei()} GWei, " +
if (withBlob) {
"maxFeePerBlobGas=${maxFeePerBlobGas!!.toGWei()} GWei, " +
"dynamicMaxFeePerBlobGas=${dynamicMaxFeePerBlobGas!!.toGWei()} GWei"
"maxFeePerBlobGas=${maxFeePerBlobGas?.toGWei()} GWei, " +
"dynamicMaxFeePerBlobGas=${dynamicMaxFeePerBlobGas?.toGWei()} GWei"
} else {
""
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.consensys.linea.contract

import build.linea.web3j.Web3JLogsClient
import net.consensys.toULong
import net.consensys.zkevm.coordinator.clients.L2MessageServiceLogsClient
import net.consensys.zkevm.domain.BridgeLogsData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class BlobAndAggregationFinalizationIntTest : CleanDbTestSuiteParallel() {
val blobsEndTime = blobs.last().endBlockTime
val endTime = if (aggEndTime > blobsEndTime) aggEndTime else blobsEndTime

fakeClock.setTimeTo(endTime.plus(10.seconds))
// submission do the cutoff by minutes, so we need to add 1 minute to the end time
fakeClock.setTimeTo(endTime.plus(1.minutes))

blobSubmissionCoordinator.start()
aggregationFinalizationCoordinator.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

package net.consensys.zkevm.ethereum.submission

import build.linea.web3j.Web3JLogsClient
import net.consensys.linea.contract.L2MessageService
import net.consensys.linea.contract.Web3JLogsClient
import net.consensys.toULong
import net.consensys.zkevm.ethereum.coordination.conflation.upgrade.SwitchProvider
import org.apache.logging.log4j.LogManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ object L1AccountManager : AccountManager by WhaleBasedAccountManager(

object L2AccountManager : AccountManager by WhaleBasedAccountManager(
web3jClient = Web3jClientManager.l2Client,
genesisFile = getPathTo(System.getProperty("L2_GENESIS", "docker/config/linea-local-dev-genesis.json")),
genesisFile = getPathTo(System.getProperty("L2_GENESIS", "docker/config/linea-local-dev-genesis-PoA.json")),
log = LogManager.getLogger(L2AccountManager::class.java)
)

Expand Down
102 changes: 102 additions & 0 deletions docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ services:
condition: service_healthy
l1-node-genesis-generator:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:4000/eth/v1/node/health || exit 1"]
interval: 1s
timeout: 1s
retries: 120
command: [ "--config-file=/config/config-file.yaml" ]
volumes:
- ./config/l1-node/cl/teku.key:/config/keys/teku.key:ro
Expand Down Expand Up @@ -644,6 +649,10 @@ services:
condition: service_healthy
redis:
condition: service_healthy
l1-cl-node:
condition: service_healthy
l1-el-node:
condition: service_healthy

blobscan-indexer:
container_name: blobscan-indexer
Expand All @@ -662,6 +671,10 @@ services:
condition: service_healthy
blobscan-api:
condition: service_started
l1-cl-node:
condition: service_healthy
l1-el-node:
condition: service_healthy

redis:
container_name: redis
Expand All @@ -684,6 +697,95 @@ services:
l1network:
ipv4_address: 10.10.10.205

zkbesu-shomei-sr:
image: consensys/linea-besu-package:${SEQUENCER_TAG:-devnet-811f30b}
hostname: zkbesu-shomei-sr
container_name: zkbesu-shomei-sr
profiles: [ "external-to-monorepo", "staterecover" ]
privileged: true
# restart: none
user: root
ports:
- "9145:8545" # http
- "9146:8546" # websockets
- "9150:8550"
- "10545:9545"
healthcheck:
test: [ "CMD-SHELL", "bash -c \"[ -f /tmp/pid ]\"" ]
interval: 1s
timeout: 1s
retries: 120
restart: "no"
networks:
l1network:
ipv4_address: 10.10.10.206
linea:
ipv4_address: 11.11.11.116
environment:
LOG4J_CONFIGURATION_FILE: /var/lib/besu/log4j.xml
L1_ROLLUP_CONTRACT_ADDRESS: ${L1_ROLLUP_CONTRACT_ADDRESS:-0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9}
entrypoint:
- /bin/bash
- -c
- |
chown -R besu:besu /opt/besu/plugins && \
ls -lh /opt/besu/plugins && \
sed -i '/^CLASSPATH/c\CLASSPATH=/opt/besu/lib/\*' /opt/besu/bin/besu && \
/opt/besu/bin/besu \
--config-file=/var/lib/besu/zkbesu-config.toml \
--genesis-file=/var/lib/besu/genesis.json \
--plugins=BesuShomeiRpcPlugin,ZkTrieLogPlugin,LineaStateRecoverPlugin \
--rpc-http-api=ADMIN,DEBUG,NET,ETH,WEB3,PLUGINS,MINER,SHOMEI \
--Xbonsai-limit-trie-logs-enabled=false \
--plugin-shomei-http-host="11.11.11.117" \
--plugin-shomei-http-port=8888 \
--plugin-staterecovery-l1-rpc-endpoint=http://l1-el-node:8545 \
--plugin-staterecovery-shomei-endpoint=http://shomei-sr:8888 \
--plugin-staterecovery-blobscan-endpoint=http://blobscan-api:4001 \
--plugin-staterecovery-linea-sequencer-beneficiary-address=0x6d976c9b8ceee705d4fe8699b44e5eb58242f484 \
--plugin-staterecovery-overriding-recovery-start-block-number=1 \
--plugin-staterecovery-l1-polling-interval=PT1S
volumes:
- ./config/zkbesu-shomei/zkbesu-config.toml:/var/lib/besu/zkbesu-config.toml:ro
- ./config/zkbesu-shomei/log4j-staterecovery.xml:/var/lib/besu/log4j.xml:ro
- ./config/linea-local-dev-genesis-PoA-besu.json/:/var/lib/besu/genesis.json:ro
- ../state-recover/besu-plugin/build/libs/linea-staterecover-plugin-0.0.1-rc2.jar:/opt/besu/lib/linea-staterecover-plugin-0.0.1-rc2.jar
- ../state-recover/besu-plugin/build/libs/linea-staterecover-plugin-0.0.1-rc2.jar:/opt/besu/plugins/linea-staterecover-plugin-0.0.1-rc2.jar

shomei-sr:
image: consensys/linea-shomei:2.3.0
hostname: shomei-sr
container_name: shomei-sr
profiles: [ "external-to-monorepo", "staterecover" ]
depends_on:
zkbesu-shomei-sr:
condition: service_started
privileged: true
user: root
ports:
- "8890:8888"
healthcheck:
test: [ "CMD-SHELL", "bash -c \"[ -f /data/shomei/LOCK ]\"" ]
interval: 1s
timeout: 1s
retries: 60
networks:
linea:
ipv4_address: 11.11.11.117
environment:
LOG4J_CONFIGURATION_FILE: /log4j.xml
command:
- --besu-rpc-http-host=11.11.11.116
- --besu-rpc-http-port=8545
- --rpc-http-host=11.11.11.117
- --rpc-http-host-allow-list=*
- --rpc-http-port=8888
- --min-confirmations-before-importing=0
- --trace-start-block-number=0
volumes:
- ./config/shomei/log4j.xml:/log4j.xml:ro
# - ../tmp/local/shomei:/data/shomei/:z

########################
# Observability stack
########################
Expand Down
Loading

0 comments on commit 1bb8d61

Please sign in to comment.