Skip to content

Commit d7aa193

Browse files
marioevzfelix314159
authored andcommitted
fix: use proofs only instead of full cells
1 parent d58f486 commit d7aa193

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

src/ethereum_test_execution/blob_transaction.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test execution format to get blobs from the execution client."""
22

3+
from hashlib import sha256
34
from typing import ClassVar, Dict, List
45

56
from ethereum_test_base_types import Hash
@@ -26,7 +27,7 @@ def versioned_hashes_with_blobs_and_proofs(
2627
)
2728
elif isinstance(blob.proof, list):
2829
versioned_hashes[blob.versioned_hash] = BlobAndProofV2(
29-
blob=blob.data, proofs=blob.cells
30+
blob=blob.data, proofs=blob.proof
3031
)
3132
else:
3233
raise ValueError(
@@ -98,7 +99,31 @@ def execute(self, fork: Fork, eth_rpc: EthRPC, engine_rpc: EngineRPC | None):
9899
if expected_blob.blob != received_blob.blob:
99100
raise ValueError("Blob mismatch.")
100101
if expected_blob.proofs != received_blob.proofs:
101-
raise ValueError("Proofs mismatch.")
102+
error_message = "Proofs mismatch."
103+
error_message += f"len(expected_blob.proofs) = {len(expected_blob.proofs)}, "
104+
error_message += f"len(received_blob.proofs) = {len(received_blob.proofs)}\n"
105+
if len(expected_blob.proofs) == len(received_blob.proofs):
106+
index = 0
107+
108+
for expected_proof, received_proof in zip(
109+
expected_blob.proofs, received_blob.proofs, strict=False
110+
):
111+
if len(expected_proof) != len(received_proof):
112+
error_message += f"Proof length mismatch. index = {index},"
113+
error_message += f"expected_proof length = {len(expected_proof)}, "
114+
error_message += f"received_proof length = {len(received_proof)}\n"
115+
index += 1
116+
continue
117+
if expected_proof != received_proof:
118+
error_message += f"Proof mismatch. index = {index},"
119+
error_message += (
120+
f"expected_proof hash = {sha256(expected_proof).hexdigest()}, "
121+
)
122+
error_message += (
123+
f"received_proof hash = {sha256(received_proof).hexdigest()}\n"
124+
)
125+
index += 1
126+
raise ValueError(error_message)
102127
else:
103128
raise ValueError(f"Unexpected blob type: {type(expected_blob)}")
104129

src/ethereum_test_types/transaction_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,8 @@ def cell_proofs(self) -> Sequence[Sequence[Bytes]] | Sequence[Bytes] | None:
707707

708708
cells: list[list[Bytes]] = []
709709
for blob in self.blob_objects:
710-
assert isinstance(blob.cells, list)
711-
cells.append(blob.cells)
710+
assert isinstance(blob.proof, list)
711+
cells.append(blob.proof)
712712

713713
# if you remove below you instead get error: Invalid RLP. (which means getting what we have to work NWT that hold many blobs will be even more work) # noqa: E501
714714
if len(cells) == 1:

0 commit comments

Comments
 (0)