Skip to content

Commit

Permalink
chore(taiko-client): always use blockID instead of height for L2 …
Browse files Browse the repository at this point in the history
…blocks in logs (#18719)
  • Loading branch information
davidtaikocha authored Jan 6, 2025
1 parent 43163d8 commit a02b96d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
3 changes: 1 addition & 2 deletions packages/taiko-client/driver/chain_syncer/blob/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (s *Syncer) onBlockProposed(

log.Debug(
"Parent block",
"height", parent.Number,
"blockID", parent.Number,
"hash", parent.Hash(),
"beaconSyncTriggered", s.progressTracker.Triggered(),
)
Expand Down Expand Up @@ -286,7 +286,6 @@ func (s *Syncer) onBlockProposed(
log.Info(
"🔗 New L2 block inserted",
"blockID", meta.GetBlockID(),
"height", payloadData.Number,
"hash", payloadData.BlockHash,
"transactions", len(payloadData.Transactions),
"baseFee", utils.WeiToGWei(payloadData.BaseFeePerGas),
Expand Down
6 changes: 3 additions & 3 deletions packages/taiko-client/driver/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *State) init(ctx context.Context) error {
s.OnTakeForkHeight = new(big.Int).SetUint64(protocolConfigs.OntakeForkHeight)

log.Info("Genesis L1 height", "height", stateVars.A.GenesisHeight)
log.Info("OnTake fork height", "height", s.OnTakeForkHeight)
log.Info("OnTake fork height", "blockID", s.OnTakeForkHeight)

// Set the L2 head's latest known L1 origin as current L1 sync cursor.
latestL2KnownL1Header, err := s.rpc.LatestL2KnownL1Header(ctx)
Expand All @@ -93,7 +93,7 @@ func (s *State) init(ctx context.Context) error {
return err
}

log.Info("L2 execution engine head", "height", l2Head.Number, "hash", l2Head.Hash())
log.Info("L2 execution engine head", "blockID", l2Head.Number, "hash", l2Head.Hash())
s.setL2Head(l2Head)

s.setHeadBlockID(new(big.Int).SetUint64(stateVars.B.NumBlocks - 1))
Expand Down Expand Up @@ -214,7 +214,7 @@ func (s *State) setL2Head(l2Head *types.Header) {
return
}

log.Trace("New L2 head", "height", l2Head.Number, "hash", l2Head.Hash(), "timestamp", l2Head.Time)
log.Trace("New L2 head", "blockID", l2Head.Number, "hash", l2Head.Hash(), "timestamp", l2Head.Time)
metrics.DriverL2HeadHeightGauge.Set(float64(l2Head.Number.Uint64()))

s.l2Head.Store(l2Head)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func (g *GuardianProofProducer) RequestProof(
"Request guardian proof",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func (o *OptimisticProofProducer) RequestProof(
"Request optimistic proof",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
)

Expand Down
7 changes: 3 additions & 4 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func (s *SGXProofProducer) RequestProof(
"Request sgx proof from raiko-host service",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
"time", time.Since(requestAt),
)
Expand Down Expand Up @@ -358,14 +357,14 @@ func (s *SGXProofProducer) callProverDaemon(

output, err := s.requestProof(ctx, opts)
if err != nil {
log.Error("Failed to request proof", "height", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
log.Error("Failed to request proof", "blockID", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
return nil, err
}

if output == nil {
log.Info(
"Proof generating",
"height", opts.BlockID,
"blockID", opts.BlockID,
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
Expand All @@ -392,7 +391,7 @@ func (s *SGXProofProducer) callProverDaemon(

log.Info(
"Proof generated",
"height", opts.BlockID,
"blockID", opts.BlockID,
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
Expand Down
5 changes: 2 additions & 3 deletions packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (s *ZKvmProofProducer) RequestProof(
"Request zk proof from raiko-host service",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
"zkType", s.ZKProofType,
"time", time.Since(requestAt),
Expand Down Expand Up @@ -178,7 +177,7 @@ func (s *ZKvmProofProducer) callProverDaemon(

output, err := s.requestProof(zkCtx, opts)
if err != nil {
log.Error("Failed to request proof", "height", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
log.Error("Failed to request proof", "blockID", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
return nil, err
}

Expand All @@ -197,7 +196,7 @@ func (s *ZKvmProofProducer) callProverDaemon(
}
log.Info(
"Proof generated",
"height", opts.BlockID,
"blockID", opts.BlockID,
"time", time.Since(requestAt),
"producer", "ZKvmProofProducer",
)
Expand Down

0 comments on commit a02b96d

Please sign in to comment.