Skip to content

Increase api-server HTTP timeouts for devnet (hosted Canton) #277

@sadiq1971

Description

@sadiq1971

Problem

On the deployed devnet, registration and transfer requests time out at the client (~15s) but the underlying Canton operation eventually succeeds — balances update on refresh. Local docker is unaffected because everything is sub-100ms there.

Root cause

http.Server.WriteTimeout = 15s (from `server.write_timeout`) is the outermost deadline applied at the TCP socket — fires before the handler can finish a Canton-backed operation on a WAN-hosted node:

  • Configured at `pkg/app/http/server.go:40` ← `pkg/app/http/config.go:10` (default `15s`)
  • Devnet/mainnet yamls leave it at 15s:
    • `pkg/config/defaults/config.api-server.local-devnet.yaml:6`
    • `pkg/config/defaults/config.api-server.mainnet.yaml:5`

The larger inner timeouts never get a chance to apply:

  • chi `middleware.Timeout(60s)` at `pkg/app/api/server.go:344`
  • chi `middleware.Timeout(30s)` for `/eth` at `pkg/ethrpc/service/http.go:35` (from `eth_rpc.request_timeout`)

Slow paths on hosted Canton:

  • `POST /register` → `AllocateExternalPartyWithSignature` (topology submit + propagation) + `CreateFingerprintMapping` (SubmitAndWait) + RDS write
  • `eth_sendRawTransaction` → registry HTTP (USDCx) + `PrepareSubmission` + `ExecuteSubmission` (SubmitAndWait)

Both routinely exceed 15s when Canton is remote.

Fix

Raise `server.write_timeout` (and align `server.read_timeout` / chi timeout) in devnet + mainnet configs to a value that covers realistic Canton latency (suggest 60s). Verify ordering: `http.Server.WriteTimeout` ≥ `chi.middleware.Timeout` ≥ `eth_rpc.request_timeout` so the inner deadlines actually have effect.

Acceptance

  • Devnet registration and USDCx transfer complete without client-side timeout under normal Canton latency
  • Timeout layering documented in `pkg/app/http/config.go`

Note

This is a stopgap. The architectural fix for `eth_sendRawTransaction` is tracked separately (async submission via the existing mempool/miner infrastructure).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: P1Added to issues and PRs relating to a high severity bugs.Type: BugAdded to issues and PRs if they are addressing a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions