Skip to content

Commit 72994bc

Browse files
authored
Improve some eip7732 p2p gossip validations (#4474)
* Simplify some statements. * Move `header.builder_index` check before withdrawal creds check. * Fix `header.value` check; clarify that it's excess balance & `MIN_ACTIVATION_BALANCE` not `MIN_BUILDER_BALANCE`. * Fix joined list item for `header.parent_block_root`.
1 parent 224a91a commit 72994bc

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

specs/_features/eip7732/p2p-interface.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@ obtained from the `state.signed_execution_payload_header`)
209209
- _[REJECT]_ `block.slot` equals `envelope.slot`.
210210
- _[REJECT]_ `envelope.builder_index == header.builder_index`
211211
- _[REJECT]_ `payload.block_hash == header.block_hash`
212-
- _[REJECT]_ The builder signature,
213-
`signed_execution_payload_envelope.signature`, is valid with respect to the
214-
builder's public key.
212+
- _[REJECT]_ `signed_execution_payload_envelope.signature` is valid with respect
213+
to the builder's public key.
215214

216215
###### `payload_attestation_message`
217216

@@ -234,8 +233,8 @@ The following validations MUST pass before forwarding the
234233
- _[REJECT]_ The message's validator index is within the payload committee in
235234
`get_ptc(state, data.slot)`. The `state` is the head state corresponding to
236235
processing the block up to the current slot as determined by the fork choice.
237-
- _[REJECT]_ The message's signature of `payload_attestation_message.signature`
238-
is valid with respect to the validator index.
236+
- _[REJECT]_ `payload_attestation_message.signature` is valid with respect to
237+
the validator's public key.
239238

240239
###### `execution_payload_header`
241240

@@ -245,24 +244,26 @@ The following validations MUST pass before forwarding the
245244
`signed_execution_payload_header` on the network, assuming the alias
246245
`header = signed_execution_payload_header.message`:
247246

248-
- _[REJECT]_ the builder's withdrawal credentials' prefix equals
249-
`BUILDER_WITHDRAWAL_PREFIX`.
247+
- _[REJECT]_ `header.builder_index` is a valid, active, and non-slashed builder
248+
index.
249+
- _[REJECT]_ the builder's withdrawal credentials' prefix is
250+
`BUILDER_WITHDRAWAL_PREFIX` -- i.e.
251+
`is_builder_withdrawal_credential(state.validators[header.builder_index].withdrawal_credentials)`
252+
returns `True`.
250253
- _[IGNORE]_ this is the first signed bid seen with a valid signature from the
251254
given builder for this slot.
252-
- _[IGNORE]_ this bid is the highest value bid seen for the pair of the
253-
corresponding slot and the given parent block hash.
254-
- _[REJECT]_ The signed builder bid, `header.builder_index` is a valid, active,
255-
and non-slashed builder index in state.
256-
- _[IGNORE]_ The signed builder bid value, `header.value`, is less or equal than
257-
the builder's balance in state. i.e.
258-
`MIN_BUILDER_BALANCE + header.value < state.builder_balances[header.builder_index]`.
255+
- _[IGNORE]_ this bid is the highest value bid seen for the corresponding slot
256+
and the given parent block hash.
257+
- _[IGNORE]_ `header.value` is less or equal than the builder's excess balance
258+
-- i.e.
259+
`MIN_ACTIVATION_BALANCE + header.value <= state.balances[header.builder_index]`.
259260
- _[IGNORE]_ `header.parent_block_hash` is the block hash of a known execution
260-
payload in fork choice. _ _[IGNORE]_ `header.parent_block_root` is the hash
261-
tree root of a known beacon block in fork choice.
261+
payload in fork choice.
262+
- _[IGNORE]_ `header.parent_block_root` is the hash tree root of a known beacon
263+
block in fork choice.
262264
- _[IGNORE]_ `header.slot` is the current slot or the next slot.
263-
- _[REJECT]_ The builder signature,
264-
`signed_execution_payload_header_envelope.signature`, is valid with respect to
265-
the `header_envelope.builder_index`.
265+
- _[REJECT]_ `signed_execution_payload_header.signature` is valid with respect
266+
to the `header.builder_index`.
266267

267268
##### Attestation subnets
268269

specs/_features/eip7805/p2p-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ the network, assuming the alias `message = signed_inclusion_list.message`:
6767
- _[IGNORE]_ The `message` is either the first or second valid message received
6868
from the validator with index `message.validator_index`.
6969
- _[REJECT]_ The signature of `inclusion_list.signature` is valid with respect
70-
to the validator index.
70+
to the validator's public key.
7171

7272
### The Req/Resp domain
7373

0 commit comments

Comments
 (0)