feat: store Receipts#313
Conversation
| && gas_limit >= GAS_LIMIT_MINIMUM | ||
| } | ||
|
|
||
| // Calculates the base fee per blob gas for the current block based on it's parent excess blob gas |
There was a problem hiding this comment.
init: t's weird that all these helper functions are here (not only the ones you added)
There was a problem hiding this comment.
I agree. Maybe we need a core::utils module to hold this logic?
There was a problem hiding this comment.
I wouldnt use a generic utils module. Maybe gas_helpers or 4844_helpers? We can also leave them here for now until we think of a better place
| #[serde(rename = "type")] | ||
| pub tx_type: TxType, | ||
| #[serde(with = "crate::serde_utils::bool")] | ||
| #[serde(with = "crate::serde_utils::bool", rename = "status")] |
There was a problem hiding this comment.
I wonder if we should do all this rpc specific stuff inside the rpc crate (add a RpcReceipt type or something) and implement from/into to map to the "core" Receipt. Not in scope for this PR though. WDYT?
There was a problem hiding this comment.
Ah, I see there is one further down. Why does this one have the serde implementations?
There was a problem hiding this comment.
The RpcReceipt is a wrapper around this Receipt and some metadata:
pub struct RpcReceipt {
pub receipt: Receipt,
pub tx_info: RpcReceiptTxInfo,
pub block_info: RpcReceiptBlockInfo,
...
}Should I unwrap the Receipt and store its fields directly?
There was a problem hiding this comment.
Maybe you could create a type like ReceiptInfo inside RPC that has the serde attributes. And then you can do a from/into the core Receipt. So that we have the Rpc stuff separated from the core stuff. Thoughts?
Motivation
After executing all block transactions, we need to store the resulting
Receipts.Description
Receiptfrom theExecutionResultwhen executing a transaction. This includes handlinglogsandBloomcomputation.Vec<Receipt>as the result ofexecute_blockin the evm crate.gas_usedagainst theBlockHeader.Receiptsin the db.RpcReceiptto theRpccrate.blob_gas_pricefrom theparent_header.Closes #271
Closes #276