Skip to content

Commit 9ec8101

Browse files
committed
backport to older forks
1 parent 2c893be commit 9ec8101

File tree

32 files changed

+112
-16
lines changed

32 files changed

+112
-16
lines changed

src/ethereum/arrow_glacier/fork.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,12 @@ def process_transaction(
793793
tx, tx_output.error, block_output.block_gas_used, tx_output.logs
794794
)
795795

796+
receipt_key = rlp.encode(Uint(index))
797+
block_output.receipt_keys += (receipt_key,)
798+
796799
trie_set(
797800
block_output.receipts_trie,
798-
rlp.encode(Uint(index)),
801+
receipt_key,
799802
receipt,
800803
)
801804

src/ethereum/arrow_glacier/vm/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class BlockOutput:
6262
Trie of all the transactions in the block.
6363
receipts_trie : `ethereum.fork_types.Root`
6464
Trie root of all the receipts in the block.
65+
receipt_keys :
66+
Key of all the receipts in the block.
6567
block_logs : `Bloom`
6668
Logs bloom of all the logs included in all the transactions of the
6769
block.
@@ -74,6 +76,7 @@ class BlockOutput:
7476
receipts_trie: Trie[Bytes, Optional[Union[Bytes, Receipt]]] = field(
7577
default_factory=lambda: Trie(secured=False, default=None)
7678
)
79+
receipt_keys: Tuple[Bytes, ...] = field(default_factory=tuple)
7780
block_logs: Tuple[Log, ...] = field(default_factory=tuple)
7881

7982

src/ethereum/berlin/fork.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,12 @@ def process_transaction(
692692
tx, tx_output.error, block_output.block_gas_used, tx_output.logs
693693
)
694694

695+
receipt_key = rlp.encode(Uint(index))
696+
block_output.receipt_keys += (receipt_key,)
697+
695698
trie_set(
696699
block_output.receipts_trie,
697-
rlp.encode(Uint(index)),
700+
receipt_key,
698701
receipt,
699702
)
700703

src/ethereum/berlin/vm/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class BlockOutput:
6161
Trie of all the transactions in the block.
6262
receipts_trie : `ethereum.fork_types.Root`
6363
Trie root of all the receipts in the block.
64+
receipt_keys :
65+
Key of all the receipts in the block.
6466
block_logs : `Bloom`
6567
Logs bloom of all the logs included in all the transactions of the
6668
block.
@@ -73,6 +75,7 @@ class BlockOutput:
7375
receipts_trie: Trie[Bytes, Optional[Union[Bytes, Receipt]]] = field(
7476
default_factory=lambda: Trie(secured=False, default=None)
7577
)
78+
receipt_keys: Tuple[Bytes, ...] = field(default_factory=tuple)
7679
block_logs: Tuple[Log, ...] = field(default_factory=tuple)
7780

7881

src/ethereum/byzantium/fork.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,12 @@ def process_transaction(
669669
tx_output.error, block_output.block_gas_used, tx_output.logs
670670
)
671671

672+
receipt_key = rlp.encode(Uint(index))
673+
block_output.receipt_keys += (receipt_key,)
674+
672675
trie_set(
673676
block_output.receipts_trie,
674-
rlp.encode(Uint(index)),
677+
receipt_key,
675678
receipt,
676679
)
677680

src/ethereum/byzantium/vm/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class BlockOutput:
6161
Trie of all the transactions in the block.
6262
receipts_trie : `ethereum.fork_types.Root`
6363
Trie root of all the receipts in the block.
64+
receipt_keys :
65+
Key of all the receipts in the block.
6466
block_logs : `Bloom`
6567
Logs bloom of all the logs included in all the transactions of the
6668
block.
@@ -73,6 +75,7 @@ class BlockOutput:
7375
receipts_trie: Trie[Bytes, Optional[Receipt]] = field(
7476
default_factory=lambda: Trie(secured=False, default=None)
7577
)
78+
receipt_keys: Tuple[Bytes, ...] = field(default_factory=tuple)
7679
block_logs: Tuple[Log, ...] = field(default_factory=tuple)
7780

7881

src/ethereum/cancun/fork.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,12 @@ def process_transaction(
731731
tx, tx_output.error, block_output.block_gas_used, tx_output.logs
732732
)
733733

734+
receipt_key = rlp.encode(Uint(index))
735+
block_output.receipt_keys += (receipt_key,)
736+
734737
trie_set(
735738
block_output.receipts_trie,
736-
rlp.encode(Uint(index)),
739+
receipt_key,
737740
receipt,
738741
)
739742

src/ethereum/cancun/vm/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class BlockOutput:
6464
Trie of all the transactions in the block.
6565
receipts_trie : `ethereum.fork_types.Root`
6666
Trie root of all the receipts in the block.
67+
receipt_keys :
68+
Key of all the receipts in the block.
6769
block_logs : `Bloom`
6870
Logs bloom of all the logs included in all the transactions of the
6971
block.
@@ -80,6 +82,7 @@ class BlockOutput:
8082
receipts_trie: Trie[Bytes, Optional[Union[Bytes, Receipt]]] = field(
8183
default_factory=lambda: Trie(secured=False, default=None)
8284
)
85+
receipt_keys: Tuple[Bytes, ...] = field(default_factory=tuple)
8386
block_logs: Tuple[Log, ...] = field(default_factory=tuple)
8487
withdrawals_trie: Trie[Bytes, Optional[Union[Bytes, Withdrawal]]] = field(
8588
default_factory=lambda: Trie(secured=False, default=None)

src/ethereum/constantinople/fork.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,12 @@ def process_transaction(
669669
tx_output.error, block_output.block_gas_used, tx_output.logs
670670
)
671671

672+
receipt_key = rlp.encode(Uint(index))
673+
block_output.receipt_keys += (receipt_key,)
674+
672675
trie_set(
673676
block_output.receipts_trie,
674-
rlp.encode(Uint(index)),
677+
receipt_key,
675678
receipt,
676679
)
677680

src/ethereum/constantinople/vm/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class BlockOutput:
6161
Trie of all the transactions in the block.
6262
receipts_trie : `ethereum.fork_types.Root`
6363
Trie root of all the receipts in the block.
64+
receipt_keys :
65+
Key of all the receipts in the block.
6466
block_logs : `Bloom`
6567
Logs bloom of all the logs included in all the transactions of the
6668
block.
@@ -73,6 +75,7 @@ class BlockOutput:
7375
receipts_trie: Trie[Bytes, Optional[Receipt]] = field(
7476
default_factory=lambda: Trie(secured=False, default=None)
7577
)
78+
receipt_keys: Tuple[Bytes, ...] = field(default_factory=tuple)
7679
block_logs: Tuple[Log, ...] = field(default_factory=tuple)
7780

7881

0 commit comments

Comments
 (0)