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

[WIP] Minimal ePBS without Max EB and 7002 #2

Open
wants to merge 112 commits into
base: dev
Choose a base branch
from
Open

Conversation

potuz
Copy link
Owner

@potuz potuz commented Apr 2, 2024

Full specification for ePBS

The full design notes are included in https://hackmd.io/@potuz/rJ9GCnT1C
Forkchoice annotated spec can be found in https://hackmd.io/@potuz/SJdXM43x0
Currently fully specified documents:

  • beacon-chain.md
  • p2p-interface.md
  • validator.md
  • builder.md
  • fork-choice.md
  • engine.md

Most of the engine API and the forkchoice handlers in forkchoice.md are ready

Still missing is:

  • Execution specification

@potuz potuz force-pushed the epbs_stripped_out branch 4 times, most recently from 46432e7 to ac34ffc Compare April 3, 2024 14:10
potuz added 26 commits April 3, 2024 14:28
Also notice that the DA issue only happens if all the transactions are
invalidated in the same slot
Notice that the whole thing is broken by the construct if index < len(validators) else.
- Added handlers for execution payloads and checks inclusion lists
  availability on consensus blocks
Move the builder id and other unnecessary information outside of the
payload.
Copy link

@come-maiz come-maiz left a comment

Choose a reason for hiding this comment

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

Thanks for all this work and the care you have put on branch feature.
I've left a few comments during my initial reading.

specs/_features/epbs/beacon-chain.md Outdated Show resolved Hide resolved
specs/_features/epbs/beacon-chain.md Outdated Show resolved Hide resolved
specs/_features/epbs/beacon-chain.md Outdated Show resolved Hide resolved
At any given slot, the status of the blockchain's head may be either
- A block from a previous slot (eg. the current slot's proposer did not submit its block).
- An *empty* block from the current slot (eg. the proposer submitted a timely block, but the builder did not reveal the payload on time).
- A full block for the current slot (both the proposer and the builder revealed on time).

Choose a reason for hiding this comment

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

Suggested change
- A full block for the current slot (both the proposer and the builder revealed on time).
- A block with payload for the current slot (both the proposer and the builder revealed on time).

Full can be confusing. Is the block full of transactions? Instead of empty or full, what about block with or without payload?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Full is used throughout the whole list of long documents I worked on, changing this will be overkill for this stage of the project

| `PAYLOAD_ABSENT` | `uint8(0)` |
| `PAYLOAD_PRESENT` | `uint8(1)` |
| `PAYLOAD_WITHHELD` | `uint8(2)` |
| `PAYLOAD_INVALID_STATUS` | `uint8(3)` |

Choose a reason for hiding this comment

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

Suggested change
| `PAYLOAD_INVALID_STATUS` | `uint8(3)` |
| `PAYLOAD_INVALID` | `uint8(3)` |

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks for all the reading, I'll go over them and change the typos. I won't touch anything about naming cause there's always a lot of bikeshedding about that. I'll defer naming discussions until the very last moment when I am no longer involved

specs/_features/epbs/validator.md Show resolved Hide resolved
specs/_features/epbs/validator.md Show resolved Hide resolved
specs/_features/epbs/validator.md Show resolved Hide resolved
specs/_features/epbs/validator.md Show resolved Hide resolved
specs/_features/epbs/validator.md Show resolved Hide resolved
potuz and others added 2 commits April 24, 2024 13:32
Left out naming suggestions until a later stage.

Co-authored-by: Leonardo Arias <[email protected]>
Co-authored-by: Ryan Schneider <[email protected]>
@Ruteri
Copy link

Ruteri commented Apr 27, 2024

Thanks for all the effort you are putting into solving this nasty problem!

I think I'm missing some context on the payload attestation committee (PTC) after reading both the annotated spec and spec notes. Could you point me to where incentives for the committee are discussed? What incentivises PTC to vote truthfully and timely - and vote in the first place?
Related - what is the probability colluding proposers (say 30% of the stake) control the majority of the PTC votes for a slot? This is important since a majority PTC seems to be able to coerce either the proposer to include a particular payload or the builders to pay them by otherwise voting untruthfully.

It seems like inclusion lists could be used to force mayhem in periods of high MEV. Could you help me see the reason why the proposer for slot N (that possibly also controls slot N+2 or colludes with someone who does which happens) would not force the proposer in slot N+1 to include 1 wei priority gas fee 30 million gas transaction? This would mean the proposer controlling both N and N+2 can extract all the value available in slots N, N+1 and N+2 which would be disastrous.

@potuz
Copy link
Owner Author

potuz commented Apr 29, 2024

Could you point me to where incentives for the committee are discussed? What incentivises PTC to vote truthfully and timely - and vote in the first place?

PTC attesters get rewarded a full attestation reward if they attest correctly and get penalized as a missed attestation if they don't.

Related - what is the probability colluding proposers (say 30% of the stake) control the majority of the PTC votes for a slot?

In order to save time let me do a larger case, in which the attacker has 35% of the stake (so that python's default float does not overflow), in this case there's a probability of ~10^-12 per slot:

>>> from scipy.stats import binom
>>> 1 - binom.cdf(k=255, n=512, p=0.35)
2.461586490198897e-12

Which gives an expected time of about 154 582 years to succeed.

... would not force the proposer in slot N+1 to include 1 wei priority gas fee 30 million gas transaction?

The maximum gas of the IL is 3M and this is on top of any gas limit for the next block.

@Ruteri
Copy link

Ruteri commented May 13, 2024

Thanks for all the answers!

PTC attesters get rewarded a full attestation reward if they attest correctly and get penalized as a missed attestation if they don't.

Follow up: since attesters are penalized for missing votes, wouldn't they be incentivized to vote "missing payload" as soon as they can to guarantee they don't miss the vote? Is the reward for voting the same in all cases?

The maximum gas of the IL is 3M and this is on top of any gas limit for the next block.

Ah I see. I wonder if there's anything funny one can do with nonces - say there are two transactions with the same nonce. One can try and time releasing the transactions such that they propagate to some fraction of PTC

@potuz
Copy link
Owner Author

potuz commented May 15, 2024

Follow up: since attesters are penalized for missing votes, wouldn't they be incentivized to vote "missing payload" as soon as they can to guarantee they don't miss the vote? Is the reward for voting the same in all cases?

If the PTC member attest for "missing payload" but the majority is honest, the payload is present and becomes canonical, the PTC member will be penalized. The reward is only applied when voting for the right outcome.

state_root: Bytes32
receipts_root: Bytes32
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM]
prev_randao: Bytes32 # 'difficulty' in the yellow paper
Copy link

Choose a reason for hiding this comment

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

Suggested change
prev_randao: Bytes32 # 'difficulty' in the yellow paper
prev_randao: Bytes32 # 'mix_hash' in the yellow paper

Copy link
Owner Author

Choose a reason for hiding this comment

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

has this changed in the YP and the main repo? I took this one out from the main repo


#### `ExecutionPayloadHeader`

**Note:** The `ExecutionPayloadHeader` is modified to only contain the block hash of the committed `ExecutionPayload` in addition to the builder's payment information and KZG commitments root to verify the inclusion proofs.
Copy link

Choose a reason for hiding this comment

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

one consideration of compression here by dropping other fields are if there are any apps/use cases are building/consuming proofs against the other attributes of payload against the inclusion in a block

One way to make this easy would be to have a merkle hash of the execution payload ad the block hash here

(just thinking aloud)


Builders can broadcast a payload bid for the current or the next slot's proposer to include. They produce a `SignedExecutionPayloadHeader` as follows.

Prior to constructing a payload, the builder **MUST** have a full `InclusionList` object from the proposer matching `state.previous_inclusion_list_proposer`. The signed summary for this inclusion list will be needed when revealing the full execution payload (see below).
Copy link

Choose a reason for hiding this comment

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

may be totally remove inclusion list for now?

Copy link
Owner Author

Choose a reason for hiding this comment

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

it will be removed in the EIP, I'll open a new PR in this repo based on Electra soon

@Ali1994Baker
Copy link

Ali1994baker

1 similar comment
@Ali1994Baker
Copy link

Ali1994baker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants