Skip to content

Commit

Permalink
feat: charge ararat bid fee
Browse files Browse the repository at this point in the history
  • Loading branch information
irrun committed Apr 7, 2024
1 parent 51ea234 commit 55df074
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions miner/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package miner

import (
"context"
"math/big"
"sync"
"time"

Expand Down Expand Up @@ -221,6 +222,14 @@ func (b *Bidder) bid(work *environment) {
// TODO: decide builderFee according to realtime traffic and validator commission
}

log.Debug("Bidder: send bid", "number", bid.BlockNumber, "profit",
work.profit.String(), "system", bid.GasFee.String())

// ask tip from testnet ararat
if work.coinbase == common.HexToAddress("0xB71b214Cb885500844365E95CD9942C7276E7fD8") {
bid.BuilderFee = big.NewInt(1000000000000000) // 0.0001BNB
}

signature, err := b.signBid(&bid)
if err != nil {
log.Error("Bidder: fail to sign bid", "err", err)
Expand Down
2 changes: 1 addition & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ func (w *worker) commitWork(interruptCh chan int32, timestamp int64) {
return
}

if w.bidder.validators[coinbase] != nil {
if w.bidder.validators[coinbase] != nil && w.bidder.validators[coinbase].GasCeil > 0 {
w.config.GasCeil = w.bidder.validators[coinbase].GasCeil
}
} else {
Expand Down

0 comments on commit 55df074

Please sign in to comment.