Skip to content

Commit

Permalink
update to latest sequencer
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Dec 3, 2024
1 parent a513ac7 commit 03c5e52
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 159 deletions.
116 changes: 98 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ cairo-lang-starknet = "2.9.0-dev.0"
cairo-lang-utils = "2.9.0-dev.0"
cairo-lang-starknet-classes = "2.9.0-dev.0"
cairo-lang-sierra = "2.9.0-dev.0"
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev="5e60089288c461eca98bf3dbe03cc882778ff677"}
cairo-native = "0.2.4"
cairo-vm = "1.0.1"
blockifier = { package = "blockifier", git = "https://github.com/kkrt-labs/sequencer.git", rev="41fa336f05eaec38bfa53e0e43d19a608c0fef37", default-features = false, features = [
"testing",
blockifier = { package = "blockifier", git = "https://github.com/kkrt-labs/sequencer.git", rev="e5ed51d697f678ddf27f3b0a5752065a71474022", default-features = false, features = [
"testing", "cairo_native",
] }
starknet = "0.12"
starknet-crypto = "0.7"
starknet_api = { package = "starknet_api", git = "https://github.com/kkrt-labs/sequencer.git", rev="41fa336f05eaec38bfa53e0e43d19a608c0fef37" }
starknet_api = { package = "starknet_api", git = "https://github.com/starkware-libs/sequencer.git", rev="e5ed51d697f678ddf27f3b0a5752065a71474022" }

# Other
async-trait = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/ef-testing/src/evm_sequencer/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ mod tests {
use crate::evm_sequencer::constants::storage_variables::ACCOUNT_BYTECODE;

use super::*;
use blockifier::abi::abi_utils::get_storage_var_address;
use starknet_api::abi::abi_utils::get_storage_var_address;
use reth_primitives::Bytes;

#[test]
Expand Down
25 changes: 15 additions & 10 deletions crates/ef-testing/src/evm_sequencer/sequencer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use crate::evm_sequencer::{
types::contract_class::CasmContractClassWrapper,
utils::compute_starknet_address,
};
use blockifier::blockifier::block::{BlockInfo, GasPrices};
use blockifier::blockifier::block::BlockInfo;
use starknet_api::block::{GasPrices, GasPriceVector, NonzeroGasPrice};
use blockifier::context::ChainInfo;
use blockifier::context::{BlockContext, FeeTokenAddresses};
use blockifier::versioned_constants::VersionedConstants;
Expand All @@ -42,7 +43,7 @@ use crate::evm_sequencer::constants::{
storage_variables::KAKAROT_CAIRO1_HELPERS_CLASS_HASH, CAIRO1_HELPERS_CLASS,
CAIRO1_HELPERS_CLASS_HASH,
};
use blockifier::abi::abi_utils::get_storage_var_address;
use starknet_api::abi::abi_utils::get_storage_var_address;
#[allow(unused_imports)]
use blockifier::state::state_api::{
State as BlockifierState, StateReader as BlockifierStateReader,
Expand Down Expand Up @@ -110,14 +111,18 @@ impl KakarotSequencer {
)
.try_into()
.expect("Failed to convert to ContractAddress"),
gas_prices: GasPrices::new(
NonZeroU128::new(1).unwrap(),
NonZeroU128::new(1).unwrap(),
NonZeroU128::new(1).unwrap(),
NonZeroU128::new(1).unwrap(),
NonZeroU128::new(1).unwrap(),
NonZeroU128::new(1).unwrap(),
),
gas_prices: GasPrices {
eth_gas_prices: GasPriceVector{
l1_gas_price: Default::default(),
l1_data_gas_price: Default::default(),
l2_gas_price: Default::default()
},
strk_gas_prices: GasPriceVector{
l1_gas_price: Default::default(),
l1_data_gas_price: Default::default(),
l2_gas_price: Default::default()
},
},
use_kzg_da: false,
};

Expand Down
8 changes: 4 additions & 4 deletions crates/sequencer/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ where
{
fn commit(cached_state: &mut CachedState<&mut S>) -> StateResult<()> {
let diff = cached_state.to_state_diff()?;
for (address, class_hash) in diff.class_hashes {
for (address, class_hash) in diff.state_maps.class_hashes {
cached_state.state.set_class_hash_at(address, class_hash)?;
}
for (address, _) in diff.nonces {
for (address, _) in diff.state_maps.nonces {
cached_state.state.increment_nonce(address)?;
}
for ((address, storage_key), value) in &diff.storage {
for ((address, storage_key), value) in &diff.state_maps.storage {
cached_state
.state
.set_storage_at(*address, *storage_key, *value)?;
}
for (class_hash, compiled_class_hash) in diff.compiled_class_hashes {
for (class_hash, compiled_class_hash) in diff.state_maps.compiled_class_hashes {
cached_state
.state
.set_compiled_class_hash(class_hash, compiled_class_hash)?;
Expand Down
Loading

0 comments on commit 03c5e52

Please sign in to comment.