Skip to content

Commit

Permalink
query accInputHash only if l1syncer set (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Staykov authored Sep 20, 2024
1 parent c9c3ce5 commit cd73b3a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd/rpcdaemon/commands/zkevm_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,14 @@ func (api *ZkEvmAPIImpl) GetBatchByNumber(ctx context.Context, batchNumber rpc.B
}
batch.BatchL2Data = batchL2Data

oldAccInputHash, err := api.l1Syncer.GetOldAccInputHash(ctx, &api.config.AddressRollup, api.config.L1RollupId, batchNo)
if err != nil {
log.Warn("Failed to get old acc input hash", "err", err)
batch.AccInputHash = common.Hash{}
if api.l1Syncer != nil {
oldAccInputHash, err := api.l1Syncer.GetOldAccInputHash(ctx, &api.config.AddressRollup, api.config.L1RollupId, batchNo)
if err != nil {
log.Warn("Failed to get old acc input hash", "err", err)
batch.AccInputHash = common.Hash{}
}
batch.AccInputHash = oldAccInputHash
}
batch.AccInputHash = oldAccInputHash

// forkid exit roots logic
// if forkid < 12 then we should only set the exit roots if they have changed, otherwise 0x00..00
// if forkid >= 12 then we should always set the exit roots
Expand Down

0 comments on commit cd73b3a

Please sign in to comment.