Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

#3514 Fix l1 info root after reorg #3515

Merged
merged 8 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix non e2e test
  • Loading branch information
ARR552 committed Apr 4, 2024
commit e815320bced22dad62455b1803727b36da8f8478
5 changes: 2 additions & 3 deletions l1infotree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func NewL1InfoTree(height uint8, initialLeaves [][32]byte) (*L1InfoTree, error)
func (mt *L1InfoTree) ResetL1InfoTree(initialLeaves [][32]byte) (*L1InfoTree, error) {
log.Info("Resetting L1InfoTree...")
newMT := &L1InfoTree{
zeroHashes: mt.zeroHashes,
height: mt.height,
zeroHashes: generateZeroHashes(32), // nolint:gomnd
height: 32, // nolint:gomnd
count: uint32(len(initialLeaves)),
}
var err error
Expand All @@ -50,7 +50,6 @@ func (mt *L1InfoTree) ResetL1InfoTree(initialLeaves [][32]byte) (*L1InfoTree, er
}
log.Debug("Reset initial count: ", newMT.count)
log.Debug("Reset initial root: ", newMT.currentRoot)
mt = newMT
return newMT, nil
}

Expand Down
10 changes: 10 additions & 0 deletions synchronizer/synchronizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ func TestForcedBatchEtrog(t *testing.T) {
Return(blocks, order, nil).
Once()

m.Etherman.
On("EthBlockByNumber", ctx, lastBlock.BlockNumber).
Return(ethBlock, nil).
Once()

m.ZKEVMClient.
On("BatchNumber", ctx).
Return(uint64(1), nil)
Expand Down Expand Up @@ -509,6 +514,11 @@ func TestSequenceForcedBatchIncaberry(t *testing.T) {
Return(blocks, order, nil).
Once()

m.Etherman.
On("EthBlockByNumber", ctx, lastBlock.BlockNumber).
Return(ethBlock, nil).
Once()

m.State.
On("BeginStateTransaction", ctx).
Return(m.DbTx, nil).
Expand Down
Loading