You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the modification made to the BuiltinActor trait (#4345), the new max_gas() function - a counterpart of the "weight()" function for pallets extrinsics, does not accept any arguments, so it can only report a single maximum gas needed for any message processing, regardless of the concrete payload.
This can backfire in cases when a builtin actor has very different execution paths depending on the payload, when we would have to prohibit actual light and fast handle based on a mere possibility it could have been a heavy and slow one.
To account for this we might want to let max_gas take some complexity arguments; it could be a "complexity" argument (similarly to what we have for extrinsics' weight functions) or some small fraction of the payload (the first byte or something) that would provide a clue about the actual execution path inside the handle etc.
That we can have more accurate estimation of the expected gas budged based on the actual message payload.
The text was updated successfully, but these errors were encountered:
ekovalev
changed the title
Let the max_gas() function in BuiltinActor's take complexity argument(s)
Let the max_gas() function in BuiltinActor's take argument(s)
Dec 25, 2024
In the modification made to the
BuiltinActor
trait (#4345), the newmax_gas()
function - a counterpart of the "weight()" function for pallets extrinsics, does not accept any arguments, so it can only report a single maximum gas needed for any message processing, regardless of the concrete payload.This can backfire in cases when a builtin actor has very different execution paths depending on the payload, when we would have to prohibit actual light and fast
handle
based on a mere possibility it could have been a heavy and slow one.To account for this we might want to let
max_gas
take some complexity arguments; it could be a "complexity" argument (similarly to what we have for extrinsics' weight functions) or some small fraction of the payload (the first byte or something) that would provide a clue about the actual execution path inside thehandle
etc.That we can have more accurate estimation of the expected gas budged based on the actual message payload.
The text was updated successfully, but these errors were encountered: