-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
intrinsic gas check #4867
intrinsic gas check #4867
Conversation
Codecov Report
... and 8 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
thanks,
I want the check as separate function that does not use generics but bools for enabled hardforks instead
let input = tx.input().as_ref(); | ||
|
||
let access_list: AccessList = match transaction.tx_type() { | ||
LEGACY_TX_TYPE_ID => AccessList::default(), | ||
EIP2930_TX_TYPE_ID => { | ||
if let Some(access_list_tx) = tx.as_eip2930() { | ||
access_list_tx.access_list.clone() | ||
} else { | ||
AccessList::default() | ||
} | ||
} | ||
EIP1559_TX_TYPE_ID => { | ||
if let Some(dynamic_fee_tx) = transaction.to_recovered_transaction().as_eip1559() { | ||
dynamic_fee_tx.access_list.clone() | ||
} else { | ||
AccessList::default() | ||
} | ||
} | ||
EIP4844_TX_TYPE_ID => { | ||
if let Some(blob_tx) = transaction.to_recovered_transaction().as_eip4844() { | ||
blob_tx.access_list.clone() | ||
} else { |
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 want this check as a new function in reth-revm-primitives
@@ -51,6 +51,21 @@ impl AccessList { | |||
self.flatten().collect() | |||
} | |||
|
|||
/// Converts the ['AccessList'] into a Vec of (Address, `Vec<U256>`), as expected by revm | |||
pub fn to_ref_slice(&self) -> Vec<(Address, Vec<U256>)> { |
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 return a slice
maybe fn as_flattened
?
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.
agree w/ as_flattened
, I would also remain the other function to into_flattened
and ensure as_flattened
returns an iterator instead of collecting
To ensure I understand it correctly, we want the entire check to be a different function right? Or owe want the access list extraction as a separate function? |
the intrinsic gas check as separate function yes |
Looks like there is cyclic dependency between transaction-pool and revm-primitives. Maybe move the check to revm-inspectors instead? wdyt |
I had another look at this, this can be simplified a lot by adding a new function in reth-revm-primitives that
and calls: we also want a new trait function of PoolTransaction that returns the access list to get rid of the match |
Realised that we didn't need the new flattened function since B160 was deprecated. So deleted it and using the existing functions. |
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 is great,
I made a few small changes
Amazed to see the modularity of the code |
Ref #4504