diff --git a/Cargo.lock b/Cargo.lock index 6e352283e..99f350c6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1597,7 +1597,7 @@ dependencies = [ [[package]] name = "blockifier" version = "0.8.0-rc.3" -source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.1#dd69217cdec340f9b5267b781be38eef972ac401" +source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.2#d6951f24fc2082c7aa89cdbc063648915b131d74" dependencies = [ "anyhow", "ark-ec", @@ -1629,7 +1629,7 @@ dependencies = [ "sha2", "sha3", "starknet-types-core", - "starknet_api 0.13.0-rc.1 (git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.1)", + "starknet_api 0.13.0-rc.1 (git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.2)", "strum 0.25.0", "strum_macros 0.25.3", "thiserror", @@ -2510,6 +2510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58363ad8065ed891e3b14a8191b707677c7c7cb5b9d10030822506786d8d8108" dependencies = [ "anyhow", + "arbitrary", "bincode 2.0.0-rc.3", "bitvec", "generic-array", @@ -3341,8 +3342,8 @@ dependencies = [ [[package]] name = "dojo-lang" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -3380,8 +3381,8 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "hyper 0.14.30", @@ -3394,13 +3395,14 @@ dependencies = [ "metrics-util", "thiserror", "tokio", + "tokio-util", "tracing", ] [[package]] name = "dojo-test-utils" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "assert_fs", @@ -3425,8 +3427,8 @@ dependencies = [ [[package]] name = "dojo-types" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "cainome", "crypto-bigint", @@ -3443,8 +3445,8 @@ dependencies = [ [[package]] name = "dojo-utils" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "futures", @@ -3457,8 +3459,8 @@ dependencies = [ [[package]] name = "dojo-world" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "async-trait", @@ -6333,8 +6335,8 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "cairo-lang-casm", "cairo-lang-runner", @@ -6344,13 +6346,13 @@ dependencies = [ "cairo-lang-starknet-classes", "cairo-lang-utils", "cairo-vm", - "starknet_api 0.13.0-rc.1 (git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.1)", + "starknet_api 0.13.0-rc.1 (git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.2)", ] [[package]] name = "katana-core" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "alloy-contract", "alloy-network 0.3.6", @@ -6372,6 +6374,7 @@ dependencies = [ "katana-tasks", "lazy_static", "metrics", + "num-traits 0.2.19", "parking_lot 0.12.3", "reqwest 0.12.8", "serde", @@ -6385,8 +6388,8 @@ dependencies = [ [[package]] name = "katana-db" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "dojo-metrics", @@ -6406,8 +6409,8 @@ dependencies = [ [[package]] name = "katana-executor" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "blockifier", "katana-cairo", @@ -6421,8 +6424,8 @@ dependencies = [ [[package]] name = "katana-node" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "dojo-metrics", @@ -6435,11 +6438,9 @@ dependencies = [ "katana-pipeline", "katana-pool", "katana-primitives", - "katana-provider", "katana-rpc", "katana-rpc-api", "katana-tasks", - "num-traits 0.2.19", "serde_json", "starknet", "strum 0.25.0", @@ -6451,8 +6452,8 @@ dependencies = [ [[package]] name = "katana-pipeline" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "async-trait", @@ -6462,13 +6463,14 @@ dependencies = [ "katana-pool", "katana-tasks", "thiserror", + "tokio", "tracing", ] [[package]] name = "katana-pool" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "futures", "katana-executor", @@ -6481,11 +6483,12 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "alloy-primitives", "anyhow", + "arbitrary", "base64 0.21.7", "derive_more 0.99.18", "flate2", @@ -6499,14 +6502,14 @@ dependencies = [ "serde_with", "starknet", "starknet-crypto 0.7.2", - "strum_macros 0.25.3", + "starknet-types-core", "thiserror", ] [[package]] name = "katana-provider" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "auto_impl", @@ -6522,8 +6525,8 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "dojo-metrics", @@ -6546,8 +6549,8 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -6558,8 +6561,8 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "alloy-primitives", "anyhow", @@ -6582,8 +6585,8 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "anyhow", "katana-executor", @@ -6595,8 +6598,8 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "1.0.0-alpha.15" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.15#f56c4f90eca84b92f348303dc85ff6e126609f16" +version = "1.0.0-alpha.19" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.19#ef696ea9bbaa22d3f6db392d9692b4821578c23c" dependencies = [ "futures", "rayon", @@ -11630,6 +11633,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa1b9e01ccb217ab6d475c5cda05dbb22c30029f7bb52b192a010a00d77a3d74" dependencies = [ + "arbitrary", "lambdaworks-crypto", "lambdaworks-math", "lazy_static", @@ -11666,7 +11670,7 @@ dependencies = [ [[package]] name = "starknet_api" version = "0.13.0-rc.1" -source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.1#dd69217cdec340f9b5267b781be38eef972ac401" +source = "git+https://github.com/dojoengine/sequencer?tag=v0.8.0-rc3.2#d6951f24fc2082c7aa89cdbc063648915b131d74" dependencies = [ "bitvec", "cairo-lang-starknet-classes", diff --git a/Cargo.toml b/Cargo.toml index d48f6c06e..1c944f64e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -165,9 +165,9 @@ alloy-signer = { version = "0.4.2", default-features = false, optional = true } alloy-serde = { version = "0.4.2", default-features = false } # Starknet -dojo-test-utils = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, optional = true } -katana-node = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, optional = true } -katana-primitives = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.15", default-features = false, features = [ +dojo-test-utils = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.19", default-features = false, optional = true } +katana-node = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.19", default-features = false, optional = true } +katana-primitives = { git = 'https://github.com/dojoengine/dojo', tag = "v1.0.0-alpha.19", default-features = false, features = [ "serde", ], optional = true } starknet_api = { version = "0.13.0-rc.0", optional = true } diff --git a/Makefile b/Makefile index 06d250d67..62441d613 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ run-dev: load-env RUST_LOG=trace cargo run --bin kakarot-rpc install-katana: - cargo install --git https://github.com/dojoengine/dojo --locked --tag v1.0.0-alpha.15 katana + cargo install --git https://github.com/dojoengine/dojo --locked --tag v1.0.0-alpha.19 katana katana-genesis: install-katana cargo run --bin katana_genesis --features testing diff --git a/docker-compose.yaml b/docker-compose.yaml index 12a42f94f..455f30bf7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,7 +14,7 @@ services: restart: on-failure starknet: - image: ghcr.io/dojoengine/dojo:v1.0.0-alpha.16 + image: ghcr.io/dojoengine/dojo:v1.0.0-alpha.19 command: - katana - --disable-fee diff --git a/docker/hive/Dockerfile b/docker/hive/Dockerfile index 0f0956e5f..b85127c20 100644 --- a/docker/hive/Dockerfile +++ b/docker/hive/Dockerfile @@ -1,7 +1,7 @@ # trunk-ignore-all(terrascan/AC_DOCKER_0047) # CairoVM Chain -FROM ghcr.io/dojoengine/dojo:v1.0.0-alpha.15 as katana +FROM ghcr.io/dojoengine/dojo:v1.0.0-alpha.19 as katana # Indexer service ### Apibara DNA indexer and indexer diff --git a/src/test_utils/hive/mod.rs b/src/test_utils/hive/mod.rs index cbc4bfb73..d4b729763 100644 --- a/src/test_utils/hive/mod.rs +++ b/src/test_utils/hive/mod.rs @@ -8,7 +8,10 @@ use account::{Account, KakarotAccount}; use alloy_primitives::{Address, Bytes, B256, U256, U64}; use katana_primitives::{ contract::ContractAddress, - genesis::json::{ClassNameOrHash, GenesisContractJson, GenesisJson}, + genesis::{ + constant::DEFAULT_ETH_FEE_TOKEN_ADDRESS, + json::{ClassNameOrHash, GenesisContractJson, GenesisJson}, + }, }; use serde::{Deserialize, Serialize}; use starknet::core::{types::Felt, utils::get_storage_var_address}; @@ -123,7 +126,19 @@ impl HiveGenesisConfig { contract.storage.get_or_insert_with(BTreeMap::new).extend(additional_kakarot_storage); }); - genesis.fee_token.storage.get_or_insert_with(BTreeMap::new).extend(fee_token_storage); + // Add the fee token storage to the genesis. + genesis + .contracts + .entry(DEFAULT_ETH_FEE_TOKEN_ADDRESS) + .or_insert_with(|| katana_primitives::genesis::json::GenesisContractJson { + balance: None, + nonce: None, + class: None, + storage: Some(BTreeMap::new()), + }) + .storage + .get_or_insert_with(BTreeMap::new) + .extend(fee_token_storage); // Add the contracts to the genesis. genesis.contracts.extend(contracts); diff --git a/src/test_utils/katana/genesis.rs b/src/test_utils/katana/genesis.rs index 6dcce4eb9..5ac97dac4 100644 --- a/src/test_utils/katana/genesis.rs +++ b/src/test_utils/katana/genesis.rs @@ -15,10 +15,9 @@ use katana_primitives::{ contract::{ContractAddress, StorageKey, StorageValue}, genesis::{ allocation::DevAllocationsGenerator, - constant::{DEFAULT_FEE_TOKEN_ADDRESS, DEFAULT_PREFUNDED_ACCOUNT_BALANCE}, + constant::{DEFAULT_ETH_FEE_TOKEN_ADDRESS, DEFAULT_PREFUNDED_ACCOUNT_BALANCE}, json::{ - ClassNameOrHash, FeeTokenConfigJson, GenesisAccountJson, GenesisClassJson, GenesisContractJson, - GenesisJson, PathOrFullArtifact, + ClassNameOrHash, GenesisAccountJson, GenesisClassJson, GenesisContractJson, GenesisJson, PathOrFullArtifact, }, }, }; @@ -201,7 +200,7 @@ impl KatanaGenesisBuilder { &UdcUniqueness::NotUnique, &[ Felt::ZERO, - DEFAULT_FEE_TOKEN_ADDRESS.0, + DEFAULT_ETH_FEE_TOKEN_ADDRESS.0, account_contract_class_hash, uninitialized_account_class_hash, cairo1_helpers_class_hash, @@ -215,7 +214,7 @@ impl KatanaGenesisBuilder { // Construct the kakarot contract storage. let kakarot_storage = [ - (storage_addr(KAKAROT_NATIVE_TOKEN_ADDRESS)?, *DEFAULT_FEE_TOKEN_ADDRESS), + (storage_addr(KAKAROT_NATIVE_TOKEN_ADDRESS)?, *DEFAULT_ETH_FEE_TOKEN_ADDRESS), (storage_addr(KAKAROT_ACCOUNT_CONTRACT_CLASS_HASH)?, account_contract_class_hash), (storage_addr(KAKAROT_UNINITIALIZED_ACCOUNT_CLASS_HASH)?, uninitialized_account_class_hash), (storage_addr(KAKAROT_CAIRO1_HELPERS_CLASS_HASH)?, cairo1_helpers_class_hash), @@ -312,18 +311,22 @@ impl KatanaGenesisBuilder { /// Consume the [`KatanaGenesisBuilder`] and returns the corresponding [`GenesisJson`]. pub fn build(self) -> Result { + let mut contracts = self.contracts.clone(); + contracts.insert( + DEFAULT_ETH_FEE_TOKEN_ADDRESS, + GenesisContractJson { + balance: None, + nonce: None, + class: None, + storage: Some(self.fee_token_storage.clone()), + }, + ); + Ok(GenesisJson { sequencer_address: self.compute_starknet_address(self.coinbase)?, classes: self.classes, - fee_token: FeeTokenConfigJson { - name: "Ether".to_string(), - symbol: "ETH".to_string(), - decimals: 18, - storage: Some(self.fee_token_storage), - ..Default::default() - }, accounts: self.accounts, - contracts: self.contracts, + contracts, ..Default::default() }) } diff --git a/src/test_utils/katana/mod.rs b/src/test_utils/katana/mod.rs index d9ee60d24..4e707995e 100644 --- a/src/test_utils/katana/mod.rs +++ b/src/test_utils/katana/mod.rs @@ -23,10 +23,16 @@ use crate::{ }; use alloy_primitives::{Address, Bytes, U256}; use alloy_rpc_types::Log; -use dojo_test_utils::sequencer::{Environment, StarknetConfig, TestSequencer}; +use dojo_test_utils::sequencer::TestSequencer; +use katana_node::config::execution::ExecutionConfig; use katana_primitives::{ chain::ChainId, - genesis::{json::GenesisJson, Genesis}, + chain_spec::FeeContracts, + genesis::{ + constant::{DEFAULT_ETH_FEE_TOKEN_ADDRESS, DEFAULT_STRK_FEE_TOKEN_ADDRESS}, + json::GenesisJson, + Genesis, + }, }; use mongodb::{ bson, @@ -64,9 +70,10 @@ fn load_genesis() -> Genesis { #[cfg(any(test, feature = "arbitrary", feature = "testing"))] pub async fn katana_sequencer() -> TestSequencer { TestSequencer::start(Config { - chain: ChainSpec { id: ChainId::parse("kaka_test").unwrap(), genesis: load_genesis() }, - starknet: StarknetConfig { - env: Environment { invoke_max_steps: u32::MAX, validate_max_steps: u32::MAX }, + chain: ChainSpec { + id: ChainId::parse("kaka_test").unwrap(), + genesis: load_genesis(), + fee_contracts: FeeContracts { eth: DEFAULT_ETH_FEE_TOKEN_ADDRESS, strk: DEFAULT_STRK_FEE_TOKEN_ADDRESS }, ..Default::default() }, sequencing: SequencingConfig { block_time: None, no_mining: false }, @@ -77,6 +84,11 @@ pub async fn katana_sequencer() -> TestSequencer { allowed_origins: None, apis: HashSet::from([ApiKind::Starknet, ApiKind::Dev, ApiKind::Saya, ApiKind::Torii]), }, + execution: ExecutionConfig { + invocation_max_steps: u32::MAX, + validation_max_steps: u32::MAX, + ..Default::default() + }, ..Default::default() }) .await