Skip to content

Commit f576d41

Browse files
committed
fix: Correctly decode London dynamic-fee txns
Regressions here will be caught by the soon-to-be-included tests/core/vm/test_eip1559_txn_rewards
1 parent e3fe5e0 commit f576d41

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

eth/vm/forks/berlin/transactions.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ class BerlinTransactionBuilder(TransactionBuilderAPI):
388388
"""
389389
legacy_signed = BerlinLegacyTransaction
390390
legacy_unsigned = BerlinUnsignedLegacyTransaction
391+
typed_transaction = TypedTransaction
391392

392393
@classmethod
393394
def decode(cls, encoded: bytes) -> SignedTransactionAPI:
@@ -396,21 +397,21 @@ def decode(cls, encoded: bytes) -> SignedTransactionAPI:
396397

397398
type_id = to_int(encoded[0])
398399
if type_id in VALID_TRANSACTION_TYPES:
399-
return TypedTransaction.decode(encoded)
400+
return cls.typed_transaction.decode(encoded)
400401
else:
401402
return rlp.decode(encoded, sedes=cls.legacy_signed)
402403

403404
@classmethod
404405
def deserialize(cls, encoded: DecodedZeroOrOneLayerRLP) -> SignedTransactionAPI:
405406
if isinstance(encoded, bytes):
406-
return TypedTransaction.deserialize(encoded)
407+
return cls.typed_transaction.deserialize(encoded)
407408
else:
408409
return cls.legacy_signed.deserialize(encoded)
409410

410411
@classmethod
411412
def serialize(cls, obj: SignedTransactionAPI) -> DecodedZeroOrOneLayerRLP:
412-
if isinstance(obj, TypedTransaction):
413-
return TypedTransaction.serialize(obj)
413+
if isinstance(obj, cls.typed_transaction):
414+
return cls.typed_transaction.serialize(obj)
414415
else:
415416
return cls.legacy_signed.serialize(obj)
416417

@@ -489,4 +490,4 @@ def new_access_list_transaction(
489490
r,
490491
s,
491492
)
492-
return TypedTransaction(ACCESS_LIST_TRANSACTION_TYPE, transaction)
493+
return cls.typed_transaction(ACCESS_LIST_TRANSACTION_TYPE, transaction)

eth/vm/forks/london/transactions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class LondonTypedTransaction(TypedTransaction):
222222
class LondonTransactionBuilder(BerlinTransactionBuilder):
223223
legacy_signed = LondonLegacyTransaction
224224
legacy_unsigned = LondonUnsignedLegacyTransaction
225+
typed_transaction = LondonTypedTransaction
225226

226227
@classmethod
227228
def new_unsigned_fee_burn_transaction(

0 commit comments

Comments
 (0)