Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new rules on block scoring excluding withdrawals #99

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions specs/deneb/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
- [`ExecutionPayloadHeader`](#executionpayloadheader)
- [`BlindedBeaconBlockBody`](#blindedbeaconblockbody)
- [Building](#building)
- [Block scoring](#block-scoring)
- [Relaying](#relaying)
- [Block scoring](#block-scoring-1)
- [Bidding](#bidding)
- [Revealing the `ExecutionPayload`](#revealing-the-executionpayload)
- [Blinded block processing](#blinded-block-processing)
Expand Down Expand Up @@ -86,9 +89,40 @@ class BlindedBeaconBlockBody(Container):

## Building

Builders provide bids as the have in prior forks.
Builders provide bids as the have in prior forks, with a notable restriction to block scoring.
ralexstokes marked this conversation as resolved.
Show resolved Hide resolved

Relays have a few additional duties.
### Block scoring

Builders **MUST** not include the `amount`s from the consensus block's withdrawals when computing the `value` for their `BuilderBid`.

See [the section below on relay verification](#block-scoring-1) for the logic a builder's bid must satisfy.

## Relaying

Relays have a few additional duties to support the features in this upgrade.

### Block scoring

Relays **MUST** ensure the `value` in the `BuilderBid` corresponds to the payment delivered by the builder to the proposer, excluding any withdrawals.

Consider the following validation logic following definitions in the `consensus-specs`:

```python
def verify_bid_value(execution_payload: ExecutionPayload, fee_recipient: ExecutionAddress, bid_value: uint256, balance_difference: uint256):
target_amounts = [w.amount for w in execution_payload.withdrawals if w.address == fee_recipient]
excluded_amount = sum(target_amounts)
ralexstokes marked this conversation as resolved.
Show resolved Hide resolved
proposer_payment = balance_difference - excluded_amount
assert proposer_payment == bid_value
```

`verify_bid_value` should execute completely, noting that assertion failures are errors.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these be bullets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its fine without

The `execution_payload`, `fee_recipient`, and `bid_value` are all provided by the builder in their payload submission.
The `balance_difference` is computed by the relay during simulation of the `execution_payload` where
`balance_difference = post_state_balance - pre_state_balance`.
`pre_state_balance` is the ether amount at the `fee_recipient`’s address in the execution state before applying
the `execution_payload` and the `post_state_balance` is the same data after applying the `execution_payload`.

Any block submissions where `verify_bid_value` fails should be considered invalid and **MUST** not be served to proposers requesting bids.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this verify_bid_value executed in consensus layer or execution layer? consensus layer has no information about fee_recipient balance at pre_execution_state and post_execution_state

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relays would verify this value as part of confirming execution validity

they have the withdrawals from the CL and can check the balance against the EL


### Bidding

Expand Down
Loading