Now the receipt RLP format in our chain database is:
type receiptStorageRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
Bloom Bloom
TxHash common.Hash
ContractAddress common.Address
Logs []*LogForStorage
GasUsed uint64
}
In fact the below fields are unnecessary in database:
- Bloom
- TxHash
- ContractAddress
- GasUsed
because they can be derive from the transaction. Then format can be simplified to:
type storedReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
Logs []*Log
}
So we can encode the new receipt RLP with the new format. Then convert the old receipt RLP to the new format later.
Now the receipt RLP format in our chain database is:
In fact the below fields are unnecessary in database:
because they can be derive from the transaction. Then format can be simplified to:
So we can encode the new receipt RLP with the new format. Then convert the old receipt RLP to the new format later.