From cad42a797ebc97f43950d19c704339df9beb189d Mon Sep 17 00:00:00 2001 From: Stonemac65 <103312943+StoneMac65@users.noreply.github.com> Date: Fri, 7 Feb 2025 03:10:07 +0000 Subject: [PATCH] feat(taiko-client): add proof type to batch proof acceptance log messages (#18885) --- .../proof_submitter/transaction/sender.go | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/taiko-client/prover/proof_submitter/transaction/sender.go b/packages/taiko-client/prover/proof_submitter/transaction/sender.go index d1bb985055..e9563f499c 100644 --- a/packages/taiko-client/prover/proof_submitter/transaction/sender.go +++ b/packages/taiko-client/prover/proof_submitter/transaction/sender.go @@ -43,6 +43,27 @@ func NewSender( } } +func getProofTypeString(tier uint16) string { + switch tier { + case encoding.TierOptimisticID: + return "Optimistic" + case encoding.TierSgxID: + return "SGX" + case encoding.TierZkVMRisc0ID: + return "ZK-RISC0" + case encoding.TierZkVMSp1ID: + return "ZK-SP1" + case encoding.TierSgxAndZkVMID: + return "SGX+ZK" + case encoding.TierGuardianMinorityID: + return "Guardian-Minority" + case encoding.TierGuardianMajorityID: + return "Guardian-Majority" + default: + return "Unknown" + } +} + // Send sends the given proof to the TaikoL1 smart contract with a backoff policy. func (s *Sender) Send( ctx context.Context, @@ -166,7 +187,7 @@ func (s *Sender) SendBatchProof( } log.Info( - "🚚 Your batch proofs were accepted", + fmt.Sprintf("🚚 Your %s batch proofs were accepted", getProofTypeString(batchProof.Tier)), "txHash", receipt.TxHash, "tier", batchProof.Tier, "blockIDs", batchProof.BlockIDs,