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
According to the RSKIP240, CALLs with value transfer are priced with 9000 gas, but that's not the actual RSK implementation. If you execute a CALL opcode, it will require at first 700 gas (CALL), then if you're sending value, you'll need to charge an extra of 9000 gas (VT_CALL).
To be more precisely the actual gas cost for a CALL with value transfer it's given by:
CALL (with value > 0): CALL (700) + VT_CALL (9000) = 9700 gas
NOTE: I'm excluding the STIPEND_CALL (2300) gas cost
The text was updated successfully, but these errors were encountered:
Value-transferringCALLs cost 9000 gas. From this 9000, an amount 2300 gas is subtracted as a call stipend and passed to the receiving contract. The stipend is intended to cover the cost for logging the value transfer. If the receiving contract performs any BAL or SLOAD operations as part of logging, and if enough rent has accumulated in those accounts or storage cells, then some CALLs may fail.
Thanks for pointing out these mistakes. The 700 gas for CALL is an obvious miss and it directly affects the fixed costs. This will be updated in the next version. The fact that the 2300 gas for call_stipend is added on top of the 9700 (and not sourced from it) does not change the backwards compatibility issue. But it is a factual error and will be corrected.
According to the RSKIP240, CALLs with value transfer are priced with 9000 gas, but that's not the actual RSK implementation. If you execute a CALL opcode, it will require at first 700 gas (
CALL
), then if you're sending value, you'll need to charge an extra of 9000 gas (VT_CALL
).To be more precisely the actual gas cost for a CALL with value transfer it's given by:
NOTE: I'm excluding the
STIPEND_CALL (2300)
gas costThe text was updated successfully, but these errors were encountered: