Force the proposer to reorg unavailable blocks - #5186
Conversation
Why do we want to make this behavior preferable? Honest proposer will propagate blob data and it will likely reach attesters before the attestation deadline and then attesters will have to vote against the proposed block |
If the PTC signals unavailability, attesters will not vote against the proposed block. The PTC basically gives a "reorg pass" to the proposer. As for why the default behavior should be to reorg, the main reason is that a proposer that samples is not able to fully determine availability by itself, so it makes sense for them to follow the PTC's availability determination. Otherwise, they might just be wrong (their 8 columns are available, but the rest is not), and their proposal would end up being reorged. However, this does not necessarily need to be the case for proposers that download the whole data. They could ignore the PTC in principle. |
In the event the proposer has seen the payload timely and its local view of DA passes, the node will have the payload verified. However, if the PTC is signalling that the Payload blob data is not available, the proposer MUST reorg the payload. This PR implements this mechanism with a few caveats. - Most importantly, currently it is very aggressive and if there are no PTC attestations the proposer will be forced to reorg the payload. There are many solutions to this problem like simply counting the PTC attestations (which is also a way of counting the NAY votes) or using 5180. If we go with 5180 this PR needs to be accomodated to that and actually count the NAY votes. - The threshold could be different than 50%. - The proposer may have all the data available locally and decide to build on full even though the PTC voted no. I think it's better to leave that unspecified.
| ### New `ptc_voted_data_unavailable` | ||
|
|
||
| ```python | ||
| def ptc_voted_data_unavailable(store: Store, root: Root) -> bool: |
There was a problem hiding this comment.
After #5186 and #5210, there will be very similar four PTC-related functions. We can at least shrink it into two: timeliness and availability. For instance,
def payload_data_availability(store: Store, root: Root, available: bool) -> bool:
"""
Return whether the blob data for the beacon block with root ``root``
was voted as present by the PTC, and was locally determined to be available or unavailable.
"""
# The beacon block root must be known
assert root in store.payload_data_availability_vote
# If the payload is not locally available, the blob data
# is not considered available regardless of the PTC vote
if not is_payload_verified(store, root):
return not available
votes = store.payload_data_availability_vote[root]
return sum(vote is available for vote in votes) > DATA_AVAILABILITY_TIMELY_THRESHOLD* Review 5186 * revamp refactor
|
For the record, @potuz does not like the shared helper functions.
Though Jihoon & I still prefer it for deduplication reasons. |
Sure, and sibling functions with mismatched names is also an anti-pattern: Having Whichever we choose, it's an improvement to the original code. |
**Motivation** - implement `shouldBuildOnFull()` as in ethereum/consensus-specs#5186 **Description** - track blob data available in a new `daVotes` - thread blob data available from block import, gossip handler and api - track ptc voted in a new `ptcAttested` - count NO votes and implement `shouldBuildOnFull()` when producing block **AI Assistance Disclosure** Created with Claude --------- Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com> Co-authored-by: Cayman <caymannava@gmail.com>
In the event the proposer has seen the payload timely and its local view of DA passes, the node will have the payload verified. However, if the PTC is signalling that the Payload blob data is not available, the proposer MUST reorg the payload.
This PR implements this mechanism with a few caveats.
Distinguish absent PTC votes from negative votes #5180. If we go with Distinguish absent PTC votes from negative votes #5180 this PR needs to be accomodated to that and actually count the NAY votes.