diff --git a/l1infotreesync/e2e_test.go b/l1infotreesync/e2e_test.go index e26fb6bf..16934044 100644 --- a/l1infotreesync/e2e_test.go +++ b/l1infotreesync/e2e_test.go @@ -272,7 +272,7 @@ func TestWithReorgs(t *testing.T) { func TestStressAndReorgs(t *testing.T) { const ( - totalIterations = 2 // Have tested with much larger number (+10k) + totalIterations = 10 blocksInIteration = 140 reorgEveryXIterations = 70 reorgSizeInBlocks = 2 @@ -356,7 +356,7 @@ func TestStressAndReorgs(t *testing.T) { t.Logf("expectedL1InfoRoot: %s", common.Hash(expectedL1InfoRoot).String()) require.Equal(t, common.Hash(expectedGER), info.GlobalExitRoot, fmt.Sprintf("%+v", info)) - // require.Equal(t, common.Hash(expectedL1InfoRoot), lastRoot.Hash) // TODO this fails + require.Equal(t, common.Hash(expectedL1InfoRoot), lastRoot.Hash) } func waitForSyncerToCatchUp(ctx context.Context, t *testing.T, syncer *l1infotreesync.L1InfoTreeSync, client *simulated.Backend) { diff --git a/tree/appendonlytree.go b/tree/appendonlytree.go index 418a576b..2444682a 100644 --- a/tree/appendonlytree.go +++ b/tree/appendonlytree.go @@ -113,7 +113,7 @@ func (t *AppendOnlyTree) initCache(tx db.Txer) error { } // Reverse the siblings to go from leafs to root - for i, j := 0, len(siblings)-1; i < j; i, j = i+1, j-1 { + for i, j := 0, len(siblings)-1; i <= j; i, j = i+1, j-1 { siblings[i], siblings[j] = siblings[j], siblings[i] }