-
Notifications
You must be signed in to change notification settings - Fork 108
chore(l1): remove/justify clones from common #4769
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
base: main
Are you sure you want to change the base?
Conversation
Lines of code reportTotal lines added: Detailed view
|
Benchmark Results ComparisonNo significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: FibonacciRecursive
Benchmark Results: ManyHashes
Benchmark Results: MstoreBench
Benchmark Results: Push
Benchmark Results: SstoreBench_no_opt
|
Co-authored-by: fmoletta <[email protected]>
let tx = if authorization_list.is_some() { | ||
Transaction::EIP7702Transaction(EIP7702Transaction { | ||
to: match test_tx.to { | ||
TxKind::Call(to) => to, | ||
TxKind::Create => return Err(EFTestRunnerError::EIP7702ShouldNotBeCreateType), | ||
}, | ||
value: test_tx.value, | ||
data: test_tx.data.clone(), | ||
access_list, | ||
authorization_list: list, | ||
access_list: access_list, | ||
authorization_list: authorization_list.unwrap(), |
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.
Why was this change needed?
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.
Ah, that was because I removed the blob hashes field from the environment (since it required cloning the blob hashes from the transaction). The way the runner worked was that for EIP4844 transactions, it encoded them as EIP1599 txs and then injected the blob parameters via the environment. Because this would cause tests to fail now the environment didn't have the blob hashes, I had to add some extra logic to build the test transaction as an EIP4844 one when appropriate
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.
Makes sense, I wonder if we can keep the match/ use an if let Some so we don't have to unwrap the authorization_list
let fork_id = ForkId::new( | ||
chain_config, | ||
genesis_header.clone(), | ||
genesis_header.clone(), // ok-clone: value is needed later, clone is in test |
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 don't think we have to justify clones in tests
c3e53f4
to
ff04834
Compare
Motivation
Cleaning up our code and improving it's performance. This PR is part of a broader campaign to remove clones from our code.
Description
This PR removes most of the .clone() calls from the types and utils of the common crate. Those clones that couldn't be removed are justified with an
// ok-clone
commentPart of #4668