Skip to content
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(levm): error handling ef_tests (Part 1) #1319

Merged
merged 32 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
49a1967
add errors
JereSalo Nov 27, 2024
8c0088a
add is_internal function to vmerror
JereSalo Nov 27, 2024
cfeee50
remove previous validate_transaction
JereSalo Nov 27, 2024
3167f2c
change execute, mainly for propagating internal errors
JereSalo Nov 27, 2024
74e4923
add validate_transaction (not working yet) and gas_price_or_max_fee_p…
JereSalo Nov 27, 2024
1e0449d
change return type of has_code in Account
JereSalo Nov 27, 2024
c62cfad
add intrinsic gas function
JereSalo Nov 27, 2024
f4566c9
add necessary constants
JereSalo Nov 27, 2024
d24ec11
add some fields to environment and think of gas_price as effective ga…
JereSalo Nov 27, 2024
6ac5c20
add unwraps to execute
JereSalo Nov 28, 2024
b01ec97
change blob hashes type and add other paremeters in vm.rs
JereSalo Nov 28, 2024
e5196ec
make small changes in type 3 validations
JereSalo Nov 28, 2024
99a1e21
fix behavior for op_blobhash
JereSalo Nov 28, 2024
88c50c3
Merge branch 'main' of github.com:lambdaclass/lambda_ethereum_rust in…
JereSalo Nov 28, 2024
40b6b8a
fix ef_tests environment for levm
JereSalo Nov 28, 2024
8d62d29
stop using effective gas price in levm
JereSalo Nov 28, 2024
85b7dd6
comment some stuff in validate transaction
JereSalo Nov 28, 2024
d94a98a
delete add_intrinsic_gas (out of scope), and change some things in va…
JereSalo Nov 28, 2024
2f71d26
last commit was wrong, this one is the real one :)
JereSalo Nov 28, 2024
d13cf3b
remove import gas price
JereSalo Nov 28, 2024
0f2f7a1
Merge branch 'main' into levm/ef-tests-error-handling
JereSalo Nov 28, 2024
68a3191
add unwrap() to execute in edge cases tests
JereSalo Nov 28, 2024
79b14d6
merge main into branch
JereSalo Nov 28, 2024
8e882bc
return error when not finding transaction levm_runner
JereSalo Nov 28, 2024
8981d83
remove storage constants that were not used
JereSalo Nov 28, 2024
c9b747f
remove comment from revert create
JereSalo Nov 28, 2024
fc1c17d
Merge branch 'main' into levm/ef-tests-error-handling
JereSalo Nov 28, 2024
ba57edf
fix clippy lint in execute
JereSalo Nov 28, 2024
793d6ad
Merge branch 'main' into levm/ef-tests-error-handling
JereSalo Nov 28, 2024
f80c900
merge
JereSalo Nov 28, 2024
7455a1d
change rust version levm workflow
JereSalo Nov 28, 2024
4897293
Merge branch 'main' into levm/ef-tests-error-handling
JereSalo Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_levm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.79.0
RUST_VERSION: 1.81.0

jobs:
ef-test:
Expand Down
31 changes: 19 additions & 12 deletions cmd/ef_tests/levm/runner/levm_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,38 @@ pub fn prepare_vm_for_tx(vector: &TestVector, test: &EFTest) -> Result<VM, EFTes
store: initial_state.database().unwrap().clone(),
block_hash,
});

let tx = test
.transactions
.get(vector)
.ok_or(EFTestRunnerError::Internal(
InternalError::FirstRunInternal("Failed to get transaction".to_owned()),
))?;

VM::new(
test.transactions.get(vector).unwrap().to.clone(),
tx.to.clone(),
Environment {
origin: test.transactions.get(vector).unwrap().sender,
origin: tx.sender,
consumed_gas: U256::default(),
refunded_gas: U256::default(),
gas_limit: test.env.current_gas_limit, //this should be tx gas limit
gas_limit: tx.gas_limit,
block_number: test.env.current_number,
coinbase: test.env.current_coinbase,
timestamp: test.env.current_timestamp,
prev_randao: test.env.current_random,
chain_id: U256::from(1729),
base_fee_per_gas: test.env.current_base_fee.unwrap_or_default(),
gas_price: test
.transactions
.get(vector)
.unwrap()
.gas_price
.unwrap_or_default(), // or max_fee_per_gas?
gas_price: tx.gas_price.unwrap_or_default(),
block_excess_blob_gas: test.env.current_excess_blob_gas,
block_blob_gas_used: None,
tx_blob_hashes: None,
tx_blob_hashes: tx.blob_versioned_hashes.clone(),
tx_max_priority_fee_per_gas: tx.max_priority_fee_per_gas,
tx_max_fee_per_gas: tx.max_fee_per_gas,
tx_max_fee_per_blob_gas: tx.max_fee_per_blob_gas,
block_gas_limit: test.env.current_gas_limit,
},
test.transactions.get(vector).unwrap().value,
test.transactions.get(vector).unwrap().data.clone(),
tx.value,
tx.data.clone(),
db,
CacheDB::default(),
)
Expand Down
Loading