-
Notifications
You must be signed in to change notification settings - Fork 177
feat(tests): Add Mainnet "big-state" related tests (XEN-related attack scenarios) #2101
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
Draft
jochem-brouwer
wants to merge
12
commits into
main
Choose a base branch
from
xen-state
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3cf20b7
to
48039af
Compare
3 tasks
3 tasks
ea1822f
to
6a45a43
Compare
8 tasks
8acd12b
to
965908d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗒️ Description
This PR adds tests to test the very big in state XEN contract in various situations. To actually test this, ensure that your state backend reflects the big mainnet size, i.e. run this on top of a mainnet fork. This test uses address stubs as described in #2073
For this test, you need to provide:
--address-stubs '{"XEN_CONTRACT": "0x06450dEe7FD2Fb8E39061434BAbCFC05599a6Fb8", "MATH_CONTRACT": "0x4bBA9B6B49f3dFA6615f079E9d66B0AA68B04A4d"}'
to use the mainnet contracts for this.The initial test
claimRank(1)
and thenclaimMintReward()
. This is the first draft of this test, and we will expand this with more situations, such asclaimRank(1)
and thenclaimMintReward()
plusclaimRank(1)
again, or variants withclaimMintRewardAndShare(uint256,uint256)
orclaimMintRewardAndStake(uint256,uint256)
.NOTE: the test sets the timestamp automatically by moving it forward
3600*24
seconds.Will be merge ready once this is tested so we know if this works and if test cases are added.
TODOs:
🔗 Related Issues or PRs
N/A.
✅ Checklist
tox
checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
type(scope):
.mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_from
marker.