feat: Log additions to relay #1446
<h3>Greptile Summary</h3>
This PR threads structured loggers through relay processors and local and remote prover construction, then adds packet-submission, remote-proof, and attestor-quorum diagnostics.
<h3>Confidence Score: 4/5</h3>
The PR appears safe to merge, with a non-blocking observability issue in degraded-quorum diagnostics.
Logger propagation preserves the existing relay and proof behavior, and all discovered callers provide initialized loggers; however, one newly added warning can omit some attestor exclusion reasons and should be improved for reliable diagnosis.
Files Needing Attention: cli/internal/relay/prover/attestation/quorum.go
<h3>Important Files Changed</h3>
| Filename | Overview |
|----------|----------|
| cli/internal/relay/prover/attestation/quorum.go | Adds attestor failure and degraded-quorum logging, but mixed exclusion reasons are not fully represented. |
| cli/internal/relay/processors/batch_relay.go | Adds structured packet context and successful transaction logging around the existing relay flow. |
| cli/internal/relay/prover/prover.go | Threads a client-scoped logger into local and remote prover construction. |
| cli/internal/relay/prover/remote/remote.go | Stores a scoped logger and emits debug diagnostics after successful remote proof requests. |
| cli/internal/types/v2/types.go | Adds stable human-readable names for all defined relay kinds. |
<details><summary><h3>Flowchart</h3></summary>
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Bootstrap[Bootstrap logger] --> ProverSet[Prover set]
Bootstrap --> Pipeline[Relay pipeline]
ProverSet --> Local[Attestation generator]
ProverSet --> Remote[Remote prover]
Local --> Quorum[Attestor quorum queries]
Pipeline --> Batch[Receive / Ack / Timeout batches]
Batch --> Relay[Build and submit relay transaction]
Quorum --> Logs[Structured diagnostics]
Remote --> Logs
Relay --> Logs
</details>
<!-- greptile_other_comments_section -->
<sub>Reviews (1): Last reviewed commit: "Log additions to relay" | Re-trigger Greptile</sub>
<a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Quorum Reasons Are Incomplete
The degraded-quorum warning can omit exclusion reasons when failure modes are mixed. Conflicting claims and duplicate signers are excluded without an error, while joinResponseErrors reports only responses with errors. If one attestor errors while another conflicts or duplicates a signer, the warning lists only the error, making it harder for operators to identify every attestor responsible for the reduced quorum.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
For such cases I'd do someling like this:
// prev code sets logging.Context(ctx, g.logger) - attaches slog to ctx,
// log.FromContext() returns attached logger or slog.Default()
return latestProvableHeight(ctx, g.attestors, g.threshold, g.counterpartyChain)
Approved these changes.
Mmmm, I tried it out and it's basically the same level of complexity just in a different place. Yes, you keep the logger out of the function signature in these cases, but it's inconsistent with the way the logger is passed in other places and you have to maintain the custom logger context stuff. I think we should just keep it as is.
swift1337
Eric-Warehime
Adds some logging to the attestor/relayer.
Most of this PR is just threading the logger through, with a couple of additions of info/warn and a few debug logs.