diff --git a/kv/tables.go b/kv/tables.go index 7d144724b..f2dcf6910 100644 --- a/kv/tables.go +++ b/kv/tables.go @@ -349,7 +349,7 @@ const ( // BOR BorReceipts = "BorReceipt" - BorTxLookup = "BlockBorTransactionLookup" + BorTxLookup = "BlockBorTransactionLookup" // transaction_hash -> block_num_u64 BorSeparate = "BorSeparate" // Downloader diff --git a/types/txn.go b/types/txn.go index 76182e09a..6eaffb44d 100644 --- a/types/txn.go +++ b/types/txn.go @@ -96,13 +96,9 @@ type TxSlot struct { AlAddrCount int // Number of addresses in the access list AlStorCount int // Number of storage keys in the access list - IsBor bool // Wether or not the current parsed transaction is a bor transaction or not - Rlp []byte // TxPool set it to nil after save it to db } -var emptyHash = make([]byte, 20) - const ( LegacyTxType int = 0 AccessListTxType int = 1 @@ -237,7 +233,6 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo } // Next follows the destination address (if present) dataPos, dataLen, err = rlp.String(payload, p) - var isEmptyHash bool if err != nil { return 0, fmt.Errorf("%w: to len: %s", ErrParseTxn, err) } @@ -245,10 +240,6 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo return 0, fmt.Errorf("%w: unexpected length of to field: %d", ErrParseTxn, dataLen) } - if dataLen != 0 { - hashBytes := payload[dataPos+1 : dataPos+dataLen] - isEmptyHash = bytes.Equal(hashBytes, emptyHash) - } // Only note if To field is empty or not slot.Creation = dataLen == 0 p = dataPos + dataLen @@ -263,11 +254,6 @@ func (ctx *TxParseContext) ParseTransaction(payload []byte, pos int, slot *TxSlo return 0, fmt.Errorf("%w: data len: %s", ErrParseTxn, err) } slot.DataLen = dataLen - isDataEmpty := dataLen == 0 - - if ctx.withBor && isEmptyHash && isDataEmpty && legacy { - slot.IsBor = true - } // Zero and non-zero bytes are priced differently slot.DataNonZeroLen = 0