feat(metrics): attestation aggregation metrics #1470
<!-- 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.
<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>
<!-- 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-linkback -->
<p><a href="https://linear.app/cosmoslabs/issue/FOU-1558">FOU-1558</a></p>
swift1337
dhfang
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