Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce the receipt RLP size in chain database #570

Open
gzliudan opened this issue Jul 4, 2024 · 2 comments
Open

reduce the receipt RLP size in chain database #570

gzliudan opened this issue Jul 4, 2024 · 2 comments

Comments

@gzliudan
Copy link
Collaborator

gzliudan commented Jul 4, 2024

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.

@JukLee0ira
Copy link

JukLee0ira commented Jul 4, 2024

I will refer ethereum#19345 and handle it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants