Repository navigation
feat(relayer): add remote prover timeout config support - #1623
lakshay-zeeve wants to merge 1 commit into
Conversation
f4ee903 to
7c8c929
Compare
|
@greptile review |
[Medium impact] The change affects remote prover requests used by configured relayer connections. Add the required documentation report before merging; no new code defects were found. Findings
SummaryAdds a configurable timeout for remote prover requests while keeping the existing 30-second default.
No new findings. Previous finding #1 remains open: the PR description still lacks the required documentation report. Reviews (4) · Last reviewed commit: "Merge branch 'main' into feat/prover-rem..." · Reviewed by Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1623 +/- ##
==========================================
+ Coverage 43.03% 43.22% +0.18%
==========================================
Files 145 145
Lines 15513 15615 +102
==========================================
+ Hits 6676 6749 +73
- Misses 8309 8333 +24
- Partials 528 533 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
dhfang
left a comment
There was a problem hiding this comment.
Hi @lakshay-zeeve, can you merge main and then align the default timeout with the latest changes? It's 30 seconds now
|
@dhfang Thanks for pointing this out. I’ve merged main and updated the default remote prover request timeout to 30 seconds |
|
@greptile review |
| type: "op-stack" | ||
| remoteProver: | ||
| url: prover.example.com:9090 | ||
| requestTimeout: 5m # per RPC; defaults to 30s |
There was a problem hiding this comment.
not needed for default config, let's revert it
| } | ||
|
|
||
| func newHTTPClient(tlsConfig *tls.Config) *http.Client { | ||
| func newHTTPClient(tlsConfig *tls.Config, requestTimeout time.Duration) *http.Client { |
There was a problem hiding this comment.
should have a fallback if timeout <= 0
There was a problem hiding this comment.
added a 30-second fallback
| client := timeoutProverClient{t: t} | ||
| prover := &Prover{client: client, chainID: "chain-a", clientID: "client-0", logger: slog.Default()} | ||
| ctx := context.Background() | ||
| for _, timeout := range []time.Duration{config.DefaultRemoteProverRequestTimeout, 5 * time.Minute} { |
There was a problem hiding this comment.
what does this code test? let's drop it
|
|
||
| _, err = prover.PacketProofs(ctx, 1, v2.ProofKindPacketCommitment, []channeltypesv2.Packet{{Sequence: 1}}, nil) | ||
| require.NoError(t, err) | ||
| func TestHTTPClientRequestTimeout(t *testing.T) { |
|
|
||
| func (p *Prover) LatestProvableHeight(ctx context.Context) (uint64, time.Time, error) { | ||
| ctx, cancel := context.WithTimeout(ctx, requestTimeout) | ||
| ctx, cancel := context.WithTimeout(ctx, p.requestTimeout) |
There was a problem hiding this comment.
Set http client.Timeout in newHTTPClient()
There was a problem hiding this comment.
done and removed ResponseHeaderTimeout from http.Client.Transport
|
@lakshay-zeeve thank you for this PR! The team left a few comments. |
| // todo: make it configurable in ibc.yaml | ||
| const ( | ||
| maxResponseBytes = 1 << 20 // 1MB | ||
| requestTimeout = 30 * time.Second |
There was a problem hiding this comment.
Why dont we just move the default back to here so we can consolidate the two requestTimeoutOrDefault functions that are mostly duplicates into this file
There was a problem hiding this comment.
yeah it makes sense, moved it back here.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
|
||
| func (p *Prover) LatestProvableHeight(ctx context.Context) (uint64, time.Time, error) { | ||
| ctx, cancel := context.WithTimeout(ctx, requestTimeout) | ||
| ctx, cancel := context.WithTimeout(ctx, p.requestTimeout) |
There was a problem hiding this comment.
We don't need that timeout as it's set in the client constructor
| ctx, cancel := context.WithTimeout(ctx, p.requestTimeout) |
There was a problem hiding this comment.
agreed, I have removed this now.
| # The constant names it: a package that moves costs nothing, and a constant | ||
| # that is renamed or deleted is a real change that says so by name. | ||
| DEFAULT_CONSTS = { | ||
| ("RemoteProverConfig", "requestTimeout"): [("", "DefaultRemoteProverRequestTimeout")], |
There was a problem hiding this comment.
Documentation report is missing. This PR updates the generated configuration reference, but its description has no documentation report. The repository requires the output of
python3 docs/scripts/refgen.py all --report in the PR description, including what was written by hand and which hand-written CLI pages were checked. Add that report before merging.
Context Used: docs/scripts/AGENTS.md (source)
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!
a596b9b to
d390ce4
Compare
Signed-off-by: Lakshay Gaur <lakshay.gaur@zeeve.io>
d390ce4 to
23bad56
Compare
Description
Remote prover requests currently have a hardcoded 1 minute timeout. Proof generation can take longer depending on the light client, proving workload, and service latency. Requests exceeding this limit fail even when the prover is operating normally.
A configurable timeout lets operators accommodate slower proof generation or enforce shorter deadlines without modifying the CLI source.
closes: #1621
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/) if anything is changed.godoccomments if relevant.Files changedin the GitHub PR explorer.Reference documentation
Derived from source: 89 regions across 3 pages.
requiredon the command tables is a floor. It is read by running each command, which stops at the first value it rejects, so a flag a command checks only after that is unread. A blank cell means not seen, not optional.Nothing to do: every table matches the source.
Written by hand, not derived
cli/internal/config/relayer.godocuments thatremoteProver.requestTimeoutlimits each remote prover RPC and must be positive when set.docs/scripts/refgen.pymaps the field toDefaultRemoteProverRequestTimeoutso the reference derives the default from Go.