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

Respect ratelimits args in create fork cheatcode #5885

Open
mattsse opened this issue Sep 23, 2023 · 2 comments
Open

Respect ratelimits args in create fork cheatcode #5885

mattsse opened this issue Sep 23, 2023 · 2 comments
Assignees
Labels
A-cheatcodes Area: cheatcodes good first issue Good for newcomers

Comments

@mattsse
Copy link
Member

mattsse commented Sep 23, 2023

/// Creates a new fork
///
/// This will establish a new `Provider` to the endpoint and return the Fork Backend
async fn create_fork(
mut fork: CreateFork,
retries: u32,
backoff: u64,
) -> eyre::Result<(CreatedFork, Handler)> {
let provider = Arc::new(
ProviderBuilder::new(fork.url.as_str())
.max_retry(retries)
.initial_backoff(backoff)
.compute_units_per_second(fork.evm_opts.get_compute_units_per_second())
.build()?,
);

let retries = self.retries;
let backoff = self.backoff;
// need to create a new fork
let task = Box::pin(create_fork(fork, retries, backoff));

and uses fixed values for some reason

retries: 8,
// 800ms
backoff: 800,

we definitely want support for this, I think the easiest way would be to use the values of the CreateFork argument instead here

fn create_fork(&mut self, fork: CreateFork, sender: CreateSender) {

via createfork.evm_opts.no_rpc_rate_limit

this would be an easy fix, do you want to take this @ChinW ?

converting this into an issue

Originally posted by @mattsse in #5810 (comment)

@mattsse mattsse added good first issue Good for newcomers A-cheatcodes Area: cheatcodes labels Sep 23, 2023
@Perelyn-sama
Copy link
Contributor

I'll handle this one

@gr4yha7
Copy link

gr4yha7 commented Oct 23, 2023

@mattsse i picked this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes good first issue Good for newcomers
Projects
No open projects
Status: Todo
Development

No branches or pull requests

3 participants