-
Notifications
You must be signed in to change notification settings - Fork 62
refactor(levm,l2): hooks #2508
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
refactor(levm,l2): hooks #2508
Conversation
Lines of code reportTotal lines added: Detailed view
|
Benchmark Results ComparisonPR ResultsBenchmark Results: Factorial
Benchmark Results: Factorial - Recursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: BubbleSort
Benchmark Results: ERC20 - Transfer
Benchmark Results: ERC20 - Mint
Benchmark Results: ERC20 - Approval
Main ResultsBenchmark Results: Factorial
Benchmark Results: Factorial - Recursive
Benchmark Results: Fibonacci
Benchmark Results: ManyHashes
Benchmark Results: BubbleSort
Benchmark Results: ERC20 - Transfer
Benchmark Results: ERC20 - Mint
Benchmark Results: ERC20 - Approval
|
@@ -188,6 +188,8 @@ pub fn prepare_vm_for_tx<'a>( | |||
tx_nonce: test_tx.nonce, | |||
block_gas_limit: test.env.current_gas_limit, | |||
transient_storage: HashMap::new(), | |||
#[cfg(feature = "l2")] | |||
is_privilege: false, |
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.
Should this be is_privileged
?
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.
Done in e60b7ee.
Ok(()) | ||
} | ||
|
||
pub fn validate_type_3_tx(vm: &mut VM<'_>) -> Result<(), VMError> { |
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.
Something like validate_4844_tx
might be easier to read
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.
Done in 8941381.
Ok(()) | ||
} | ||
|
||
pub fn validate_type_4_tx(vm: &mut VM<'_>) -> Result<(), VMError> { |
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
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.
Done in 8941381.
Motivation
DefaultHook
andL2Hook
implementations.L2Hook
for every tx (regular ETH txs and L2's privilege txs) when running the L2.Description
This PR:
DefaultHook
andL2Hook
to remove repeated code.is_privilege
field to LEVM'sEnvironment
only compiled under thel2
feature flag.L2Hook
now supports executing every tx (before only privileged).