Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance bid comparison and reply bidding results && detail logs #2538

Merged
merged 14 commits into from
Jul 11, 2024

Conversation

Jolly23
Copy link
Contributor

@Jolly23 Jolly23 commented Jun 25, 2024

Description

  • mev_sendBid replies current bestBid reward if it's discard due to low reward (but it still cost 1 submit chance for builder).
  • The thread safe transaction set is no need for GreedyMergeTx. The change will lift extensive locking mechanisms.
    Add builder bid arriving and comparing log into standard log output.
  • Simplified bidRuntime comparison by moving comparing function into bidRuntime.
  • add bid arrive/comparsion detail logs, helps validator records the builder bid operation, to better understand and get involve the BPS mechanisms.

miner/bid_simulator.go Outdated Show resolved Hide resolved
irrun
irrun previously approved these changes Jun 25, 2024
@irrun
Copy link
Contributor

irrun commented Jun 25, 2024

could you please help to add a metric on bid_simulator Line547
metrics.GetOrRegisterCounter(fmt.Sprintf("bid/sim/count/%d", bidRuntime.bid.BlockNumber), nil).Inc(1)

irrun
irrun previously approved these changes Jun 25, 2024
Copy link
Collaborator

@unclezoro unclezoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, We will have hot fix release soon, as this PR is not a must to have feature, so we will hold this PR after the hot fix. It may take 2 weeks.

"validatorReward", weiToEtherStringF6(bidRuntime.expectedValidatorReward),
"tx", len(newBid.bid.Txs),
"hash", newBid.bid.Hash().TerminalString(),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is suggested to send a nil error back to newBid.feedback if no error happen, so that sendBid can return ASAP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if no error happen, it's nil.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check this note?

@@ -633,7 +643,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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the motivation to change the hash set type?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for no concurrent operation on bidTxsSet

irrun
irrun previously approved these changes Jul 10, 2024
@irrun irrun changed the title enhance bid comparison and reply if it's discarded && details bid logs feat: enhance bid comparison and reply if it's discarded && details bid logs Jul 10, 2024
@irrun irrun changed the title feat: enhance bid comparison and reply if it's discarded && details bid logs feat: enhance bid comparison and reply bidding results && detail logs Jul 10, 2024
miner/bid_simulator.go Outdated Show resolved Hide resolved
@irrun irrun requested a review from unclezoro July 11, 2024 03:19
@irrun irrun removed the request for review from unclezoro July 11, 2024 03:27
@irrun irrun merged commit a04e287 into bnb-chain:develop Jul 11, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants