XinFinOrg / XDPoSChain

Customer centric, Hybrid & Interoperable XinFin Network
https://www.xinfin.org
GNU Lesser General Public License v3.0
50 stars 59 forks source link

reduce the receipt RLP size in chain database #570

Open gzliudan opened 4 days ago

gzliudan commented 4 days ago

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:

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.

JukLee0ira commented 4 days ago

I will refer ethereum#19345 and handle it