Skip to content

Add PTC data selection strategies - #435

Open
AntiD2ta wants to merge 4 commits into
gloas-ptc-data-addressesfrom
gloas-ptc-data-strategies
Open

Add PTC data selection strategies#435
AntiD2ta wants to merge 4 commits into
gloas-ptc-data-addressesfrom
gloas-ptc-data-strategies

Conversation

@AntiD2ta

@AntiD2ta AntiD2ta commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds first and majority payload-attestation-data strategies for PTC duties. The existing simple multiclient remains the default for absent or unknown styles.

Behavior

  • first requests all configured providers concurrently and selects the first structurally valid Gloas response for the requested slot.
  • majority groups complete signed tuples: version, beacon block root, slot, payload presence, and blob availability. It applies the configured threshold, including 0.
  • A same-root tie resolves only when exactly one leading tuple reports PayloadPresent: true. Competing roots and other ties fail.
  • Style-specific beacon-node addresses inherit from the parent PTC-data setting and then the top-level beacon-node setting.

Review guide

  1. main.go and util/config.go wire style selection, timeout defaults, and address resolution.
  2. strategies/payloadattestationdata/first/ contains concurrent first-valid selection.
  3. strategies/payloadattestationdata/majority/ contains tuple bucketing, threshold handling, and tie policy.
  4. The matching tests cover invalid and failing providers, cancellation, metrics, ties, thresholds, address resolution, and the default path.

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.

@AntiD2ta AntiD2ta self-assigned this Aug 27, 2026
@AntiD2ta AntiD2ta changed the title add PTC data selection strategies Add PTC data selection strategies Aug 27, 2026
@AntiD2ta
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
AntiD2ta force-pushed the gloas-ptc-data-strategies branch from 6f59e2e to d4cc693 Compare August 27, 2026 16:01
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.

1 participant