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

Anvil testing update stakes #60

Conversation

8sunyuan
Copy link
Collaborator

@8sunyuan 8sunyuan commented Nov 8, 2023

Performed some local testing by running the following commands. Note some contracts in M2_DeployTesting.s.sol are mocked for easier operator registration but none of the contracts called in updateStakesAllOperators are mocked for more accurate estimations.

Setup anvil node
anvil -f https://ethereum-goerli.publicnode.com --accounts 200
Run the testing script
forge script script/testing/M2_DeployTesting.s.sol:Deployer_M2 --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvv

With a setup of 10 total quorums, 10 strategies in quorum0, 1 strategy each in quorums1-9
200 operators registered in quorum0, 50 operators each in quorum1-9. Gas cost for updateStakesAllOperators is ~26million gas and results in the error (code: -32000, message: intrinsic gas too high, data: None)

Changing number of registered operators for quorums1-9 from 50 -> 30 changes the updateStakesAllOperators costs to ~19.7 million gas instead

Running updateStakesAllOperators results in `(code: -32000, message: intrinsic gas too high, data: None)`. Stack trace shows ~26million gas units for the function call
@8sunyuan 8sunyuan closed this Dec 4, 2023
@8sunyuan 8sunyuan deleted the test/anvil-testing-updateStakes branch December 4, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant