diff --git a/src/ethereum/arrow_glacier/vm/gas.py b/src/ethereum/arrow_glacier/vm/gas.py index fea38b4b51..1fbd513336 100644 --- a/src/ethereum/arrow_glacier/vm/gas.py +++ b/src/ethereum/arrow_glacier/vm/gas.py @@ -81,18 +81,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -189,8 +190,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/arrow_glacier/vm/instructions/system.py b/src/ethereum/arrow_glacier/vm/instructions/system.py index 986b091c52..7e664e534e 100644 --- a/src/ethereum/arrow_glacier/vm/instructions/system.py +++ b/src/ethereum/arrow_glacier/vm/instructions/system.py @@ -360,11 +360,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -434,11 +434,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -551,7 +551,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -613,7 +613,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/berlin/vm/gas.py b/src/ethereum/berlin/vm/gas.py index ac8d482faa..9b1b161adb 100644 --- a/src/ethereum/berlin/vm/gas.py +++ b/src/ethereum/berlin/vm/gas.py @@ -82,18 +82,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -190,8 +191,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/berlin/vm/instructions/system.py b/src/ethereum/berlin/vm/instructions/system.py index 168f6ef7b7..ba2f78fc06 100644 --- a/src/ethereum/berlin/vm/instructions/system.py +++ b/src/ethereum/berlin/vm/instructions/system.py @@ -361,11 +361,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -435,11 +435,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -562,7 +562,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -624,7 +624,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/byzantium/vm/gas.py b/src/ethereum/byzantium/vm/gas.py index b1d71e5d34..6658ebbab9 100644 --- a/src/ethereum/byzantium/vm/gas.py +++ b/src/ethereum/byzantium/vm/gas.py @@ -81,18 +81,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -189,8 +190,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/byzantium/vm/instructions/system.py b/src/ethereum/byzantium/vm/instructions/system.py index 8bb0efd958..93ab4088a2 100644 --- a/src/ethereum/byzantium/vm/instructions/system.py +++ b/src/ethereum/byzantium/vm/instructions/system.py @@ -280,11 +280,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -347,11 +347,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -463,7 +463,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -518,7 +518,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/cancun/vm/gas.py b/src/ethereum/cancun/vm/gas.py index a47fc6e921..00dad03426 100644 --- a/src/ethereum/cancun/vm/gas.py +++ b/src/ethereum/cancun/vm/gas.py @@ -91,18 +91,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -199,8 +200,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/cancun/vm/instructions/system.py b/src/ethereum/cancun/vm/instructions/system.py index fa0e181775..7299cfa552 100644 --- a/src/ethereum/cancun/vm/instructions/system.py +++ b/src/ethereum/cancun/vm/instructions/system.py @@ -384,11 +384,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -458,11 +458,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -577,7 +577,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -639,7 +639,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/constantinople/vm/gas.py b/src/ethereum/constantinople/vm/gas.py index 55790d5975..0511701c68 100644 --- a/src/ethereum/constantinople/vm/gas.py +++ b/src/ethereum/constantinople/vm/gas.py @@ -82,18 +82,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -190,8 +191,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/constantinople/vm/instructions/system.py b/src/ethereum/constantinople/vm/instructions/system.py index 03d0d6168b..efaefa4bed 100644 --- a/src/ethereum/constantinople/vm/instructions/system.py +++ b/src/ethereum/constantinople/vm/instructions/system.py @@ -347,11 +347,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -414,11 +414,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -530,7 +530,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -585,7 +585,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/dao_fork/vm/gas.py b/src/ethereum/dao_fork/vm/gas.py index 4e0bf085ec..625fe599ad 100644 --- a/src/ethereum/dao_fork/vm/gas.py +++ b/src/ethereum/dao_fork/vm/gas.py @@ -80,18 +80,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: diff --git a/src/ethereum/dao_fork/vm/instructions/system.py b/src/ethereum/dao_fork/vm/instructions/system.py index 27e567302b..34e19e6c26 100644 --- a/src/ethereum/dao_fork/vm/instructions/system.py +++ b/src/ethereum/dao_fork/vm/instructions/system.py @@ -250,11 +250,11 @@ def call(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -310,11 +310,11 @@ def callcode(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, diff --git a/src/ethereum/frontier/vm/gas.py b/src/ethereum/frontier/vm/gas.py index 4e0bf085ec..625fe599ad 100644 --- a/src/ethereum/frontier/vm/gas.py +++ b/src/ethereum/frontier/vm/gas.py @@ -80,18 +80,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: diff --git a/src/ethereum/frontier/vm/instructions/system.py b/src/ethereum/frontier/vm/instructions/system.py index 80dd071370..110b2c7a87 100644 --- a/src/ethereum/frontier/vm/instructions/system.py +++ b/src/ethereum/frontier/vm/instructions/system.py @@ -246,11 +246,11 @@ def call(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -305,11 +305,11 @@ def callcode(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, diff --git a/src/ethereum/gray_glacier/vm/gas.py b/src/ethereum/gray_glacier/vm/gas.py index fea38b4b51..1fbd513336 100644 --- a/src/ethereum/gray_glacier/vm/gas.py +++ b/src/ethereum/gray_glacier/vm/gas.py @@ -81,18 +81,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -189,8 +190,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/gray_glacier/vm/instructions/system.py b/src/ethereum/gray_glacier/vm/instructions/system.py index 986b091c52..7e664e534e 100644 --- a/src/ethereum/gray_glacier/vm/instructions/system.py +++ b/src/ethereum/gray_glacier/vm/instructions/system.py @@ -360,11 +360,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -434,11 +434,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -551,7 +551,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -613,7 +613,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/homestead/vm/gas.py b/src/ethereum/homestead/vm/gas.py index 4e0bf085ec..625fe599ad 100644 --- a/src/ethereum/homestead/vm/gas.py +++ b/src/ethereum/homestead/vm/gas.py @@ -80,18 +80,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: diff --git a/src/ethereum/homestead/vm/instructions/system.py b/src/ethereum/homestead/vm/instructions/system.py index 27e567302b..34e19e6c26 100644 --- a/src/ethereum/homestead/vm/instructions/system.py +++ b/src/ethereum/homestead/vm/instructions/system.py @@ -250,11 +250,11 @@ def call(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -310,11 +310,11 @@ def callcode(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, diff --git a/src/ethereum/istanbul/vm/gas.py b/src/ethereum/istanbul/vm/gas.py index 1ad30a3d1f..2b9deb083d 100644 --- a/src/ethereum/istanbul/vm/gas.py +++ b/src/ethereum/istanbul/vm/gas.py @@ -84,18 +84,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -192,8 +193,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/istanbul/vm/instructions/system.py b/src/ethereum/istanbul/vm/instructions/system.py index 03d0d6168b..efaefa4bed 100644 --- a/src/ethereum/istanbul/vm/instructions/system.py +++ b/src/ethereum/istanbul/vm/instructions/system.py @@ -347,11 +347,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -414,11 +414,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -530,7 +530,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -585,7 +585,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/london/vm/gas.py b/src/ethereum/london/vm/gas.py index fea38b4b51..1fbd513336 100644 --- a/src/ethereum/london/vm/gas.py +++ b/src/ethereum/london/vm/gas.py @@ -81,18 +81,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -189,8 +190,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/london/vm/instructions/system.py b/src/ethereum/london/vm/instructions/system.py index 986b091c52..7e664e534e 100644 --- a/src/ethereum/london/vm/instructions/system.py +++ b/src/ethereum/london/vm/instructions/system.py @@ -360,11 +360,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -434,11 +434,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -551,7 +551,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -613,7 +613,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/muir_glacier/vm/gas.py b/src/ethereum/muir_glacier/vm/gas.py index 1ad30a3d1f..2b9deb083d 100644 --- a/src/ethereum/muir_glacier/vm/gas.py +++ b/src/ethereum/muir_glacier/vm/gas.py @@ -84,18 +84,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -192,8 +193,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/muir_glacier/vm/instructions/system.py b/src/ethereum/muir_glacier/vm/instructions/system.py index 03d0d6168b..efaefa4bed 100644 --- a/src/ethereum/muir_glacier/vm/instructions/system.py +++ b/src/ethereum/muir_glacier/vm/instructions/system.py @@ -347,11 +347,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -414,11 +414,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -530,7 +530,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -585,7 +585,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/paris/vm/gas.py b/src/ethereum/paris/vm/gas.py index fea38b4b51..1fbd513336 100644 --- a/src/ethereum/paris/vm/gas.py +++ b/src/ethereum/paris/vm/gas.py @@ -81,18 +81,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -189,8 +190,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/paris/vm/instructions/system.py b/src/ethereum/paris/vm/instructions/system.py index 986b091c52..7e664e534e 100644 --- a/src/ethereum/paris/vm/instructions/system.py +++ b/src/ethereum/paris/vm/instructions/system.py @@ -360,11 +360,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -434,11 +434,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -551,7 +551,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -613,7 +613,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/shanghai/vm/gas.py b/src/ethereum/shanghai/vm/gas.py index d8ac492728..45198cd051 100644 --- a/src/ethereum/shanghai/vm/gas.py +++ b/src/ethereum/shanghai/vm/gas.py @@ -82,18 +82,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -190,8 +191,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/shanghai/vm/instructions/system.py b/src/ethereum/shanghai/vm/instructions/system.py index ea7463104d..49ac7a6cf3 100644 --- a/src/ethereum/shanghai/vm/instructions/system.py +++ b/src/ethereum/shanghai/vm/instructions/system.py @@ -383,11 +383,11 @@ def call(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -457,11 +457,11 @@ def callcode(evm: Evm) -> None: if sender_balance < value: push(evm.stack, U256(0)) evm.return_data = b"" - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -574,7 +574,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, @@ -636,7 +636,7 @@ def staticcall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, U256(0), evm.message.current_target, to, diff --git a/src/ethereum/spurious_dragon/vm/gas.py b/src/ethereum/spurious_dragon/vm/gas.py index d5f8c04caa..77b0ff7f84 100644 --- a/src/ethereum/spurious_dragon/vm/gas.py +++ b/src/ethereum/spurious_dragon/vm/gas.py @@ -80,18 +80,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -188,8 +189,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/spurious_dragon/vm/instructions/system.py b/src/ethereum/spurious_dragon/vm/instructions/system.py index c80d0af986..32f611b104 100644 --- a/src/ethereum/spurious_dragon/vm/instructions/system.py +++ b/src/ethereum/spurious_dragon/vm/instructions/system.py @@ -267,11 +267,11 @@ def call(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -332,11 +332,11 @@ def callcode(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -446,7 +446,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target, diff --git a/src/ethereum/tangerine_whistle/vm/gas.py b/src/ethereum/tangerine_whistle/vm/gas.py index 60779cf74f..9891d46a3f 100644 --- a/src/ethereum/tangerine_whistle/vm/gas.py +++ b/src/ethereum/tangerine_whistle/vm/gas.py @@ -80,18 +80,19 @@ class ExtendMemory: @dataclass class MessageCallGas: """ - Define the gas cost and stipend for executing the call opcodes. + Define the gas cost and gas given to the sub-call for + executing the call opcodes. `cost`: `ethereum.base_types.Uint` - The non-refundable portion of gas reserved for executing the - call opcode. - `stipend`: `ethereum.base_types.Uint` + The gas required to execute the call opcode, excludes + memory expansion costs. + `sub_call`: `ethereum.base_types.Uint` The portion of gas available to sub-calls that is refundable - if not consumed + if not consumed. """ cost: Uint - stipend: Uint + sub_call: Uint def charge_gas(evm: Evm, amount: Uint) -> None: @@ -188,8 +189,8 @@ def calculate_message_call_gas( call_stipend: Uint = GAS_CALL_STIPEND, ) -> MessageCallGas: """ - Calculates the MessageCallGas (cost and stipend) for - executing call Opcodes. + Calculates the MessageCallGas (cost and gas made available to the sub-call) + for executing call Opcodes. Parameters ---------- diff --git a/src/ethereum/tangerine_whistle/vm/instructions/system.py b/src/ethereum/tangerine_whistle/vm/instructions/system.py index 2643aba00e..932e60d856 100644 --- a/src/ethereum/tangerine_whistle/vm/instructions/system.py +++ b/src/ethereum/tangerine_whistle/vm/instructions/system.py @@ -263,11 +263,11 @@ def call(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -328,11 +328,11 @@ def callcode(evm: Evm) -> None: ).balance if sender_balance < value: push(evm.stack, U256(0)) - evm.gas_left += message_call_gas.stipend + evm.gas_left += message_call_gas.sub_call else: generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, value, evm.message.current_target, to, @@ -435,7 +435,7 @@ def delegatecall(evm: Evm) -> None: evm.memory += b"\x00" * extend_memory.expand_by generic_call( evm, - message_call_gas.stipend, + message_call_gas.sub_call, evm.message.value, evm.message.caller, evm.message.current_target,