-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: optimism-specific receipt #13317
Conversation
Co-authored-by: Emilia Hane <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it not possible to make an enum with one variant wrapping op_alloy_consensus::OpDepositReceipt
?
this would require a manual compact impl through a struct same as the current one for compatibility but should be possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm pending op-alloy bump
/// TODO: Remove once <https://github.com/alloy-rs/op-alloy/pull/317> is released. | ||
#[cfg(feature = "serde")] | ||
mod tx_type_serde { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
released now
pub fn get_bit_size(ftype: &str) -> u8 { | ||
match ftype { | ||
"TransactionKind" | "TxKind" | "bool" | "Option" | "Signature" => 1, | ||
"TxType" => 2, | ||
"TxType" | "OpTxType" => 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a footgun.
perhaps a better approach long term would be a trait, maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked into this, we can't solve this with a trait while we depend on modular_bitifield
the get_bit_size
output is translates into B2
/B1
etc inputs for bitfield macro:
#[bitfield]
pub struct OpReceiptFlags {
pub tx_type_len: B2,
pub success_len: B1,
pub cumulative_gas_used_len: B4,
pub deposit_nonce_len: B1,
pub deposit_receipt_version_len: B1,
pub __zstd: B1,
#[skip]
unused: B6,
}
Co-authored-by: Emilia Hane <[email protected]>
Closes #12588
Same as #13295 but for OP receipt