-
Notifications
You must be signed in to change notification settings - Fork 475
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
Improve precompile counting test #2742
base: master
Are you sure you want to change the base?
Conversation
PlasmaPower
commented
Oct 17, 2024
- Adding a new precompile can cause a divergence, even if it doesn't have any methods. Therefore, this PR keeps track of the number of methods + the number of precompiles added in every ArbOS version.
- Debug precompiles' methods aren't visible for production chains, so they should be ignored for this test. It should be fine to retroactively add new methods to them (though adding new debug precompiles altogether would still cause a divergence I think).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
for _, method := range precompile.Precompile().methods { | ||
version := arbmath.MaxInt(method.arbosVersion, precompile.Precompile().arbosVersion) | ||
innerPrecompile := precompile.Precompile() | ||
newMethodsPerArbosVersion[innerPrecompile.arbosVersion]++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment explaining it and/or rename newMethodsper.. to newEntriesPer..
5: 3, | ||
10: 2, | ||
11: 4, | ||
20: 8, | ||
30: 38, | ||
30: 39, | ||
31: 1, | ||
} | ||
|
||
precompiles := Precompiles() | ||
newMethodsPerArbosVersion := make(map[uint64]int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newMethodsPerArbosVersion := make(map[uint64]int) | |
// Number of precompile methods per ArbOS version | |
newMethodsPerArbosVersion := make(map[uint64]int) |