-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(anvil
): add support for EIP4844 types
#7202
Conversation
39f2a56
to
85ca342
Compare
anvil
): add support for EIP4844 typesanvil
): add support for EIP4844 types
@@ -259,6 +259,12 @@ impl FeeHistoryService { | |||
.min(U256::from(t.max_fee_per_gas).saturating_sub(base_fee)) | |||
.to::<u64>() | |||
} | |||
// TODO: This probably needs to be extended to extract 4844 info. |
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.
Will be done in a subsequent PR which modifies FeeHistory
to accomodate 4844 changes
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.
we should add a follow up issue for this to track
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 should go on #7242
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.
saw it there
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 does not support the envoloped format for 4844 which includes the sidecar
I think we want a helper type here that decodes with the sidecar, then extract the sidecar (+ validate), and convert into TypedTx
https://github.com/foundry-rs/foundry/blob/master/crates/anvil/src/eth/api.rs#L942-L942
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.
looks good to me, want @mattsse to take a look
@@ -259,6 +259,12 @@ impl FeeHistoryService { | |||
.min(U256::from(t.max_fee_per_gas).saturating_sub(base_fee)) | |||
.to::<u64>() | |||
} | |||
// TODO: This probably needs to be extended to extract 4844 info. |
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.
we should add a follow up issue for this to track
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
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.
@@ -39,11 +42,14 @@ pub fn transaction_request_to_typed(tx: TransactionRequest) -> Option<TypedTrans | |||
gas_price, | |||
max_fee_per_gas, | |||
max_priority_fee_per_gas, | |||
max_fee_per_blob_gas, |
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 forget, why don't we do this with a From
impl / reuse any alloy types code? Is it due to the Deposit tx I guess?
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.
nit there's a Some(126)
below i'd like to replace it with a const that indicates the semantic value of the number from op specs
/// EIP-4844 transaction | ||
EIP4844(Signed<TxEip4844Variant>), | ||
/// op-stack deposit transaction | ||
Deposit(DepositTransaction), |
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.
same here i take that we redefine the enum vs reusing from alloy bc of the deposit tx right?
@mattsse do u have any ideas for doing this with a super-enum?
something like enum TypedTransaction { #[flatten] Inner(alloy::TypedTransaction), Deposit(...)
?
@@ -259,6 +259,12 @@ impl FeeHistoryService { | |||
.min(U256::from(t.max_fee_per_gas).saturating_sub(base_fee)) | |||
.to::<u64>() | |||
} | |||
// TODO: This probably needs to be extended to extract 4844 info. |
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.
saw it there
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
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, but this will likely break with new alloy rlp API
but since this most likely also breaks existing variants we can do this
Motivation
This does not include any functionality regarding 4844 yet other than support for 4844 variants in the corresponding types.
First of a series of PRs that will add Cancun support to foundry. Tracking here: #5574
Solution
Add support for 4844 transaction types.