Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Use timeout for heavy rpc handler #963

Closed
yihuang opened this issue Mar 1, 2022 · 1 comment · Fixed by #979
Closed

Use timeout for heavy rpc handler #963

yihuang opened this issue Mar 1, 2022 · 1 comment · Fixed by #979

Comments

@yihuang
Copy link
Contributor

yihuang commented Mar 1, 2022

Proposal: Use timeout for heavy RPC handler

Current behavior:

Some rpc endpoints are heavy:

  • debug_traceTransaction
  • eth_call
  • eth_estimateGas
  • eth_getLogs
  • etc.

Right now, only eth_call is run under context.WithTimeout, better to implement a timeout mechanic for all heavy APIs, especially the trace transaction, which could cause a delay in node syncing.

Desired behavior: apply a timeout to all heavy endpoints.

Use case: more stable public rpc service.

Requests may be closed if we're not actively planning to work on them.

@yihuang
Copy link
Contributor Author

yihuang commented Mar 8, 2022

var DefaultHTTPTimeouts = HTTPTimeouts{
	ReadTimeout:  30 * time.Second,
	WriteTimeout: 30 * time.Second,
	IdleTimeout:  120 * time.Second,
}

These are the default timeout values for the HTTP server in go-ethereum.
I guess we should make it configurable for public rpc servers.

yihuang added a commit to yihuang/ethermint that referenced this issue Mar 8, 2022
fedekunze pushed a commit that referenced this issue Mar 9, 2022
* Add configurable timeouts to http server

Closes: #963

* add flags

* changelog

* fix toml
yihuang added a commit to yihuang/ethermint that referenced this issue Mar 24, 2022
* Add configurable timeouts to http server

Closes: evmos#963

* add flags

* changelog

* fix toml
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant