generated from flashbots/flashbots-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 222
Home
Chris Hager edited this page Jun 10, 2022
·
54 revisions
Welcome to the mev-boost wiki ❤️
This page contains implementation resources, and the sidebar on the right links to various subpages 👉
Relevant repositories:
- Specs: Builder Specs (live), Beacon APIs (live), Consensus Specs
- https://github.com/flashbots/mev-boost (Docker image)
- https://github.com/ralexstokes/mev-rs
- https://github.com/protolambda/mergemock
- https://github.com/flashbots/go-boost-utils
- https://github.com/flashbots/boost-geth-builder
Diagrams:
Relays:
These are the required parts to implement:
- call
register_validator
on the beacon node (on startup and on change infee_recipient
/gas_limit
)
- implement
register_validator
, and forward to mev-boost / the builder network - implement the APIs defined in github.com/ethereum/builder-spec (see live version) to communicate with external block builders
- ask EL client and external block builders for a block
- provide the highest paying block to the proposer
- need to provide the APIs defined in github.com/ethereum/builder-spec (see live version) to the beacon nodes
Project | Integration | Testable | Guide |
---|---|---|---|
Teku | advanced | yes | link |
Lighthouse | advanced | yes | ? |
Lodestar | advanced | ? | ? |
Nimbus | halfway | ? | ? |
Prysm | halfway | no | - |
You can use our Kiln relay+builder at https://builder-relay-kiln.flashbots.net
curl https://builder-relay-kiln.flashbots.net/eth/v1/builder/status
Use our Ropsten relay+builder at https://builder-relay-ropsten.flashbots.net
curl https://builder-relay-ropsten.flashbots.net/eth/v1/builder/status
You can test the builder API with the mergemock relay.
git clone https://github.com/protolambda/mergemock.git
cd mergemock
go run . relay
# Call eth_getBlockByNumber to get current blockHash
curl --header 'Content-Type: application/json' --request POST 'http://127.0.0.1:8551' --data-raw '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":["latest", false],
"id":1
}'
# Next produce a new block with FCU, using the hash from 👆
curl --header 'Content-Type: application/json' --request POST 'http://127.0.0.1:8551' --data-raw '{
"jsonrpc":"2.0",
"method":"engine_forkchoiceUpdatedV1",
"params":[
{
"headBlockHash": "PREVIOUS_BLOCKHASH",
"safeBlockHash": "PREVIOUS_BLOCKHASH",
"finalizedBlockHash": "PREVIOUS_BLOCKHASH"
},
{
"timestamp": "0x1234",
"prevRandao": "0xc2fa210081542a87f334b7b14a2da3275e4b281dd77b007bcfcb10e34c42052e",
"suggestedFeeRecipient": "0xdfb434922631787e43725c6b926e989875125751"
}
],
"id":1
}'
# Then you can use the builder REST API at 127.0.0.1:28545
-> registerValidator
-> getHeader
-> getPayload
# getHeader
curl 127.0.0.1:28545/eth/v1/builder/header/1/PREVIOUS_BLOCKHASH/0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000