diff --git a/.github/workflows/test-e2e-multi_pp.yml b/.github/workflows/test-e2e-multi_pp.yml index 72c7140d..69b7ecaa 100644 --- a/.github/workflows/test-e2e-multi_pp.yml +++ b/.github/workflows/test-e2e-multi_pp.yml @@ -17,6 +17,7 @@ jobs: e2e-group: - "fork12-pessimistic" runs-on: ubuntu-latest + timeout-minutes: 30 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index e164705c..1971a0d4 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -9,7 +9,7 @@ on: jobs: build-cdk-image: runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 20 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 diff --git a/Makefile b/Makefile index fad3c395..e4ca22ef 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ stop: ## Stops all services .PHONY: test-unit test-unit: - trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -short -race -p 1 -covermode=atomic -coverprofile=coverage.out -coverpkg ./... -timeout 200s ./... + trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -short -race -p 1 -covermode=atomic -coverprofile=coverage.out -coverpkg ./... -timeout 15m ./... .PHONY: test-seq_sender test-seq_sender: diff --git a/bridgesync/bridgesync.go b/bridgesync/bridgesync.go index 4052ba29..8f61e34e 100644 --- a/bridgesync/bridgesync.go +++ b/bridgesync/bridgesync.go @@ -12,8 +12,8 @@ import ( ) const ( - bridgeSyncL1 = "L1" - bridgeSyncL2 = "L2" + l1BridgeSyncer = "L1BridgeSyncer" + l2BridgeSyncer = "L2BridgeSyncer" downloadBufferSize = 1000 ) @@ -55,7 +55,7 @@ func NewL1( rd, ethClient, initialBlock, - bridgeSyncL1, + l1BridgeSyncer, waitForNewBlocksPeriod, retryAfterErrorPeriod, maxRetryAttemptsAfterError, @@ -89,7 +89,7 @@ func NewL2( rd, ethClient, initialBlock, - bridgeSyncL2, + l2BridgeSyncer, waitForNewBlocksPeriod, retryAfterErrorPeriod, maxRetryAttemptsAfterError, @@ -107,14 +107,14 @@ func newBridgeSync( rd ReorgDetector, ethClient EthClienter, initialBlock uint64, - layerID string, + syncerID string, waitForNewBlocksPeriod time.Duration, retryAfterErrorPeriod time.Duration, maxRetryAttemptsAfterError int, originNetwork uint32, syncFullClaims bool, ) (*BridgeSync, error) { - logger := log.WithFields("bridge-syncer", layerID) + logger := log.WithFields("module", syncerID) processor, err := newProcessor(dbPath, logger) if err != nil { return nil, err @@ -143,7 +143,7 @@ func newBridgeSync( return nil, err } downloader, err := sync.NewEVMDownloader( - layerID, + syncerID, ethClient, syncBlockChunkSize, blockFinalityType, @@ -156,13 +156,13 @@ func newBridgeSync( return nil, err } - driver, err := sync.NewEVMDriver(rd, processor, downloader, layerID, downloadBufferSize, rh) + driver, err := sync.NewEVMDriver(rd, processor, downloader, syncerID, downloadBufferSize, rh) if err != nil { return nil, err } logger.Infof( - "BridgeSyncer [%s] created:\n"+ + "%s created:\n"+ " dbPath: %s\n"+ " initialBlock: %d\n"+ " bridgeAddr: %s\n"+ @@ -172,7 +172,7 @@ func newBridgeSync( " syncBlockChunkSize: %d\n"+ " blockFinalityType: %s\n"+ " waitForNewBlocksPeriod: %s", - layerID, + syncerID, dbPath, initialBlock, bridge.String(), diff --git a/crates/cdk/build.rs b/crates/cdk/build.rs index cceff95c..3bb15ece 100644 --- a/crates/cdk/build.rs +++ b/crates/cdk/build.rs @@ -70,7 +70,7 @@ fn build_versions() -> std::io::Result<()> { // Get the corresponding lines from the contents of the starlark file let versions = content .lines() - .skip(30) + .skip(32) .take(15) .collect::>() .join("\n"); @@ -81,6 +81,7 @@ fn build_versions() -> std::io::Result<()> { // Remove all comments to the end of the line using a regexp let re = Regex::new(r"\s#\s.*\n").unwrap(); let versions = re.replace_all(&versions, ""); + // Replace the trailing comma on the last line let versions = versions.replace(", }", " }"); diff --git a/test/Makefile b/test/Makefile index 2e81a453..46492f87 100644 --- a/test/Makefile +++ b/test/Makefile @@ -74,31 +74,37 @@ generate-mocks-agglayer: ## Generates mocks for agglayer, using mockery tool .PHONY: test-e2e-fork9-validium test-e2e-fork9-validium: stop ./run-e2e.sh fork9 cdk-validium + export BATS_TEST_TIMEOUT=1800 bats bats/fep/ .PHONY: test-e2e-fork11-rollup test-e2e-fork11-rollup: stop ./run-e2e.sh fork11 rollup + export BATS_TEST_TIMEOUT=1800 bats bats/fep/ .PHONY: test-e2e-fork12-validium test-e2e-fork12-validium: stop ./run-e2e.sh fork12 cdk-validium + export BATS_TEST_TIMEOUT=1800 bats bats/fep/ .PHONY: test-e2e-fork12-rollup test-e2e-fork12-rollup: stop ./run-e2e.sh fork12 rollup + export BATS_TEST_TIMEOUT=1800 bats bats/fep/ .PHONY: test-e2e-fork12-pessimistic test-e2e-fork12-pessimistic: stop ./run-e2e.sh fork12 pessimistic + export BATS_TEST_TIMEOUT=1800 bats bats/pp/bridge-e2e.bats bats/pp/e2e-pp.bats .PHONY: test-e2e-fork12-multi-pessimistic test-e2e-fork12-multi-pessimistic: stop - ./run-e2e-multi_pp.sh + ./run-e2e-multi_pp.sh + export BATS_TEST_TIMEOUT=1800 bats bats/pp-multi .PHONY: stop diff --git a/test/helpers/e2e.go b/test/helpers/e2e.go index c7fb908e..fb66319d 100644 --- a/test/helpers/e2e.go +++ b/test/helpers/e2e.go @@ -29,8 +29,6 @@ import ( const ( rollupID = uint32(1) syncBlockChunkSize = 10 - retries = 3 - periodRetry = time.Millisecond * 100 ) type AggoracleWithEVMChain struct { @@ -108,6 +106,11 @@ func L1Setup(t *testing.T) *L1Environment { require.NoError(t, err) go rdL1.Start(ctx) //nolint:errcheck + const ( + l1InfoTreeSyncerRetries = 3 + l1InfoTreeSyncerRetryFreq = time.Millisecond * 100 + ) + // L1 info tree sync dbPathL1InfoTreeSync := path.Join(t.TempDir(), "L1InfoTreeSync.sqlite") l1InfoTreeSync, err := l1infotreesync.New( @@ -115,20 +118,19 @@ func L1Setup(t *testing.T) *L1Environment { gerL1Addr, common.Address{}, syncBlockChunkSize, etherman.LatestBlock, rdL1, l1Client.Client(), - time.Millisecond, 0, periodRetry, - retries, l1infotreesync.FlagAllowWrongContractsAddrs, + time.Millisecond, 0, l1InfoTreeSyncerRetryFreq, + l1InfoTreeSyncerRetries, l1infotreesync.FlagAllowWrongContractsAddrs, ) require.NoError(t, err) go l1InfoTreeSync.Start(ctx) const ( - syncBlockChunks = 10 waitForNewBlocksPeriod = 10 * time.Millisecond originNetwork = 1 initialBlock = 0 - retryPeriod = 0 - retriesCount = 0 + retryPeriod = 50 * time.Millisecond + retriesCount = 10 ) // Bridge sync @@ -136,7 +138,7 @@ func L1Setup(t *testing.T) *L1Environment { dbPathBridgeSyncL1 := path.Join(t.TempDir(), "BridgeSyncL1.sqlite") bridgeL1Sync, err := bridgesync.NewL1( ctx, dbPathBridgeSyncL1, bridgeL1Addr, - syncBlockChunks, etherman.LatestBlock, rdL1, testClient, + syncBlockChunkSize, etherman.LatestBlock, rdL1, testClient, initialBlock, waitForNewBlocksPeriod, retryPeriod, retriesCount, originNetwork, false) require.NoError(t, err) @@ -186,16 +188,15 @@ func L2Setup(t *testing.T) *L2Environment { testClient := TestClient{ClientRenamed: l2Client.Client()} const ( - syncBlockChunks = 10 waitForNewBlocksPeriod = 10 * time.Millisecond originNetwork = 1 initialBlock = 0 - retryPeriod = 0 - retriesCount = 0 + retryPeriod = 50 * time.Millisecond + retriesCount = 10 ) bridgeL2Sync, err := bridgesync.NewL2( - ctx, dbPathL2BridgeSync, bridgeL2Addr, syncBlockChunks, + ctx, dbPathL2BridgeSync, bridgeL2Addr, syncBlockChunkSize, etherman.LatestBlock, rdL2, testClient, initialBlock, waitForNewBlocksPeriod, retryPeriod, retriesCount, originNetwork, false)