Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmd/jsutils/getchainstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const validatorMap = new Map([
["0x86eb31b90566a9f4F3AB85138c78A000EBA81685", "GucciOp3k"],
["0x28D70c3756d4939DCBdEB3f0fFF5B4B36E6e327F", "OmegaV"],
["0x6a5470a3B7959ab064d6815e349eD4aE2dE5210d", "Skynet10k"],
["0x90409F56966B5da954166eB005Cb1A8790430BA1", "Legend"],
]);

const builderMap = new Map([
Expand Down Expand Up @@ -246,15 +247,15 @@ const builderMap = new Map([
["0xb49f86586a840AB9920D2f340a85586E50FD30a2", "inblock eu"],
["0x0F6D8b72F3687de6f2824903a83B3ba13c0e88A0", "inblock us"],
// nodereal
["0x79102dB16781ddDfF63F301C9Be557Fd1Dd48fA0", "nodereal ap"],
["0x79102dB16781ddDfF63F301C9Be557Fd1Dd48fA0", "nodereal ap x"],
["0xd0d56b330a0dea077208b96910ce452fd77e1b6f", "nodereal eu"],
["0x4f24ce4cd03a6503de97cf139af2c26347930b99", "nodereal us"],
// xzbuilder
["0x812720cb4639550D7BDb1d8F2be463F4a9663762", "xzbuilder"],

// Chapel
["0x627fE6AFA2E84e461CB7AE7C2c46e8adf9a954a2", "txboost"],
// ["0x79102dB16781ddDfF63F301C9Be557Fd1Dd48fA0", "nodereal ap"],
["0x5EC60f73f938e36400ec3CC3Ff4d7a7703F7c005", "nodereal ap y"],
// ["0x4827b423D03a349b7519Dda537e9A28d31ecBB48", "puissant y"],
["0x0eAbBdE133fbF3c5eB2BEE6F7c8210deEAA0f7db", "blockrazor"],
]);
Expand Down
21 changes: 14 additions & 7 deletions internal/ethapi/api_mev.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,29 @@ func (m *MevAPI) SendBid(ctx context.Context, args types.BidArgs) (common.Hash,
return common.Hash{}, types.ErrMevNotRunning
}

if !m.b.MinerInTurn() {
return common.Hash{}, types.ErrMevNotInTurn
}

var (
rawBid = args.RawBid
currentHeader = m.b.CurrentHeader()
currentHeader = m.b.CurrentHeader() // `currentHeader` might change during use.
)

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

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

if rawBid.ParentHash != currentHeader.Hash() {
Expand Down