← Back to Pull requests

feat(metrics): attestation aggregation metrics #1470

Open
dhfang opened this pull request with 270 lines diff across 9 files
View on GitHub
dhfang dhfang commented on Sep 16, 2026 23:17 UTC
Author

Adds metric tracking whether the attested data an attestor returns matches the expected on-chain commitment. A mismatch could indicate a misbehaving attestor so this would be a useful metric for an operator to create an alert on.

Open to adding other metrics, but the other metrics I could think of seemed redundant to the existing prover metrics which already tracks latency and result for all provers and the attestor metrics which already track latency and result for individual attestor calls. I could add a gauge tracking how many valid attestor responses there are per aggregation round if reviewers think that's useful, but this seems mostly a measure of attestor liveness which is already captured by the metrics for individual attestor calls.

closes FOU-1558

Diff: 270 lines (+216 / -54) across 9 files Reviewer: swift1337 Review duration: 41199m
All Vouch review confidence checks passed
Residual risk 0.05 = Change Risk (0.48) × (1 − Review Confidence (0.90)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 270 lines diff across 9 files
0.48
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.97 · 3 substantive comment(s)
0.97
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
90%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.335
Real PR Conversation Timeline
4 items
greptile-apps[bot] greptile-apps[bot] commented on Sep 16, 2026 23:20 UTC
Bot

<!-- greptile_summary -->

<h3>Greptile Summary</h3>

The PR adds an attestation-prover counter that records, per attestor and local client scope, whether returned attestation data matches the expected on-chain claim.

  • Adds chain, client, attestor, and boolean result dimensions.

  • Emits observations after successful attestor queries and before signature validation.

  • Propagates prover identity into the attestation generator.

  • Adds focused metric tests and updates the telemetry catalog.
  • <h3>Confidence Score: 5/5</h3>

    The PR appears safe to merge; no actionable correctness, security, or repository-rule violations were identified.

    The metric is emitted at the intended data-comparison point, preserves existing quorum and signature validation, uses the established prover identity, and is covered by focused tests.

    <h3>Important Files Changed</h3>

    | Filename | Overview |
    |----------|----------|
    | cli/internal/relay/prover/attestation/metrics.go | Defines the attestation data-match counter and records local client scope, attestor identity, and match result. |
    | cli/internal/relay/prover/attestation/quorum.go | Integrates metric emission into each successful attestor response while preserving data, signature, signer, and quorum validation. |
    | cli/internal/relay/prover/attestation/generator.go | Stores chain and client identity on the generator and converts quorum helpers into generator methods. |
    | cli/internal/relay/prover/attestation/resolve.go | Supplies the local prover chain and client identity when constructing the attestation generator. |
    | cli/internal/relay/prover/attestation/metrics_test.go | Verifies match, mismatch, pre-signature-validation, and RPC-failure metric behavior and attributes. |
    | cli/internal/otel/README.md | Documents the new counter and its label dimensions. |

    <details><summary>Flowchart</summary>

    %%{init: {'theme': 'neutral'}}%%
    flowchart LR
        Q[Query attestor] --> R{RPC succeeds?}
        R -->|No| E[Return query error]
        R -->|Yes| C{Data matches expected claim?}
        C --> M[Increment data-match counter]
        C -->|No| D[Exclude response]
        C -->|Yes| S{Signature recoverable?}
        S -->|No| D
        S -->|Yes| A[Include signer in quorum]
        A --> T{Threshold met?}
        T -->|Yes| P[Return attestation proof]
        T -->|No| F[Return quorum error]
    

    </details>

    <!-- greptile_other_comments_section -->

    <sub>Reviews (1): Last reviewed commit: "docs(metrics): shorten attestation metri..." | Re-trigger Greptile</sub>

    github-actions[bot] github-actions[bot] commented on Oct 09, 2026 01:25 UTC
    Bot

    <!-- dependency-review:govulncheck -->

    Vulnerable dependencies

    11 advisories across 1 library need attention, 2 accepted.

    :rotating_light: Needs attention

    Go standard library

    In use: go1.26.6, go0.59.0 — reached from cli, e2e, gen/go/solidity-abi

    | Advisory | CVE | Fixed in | Summary |
    |---|---|---|---|
    | GO-2026-6599 | CVE-2026-94448 | go1.26.9 | Reset context tracking on consecutive template expressions in html/template |
    | GO-2026-6600 | CVE-2026-97030 | go1.26.9 | Recognize yield as regexp preceder keyword in html/template |
    | GO-2026-6603 | CVE-2026-78659 | go1.26.9 | HTTP/2 server memory exhaustion due to Trailer headers in net/http |
    | GO-2026-6605 | CVE-2026-56866 | go1.26.9 | HTTP/1 client connection desynchronization after CONNECT rejection in net/http |
    | GO-2026-6607 | CVE-2026-97031 | go1.26.9 | Reject malformed ECH outer extension references in crypto/tls |
    | GO-2026-6608 | CVE-2026-94440 | go1.26.9 | Memory limit bypass when parsing MIME headers in net/textproto, mime/multipart |
    | GO-2026-6610 | CVE-2026-78660 | go1.26.9 | HTTP/2 transport accepts malformed framing-related headers in net/http |
    | GO-2026-6611 | CVE-2026-78669 | go1.26.9 | Excessive CPU consumption from repeated initial window changes in net/http |
    | GO-2026-6612 | CVE-2026-78663 | go1.26.9 | Double flow control refund on HTTP/2 server streams in net/http |
    | GO-2026-6613 | CVE-2026-94439 | go1.26.9 | HTTP/1 server connection desynchronization after 2xx CONNECT response in net/http |
    | GO-2026-6617 | CVE-2026-97032 | go1.26.9 | HTTP/2 server crash due to HPACK encoder race in net/http |

    Run make vulncheck for the call paths. Either upgrade the library, or add the
    advisory to .govulncheck-ignore with a reason if no fix exists yet.

    Accepted

    Listed in .govulncheck-ignore with a reason.

    github.com/pion/dtls/v2

    In use: v2.2.12 — reached from cli, e2e

    | Advisory | CVE | Fixed in | Summary |
    |---|---|---|---|
    | GO-2026-4479 | CVE-2026-26014 | no fix yet | Usage of random nonce generation with AES GCM ciphers risks leaking the authentication key in github.com/pion/dtls |

    golang.org/x/crypto

    In use: v0.57.0 — reached from cli, e2e

    | Advisory | CVE | Fixed in | Summary |
    |---|---|---|---|
    | GO-2026-5932 | — | no fix yet | The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues |

    <sub>From make vulncheck-json on this run: logs.</sub>

    linear-code[bot] linear-code[bot] commented on Oct 11, 2026 18:26 UTC
    Bot
    Reviewers
    Assignees
    dhfang dhfang
    Labels
    risk: low confidence: 90.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.2% (MEDIUM) · Higher = larger blast radius
    48.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.2% · Lower = rushed or shallow review
    90.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.7% · Safe to merge
    4.7%
    Repository