-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[move] Type builder & fix calculation of node count in types #13028
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13028 +/- ##
=========================================
+ Coverage 58.4% 58.6% +0.1%
=========================================
Files 823 823
Lines 197664 198412 +748
=========================================
+ Hits 115603 116369 +766
+ Misses 82061 82043 -18 ☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
As we discussed offline
- The core logic looks good
- Both the old and new checks need feature-gating
- Better make the limits configurable (can store those as part of the gas schedule, and then pass those values into the vm config)
- It sounds like a good idea to incorporate your type builder work into this, providing a context that can carry the configs
Are we going to bundle this change with type builder then? |
746ee1e
to
7cfc04f
Compare
cd62279
to
78d68ae
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
Previously the type size was calculated prior to performing the substitution. The calculation accounted for all nodes in non-substituted types and was not well-encapsulated. This PR adds node counting to
subst
function (in addition to depth) to make sure it is correctly accounted for as well.No performance regression is expected because the counter is used in existing type traversals. An alternative design to store count and depth with types have been considered, but is significantly more verbose and it is not clear if it is needed before new type representation is designed.
The second change introduced by this PR is a new
TypeBuilder
struct which should be the only instance which can construct types in a checked fashion (respecting maximum depth and count). All type creation methods have been moved there, including:Lastly, paranoid mode is made nicer (syntactically), making type explicit and ensuring their creation is gated.
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Replays:
Also, many unit tests gave been added for type creation and substitution.
Key Areas to Review
Checklist