Add PTC data selection strategies - #435
Open
AntiD2ta wants to merge 4 commits into
Open
Conversation
AntiD2ta
marked this pull request as ready for review
August 27, 2026 15:45
Add first and majority payload attestation data strategies, retaining the simple multiclient default. Majority groups complete signed tuples and only resolves same-root ties with positive payload evidence. Files: strategy implementations and tests, payload data startup selection, configuration address resolution, and configuration documentation. Notes: the repository-wide blockrelay JSON assertion fails unchanged on the parent branch with Go 1.27.
Pass provider loop values directly into request goroutines and split majority collection, validation, and selection into focused helpers. This preserves strategy behavior while keeping static analysis complexity bounded.
The majority strategy returned a context error when its deadline passed with outstanding providers, discarding the responses it had already bucketed. A single unresponsive beacon node therefore failed every PTC duty, since the payload attester does not retry. Both strategies now drain the responses that did arrive at the deadline, and report the context error only when nothing valid was received; this also makes the cancellation tests deterministic rather than dependent on which select arm wins. Move the 1s payload attestation data timeout default from the per-style keys to the strategy key so that util.Timeout's hierarchy still applies: with the default on strategies.payloadattestationdata.first.timeout, neither strategies.payloadattestationdata.timeout nor the top-level timeout could ever be reached for the first and majority styles.
Record the first and majority payloadattestationdata strategies, the style selector, and the strategy-level timeout default. Also mark the existing dedicated-multiclient entry as the 'simple' style, now that it is one of three.
AntiD2ta
force-pushed
the
gloas-ptc-data-strategies
branch
from
August 27, 2026 16:01
6f59e2e to
d4cc693
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
firstandmajoritypayload-attestation-data strategies for PTC duties. The existingsimplemulticlient remains the default for absent or unknown styles.Behavior
firstrequests all configured providers concurrently and selects the first structurally valid Gloas response for the requested slot.majoritygroups complete signed tuples: version, beacon block root, slot, payload presence, and blob availability. It applies the configured threshold, including0.PayloadPresent: true. Competing roots and other ties fail.Review guide
main.goandutil/config.gowire style selection, timeout defaults, and address resolution.strategies/payloadattestationdata/first/contains concurrent first-valid selection.strategies/payloadattestationdata/majority/contains tuple bucketing, threshold handling, and tie policy.Risk and validation
This changes only explicitly selected PTC-data strategies. The simple default is unchanged.
CI passes: DeepSource, lint, test, Trivy, and trivy-scan.