got rid of bor related things (#618)

This commit is contained in:
Enrique Jose Avila Asapche 2022-09-02 06:50:59 +03:00 committed by GitHub
parent d9648b4c69
commit 7505532113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -349,7 +349,7 @@ const (
// BOR
BorReceipts = "BorReceipt"
BorTxLookup = "BlockBorTransactionLookup"
BorTxLookup = "BlockBorTransactionLookup" // transaction_hash -> block_num_u64
BorSeparate = "BorSeparate"
// Downloader

View File

@ -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