Skip to content

Commit f0c7795

Browse files
authored
Merge pull request #2527 from bnb-chain/develop
Draft release v1.4.10
2 parents 4566ac7 + 1548452 commit f0c7795

25 files changed

+331
-43
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
# Changelog
2+
## v1.4.10
3+
### FEATURE
4+
NA
5+
6+
### IMPROVEMENT
7+
* [\#2512](https://github.com/bnb-chain/bsc/pull/2512) feat: add mev helper params and func
8+
* [\#2508](https://github.com/bnb-chain/bsc/pull/2508) perf: speedup pbss trienode read
9+
* [\#2509](https://github.com/bnb-chain/bsc/pull/2509) perf: optimize chain commit performance for multi-database
10+
* [\#2451](https://github.com/bnb-chain/bsc/pull/2451) core/forkchoice: improve stability when inturn block not generate
11+
12+
### BUGFIX
13+
* [\#2518](https://github.com/bnb-chain/bsc/pull/2518) fix: remove zero gasprice check for BSC
14+
* [\#2519](https://github.com/bnb-chain/bsc/pull/2519) UT: random failure of TestSnapSyncWithBlobs
15+
* [\#2515](https://github.com/bnb-chain/bsc/pull/2515) fix getBlobSidecars by ethclient
16+
* [\#2525](https://github.com/bnb-chain/bsc/pull/2525) fix: ensure empty withdrawals after cancun before broadcast
17+
218
## v1.4.9
319
### FEATURE
420
* [\#2463](https://github.com/bnb-chain/bsc/pull/2463) utils: add check_blobtx.js

core/blockchain.go

+35-17
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ type BlockChain struct {
301301
diffLayerFreezerBlockLimit uint64
302302

303303
wg sync.WaitGroup
304+
dbWg sync.WaitGroup
304305
quit chan struct{} // shutdown signal, closed in Stop.
305306
stopping atomic.Bool // false if chain is running, true when stopped
306307
procInterrupt atomic.Bool // interrupt signaler for block processing
@@ -669,7 +670,7 @@ func (bc *BlockChain) cacheBlock(hash common.Hash, block *types.Block) {
669670
// into node seamlessly.
670671
func (bc *BlockChain) empty() bool {
671672
genesis := bc.genesisBlock.Hash()
672-
for _, hash := range []common.Hash{rawdb.ReadHeadBlockHash(bc.db.BlockStore()), rawdb.ReadHeadHeaderHash(bc.db.BlockStore()), rawdb.ReadHeadFastBlockHash(bc.db)} {
673+
for _, hash := range []common.Hash{rawdb.ReadHeadBlockHash(bc.db.BlockStore()), rawdb.ReadHeadHeaderHash(bc.db.BlockStore()), rawdb.ReadHeadFastBlockHash(bc.db.BlockStore())} {
673674
if hash != genesis {
674675
return false
675676
}
@@ -738,7 +739,7 @@ func (bc *BlockChain) loadLastState() error {
738739
bc.currentSnapBlock.Store(headBlock.Header())
739740
headFastBlockGauge.Update(int64(headBlock.NumberU64()))
740741

741-
if head := rawdb.ReadHeadFastBlockHash(bc.db); head != (common.Hash{}) {
742+
if head := rawdb.ReadHeadFastBlockHash(bc.db.BlockStore()); head != (common.Hash{}) {
742743
if block := bc.GetBlockByHash(head); block != nil {
743744
bc.currentSnapBlock.Store(block.Header())
744745
headFastBlockGauge.Update(int64(block.NumberU64()))
@@ -1137,7 +1138,7 @@ func (bc *BlockChain) setHeadBeyondRoot(head uint64, time uint64, root common.Ha
11371138
// If SetHead was only called as a chain reparation method, try to skip
11381139
// touching the header chain altogether, unless the freezer is broken
11391140
if repair {
1140-
if target, force := updateFn(bc.db, bc.CurrentBlock()); force {
1141+
if target, force := updateFn(bc.db.BlockStore(), bc.CurrentBlock()); force {
11411142
bc.hc.SetHead(target.Number.Uint64(), updateFn, delFn)
11421143
}
11431144
} else {
@@ -1298,19 +1299,33 @@ func (bc *BlockChain) ExportN(w io.Writer, first uint64, last uint64) error {
12981299
//
12991300
// Note, this function assumes that the `mu` mutex is held!
13001301
func (bc *BlockChain) writeHeadBlock(block *types.Block) {
1301-
// Add the block to the canonical chain number scheme and mark as the head
1302-
rawdb.WriteCanonicalHash(bc.db.BlockStore(), block.Hash(), block.NumberU64())
1303-
rawdb.WriteHeadHeaderHash(bc.db.BlockStore(), block.Hash())
1304-
rawdb.WriteHeadBlockHash(bc.db.BlockStore(), block.Hash())
1302+
bc.dbWg.Add(2)
1303+
defer bc.dbWg.Wait()
1304+
go func() {
1305+
defer bc.dbWg.Done()
1306+
// Add the block to the canonical chain number scheme and mark as the head
1307+
blockBatch := bc.db.BlockStore().NewBatch()
1308+
rawdb.WriteCanonicalHash(blockBatch, block.Hash(), block.NumberU64())
1309+
rawdb.WriteHeadHeaderHash(blockBatch, block.Hash())
1310+
rawdb.WriteHeadBlockHash(blockBatch, block.Hash())
1311+
rawdb.WriteHeadFastBlockHash(blockBatch, block.Hash())
1312+
// Flush the whole batch into the disk, exit the node if failed
1313+
if err := blockBatch.Write(); err != nil {
1314+
log.Crit("Failed to update chain indexes and markers in block db", "err", err)
1315+
}
1316+
}()
1317+
go func() {
1318+
defer bc.dbWg.Done()
13051319

1306-
batch := bc.db.NewBatch()
1307-
rawdb.WriteHeadFastBlockHash(batch, block.Hash())
1308-
rawdb.WriteTxLookupEntriesByBlock(batch, block)
1320+
batch := bc.db.NewBatch()
1321+
rawdb.WriteTxLookupEntriesByBlock(batch, block)
1322+
1323+
// Flush the whole batch into the disk, exit the node if failed
1324+
if err := batch.Write(); err != nil {
1325+
log.Crit("Failed to update chain indexes in chain db", "err", err)
1326+
}
1327+
}()
13091328

1310-
// Flush the whole batch into the disk, exit the node if failed
1311-
if err := batch.Write(); err != nil {
1312-
log.Crit("Failed to update chain indexes and markers", "err", err)
1313-
}
13141329
// Update all in-memory chain markers in the last step
13151330
bc.hc.SetCurrentHeader(block.Header())
13161331

@@ -1531,7 +1546,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
15311546
} else if !reorg {
15321547
return false
15331548
}
1534-
rawdb.WriteHeadFastBlockHash(bc.db, head.Hash())
1549+
rawdb.WriteHeadFastBlockHash(bc.db.BlockStore(), head.Hash())
15351550
bc.currentSnapBlock.Store(head.Header())
15361551
headFastBlockGauge.Update(int64(head.NumberU64()))
15371552
return true
@@ -1774,7 +1789,6 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
17741789
wg := sync.WaitGroup{}
17751790
wg.Add(1)
17761791
go func() {
1777-
rawdb.WritePreimages(bc.db, state.Preimages())
17781792
blockBatch := bc.db.BlockStore().NewBatch()
17791793
rawdb.WriteTd(blockBatch, block.Hash(), block.NumberU64(), externTd)
17801794
rawdb.WriteBlock(blockBatch, block)
@@ -1783,7 +1797,11 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
17831797
if bc.chainConfig.IsCancun(block.Number(), block.Time()) {
17841798
rawdb.WriteBlobSidecars(blockBatch, block.Hash(), block.NumberU64(), block.Sidecars())
17851799
}
1786-
rawdb.WritePreimages(blockBatch, state.Preimages())
1800+
if bc.db.StateStore() != nil {
1801+
rawdb.WritePreimages(bc.db.StateStore(), state.Preimages())
1802+
} else {
1803+
rawdb.WritePreimages(blockBatch, state.Preimages())
1804+
}
17871805
if err := blockBatch.Write(); err != nil {
17881806
log.Crit("Failed to write block into disk", "err", err)
17891807
}

core/forkchoice.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ func (f *ForkChoice) ReorgNeeded(current *types.Header, extern *types.Header) (b
114114
if f.preserve != nil {
115115
currentPreserve, externPreserve = f.preserve(current), f.preserve(extern)
116116
}
117-
reorg = !currentPreserve && (externPreserve || f.rand.Float64() < 0.5)
117+
reorg = !currentPreserve && (externPreserve ||
118+
extern.Time < current.Time ||
119+
extern.Time == current.Time && f.rand.Float64() < 0.5)
118120
}
119121
return reorg, nil
120122
}

core/genesis.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ func (g *Genesis) Commit(db ethdb.Database, triedb *triedb.Database) (*types.Blo
498498
rawdb.WriteReceipts(db.BlockStore(), block.Hash(), block.NumberU64(), nil)
499499
rawdb.WriteCanonicalHash(db.BlockStore(), block.Hash(), block.NumberU64())
500500
rawdb.WriteHeadBlockHash(db.BlockStore(), block.Hash())
501-
rawdb.WriteHeadFastBlockHash(db, block.Hash())
501+
rawdb.WriteHeadFastBlockHash(db.BlockStore(), block.Hash())
502502
rawdb.WriteHeadHeaderHash(db.BlockStore(), block.Hash())
503503
rawdb.WriteChainConfig(db, block.Hash(), config)
504504
return block, nil

core/headerchain.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ func (hc *HeaderChain) setHead(headBlock uint64, headTime uint64, updateFn Updat
668668
// first then remove the relative data from the database.
669669
//
670670
// Update head first(head fast block, head full block) before deleting the data.
671-
markerBatch := hc.chainDb.NewBatch()
671+
markerBatch := hc.chainDb.BlockStore().NewBatch()
672672
if updateFn != nil {
673673
newHead, force := updateFn(markerBatch, parent)
674674
if force && ((headTime > 0 && newHead.Time < headTime) || (headTime == 0 && newHead.Number.Uint64() < headBlock)) {
@@ -677,7 +677,7 @@ func (hc *HeaderChain) setHead(headBlock uint64, headTime uint64, updateFn Updat
677677
}
678678
}
679679
// Update head header then.
680-
rawdb.WriteHeadHeaderHash(hc.chainDb.BlockStore(), parentHash)
680+
rawdb.WriteHeadHeaderHash(markerBatch, parentHash)
681681
if err := markerBatch.Write(); err != nil {
682682
log.Crit("Failed to update chain markers", "error", err)
683683
}

core/rawdb/chain_iterator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func InitDatabaseFromFreezer(db ethdb.Database) {
8181
batch.Reset()
8282

8383
WriteHeadHeaderHash(db.BlockStore(), hash)
84-
WriteHeadFastBlockHash(db, hash)
84+
WriteHeadFastBlockHash(db.BlockStore(), hash)
8585
log.Info("Initialized database from freezer", "blocks", frozen, "elapsed", common.PrettyDuration(time.Since(start)))
8686
}
8787

core/rawdb/database.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ func DataTypeByKey(key []byte) DataType {
873873
return StateDataType
874874
}
875875
}
876-
for _, meta := range [][]byte{headHeaderKey, headFinalizedBlockKey} {
876+
for _, meta := range [][]byte{headHeaderKey, headFinalizedBlockKey, headBlockKey, headFastBlockKey} {
877877
if bytes.Equal(key, meta) {
878878
return BlockDataType
879879
}
@@ -1088,7 +1088,7 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error {
10881088
hashNumPairings.Add(size)
10891089
default:
10901090
var accounted bool
1091-
for _, meta := range [][]byte{headHeaderKey, headFinalizedBlockKey} {
1091+
for _, meta := range [][]byte{headHeaderKey, headFinalizedBlockKey, headBlockKey, headFastBlockKey} {
10921092
if bytes.Equal(key, meta) {
10931093
metadata.Add(size)
10941094
accounted = true
@@ -1282,7 +1282,7 @@ func ReadChainMetadataFromMultiDatabase(db ethdb.Database) [][]string {
12821282
data := [][]string{
12831283
{"databaseVersion", pp(ReadDatabaseVersion(db))},
12841284
{"headBlockHash", fmt.Sprintf("%v", ReadHeadBlockHash(db.BlockStore()))},
1285-
{"headFastBlockHash", fmt.Sprintf("%v", ReadHeadFastBlockHash(db))},
1285+
{"headFastBlockHash", fmt.Sprintf("%v", ReadHeadFastBlockHash(db.BlockStore()))},
12861286
{"headHeaderHash", fmt.Sprintf("%v", ReadHeadHeaderHash(db.BlockStore()))},
12871287
{"lastPivotNumber", pp(ReadLastPivotNumber(db))},
12881288
{"len(snapshotSyncStatus)", fmt.Sprintf("%d bytes", len(ReadSnapshotSyncStatus(db)))},

core/types/bid.go

+2
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,7 @@ type MevParams struct {
193193
ValidatorCommission uint64 // 100 means 1%
194194
BidSimulationLeftOver time.Duration
195195
GasCeil uint64
196+
GasPrice *big.Int // Minimum avg gas price for bid block
196197
BuilderFeeCeil *big.Int
198+
Version string
197199
}

eth/api_backend.go

+4
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ func (b *EthAPIBackend) RemoveBuilder(builder common.Address) error {
484484
return b.Miner().RemoveBuilder(builder)
485485
}
486486

487+
func (b *EthAPIBackend) HasBuilder(builder common.Address) bool {
488+
return b.Miner().HasBuilder(builder)
489+
}
490+
487491
func (b *EthAPIBackend) SendBid(ctx context.Context, bid *types.BidArgs) (common.Hash, error) {
488492
return b.Miner().SendBid(ctx, bid)
489493
}

eth/backend.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,18 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
161161
// Optimize memory distribution by reallocating surplus allowance from the
162162
// dirty cache to the clean cache.
163163
if config.StateScheme == rawdb.PathScheme && config.TrieDirtyCache > pathdb.MaxDirtyBufferSize/1024/1024 {
164-
log.Info("Capped dirty cache size", "provided", common.StorageSize(config.TrieDirtyCache)*1024*1024, "adjusted", common.StorageSize(pathdb.MaxDirtyBufferSize))
165-
log.Info("Clean cache size", "provided", common.StorageSize(config.TrieCleanCache)*1024*1024)
164+
log.Info("Capped dirty cache size", "provided", common.StorageSize(config.TrieDirtyCache)*1024*1024,
165+
"adjusted", common.StorageSize(pathdb.MaxDirtyBufferSize))
166+
log.Info("Clean cache size", "provided", common.StorageSize(config.TrieCleanCache)*1024*1024,
167+
"adjusted", common.StorageSize(config.TrieCleanCache+config.TrieDirtyCache-pathdb.MaxDirtyBufferSize/1024/1024)*1024*1024)
168+
config.TrieCleanCache += config.TrieDirtyCache - pathdb.MaxDirtyBufferSize/1024/1024
166169
config.TrieDirtyCache = pathdb.MaxDirtyBufferSize / 1024 / 1024
167170
}
168-
log.Info("Allocated trie memory caches", "clean", common.StorageSize(config.TrieCleanCache)*1024*1024, "dirty", common.StorageSize(config.TrieDirtyCache)*1024*1024)
169-
171+
log.Info("Allocated memory caches",
172+
"state_scheme", config.StateScheme,
173+
"trie_clean_cache", common.StorageSize(config.TrieCleanCache)*1024*1024,
174+
"trie_dirty_cache", common.StorageSize(config.TrieDirtyCache)*1024*1024,
175+
"snapshot_cache", common.StorageSize(config.SnapshotCache)*1024*1024)
170176
// Try to recover offline state pruning only in hash-based.
171177
if config.StateScheme == rawdb.HashScheme {
172178
if err := pruner.RecoverPruning(stack.ResolvePath(""), chainDb, config.TriesInMemory); err != nil {

eth/fetcher/block_fetcher.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,6 @@ func (f *BlockFetcher) loop() {
731731
matched = true
732732
if f.getBlock(hash) == nil {
733733
block := types.NewBlockWithHeader(announce.header).WithBody(task.transactions[i], task.uncles[i])
734-
if block.Header().EmptyWithdrawalsHash() {
735-
block = block.WithWithdrawals(make([]*types.Withdrawal, 0))
736-
}
737734
block = block.WithSidecars(task.sidecars[i])
738735
block.ReceivedAt = task.time
739736
blocks = append(blocks, block)
@@ -919,6 +916,10 @@ func (f *BlockFetcher) importBlocks(op *blockOrHeaderInject) {
919916
return
920917
}
921918

919+
if block.Header().EmptyWithdrawalsHash() {
920+
block = block.WithWithdrawals(make([]*types.Withdrawal, 0))
921+
}
922+
922923
defer func() { f.done <- hash }()
923924
// Quickly validate the header and propagate the block if it passes
924925
switch err := f.verifyHeader(block.Header()); err {

eth/handler_eth_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ func testBroadcastBlock(t *testing.T, peers, bcasts int) {
633633
go source.handler.runEthPeer(sourcePeer, func(peer *eth.Peer) error {
634634
return eth.Handle((*ethHandler)(source.handler), peer)
635635
})
636+
// Wait a bit for the above handlers to start
637+
time.Sleep(100 * time.Millisecond)
638+
636639
if err := sinkPeer.Handshake(1, td, genesis.Hash(), genesis.Hash(), forkid.NewIDWithChain(source.chain), forkid.NewFilter(source.chain), nil); err != nil {
637640
t.Fatalf("failed to run protocol handshake")
638641
}

eth/sync_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ func testChainSyncWithBlobs(t *testing.T, mode downloader.SyncMode, preCancunBlk
151151
go full.handler.runEthPeer(fullPeerEth, func(peer *eth.Peer) error {
152152
return eth.Handle((*ethHandler)(full.handler), peer)
153153
})
154+
// Wait a bit for the above handlers to start
155+
time.Sleep(250 * time.Millisecond)
154156

155157
emptyPipeSnap, fullPipeSnap := p2p.MsgPipe()
156158
defer emptyPipeSnap.Close()

ethclient/ethclient.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (ec *Client) BlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumb
133133
// BlobSidecars return the Sidecars of a given block number or hash.
134134
func (ec *Client) BlobSidecars(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.BlobTxSidecar, error) {
135135
var r []*types.BlobTxSidecar
136-
err := ec.c.CallContext(ctx, &r, "eth_getBlobSidecars", blockNrOrHash.String(), true)
136+
err := ec.c.CallContext(ctx, &r, "eth_getBlobSidecars", blockNrOrHash.String())
137137
if err == nil && r == nil {
138138
return nil, ethereum.NotFound
139139
}
@@ -143,7 +143,7 @@ func (ec *Client) BlobSidecars(ctx context.Context, blockNrOrHash rpc.BlockNumbe
143143
// BlobSidecarByTxHash return a sidecar of a given blob transaction
144144
func (ec *Client) BlobSidecarByTxHash(ctx context.Context, hash common.Hash) (*types.BlobTxSidecar, error) {
145145
var r *types.BlobTxSidecar
146-
err := ec.c.CallContext(ctx, &r, "eth_getBlockSidecarByTxHash", hash, true)
146+
err := ec.c.CallContext(ctx, &r, "eth_getBlobSidecarByTxHash", hash)
147147
if err == nil && r == nil {
148148
return nil, ethereum.NotFound
149149
}
@@ -752,6 +752,13 @@ func (ec *Client) MevRunning(ctx context.Context) (bool, error) {
752752
return result, err
753753
}
754754

755+
// HasBuilder returns whether the builder is registered
756+
func (ec *Client) HasBuilder(ctx context.Context, address common.Address) (bool, error) {
757+
var result bool
758+
err := ec.c.CallContext(ctx, &result, "mev_hasBuilder", address)
759+
return result, err
760+
}
761+
755762
// SendBid sends a bid
756763
func (ec *Client) SendBid(ctx context.Context, args types.BidArgs) (common.Hash, error) {
757764
var hash common.Hash

internal/ethapi/api_mev.go

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ func (m *MevAPI) Params() *types.MevParams {
8787
return m.b.MevParams()
8888
}
8989

90+
func (m *MevAPI) HasBuilder(builder common.Address) bool {
91+
return m.b.HasBuilder(builder)
92+
}
93+
9094
// Running returns true if mev is running
9195
func (m *MevAPI) Running() bool {
9296
return m.b.MevRunning()

internal/ethapi/api_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ func (b testBackend) ServiceFilter(ctx context.Context, session *bloombits.Match
650650
panic("implement me")
651651
}
652652

653-
func (b *testBackend) MevRunning() bool { return false }
653+
func (b *testBackend) MevRunning() bool { return false }
654+
func (b *testBackend) HasBuilder(builder common.Address) bool { return false }
654655
func (b *testBackend) MevParams() *types.MevParams {
655656
return &types.MevParams{}
656657
}

internal/ethapi/backend.go

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ type Backend interface {
115115
AddBuilder(builder common.Address, builderUrl string) error
116116
// RemoveBuilder removes a builder from the bid simulator.
117117
RemoveBuilder(builder common.Address) error
118+
// HasBuilder returns true if the builder is in the builder list.
119+
HasBuilder(builder common.Address) bool
118120
// SendBid receives bid from the builders.
119121
SendBid(ctx context.Context, bid *types.BidArgs) (common.Hash, error)
120122
// BestBidGasFee returns the gas fee of the best bid for the given parent hash.

internal/ethapi/transaction_args.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) erro
204204
// Sanity check the EIP-1559 fee parameters if present.
205205
if args.GasPrice == nil && eip1559ParamsSet {
206206
if args.MaxFeePerGas.ToInt().Sign() == 0 {
207-
return errors.New("maxFeePerGas must be non-zero")
207+
// return errors.New("maxFeePerGas must be non-zero")
208+
log.Warn("EIP-1559 Tx with zero maxFeePerGas") // BSC accepts zero gas price.
208209
}
209210
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
210211
return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
@@ -217,7 +218,8 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) erro
217218
if args.GasPrice != nil && !eip1559ParamsSet {
218219
// Zero gas-price is not allowed after London fork
219220
if args.GasPrice.ToInt().Sign() == 0 && isLondon {
220-
return errors.New("gasPrice must be non-zero after london fork")
221+
// return errors.New("gasPrice must be non-zero after london fork")
222+
log.Warn("non EIP-1559 Tx with zero gasPrice") // BSC accepts zero gas price.
221223
}
222224
return nil // No need to set anything, user already set GasPrice
223225
}

0 commit comments

Comments
 (0)