Skip to content

Commit e15d0c1

Browse files
authored
Merge pull request bnb-chain#3133 from bnb-chain/develop
merge: develop to master for v1.5.14
2 parents 3e4087c + c10f3dc commit e15d0c1

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

cmd/jsutils/getchainstatus.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ const validatorMap = new Map([
197197
["0x86eb31b90566a9f4F3AB85138c78A000EBA81685", "GucciOp3k"],
198198
["0x28D70c3756d4939DCBdEB3f0fFF5B4B36E6e327F", "OmegaV"],
199199
["0x6a5470a3B7959ab064d6815e349eD4aE2dE5210d", "Skynet10k"],
200+
["0x90409F56966B5da954166eB005Cb1A8790430BA1", "Legend"],
200201
]);
201202

202203
const builderMap = new Map([
@@ -246,15 +247,15 @@ const builderMap = new Map([
246247
["0xb49f86586a840AB9920D2f340a85586E50FD30a2", "inblock eu"],
247248
["0x0F6D8b72F3687de6f2824903a83B3ba13c0e88A0", "inblock us"],
248249
// nodereal
249-
["0x79102dB16781ddDfF63F301C9Be557Fd1Dd48fA0", "nodereal ap"],
250+
["0x79102dB16781ddDfF63F301C9Be557Fd1Dd48fA0", "nodereal ap x"],
250251
["0xd0d56b330a0dea077208b96910ce452fd77e1b6f", "nodereal eu"],
251252
["0x4f24ce4cd03a6503de97cf139af2c26347930b99", "nodereal us"],
252253
// xzbuilder
253254
["0x812720cb4639550D7BDb1d8F2be463F4a9663762", "xzbuilder"],
254255

255256
// Chapel
256257
["0x627fE6AFA2E84e461CB7AE7C2c46e8adf9a954a2", "txboost"],
257-
// ["0x79102dB16781ddDfF63F301C9Be557Fd1Dd48fA0", "nodereal ap"],
258+
["0x5EC60f73f938e36400ec3CC3Ff4d7a7703F7c005", "nodereal ap y"],
258259
// ["0x4827b423D03a349b7519Dda537e9A28d31ecBB48", "puissant y"],
259260
["0x0eAbBdE133fbF3c5eB2BEE6F7c8210deEAA0f7db", "blockrazor"],
260261
]);

internal/ethapi/api_mev.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,29 @@ func (m *MevAPI) SendBid(ctx context.Context, args types.BidArgs) (common.Hash,
2929
return common.Hash{}, types.ErrMevNotRunning
3030
}
3131

32-
if !m.b.MinerInTurn() {
33-
return common.Hash{}, types.ErrMevNotInTurn
34-
}
35-
3632
var (
3733
rawBid = args.RawBid
38-
currentHeader = m.b.CurrentHeader()
34+
currentHeader = m.b.CurrentHeader() // `currentHeader` might change during use.
3935
)
4036

4137
if rawBid == nil {
4238
return common.Hash{}, types.NewInvalidBidError("rawBid should not be nil")
4339
}
4440

4541
// only support bidding for the next block not for the future block
46-
if rawBid.BlockNumber != currentHeader.Number.Uint64()+1 {
47-
return common.Hash{}, types.NewInvalidBidError("stale block number or block in future")
42+
if latestBlockNumber := currentHeader.Number.Uint64(); rawBid.BlockNumber < latestBlockNumber+1 {
43+
return common.Hash{}, types.NewInvalidBidError(
44+
fmt.Sprintf("stale block number: %d, latest block: %d", rawBid.BlockNumber, latestBlockNumber))
45+
} else if rawBid.BlockNumber > latestBlockNumber+1 {
46+
// For the first block of a validator's turn, the previous block must be imported first.
47+
// If a builder sends bids before the import is complete, the following error message will be returned.
48+
// However, this is not a significant issue because:
49+
// a. Each turn consists of 16 blocks, so this situation can only occur at most 1/16 of the time.
50+
// b. Each builder is allowed to submit multiple bids for each block.
51+
return common.Hash{}, types.NewInvalidBidError(
52+
fmt.Sprintf("block in future: %d, latest block: %d", rawBid.BlockNumber, latestBlockNumber))
53+
} else if !m.b.MinerInTurn() {
54+
return common.Hash{}, types.ErrMevNotInTurn
4855
}
4956

5057
if rawBid.ParentHash != currentHeader.Hash() {

0 commit comments

Comments
 (0)