Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 committed Nov 7, 2024
1 parent 9d747d8 commit 48d83b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions sequencesender/txbuilder/banana_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package txbuilder

import (
"fmt"
"github.com/0xPolygon/cdk/log"

"github.com/0xPolygon/cdk/etherman"
"github.com/0xPolygon/cdk/sequencesender/seqsendertypes"
Expand Down Expand Up @@ -159,10 +160,12 @@ func calculateMaxL1InfoTreeIndexInsideL2Data(l2data []byte) (uint32, error) {
}
maxIndex := uint32(0)
for _, block := range batchRawV2.Blocks {
log.Infof("zjg, block:%v, index tree:%v", block.BlockNumber, block.IndexL1InfoTree)
if block.IndexL1InfoTree > maxIndex {
maxIndex = block.IndexL1InfoTree
}
}
log.Infof("zjg, maxIndex:%v", maxIndex)
return maxIndex, nil
}

Expand All @@ -173,6 +176,7 @@ func calculateMaxL1InfoTreeIndexInsideSequence(seq *etherman.SequenceBanana) (ui
maxIndex := uint32(0)
for _, batch := range seq.Batches {
index, err := calculateMaxL1InfoTreeIndexInsideL2Data(batch.L2Data)
log.Infof("zjg, batch:%v, index:%v, maxindex:%v", batch.BatchNumber, index, maxIndex)
if err != nil {
return 0, fmt.Errorf("calculateMaxL1InfoTreeIndexInsideBatches: error getting batch L1InfoTree , err:%w", err)
}
Expand Down
3 changes: 1 addition & 2 deletions sync/evmdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package sync

import (
"context"

"github.com/0xPolygon/cdk/log"
"github.com/0xPolygon/cdk/reorgdetector"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -85,7 +84,7 @@ reset:
cancellableCtx, cancel := context.WithCancel(ctx)
defer cancel()

log.Info("zjg, Starting sync...", " lastProcessedBlock", lastProcessedBlock)
log.Infof("zjg, start syncing from block %d", lastProcessedBlock)
// start downloading
downloadCh := make(chan EVMBlock, d.downloadBufferSize)
go d.downloader.Download(cancellableCtx, lastProcessedBlock+1, downloadCh)
Expand Down

0 comments on commit 48d83b0

Please sign in to comment.