File tree Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Expand file tree Collapse file tree 4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -921,6 +921,7 @@ def process_transaction(
921
921
blob_versioned_hashes = blob_versioned_hashes ,
922
922
authorizations = authorizations ,
923
923
index_in_block = index ,
924
+ transactions_root = root (block_output .transactions_trie ),
924
925
tx_hash = get_transaction_hash (encode_transaction (tx )),
925
926
traces = [],
926
927
)
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ class TransactionEnvironment:
107
107
blob_versioned_hashes : Tuple [VersionedHash , ...]
108
108
authorizations : Tuple [Authorization , ...]
109
109
index_in_block : Optional [Uint ]
110
+ transactions_root : Hash32
110
111
tx_hash : Optional [Hash32 ]
111
112
traces : List [dict ]
112
113
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ class Ops(enum.Enum):
100
100
BASEFEE = 0x48
101
101
BLOBHASH = 0x49
102
102
BLOBBASEFEE = 0x4A
103
+ TXROOT = 0x4B
103
104
104
105
# Control Flow Ops
105
106
STOP = 0x00
@@ -252,6 +253,7 @@ class Ops(enum.Enum):
252
253
Ops .PREVRANDAO : block_instructions .prev_randao ,
253
254
Ops .GASLIMIT : block_instructions .gas_limit ,
254
255
Ops .CHAINID : block_instructions .chain_id ,
256
+ Ops .TXROOT : block_instructions .tx_root ,
255
257
Ops .MLOAD : memory_instructions .mload ,
256
258
Ops .MSTORE : memory_instructions .mstore ,
257
259
Ops .MSTORE8 : memory_instructions .mstore8 ,
Original file line number Diff line number Diff line change @@ -253,3 +253,32 @@ def chain_id(evm: Evm) -> None:
253
253
254
254
# PROGRAM COUNTER
255
255
evm .pc += Uint (1 )
256
+
257
+
258
+ def tx_root (evm : Evm ) -> None :
259
+ """
260
+ Push the incremental transactions root of this block onto the stack.
261
+
262
+ Parameters
263
+ ----------
264
+ evm :
265
+ The current EVM frame.
266
+
267
+ Raises
268
+ ------
269
+ :py:class:`~ethereum.osaka.vm.exceptions.StackOverflowError`
270
+ If `len(stack)` is equal to `1024`.
271
+ :py:class:`~ethereum.osaka.vm.exceptions.OutOfGasError`
272
+ If `evm.gas_left` is less than `2`.
273
+ """
274
+ # STACK
275
+ pass
276
+
277
+ # GAS
278
+ charge_gas (evm , GAS_BASE )
279
+
280
+ # OPERATION
281
+ push (evm .stack , U256 .from_be_bytes (evm .message .tx_env .transactions_root ))
282
+
283
+ # PROGRAM COUNTER
284
+ evm .pc += Uint (1 )
You can’t perform that action at this time.
0 commit comments