|
1 | 1 | import |
| 2 | + stint, |
2 | 3 | ethtypes |
3 | 4 |
|
4 | 5 | export |
5 | 6 | ethtypes |
6 | 7 |
|
7 | 8 | type |
8 | | - # https://github.com/ethereum/consensus-specs/blob/v1.1.9/specs/bellatrix/beacon-chain.md#executionpayloadheader |
9 | | - ExecutionPayloadHeaderV1* = object |
10 | | - parent_hash*: FixedBytes[32] |
11 | | - fee_recipient*: Address |
12 | | - state_root*: FixedBytes[32] |
13 | | - receipts_root*: FixedBytes[32] |
14 | | - logs_bloom*: FixedBytes[256] |
| 9 | + # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L34 |
| 10 | + ExecutionPayloadWithTxRootV1* = object |
| 11 | + parentHash*: FixedBytes[32] |
| 12 | + feeRecipient*: Address |
| 13 | + stateRoot*: FixedBytes[32] |
| 14 | + receiptsRoot*: FixedBytes[32] |
| 15 | + logsBloom*: string # FixedBytes[256] |
15 | 16 | random*: FixedBytes[32] |
16 | | - block_number*: Quantity |
17 | | - gas_limit*: Quantity |
18 | | - gas_used*: Quantity |
| 17 | + blockNumber*: Quantity |
| 18 | + gasLimit*: Quantity |
| 19 | + gasUsed*: Quantity |
19 | 20 | timestamp*: Quantity |
20 | | - extra_data*: string # List[byte, MAX_EXTRA_DATA_BYTES] |
21 | | - base_fee_per_gas*: FixedBytes[32] # base fee introduced in EIP-1559, little-endian serialized |
| 21 | + extraData*: string # List[byte, MAX_EXTRA_DATA_BYTES] |
| 22 | + baseFeePerGas*: Uint256 # base fee introduced in EIP-1559, little-endian serialized |
| 23 | + blockHash*: FixedBytes[32] |
| 24 | + #transactions: seq[string] |
| 25 | + transactionsRoot*: FixedBytes[32] |
| 26 | + |
| 27 | + ExecutionPayloadHeaderOnlyBlockHash* = object |
| 28 | + # Another of these either-snake-or-camel definitions |
| 29 | + # also why use common.Hash elsewhere but string here as block type? Either |
| 30 | + # works, but. |
| 31 | + blockHash*: string |
22 | 32 |
|
23 | | - # https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#blindedbeaconblockbody |
24 | | - BlindedBeaconBlockBody* = object |
25 | | - randao_reveal*: FixedBytes[96] |
26 | | - eth1_data*: string # Eth1Data |
27 | | - graffiti*: FixedBytes[32] |
28 | | - proposer_slashings*: string # List[ProposerSlashing, MAX_PROPOSER_SLASHINGS] |
29 | | - attester_slashings*: string # List[AttesterSlashing, MAX_ATTESTER_SLASHINGS] |
30 | | - attestations*: string # List[Attestation, MAX_ATTESTATIONS] |
31 | | - voluntary_exits*: string # List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] |
32 | | - sync_aggregate*: string # SyncAggregate |
33 | | - execution_payload_header*: ExecutionPayloadHeaderV1 |
| 33 | + # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L26 |
| 34 | + BlindedBeaconBlockBodyPartial* = object |
| 35 | + execution_payload_header*: ExecutionPayloadHeaderOnlyBlockHash |
| 36 | + # Either snake_case or camelCase is allowed, or both: |
| 37 | + # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go#L157 |
34 | 38 |
|
35 | 39 | # https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#blindedbeaconblock |
| 40 | + # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L17 |
36 | 41 | BlindedBeaconBlock* = object |
37 | | - slot*: Quantity |
| 42 | + # These are snake case, while, e.g. ExecutionPayloadWithTxRootV1 is |
| 43 | + # camelCase. And others, such as BlindedBeaconBlockBodyPartial, can be either |
| 44 | + # proposer_index, parent_root, and state_root are all strings for MEV |
| 45 | + slot*: Quantity # MEV builder service uses string here |
38 | 46 | proposer_index*: Quantity |
39 | 47 | parent_root*: FixedBytes[32] |
40 | 48 | state_root*: FixedBytes[32] |
41 | | - body*: BlindedBeaconBlockBody |
| 49 | + # The MEV sevice only decodes BlindedBeaconBlockBodyPartial |
| 50 | + # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/service.go#L149 |
| 51 | + body*: BlindedBeaconBlockBodyPartial |
42 | 52 |
|
43 | 53 | # https://github.com/flashbots/mev-boost/blob/thegostep/docs/docs/milestone-1.md#signedblindedbeaconblock |
| 54 | + # https://github.com/flashbots/mev-boost/blob/thegostep/docs/lib/types.go#L11 |
44 | 55 | SignedBlindedBeaconBlock* = object |
45 | 56 | message*: BlindedBeaconBlock |
46 | | - signature*: FixedBytes[96] |
47 | | - |
| 57 | + signature*: FixedBytes[96] # the MEV builder API service uses string here |
0 commit comments