Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(all): improve proposer && prover logs (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jun 6, 2023
1 parent 99c980b commit 6d0a724
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
1 change: 1 addition & 0 deletions driver/chain_syncer/calldata/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (s *Syncer) onBlockProposed(
"L1Height", event.Raw.BlockNumber,
"L1Hash", event.Raw.BlockHash,
"BlockID", event.Id,
"BlockFee", event.BlockFee,
"Removed", event.Raw.Removed,
)

Expand Down
2 changes: 1 addition & 1 deletion driver/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (s *State) startSubscriptions(ctx context.Context) {
log.Info("✅ Block proven", "blockID", e.Id, "hash", common.Hash(e.BlockHash), "prover", e.Prover)
}
case e := <-s.blockVerifiedCh:
log.Info("📈 Block verified", "blockID", e.Id, "hash", common.Hash(e.BlockHash))
log.Info("📈 Block verified", "blockID", e.Id, "hash", common.Hash(e.BlockHash), "reward", e.Reward)
case e := <-s.crossChainSynced:
// Verify the protocol synced block, check if it exists in
// L2 execution engine.
Expand Down
9 changes: 8 additions & 1 deletion prover/proof_submitter/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ func sendTxWithBackoff(
if err != nil {
log.Warn(
"Failed to check if the generated proof is needed",
"blockID", blockID, "error", err,
"blockID", blockID,
"error", err,
)
return err
}
Expand Down Expand Up @@ -171,6 +172,12 @@ func sendTxWithBackoff(
return err
}

log.Info(
"💰 Your block proof was accepted",
"blockID", blockID,
"proposedAt", proposedAt,
)

return nil
}, backoff.NewConstantBackOff(12*time.Second)); err != nil {
return fmt.Errorf("failed to send TaikoL1.proveBlock transaction: %w", err)
Expand Down
7 changes: 0 additions & 7 deletions prover/proof_submitter/valid_proof_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,6 @@ func (s *ValidProofSubmitter) SubmitProof(
return err
}

log.Info(
"💰 Your block proof was accepted",
"blockID", proofWithHeader.BlockID,
"hash", block.Hash(), "height", block.Number(),
"transactions", block.Transactions().Len(),
)

metrics.ProverSentProofCounter.Inc(1)
metrics.ProverSentValidProofCounter.Inc(1)
metrics.ProverLatestProvenBlockIDGauge.Update(proofWithHeader.BlockID.Int64())
Expand Down
16 changes: 14 additions & 2 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,14 @@ func (p *Prover) onBlockProposed(
if event.Id.Uint64() <= p.lastHandledBlockID {
return nil
}
log.Info("Proposed block", "blockID", event.Id)
log.Info(
"Proposed block",
"L1Height", event.Raw.BlockNumber,
"L1Hash", event.Raw.BlockHash,
"BlockID", event.Id,
"BlockFee", event.BlockFee,
"Removed", event.Raw.Removed,
)
metrics.ProverReceivedProposedBlockGauge.Update(event.Id.Int64())

handleBlockProposedEvent := func() error {
Expand Down Expand Up @@ -442,7 +449,12 @@ func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1Cli
return nil
}

log.Info("New verified valid block", "blockID", event.Id, "hash", common.BytesToHash(event.BlockHash[:]))
log.Info(
"New verified valid block",
"blockID", event.Id,
"hash", common.BytesToHash(event.BlockHash[:]),
"reward", event.Reward,
)

// cancel any proofs being generated for this block
p.cancelProof(ctx, event.Id.Uint64())
Expand Down

0 comments on commit 6d0a724

Please sign in to comment.