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

Support rotating API keys for fork tests #1643

Closed
2 tasks done
jpopesculian opened this issue May 17, 2022 · 4 comments · Fixed by #1693
Closed
2 tasks done

Support rotating API keys for fork tests #1643

jpopesculian opened this issue May 17, 2022 · 4 comments · Fixed by #1693
Assignees
Labels
C-forge Command: forge Cmd-forge-test Command: forge test T-feature Type: feature

Comments

@jpopesculian
Copy link
Contributor

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

master 23dc073

What command(s) is the bug in?

cargo test --locked --workspace --all-features --lib --bins

Operating System

Linux

Describe the bug

fork tests seem to be failing on the CI but work locally https://github.com/foundry-rs/foundry/runs/6468348691?check_suite_focus=true

@jpopesculian jpopesculian added the T-bug Type: bug label May 17, 2022
@onbjerg onbjerg added this to Foundry May 17, 2022
@onbjerg onbjerg moved this to Todo in Foundry May 17, 2022
@mattsse
Copy link
Member

mattsse commented May 17, 2022

(code: 429, message: Your app has exceeded its compute units per second capacity. If you have retries enabled, you can safely ignore this message. If not, check out https://docs.alchemyapi.io/guides/rate-limits, data: None)'

got rate-limited by alchemy, let's turn this issue into a feature request to rotate API keys similar to ethers gakonst/ethers-rs#1017

@mattsse mattsse changed the title Fork tests seem to fail on the CI but work locally Support rotating API keys for fork tests May 17, 2022
@mattsse mattsse added the T-feature Type: feature label May 17, 2022
@onbjerg onbjerg added Cmd-forge-test Command: forge test C-forge Command: forge and removed T-bug Type: bug labels May 19, 2022
@onbjerg onbjerg moved this from Todo to In Progress in Foundry May 23, 2022
Repository owner moved this from In Progress to Done in Foundry May 24, 2022
@webthethird
Copy link

@mattsse Any chance you could explain how one would use this feature when using forge test?

@mattsse
Copy link
Member

mattsse commented Nov 28, 2022

this issue was about how we rotate keys internally in foundry not in solidity, but this is implemented via a counter + modulo of the number of keys you have:

like:

let keys = [...];
let mut counter = 0;
fn next_key() {
   let key = keys[counter % keys.len()];
   counter += 1;
   return key;
}

@webthethird
Copy link

Got it. I could probably hack together something similar though to use in my forge tests. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-test Command: forge test T-feature Type: feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants