Skip to content

Commit e3fc73d

Browse files
committed
wip
1 parent 9518c05 commit e3fc73d

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

src/ethereum_test_types/transaction_types.py

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@
3333
TestPrivateKey,
3434
)
3535
from ethereum_test_exceptions import TransactionException
36+
from pytest_plugins.logging import get_logger
3637

3738
from .account_types import EOA
3839
from .blob_types import Blob
3940
from .receipt_types import TransactionReceipt
4041
from .utils import int_to_bytes, keccak256
4142

43+
logger = get_logger(__name__)
44+
4245

4346
class TransactionType(IntEnum):
4447
"""Transaction types."""
@@ -719,13 +722,13 @@ def get_rlp_fields(self) -> List[str]:
719722
if self.wrapper_version is not None:
720723
wrapper = ["wrapper_version"]
721724

722-
proofs: list[str] = []
723-
if len(proofs) > 0:
724-
proofs = ["proofs"]
725+
rlp_proofs: list[str] = []
726+
if self.proofs is not None:
727+
rlp_proofs = ["proofs"]
725728

726-
cell_proofs: list[str] = []
727-
if len(cell_proofs) > 0:
728-
cell_proofs = ["cell_proofs"]
729+
rlp_cell_proofs: list[str] = []
730+
if self.cell_proofs is not None:
731+
rlp_cell_proofs = ["cell_proofs"]
729732

730733
# GETH FUSAKA_DEVNET_0 EXPECTS:
731734
# type blobTxWithBlobs struct {
@@ -743,18 +746,33 @@ def get_rlp_fields(self) -> List[str]:
743746
# Proofs []kzg4844.Proof
744747
# }
745748

746-
return [ # structure explained in https://eips.ethereum.org/EIPS/eip-7594#Networking
749+
rlp_fields: List[
750+
str
751+
] = [ # structure explained in https://eips.ethereum.org/EIPS/eip-7594#Networking
747752
"tx", # tx_payload_body, in geth: BlobTx, https://github.com/ethereum/go-ethereum/blob/e17f97a8242c55b6fba66317d3720b9728a12f78/core/types/tx_blob.go#L122
748753
*wrapper, # wrapper_version, which is always 1 for osaka (was non-existing before), in geth: Version # noqa: E501
749754
"blobs", # Blob.data, in geth: Blobs
750755
"commitments", # in geth: Commitments
751-
*proofs, # only included < osaka, in geth: Proofs
752-
*cell_proofs, # only included >=osaka, in geth this does not exist(always uses Proofs)
756+
*rlp_proofs, # only included < osaka, in geth: Proofs
757+
*rlp_cell_proofs, # only included >=osaka, in geth this does not exist(always uses Proofs)
753758
]
754759

755-
# PROBLEM:
760+
assert ("proofs" in rlp_fields) or ("cell_proofs" in rlp_fields), (
761+
"Neither proofs nor cell_proofs are in rlp_fields. Critical error!"
762+
)
763+
764+
logger.warning(f"Ended up with this rlp field list: {rlp_fields}")
765+
# print("with this")
766+
767+
return rlp_fields
768+
769+
# GETH PROBLEM:
756770
# osaka without wrapper: too few elements for types.blobTxWithBlobs
757-
# osaka with rapper: it tries to deserialize into blobTxWithBlobs instead of versionedBlobTxWithBlobs, so it complains about unexpectedtly seeing wrapper instead of blob data # noqa: E501
771+
# osaka with wrapper: it tries to deserialize into blobTxWithBlobs instead of versionedBlobTxWithBlobs, so it complains about unexpectedly seeing wrapper instead of blob data # noqa: E501
772+
773+
# NETHERMIND PROBLEM:
774+
# osaka without wrapper: code=-32602, message=Specified argument was out of the range of valid values.
775+
# osaka with wrapper: code=-32602, message=Specified argument was out of the range of valid values
758776

759777
def get_rlp_prefix(self) -> bytes:
760778
"""

0 commit comments

Comments
 (0)