-
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
[aptosvm] charge more for keyless #13005
Conversation
add a 150x multiplier for intrinsic gas for keyless txns * Swap `min_transaction_gas_units` from `InternalGas` to `InternalGasPerByte` -- that has no underlying change but the semantic change allows for it to be multiplied * Add in a multiplier for all intrinsic gas charges which will be 1 by default * Set a gas schedule of 150 for keyless -- defaults to 150 since this is live on testnet already...
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.
Stamping, but I am no gas expert; so IDK if this is missing something 🙈
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.
added labels to see if performance will be impacted by the call to check if txns is keyless
from the cleanliness of the code, I would've preferred:
- if it wasn't a multiplier, but an addition. i.e. keyless transactions cost that much more, and we take current intrinsic cost and multiply by 149 to initialize it
- if charge_intrinsic_gas_for_transaction was receiving the context (i.e. a is_keyless: bool, or authenticator_type: AuthenticatorTypeForCharging, with AuthenticatorTypeForCharging being an enum with Normal and Keyless values), and have it access the value. That way we don't have multiple places doing get_or_vm_startup_failure and accessing keyless_multiplier.
but these are nits, and can be changed later as well, so given time, looks good to me as is as well, up to you if you want to apply any of those or not.
This reimplements the gas charging for keyless in a more proper way, decoupling the keyless charge from the exisitng intrinsic charge.
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.
looks good "approved", but can't approve my own PR :P
[ | ||
keyless_base_cost: InternalGas, | ||
{ 17.. => "keyless.base" }, | ||
414_000_000, |
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.
might have been cleaner to make this x*y, but still works
@@ -110,9 +110,14 @@ pub trait AptosGasMeter: MoveGasMeter { | |||
/// Charges an intrinsic cost for executing the transaction. | |||
/// | |||
/// The cost stays constant for transactions below a certain size, but will grow proportionally | |||
/// for bigger ones. | |||
/// for bigger ones. THe multiplier can be used to increase the unit cost for exceptional | |||
/// transactions like keyless. |
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.
Forgot to delete the extra comment here, but let's not bother with it right now as that'll trigger a rerun for all the tests
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.
update looks good.
@vgao1996 for gas calibration utilities, we should see whether to treat keyless gas charge as part of the intrinsic or not
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
✅ Forge suite
|
✅ Forge suite
|
Description
add a 150x multiplier for intrinsic gas for keyless txns
min_transaction_gas_units
fromInternalGas
toInternalGasPerByte
-- that has no underlying change but the semantic change allows for it to be multipliedType of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
No other impacts otherwise some goldens would have been modified.
Key Areas to Review
Checklist