-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Cherry-pick: limits & gas for dependencies #12166
Conversation
f71050f
to
d61b6bf
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12166 +/- ##
=========================================
- Coverage 64.1% 63.9% -0.2%
=========================================
Files 798 799 +1
Lines 177110 177623 +513
=========================================
+ Hits 113534 113628 +94
- Misses 63576 63995 +419 ☔ 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.
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.
// the error semantics. | ||
if self.gas_feature_version >= 14 { | ||
// Charge old versions of the modules, in case of upgrades. | ||
session.check_dependencies_and_charge_gas_non_recursive_optional( |
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.
Yea can the logic here cause double charge?
To unblock for landing. Already addressed all issues raised
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
* [gas] add gas charges for dependencies * [gas] optimize dependency gas by avoid allocating new ModuleId * [gas] fix dependency gas for module publishing + minor gas profiler improvements * [loader] Test gas charging logic for transitive deps --------- Co-authored-by: Runtian Zhou <[email protected]>
@@ -200,6 +200,26 @@ crate::gas_schedule::macros::define_gas_parameters!( | |||
{ 7.. => "max_storage_fee" }, | |||
2_0000_0000, // 2 APT | |||
], | |||
[ | |||
dependency_per_module: InternalGas, | |||
{ 14.. => "dependency_per_module" }, |
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.
Is it intentional that we bumped the LATEST_GAS_VERSION to 15 but these are added to 14?
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.
Ah good catch. I forgot to change these. Will get them fixed
module_store: &ModuleStorageAdapter, | ||
data_store: &mut TransactionDataCache, | ||
gas_meter: &mut impl GasMeter, | ||
visited: &mut BTreeMap<(&'a AccountAddress, &'a IdentStr), ()>, |
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.
Why is this BTreeMap and not BTreeSet?
This introduces hard limits and gas metering for dependencies.