Skip to content

feat(relayer): add remote prover timeout config support - #1623

Open
lakshay-zeeve wants to merge 1 commit into
lfdt-ibc:mainfrom
lakshay-zeeve:feat/prover-remote-timeout
Open

lakshay-zeeve wants to merge 1 commit into
lfdt-ibc:mainfrom
lakshay-zeeve:feat/prover-remote-timeout

Conversation

@lakshay-zeeve

@lakshay-zeeve lakshay-zeeve commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Include changelog entry when appropriate (e.g. chores should be omitted from changelog).
  • Wrote unit and e2e tests if relevant.
  • Updated documentation (docs/) if anything is changed.
  • Added godoc comments if relevant.
  • Self-reviewed Files changed in the GitHub PR explorer.
  • Provide a conventional commit message to follow the repository standards.

Reference documentation

Derived from source: 89 regions across 3 pages.

  • required on 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.go documents that remoteProver.requestTimeout limits each remote prover RPC and must be positive when set.
  • docs/scripts/refgen.py maps the field to DefaultRemoteProverRequestTimeout so the reference derives the default from Go.
  • Reviewed the IBC CLI overview, Deploy IBC and send a token tutorial, Run a standalone attestor guide, Run a standalone relayer guide, and Plan a production deployment guide. Their prose, config examples, and command output needed no edits for this optional setting. The standalone guides use the remote attestor service, and the tutorial's packet timeout is a separate setting.

@lakshay-zeeve
lakshay-zeeve requested a review from a team as a code owner October 28, 2026 19:53
@lakshay-zeeve
lakshay-zeeve force-pushed the feat/prover-remote-timeout branch from f4ee903 to 7c8c929 Compare October 28, 2026 20:12
@dianab-cl

Copy link
Copy Markdown
Contributor

@greptile review

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Documentation report is missing. ▶

Summary

Adds a configurable timeout for remote prover requests while keeping the existing 30-second default.

  • Remote prover calls use a timeout set for each connection.

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-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.22%. Comparing base (ddffecc) to head (7c8c929).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
cli/internal/relay/prover/remote/remote.go 27.27% 8 Missing ⚠️
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     
Flag Coverage Δ
cli 43.22% <60.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lakshay-zeeve lakshay-zeeve changed the title add remote prover timeout config support feat(relayer): add remote prover timeout config support Nov 5, 2026
@mintlify

mintlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 23bad56.

Approve preview

@dhfang dhfang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lakshay-zeeve, can you merge main and then align the default timeout with the latest changes? It's 30 seconds now

@lakshay-zeeve
lakshay-zeeve requested a review from a team as a code owner November 13, 2026 09:42
@lakshay-zeeve

Copy link
Copy Markdown
Contributor Author

@dhfang Thanks for pointing this out. I’ve merged main and updated the default remote prover request timeout to 30 seconds

@dianab-cl

Copy link
Copy Markdown
Contributor

@greptile review

Comment thread cli/internal/config/ibc.yml Outdated
type: "op-stack"
remoteProver:
url: prover.example.com:9090
requestTimeout: 5m # per RPC; defaults to 30s

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed for default config, let's revert it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

}

func newHTTPClient(tlsConfig *tls.Config) *http.Client {
func newHTTPClient(tlsConfig *tls.Config, requestTimeout time.Duration) *http.Client {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have a fallback if timeout <= 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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} {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this code test? let's drop it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


_, err = prover.PacketProofs(ctx, 1, v2.ProofKindPacketCommitment, []channeltypesv2.Packet{{Sequence: 1}}, nil)
require.NoError(t, err)
func TestHTTPClientRequestTimeout(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


func (p *Prover) LatestProvableHeight(ctx context.Context) (uint64, time.Time, error) {
ctx, cancel := context.WithTimeout(ctx, requestTimeout)
ctx, cancel := context.WithTimeout(ctx, p.requestTimeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set http client.Timeout in newHTTPClient()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done and removed ResponseHeaderTimeout from http.Client.Transport

@evanorti

Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it makes sense, moved it back here.

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need that timeout as it's set in the client constructor

Suggested change
ctx, cancel := context.WithTimeout(ctx, p.requestTimeout)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, I have removed this now.

Comment thread docs/scripts/refgen.py Outdated
# 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")],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@lakshay-zeeve
lakshay-zeeve force-pushed the feat/prover-remote-timeout branch 2 times, most recently from a596b9b to d390ce4 Compare November 25, 2026 07:57
Signed-off-by: Lakshay Gaur <lakshay.gaur@zeeve.io>
@lakshay-zeeve
lakshay-zeeve force-pushed the feat/prover-remote-timeout branch from d390ce4 to 23bad56 Compare November 25, 2026 07:59

This branch has not been deployed

No deployments
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.

Remote Prover timeout configuration

6 participants