not to milestone 1 spec, but what mev-boost code actually does

This commit is contained in:
Dustin Brody 2022-02-23 05:30:02 +00:00
parent 63d586bd9d
commit 94a3c2bd95
No known key found for this signature in database
GPG Key ID: 3D7A11A0156519DC
2 changed files with 45 additions and 31 deletions

View File

@ -1,6 +1,10 @@
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#api-docs
import ethtypes, builder_api_types, engine_api_types import ethtypes, builder_api_types, engine_api_types
proc builder_getPayloadHeaderV1(payloadId: PayloadID): ExecutionPayloadHeaderV1 # https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#api-docs
proc builder_proposeBlindedBlockV1(blck: SignedBlindedBeaconBlock): ExecutionPayloadV1 # 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

View File

@ -1,47 +1,57 @@
import import
stint,
ethtypes ethtypes
export export
ethtypes ethtypes
type type
# https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#executionpayloadheader # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L34
ExecutionPayloadHeaderV1* = object ExecutionPayloadWithTxRootV1* = object
parent_hash*: FixedBytes[32] parentHash*: FixedBytes[32]
fee_recipient*: Address feeRecipient*: Address
state_root*: FixedBytes[32] stateRoot*: FixedBytes[32]
receipts_root*: FixedBytes[32] receiptsRoot*: FixedBytes[32]
logs_bloom*: FixedBytes[256] logsBloom*: string # FixedBytes[256]
random*: FixedBytes[32] random*: FixedBytes[32]
block_number*: Quantity blockNumber*: Quantity
gas_limit*: Quantity gasLimit*: Quantity
gas_used*: Quantity gasUsed*: Quantity
timestamp*: Quantity timestamp*: Quantity
extra_data*: string # List[byte, MAX_EXTRA_DATA_BYTES] extraData*: string # List[byte, MAX_EXTRA_DATA_BYTES]
base_fee_per_gas*: FixedBytes[32] # base fee introduced in EIP-1559, little-endian serialized baseFeePerGas*: Uint256 # base fee introduced in EIP-1559, little-endian serialized
blockHash*: FixedBytes[32]
#transactions: seq[string]
transactionsRoot*: FixedBytes[32]
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#blindedbeaconblockbody ExecutionPayloadHeaderOnlyBlockHash* = object
BlindedBeaconBlockBody* = object # Another of these either-snake-or-camel definitions
randao_reveal*: FixedBytes[96] # also why use common.Hash elsewhere but string here as block type? Either
eth1_data*: string # Eth1Data # works, but.
graffiti*: FixedBytes[32] blockHash*: string
proposer_slashings*: string # List[ProposerSlashing, MAX_PROPOSER_SLASHINGS]
attester_slashings*: string # List[AttesterSlashing, MAX_ATTESTER_SLASHINGS] # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L26
attestations*: string # List[Attestation, MAX_ATTESTATIONS] BlindedBeaconBlockBodyPartial* = object
voluntary_exits*: string # List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] execution_payload_header*: ExecutionPayloadHeaderOnlyBlockHash
sync_aggregate*: string # SyncAggregate # Either snake_case or camelCase is allowed, or both:
execution_payload_header*: ExecutionPayloadHeaderV1 # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go#L157
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#blindedbeaconblock # 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
BlindedBeaconBlock* = object BlindedBeaconBlock* = object
slot*: Quantity # 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 proposer_index*: Quantity
parent_root*: FixedBytes[32] parent_root*: FixedBytes[32]
state_root*: FixedBytes[32] state_root*: FixedBytes[32]
body*: BlindedBeaconBlockBody # The MEV sevice only decodes BlindedBeaconBlockBodyPartial
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go#L149
body*: BlindedBeaconBlockBodyPartial
# https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#signedblindedbeaconblock # 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
SignedBlindedBeaconBlock* = object SignedBlindedBeaconBlock* = object
message*: BlindedBeaconBlock message*: BlindedBeaconBlock
signature*: FixedBytes[96] signature*: FixedBytes[96] # the MEV builder API service uses string here