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: weight invariant selectors by number of selectors, not number of contracts. #2986

Closed
mds1 opened this issue Aug 28, 2022 · 0 comments · Fixed by #8176
Closed

feat: weight invariant selectors by number of selectors, not number of contracts. #2986

mds1 opened this issue Aug 28, 2022 · 0 comments · Fixed by #8176
Labels
A-testing Area: testing C-forge Command: forge T-feature Type: feature

Comments

@mds1
Copy link
Collaborator

mds1 commented Aug 28, 2022

Component

Forge

Describe the feature you would like

Let's say right now my invariant test is setup with two contracts:

  • Contract A has 1 function selector, fn0.
  • Contract B has 20 function selectors, fn1 through fn20.

As I understand it, right now the process is:

  1. First Contract A or Contract B will be chosen randomly
  2. Then we look at the available selectors for each and randomly choose one.

This means fn0 will be chosen ~50% of the time, and fn1 through fn20 are each only chosen 50 / 20 = 2.5% of the time. Ideally, each of the 21 functions would be chosen 100 / 21 = ~4.76% of the time

Additional context

No response

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

Successfully merging a pull request may close this issue.

2 participants