Skip to content

Commit

Permalink
fix(l1syncer): sequences post etrog
Browse files Browse the repository at this point in the history
  • Loading branch information
revitteth committed Aug 29, 2024
1 parent 1ad5bdb commit 5e898e9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions zk/stages/stage_l1syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ Loop:
info, batchLogType := parseLogType(cfg.zkCfg.L1RollupId, &l)
switch batchLogType {
case logSequence:
// prevent storing pre-etrog sequences for etrog rollups
if batchLogType == logSequence && cfg.zkCfg.L1RollupId > 1 {
continue
}
if err := hermezDb.WriteSequence(info.L1BlockNo, info.BatchNo, info.L1TxHash, info.StateRoot); err != nil {
return fmt.Errorf("failed to write batch info, %w", err)
}
Expand Down Expand Up @@ -216,9 +220,10 @@ type BatchLogType byte
var (
logUnknown BatchLogType = 0
logSequence BatchLogType = 1
logVerify BatchLogType = 2
logVerifyEtrog BatchLogType = 3
logL1InfoTreeUpdate BatchLogType = 4
logSequenceEtrog BatchLogType = 2
logVerify BatchLogType = 3
logVerifyEtrog BatchLogType = 4
logL1InfoTreeUpdate BatchLogType = 5

logIncompatible BatchLogType = 100
)
Expand All @@ -234,7 +239,7 @@ func parseLogType(l1RollupId uint64, log *ethTypes.Log) (l1BatchInfo types.L1Bat
batchLogType = logSequence
batchNum = new(big.Int).SetBytes(log.Topics[1].Bytes()).Uint64()
case contracts.SequencedBatchTopicEtrog:
batchLogType = logSequence
batchLogType = logSequenceEtrog
batchNum = new(big.Int).SetBytes(log.Topics[1].Bytes()).Uint64()
l1InfoRoot = common.BytesToHash(log.Data[:32])
case contracts.VerificationTopicPreEtrog:
Expand Down

0 comments on commit 5e898e9

Please sign in to comment.