From 7623170f6a81886056f8986100036cac63baddab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Fri, 13 Jun 2025 18:09:39 +0300 Subject: [PATCH] Update accessors_indexes.go --- core/rawdb/accessors_indexes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index fe41d9440f..3ec84bd956 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -158,11 +158,14 @@ func ReadTransaction(db ethdb.Reader, hash common.Hash) (*types.Transaction, com for txnIterator.Next() && txnIterator.Err() == nil { txnRLP := txnIterator.Value() - // Figure out if this a legacy transaction or not + // Preimage for hash calculation of legacy transactions + // are just their RLP encoding, but for EIP-2728 transactions + // the prefix needs to be trimmed before hashing. rlpKind, hashPreimage, _, err := rlp.Split(txnRLP) if err != nil { return nil, common.Hash{}, 0, 0 } + // Legacy transactions are encoded as rlp lists. if rlpKind == rlp.List { hashPreimage = txnRLP }