some in-progress changes for MEV boost builder API

This commit is contained in:
Dustin Brody 2022-04-03 22:04:33 +00:00
parent 94371837d8
commit 260d9092d4
No known key found for this signature in database
GPG Key ID: 3D7A11A0156519DC
2 changed files with 9 additions and 25 deletions

View File

@ -1,10 +1,5 @@
import ethtypes, builder_api_types, engine_api_types
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#api-docs
# but not what's in the actual code
# proc builder_getPayloadHeaderV1(payloadId: PayloadID): ExecutionPayloadHeaderV1
# proc builder_proposeBlindedBlockV1(blck: SignedBlindedBeaconBlock): ExecutionPayloadV1
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go
proc builder_getPayloadHeaderV1(payloadId: PayloadID): ExecutionPayloadWithTxRootV1
proc builder_proposeBlindedBlockV1(blck: SignedBlindedBeaconBlock): ExecutionPayloadWithTxRootV1
# https://github.com/flashbots/mev-boost/blob/main/docs/specification.md
proc builder_getPayloadHeaderV1(payloadId: PayloadID): ExecutionPayloadHeaderV1
proc builder_proposeBlindedBlockV1(blck: SignedBlindedBeaconBlock): ExecutionPayloadV1

View File

@ -7,7 +7,7 @@ export
type
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L34
ExecutionPayloadWithTxRootV1* = object
ExecutionPayloadHeaderV1* = object
parentHash*: FixedBytes[32]
feeRecipient*: Address
stateRoot*: FixedBytes[32]
@ -21,7 +21,6 @@ type
extraData*: string # List[byte, MAX_EXTRA_DATA_BYTES]
baseFeePerGas*: Uint256 # base fee introduced in EIP-1559, little-endian serialized
blockHash*: FixedBytes[32]
#transactions: seq[string]
transactionsRoot*: FixedBytes[32]
ExecutionPayloadHeaderOnlyBlockHash* = object
@ -30,28 +29,18 @@ type
# works, but.
blockHash*: string
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L26
BlindedBeaconBlockBodyPartial* = object
execution_payload_header*: ExecutionPayloadHeaderOnlyBlockHash
# Either snake_case or camelCase is allowed, or both:
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go#L157
BlindedBeaconBlockBody* = object
discard
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#blindedbeaconblock
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L17
# https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#blindedbeaconblock
BlindedBeaconBlock* = object
# These are snake case, while, e.g. ExecutionPayloadWithTxRootV1 is
# camelCase. And others, such as BlindedBeaconBlockBodyPartial, can be either
# proposer_index, parent_root, and state_root are all strings for MEV
slot*: Quantity # MEV builder service uses string here
proposer_index*: Quantity
parent_root*: FixedBytes[32]
state_root*: FixedBytes[32]
# The MEV sevice only decodes BlindedBeaconBlockBodyPartial
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go#L149
body*: BlindedBeaconBlockBodyPartial
body*: BlindedBeaconBlockBody
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#signedblindedbeaconblock
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L11
# https://github.com/flashbots/mev-boost/blob/main/docs/specification.md#signedblindedbeaconblock
SignedBlindedBeaconBlock* = object
message*: BlindedBeaconBlock
signature*: FixedBytes[96] # the MEV builder API service uses string here