From 3362674d74a344ebd6fa27e2d1f24ee30e5302d0 Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 14:18:29 +0800 Subject: [PATCH 01/12] fix: enhance GreedyMergeTx performance --- miner/bid_simulator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 1d77308fed..6e52485f9c 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -633,7 +633,7 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { if b.config.GreedyMergeTx { delay := b.engine.Delay(b.chain, bidRuntime.env.header, &b.delayLeftOver) if delay != nil && *delay > 0 { - bidTxsSet := mapset.NewSet[common.Hash]() + bidTxsSet := mapset.NewThreadUnsafeSetWithSize[common.Hash](len(bidRuntime.bid.Txs)) for _, tx := range bidRuntime.bid.Txs { bidTxsSet.Add(tx.Hash()) } From 0a10a636934db28d8abdb17a5505005e73490c96 Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 14:37:54 +0800 Subject: [PATCH 02/12] enhance: bidRuntime creation and comparison --- miner/bid_simulator.go | 86 ++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 6e52485f9c..01a7be6599 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -334,60 +334,26 @@ func (b *bidSimulator) newBidLoop() { continue } - // check the block reward and validator reward of the newBid - expectedBlockReward := newBid.GasFee - expectedValidatorReward := new(big.Int).Mul(expectedBlockReward, big.NewInt(int64(b.config.ValidatorCommission))) - expectedValidatorReward.Div(expectedValidatorReward, big.NewInt(10000)) - expectedValidatorReward.Sub(expectedValidatorReward, newBid.BuilderFee) - - if expectedValidatorReward.Cmp(big.NewInt(0)) < 0 { - // damage self profit, ignore - log.Debug("BidSimulator: invalid bid, validator reward is less than 0, ignore", - "builder", newBid.Builder, "bidHash", newBid.Hash().Hex()) + bidRuntime, err := newBidRuntime(newBid, b.config.ValidatorCommission) + if err != nil { + log.Debug("BidSimulator: invalid bid", "err", err, "builder", newBid.Builder, "bidHash", newBid.Hash().Hex()) continue } - bidRuntime := &BidRuntime{ - bid: newBid, - expectedBlockReward: expectedBlockReward, - expectedValidatorReward: expectedValidatorReward, - packedBlockReward: big.NewInt(0), - packedValidatorReward: big.NewInt(0), - finished: make(chan struct{}), - } - - simulatingBid := b.GetSimulatingBid(newBid.ParentHash) - // simulatingBid is nil means there is no bid in simulation - if simulatingBid == nil { - // bestBid is nil means bid is the first bid - bestBid := b.GetBestBid(newBid.ParentHash) - if bestBid == nil { + // simulatingBid will be nil if there is no bid in simulation, compare with the bestBid instead + if simulatingBid := b.GetSimulatingBid(newBid.ParentHash); simulatingBid != nil { + // simulatingBid always better than bestBid, so only compare with simulatingBid if a simulatingBid exists + if bidRuntime.isExpectedBetterThan(simulatingBid) { commit(commitInterruptBetterBid, bidRuntime) - continue } - - // if bestBid is not nil, check if newBid is better than bestBid - if bidRuntime.expectedBlockReward.Cmp(bestBid.expectedBlockReward) >= 0 && - bidRuntime.expectedValidatorReward.Cmp(bestBid.expectedValidatorReward) >= 0 { - // if both reward are better than last simulating newBid, commit for simulation + } else { + // bestBid is nil means the bid is the first bid, otherwise the bid should compare with the bestBid + if bestBid := b.GetBestBid(newBid.ParentHash); bestBid == nil || + bidRuntime.isExpectedBetterThan(bestBid) { commit(commitInterruptBetterBid, bidRuntime) - continue } - - log.Debug("BidSimulator: lower reward, ignore", - "builder", bidRuntime.bid.Builder, "bidHash", newBid.Hash().Hex()) - continue } - // simulatingBid must be better than bestBid, if newBid is better than simulatingBid, commit for simulation - if bidRuntime.expectedBlockReward.Cmp(simulatingBid.expectedBlockReward) >= 0 && - bidRuntime.expectedValidatorReward.Cmp(simulatingBid.expectedValidatorReward) >= 0 { - // if both reward are better than last simulating newBid, commit for simulation - commit(commitInterruptBetterBid, bidRuntime) - continue - } - - log.Debug("BidSimulator: lower reward, ignore", "builder", newBid.Builder, "bidHash", newBid.Hash().Hex()) case <-b.exitCh: return } @@ -718,11 +684,41 @@ type BidRuntime struct { duration time.Duration } +func newBidRuntime(newBid *types.Bid, validatorCommission uint64) (*BidRuntime, error) { + + // check the block reward and validator reward of the newBid + expectedBlockReward := newBid.GasFee + expectedValidatorReward := new(big.Int).Mul(expectedBlockReward, big.NewInt(int64(validatorCommission))) + expectedValidatorReward.Div(expectedValidatorReward, big.NewInt(10000)) + expectedValidatorReward.Sub(expectedValidatorReward, newBid.BuilderFee) + + if expectedValidatorReward.Cmp(big.NewInt(0)) < 0 { + // damage self profit, ignore + return nil, errors.New("validator reward is less than 0") + } + + bidRuntime := &BidRuntime{ + bid: newBid, + expectedBlockReward: expectedBlockReward, + expectedValidatorReward: expectedValidatorReward, + packedBlockReward: big.NewInt(0), + packedValidatorReward: big.NewInt(0), + finished: make(chan struct{}), + } + + return bidRuntime, nil +} + func (r *BidRuntime) validReward() bool { return r.packedBlockReward.Cmp(r.expectedBlockReward) >= 0 && r.packedValidatorReward.Cmp(r.expectedValidatorReward) >= 0 } +func (r *BidRuntime) isExpectedBetterThan(other *BidRuntime) bool { + return r.expectedBlockReward.Cmp(other.expectedBlockReward) >= 0 && + r.expectedValidatorReward.Cmp(other.expectedValidatorReward) >= 0 +} + // packReward calculates packedBlockReward and packedValidatorReward func (r *BidRuntime) packReward(validatorCommission uint64) { r.packedBlockReward = r.env.state.GetBalance(consensus.SystemAddress).ToBig() From 3123321dc4aa0c006c33707f384b463fe14c36db Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 14:52:28 +0800 Subject: [PATCH 03/12] add: reply if the bid is accepted or not for sendBid --- miner/bid_simulator.go | 46 ++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 01a7be6599..2693698359 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -68,6 +68,12 @@ type simBidReq struct { interruptCh chan int32 } +// newBidPackage is the warp of a new bid and a feedback channel +type newBidPackage struct { + bid *types.Bid + feedback chan error +} + // bidSimulator is in charge of receiving bid from builders, reporting issue to builders. // And take care of bid simulation, rewards computing, best bid maintaining. type bidSimulator struct { @@ -95,7 +101,7 @@ type bidSimulator struct { // channels simBidCh chan *simBidReq - newBidCh chan *types.Bid + newBidCh chan newBidPackage pendingMu sync.RWMutex pending map[uint64]map[common.Address]map[common.Hash]struct{} // blockNumber -> builder -> bidHash -> struct{} @@ -128,7 +134,7 @@ func newBidSimulator( chainHeadCh: make(chan core.ChainHeadEvent, chainHeadChanSize), builders: make(map[common.Address]*builderclient.Client), simBidCh: make(chan *simBidReq), - newBidCh: make(chan *types.Bid, 100), + newBidCh: make(chan newBidPackage, 100), pending: make(map[uint64]map[common.Address]map[common.Hash]struct{}), bestBid: make(map[common.Hash]*BidRuntime), simulatingBid: make(map[common.Hash]*BidRuntime), @@ -327,6 +333,10 @@ func (b *bidSimulator) newBidLoop() { } } + genReplyReason := func(betterBid *BidRuntime) error { + return fmt.Errorf("bid discarded, current bestBid is [blockReward: %s, validatorReward: %s]", betterBid.expectedBlockReward, betterBid.expectedValidatorReward) + } + for { select { case newBid := <-b.newBidCh: @@ -334,26 +344,34 @@ func (b *bidSimulator) newBidLoop() { continue } - bidRuntime, err := newBidRuntime(newBid, b.config.ValidatorCommission) + bidRuntime, err := newBidRuntime(newBid.bid, b.config.ValidatorCommission) if err != nil { - log.Debug("BidSimulator: invalid bid", "err", err, "builder", newBid.Builder, "bidHash", newBid.Hash().Hex()) continue } + var replyErr error // simulatingBid will be nil if there is no bid in simulation, compare with the bestBid instead - if simulatingBid := b.GetSimulatingBid(newBid.ParentHash); simulatingBid != nil { + if simulatingBid := b.GetSimulatingBid(newBid.bid.ParentHash); simulatingBid != nil { // simulatingBid always better than bestBid, so only compare with simulatingBid if a simulatingBid exists if bidRuntime.isExpectedBetterThan(simulatingBid) { commit(commitInterruptBetterBid, bidRuntime) + } else { + replyErr = genReplyReason(simulatingBid) } } else { // bestBid is nil means the bid is the first bid, otherwise the bid should compare with the bestBid - if bestBid := b.GetBestBid(newBid.ParentHash); bestBid == nil || + if bestBid := b.GetBestBid(newBid.bid.ParentHash); bestBid == nil || bidRuntime.isExpectedBetterThan(bestBid) { commit(commitInterruptBetterBid, bidRuntime) + } else { + replyErr = genReplyReason(bestBid) } } + if newBid.feedback != nil { + newBid.feedback <- replyErr + } + case <-b.exitCh: return } @@ -408,10 +426,14 @@ func (b *bidSimulator) clearLoop() { func (b *bidSimulator) sendBid(_ context.Context, bid *types.Bid) error { timer := time.NewTimer(1 * time.Second) defer timer.Stop() + + replyCh := make(chan error) + b.newBidCh <- newBidPackage{bid: bid, feedback: replyCh} + b.AddPending(bid.BlockNumber, bid.Builder, bid.Hash()) + select { - case b.newBidCh <- bid: - b.AddPending(bid.BlockNumber, bid.Builder, bid.Hash()) - return nil + case reply := <-replyCh: + return reply case <-timer.C: return types.ErrMevBusy } @@ -508,7 +530,7 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { } select { - case b.newBidCh <- bidRuntime.bid: + case b.newBidCh <- newBidPackage{bid: bidRuntime.bid}: log.Debug("BidSimulator: recommit", "builder", bidRuntime.bid.Builder, "bidHash", bidRuntime.bid.Hash().Hex()) default: } @@ -644,7 +666,7 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { } select { - case b.newBidCh <- bestBid.bid: + case b.newBidCh <- newBidPackage{bid: bestBid.bid}: log.Debug("BidSimulator: recommit last bid", "builder", bidRuntime.bid.Builder, "bidHash", bidRuntime.bid.Hash().Hex()) default: } @@ -694,6 +716,8 @@ func newBidRuntime(newBid *types.Bid, validatorCommission uint64) (*BidRuntime, if expectedValidatorReward.Cmp(big.NewInt(0)) < 0 { // damage self profit, ignore + log.Debug("BidSimulator: invalid bid, validator reward is less than 0, ignore", + "builder", newBid.Builder, "bidHash", newBid.Hash().Hex()) return nil, errors.New("validator reward is less than 0") } From d9f5cc8703b8cfb41cf4488e843de6bfeee47e0d Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 15:08:56 +0800 Subject: [PATCH 04/12] add: builder block detail logs --- miner/bid_simulator.go | 39 +++++++++++++++++++++++++++++++++++++-- miner/worker.go | 8 +++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 2693698359..43599bd94d 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -7,6 +7,7 @@ import ( "math/big" "net" "net/http" + "strconv" "sync" "sync/atomic" "time" @@ -370,6 +371,16 @@ func (b *bidSimulator) newBidLoop() { if newBid.feedback != nil { newBid.feedback <- replyErr + + log.Info("[BID ARRIVED]", + "block", newBid.bid.BlockNumber, + "builder", newBid.bid.Builder, + "accepted", replyErr == nil, + "blockReward", weiToEtherStringF6(bidRuntime.expectedBlockReward), + "validatorReward", weiToEtherStringF6(bidRuntime.expectedValidatorReward), + "tx", len(newBid.bid.Txs), + "hash", newBid.bid.Hash().TerminalString(), + ) } case <-b.exitCh: @@ -479,6 +490,8 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { } var ( + startTS = time.Now() + blockNumber = bidRuntime.bid.BlockNumber parentHash = bidRuntime.bid.ParentHash builder = bidRuntime.bid.Builder @@ -535,7 +548,7 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { default: } } - }(time.Now()) + }(startTS) // prepareWork will configure header with a suitable time according to consensus // prepareWork will start trie prefetching @@ -646,13 +659,30 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { } bestBid := b.GetBestBid(parentHash) - if bestBid == nil { + log.Info("[BID RESULT]", "win", "true[first]", "builder", bidRuntime.bid.Builder, "hash", bidRuntime.bid.Hash().TerminalString()) b.SetBestBid(bidRuntime.bid.ParentHash, bidRuntime) success = true return } + if bidRuntime.bid.Hash() != bestBid.bid.Hash() { + log.Info("[BID RESULT]", + "win", bidRuntime.packedBlockReward.Cmp(bestBid.packedBlockReward) >= 0, + + "bidHash", bidRuntime.bid.Hash().TerminalString(), + "bestHash", bestBid.bid.Hash().TerminalString(), + + "bidGasFee", weiToEtherStringF6(bidRuntime.packedBlockReward), + "bestGasFee", weiToEtherStringF6(bestBid.packedBlockReward), + + "bidBlockTx", bidRuntime.env.tcount, + "bestBlockTx", bestBid.env.tcount, + + "simElapsed", time.Since(startTS), + ) + } + // this is the simplest strategy: best for all the delegators. if bidRuntime.packedBlockReward.Cmp(bestBid.packedBlockReward) >= 0 { b.SetBestBid(bidRuntime.bid.ParentHash, bidRuntime) @@ -798,3 +828,8 @@ func (r *BidRuntime) commitTransaction(chain *core.BlockChain, chainConfig *para return nil } + +func weiToEtherStringF6(wei *big.Int) string { + f, _ := new(big.Float).Quo(new(big.Float).SetInt(wei), big.NewFloat(params.Ether)).Float64() + return strconv.FormatFloat(f, 'f', 6, 64) +} diff --git a/miner/worker.go b/miner/worker.go index 424a449355..1dc05554f8 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1371,7 +1371,13 @@ LOOP: bestWork = bestBid.env from = bestBid.bid.Builder - log.Debug("BidSimulator: bid win", "block", bestWork.header.Number.Uint64(), "bid", bestBid.bid.Hash()) + log.Info("[BUILDER BLOCK]", + "block", bestWork.header.Number.Uint64(), + "builder", from, + "blockReward", weiToEtherStringF6(bestBid.packedBlockReward), + "validatorReward", weiToEtherStringF6(bestBid.packedValidatorReward), + "bid", bestBid.bid.Hash().TerminalString(), + ) } } } From 082eca725b59627e3beb5de3252ba7bec93a549d Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 15:16:01 +0800 Subject: [PATCH 05/12] clean: code tidy for lint --- miner/bid_simulator.go | 1 - 1 file changed, 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 43599bd94d..629d9d0f0b 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -737,7 +737,6 @@ type BidRuntime struct { } func newBidRuntime(newBid *types.Bid, validatorCommission uint64) (*BidRuntime, error) { - // check the block reward and validator reward of the newBid expectedBlockReward := newBid.GasFee expectedValidatorReward := new(big.Int).Mul(expectedBlockReward, big.NewInt(int64(validatorCommission))) From 6b4e2b2459ab71445202a2694f176ed8de2f0d7f Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 15:31:53 +0800 Subject: [PATCH 06/12] fix: add error reply if the bid is discarded due to invalid reward --- miner/bid_simulator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 629d9d0f0b..92a0cc60e6 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -347,6 +347,9 @@ func (b *bidSimulator) newBidLoop() { bidRuntime, err := newBidRuntime(newBid.bid, b.config.ValidatorCommission) if err != nil { + if newBid.feedback != nil { + newBid.feedback <- err + } continue } @@ -747,7 +750,7 @@ func newBidRuntime(newBid *types.Bid, validatorCommission uint64) (*BidRuntime, // damage self profit, ignore log.Debug("BidSimulator: invalid bid, validator reward is less than 0, ignore", "builder", newBid.Builder, "bidHash", newBid.Hash().Hex()) - return nil, errors.New("validator reward is less than 0") + return nil, fmt.Errorf("validator reward is less than 0, value: %s, commissionConfig: %d", expectedValidatorReward, validatorCommission) } bidRuntime := &BidRuntime{ From 3a07ca187e26113e65b19e6a71c0eb5a7f8c8fc0 Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 15:48:50 +0800 Subject: [PATCH 07/12] fix: avoid channel block by using 2 select{} --- miner/bid_simulator.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 92a0cc60e6..7d2ef462eb 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -442,8 +442,13 @@ func (b *bidSimulator) sendBid(_ context.Context, bid *types.Bid) error { defer timer.Stop() replyCh := make(chan error) - b.newBidCh <- newBidPackage{bid: bid, feedback: replyCh} - b.AddPending(bid.BlockNumber, bid.Builder, bid.Hash()) + + select { + case b.newBidCh <- newBidPackage{bid: bid, feedback: replyCh}: + b.AddPending(bid.BlockNumber, bid.Builder, bid.Hash()) + case <-timer.C: + return types.ErrMevBusy + } select { case reply := <-replyCh: From 507d7451a5399c5df24a3f58d4633be06d22ec48 Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Tue, 25 Jun 2024 15:57:36 +0800 Subject: [PATCH 08/12] metrics: add simulation counter --- miner/bid_simulator.go | 1 + 1 file changed, 1 insertion(+) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 7d2ef462eb..2409bfc31a 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -544,6 +544,7 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { if success { bidRuntime.duration = time.Since(simStart) bidSimTimer.UpdateSince(simStart) + metrics.GetOrRegisterCounter(fmt.Sprintf("bid/sim/count/%d", bidRuntime.bid.BlockNumber), nil).Inc(1) // only recommit self bid when newBidCh is empty if len(b.newBidCh) > 0 { From 834336ec6baffec3859bf7f640fbb9c889114b43 Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Wed, 26 Jun 2024 20:19:10 +0800 Subject: [PATCH 09/12] fix: to ensure replyCh won't be blocked --- miner/bid_simulator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 2409bfc31a..7066299166 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -441,7 +441,7 @@ func (b *bidSimulator) sendBid(_ context.Context, bid *types.Bid) error { timer := time.NewTimer(1 * time.Second) defer timer.Stop() - replyCh := make(chan error) + replyCh := make(chan error, 1) select { case b.newBidCh <- newBidPackage{bid: bid, feedback: replyCh}: From 4619de45f1db5d993afd0b8bef338e58d8ae0863 Mon Sep 17 00:00:00 2001 From: Jolly Zhao Date: Wed, 26 Jun 2024 21:56:49 +0800 Subject: [PATCH 10/12] fix: change name of `genReplyReason` --- miner/bid_simulator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 7066299166..778c9ab719 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -334,8 +334,8 @@ func (b *bidSimulator) newBidLoop() { } } - genReplyReason := func(betterBid *BidRuntime) error { - return fmt.Errorf("bid discarded, current bestBid is [blockReward: %s, validatorReward: %s]", betterBid.expectedBlockReward, betterBid.expectedValidatorReward) + genDiscardedReply := func(betterBid *BidRuntime) error { + return fmt.Errorf("bid is discarded, current bestBid is [blockReward: %s, validatorReward: %s]", betterBid.expectedBlockReward, betterBid.expectedValidatorReward) } for { @@ -360,7 +360,7 @@ func (b *bidSimulator) newBidLoop() { if bidRuntime.isExpectedBetterThan(simulatingBid) { commit(commitInterruptBetterBid, bidRuntime) } else { - replyErr = genReplyReason(simulatingBid) + replyErr = genDiscardedReply(simulatingBid) } } else { // bestBid is nil means the bid is the first bid, otherwise the bid should compare with the bestBid @@ -368,7 +368,7 @@ func (b *bidSimulator) newBidLoop() { bidRuntime.isExpectedBetterThan(bestBid) { commit(commitInterruptBetterBid, bidRuntime) } else { - replyErr = genReplyReason(bestBid) + replyErr = genDiscardedReply(bestBid) } } From 337d6f78210dfc6cac7a804d5f75e997f6cb7b21 Mon Sep 17 00:00:00 2001 From: irrun Date: Wed, 10 Jul 2024 15:38:55 +0800 Subject: [PATCH 11/12] chore: lower report issue log level --- miner/bid_simulator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 778c9ab719..56c77f9208 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -725,7 +725,7 @@ func (b *bidSimulator) reportIssue(bidRuntime *BidRuntime, err error) { }) if err != nil { - log.Error("BidSimulator: failed to report issue", "builder", bidRuntime.bid.Builder, "err", err) + log.Warn("BidSimulator: failed to report issue", "builder", bidRuntime.bid.Builder, "err", err) } } } From bf4c999789283fbba548b31e57e9653d18f95b13 Mon Sep 17 00:00:00 2001 From: irrun Date: Thu, 11 Jul 2024 11:08:14 +0800 Subject: [PATCH 12/12] chore: remove metric --- miner/bid_simulator.go | 1 - 1 file changed, 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index 56c77f9208..0dca51d20e 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -544,7 +544,6 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) { if success { bidRuntime.duration = time.Since(simStart) bidSimTimer.UpdateSince(simStart) - metrics.GetOrRegisterCounter(fmt.Sprintf("bid/sim/count/%d", bidRuntime.bid.BlockNumber), nil).Inc(1) // only recommit self bid when newBidCh is empty if len(b.newBidCh) > 0 {