Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cast): add --timeout option #9044

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

PanGan21
Copy link
Contributor

@PanGan21 PanGan21 commented Oct 6, 2024

Motivation

Context: #8959

Solution

The following pr adds --timeout option to cast command overriding the default rpc timeout.

@PanGan21 PanGan21 marked this pull request as draft October 6, 2024 08:37
@PanGan21 PanGan21 marked this pull request as ready for review October 6, 2024 10:08
@PanGan21 PanGan21 changed the title feat(cast): add timeout flag that overrides default rpc timeout feat(cast): add --timeout option Oct 6, 2024
/// The timeout will be used to override the default timeout for RPC.
/// Default value is 45s
#[arg(long, env = "ETH_RPC_TIMEOUT")]
pub timeout: Option<u64>,
Copy link
Member

Choose a reason for hiding this comment

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

I think we should add this to Config and RpcOpts, so that it's always available in get_provider across the codebase

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried this as first option in previous commit and it was conflicting with --timeout for other commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it would be possible but the flag should be named differently

Copy link
Member

@DaniPopes DaniPopes Oct 7, 2024

Choose a reason for hiding this comment

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

The other commands should also use the config's and RpcOpts timeout then

Copy link
Contributor Author

@PanGan21 PanGan21 Oct 7, 2024

Choose a reason for hiding this comment

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

They map thought to a different Config property. (example Config::transaction_timeout)

Here is an example of failing tests when timeout was in RpcOpts:
https://github.com/foundry-rs/foundry/actions/runs/11200334838/job/31133848891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants