diff --git a/CHANGELOG.md b/CHANGELOG.md
index 713bd1d41..4ea4ab93d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,8 +4,12 @@
- feat: `exex_pragma_dispatch` implementation
- feat: Madara ExExs proof of concept
+- fix: override chain config
+- fix: estimate_fee should through an error if any txn fails
- fix: rejected transaction block production panic
- fix(sync): pending block retrying mechanism
+- feat(clean): dc_db: rename `DbBlockId::BlockN` to `DbBlockId::Number`
+- feat(cli): Environment variables can be used to specify Madara parameters
- fix:(tests): Add testing feature to mc-db dev dependency (#294)
- feat: new crate gateway client & server
- test: Starknet-js basic tests added
diff --git a/Cargo.lock b/Cargo.lock
index 584f9bd49..fe23907e7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5374,14 +5374,12 @@ dependencies = [
"mp-rpc",
"mp-transactions",
"mp-utils",
- "primitive-types",
"rand",
"rayon",
"reqwest 0.12.5",
"serde",
"serde_json",
"serde_yaml",
- "starknet-core",
"starknet-providers",
"starknet-signers",
"starknet_api",
@@ -5428,7 +5426,6 @@ dependencies = [
"mp-receipt",
"mp-state-update",
"mp-transactions",
- "mp-utils",
"num-traits 0.2.19",
"rayon",
"rstest 0.18.2",
@@ -5460,7 +5457,6 @@ dependencies = [
"mp-utils",
"rayon",
"rocksdb",
- "rstest 0.18.2",
"serde",
"starknet-core",
"starknet-types-core",
@@ -5491,7 +5487,6 @@ dependencies = [
"mp-receipt",
"mp-state-update",
"mp-transactions",
- "mp-utils",
"proptest",
"proptest-derive",
"rand",
@@ -5512,8 +5507,6 @@ dependencies = [
"env_logger 0.11.3",
"flate2",
"lazy_static",
- "mp-utils",
- "once_cell",
"reqwest 0.12.5",
"rstest 0.18.2",
"serde_json",
@@ -5679,7 +5672,6 @@ dependencies = [
"mp-rpc",
"mp-state-update",
"mp-transactions",
- "mp-utils",
"paste",
"rstest 0.18.2",
"serde_json",
@@ -5709,18 +5701,13 @@ dependencies = [
"mp-convert",
"mp-exex",
"mp-gateway",
- "mp-receipt",
"mp-transactions",
"mp-utils",
- "num-traits 0.2.19",
- "rand",
- "rayon",
"regex",
"reqwest 0.12.5",
"rstest 0.18.2",
"serde_json",
"starknet-core",
- "starknet-providers",
"starknet-types-core",
"starknet_api",
"tempfile",
@@ -5842,10 +5829,8 @@ dependencies = [
"anyhow",
"blockifier",
"lazy_static",
- "log",
"mp-utils",
"primitive-types",
- "reqwest 0.12.5",
"rstest 0.18.2",
"serde",
"serde_json",
@@ -5859,7 +5844,6 @@ dependencies = [
name = "mp-class"
version = "0.7.0"
dependencies = [
- "anyhow",
"blockifier",
"cairo-lang-starknet 1.0.0-alpha.6",
"cairo-lang-starknet 1.0.0-rc0",
@@ -5876,7 +5860,6 @@ dependencies = [
"num-bigint",
"serde",
"serde_json",
- "sha3",
"starknet-core",
"starknet-providers",
"starknet-types-core",
@@ -5946,7 +5929,6 @@ dependencies = [
"bincode 1.3.3",
"blockifier",
"cairo-vm",
- "log",
"mp-convert",
"rstest 0.18.2",
"serde",
@@ -6026,6 +6008,7 @@ dependencies = [
"rayon",
"rstest 0.18.2",
"serde",
+ "serde_yaml",
"tokio",
"url",
]
diff --git a/README.md b/README.md
index 22ee5208d..21fd36b83 100644
--- a/README.md
+++ b/README.md
@@ -342,12 +342,18 @@ Toggle details for each namespace to view additional settings:
### Environment Variables
-Set up your node's environment variables using the `STARKNET_` prefix. For example:
+Set up your node's environment variables using the `MADARA_` prefix. For example:
-- `STARKNET_BASE_PATH=/path/to/data`
-- `STARKNET_LOG=info`
+- `MADARA_BASE_PATH=/path/to/data`
+- `MADARA_RPC_PORT=1111`
-These variables allow you to adjust the node's configuration without using command-line arguments.
+These variables allow you to adjust the node's configuration without using command-line arguments. If the command-line
+argument is specified then it takes precedent over the environment variable.
+
+> [!CAUTION]
+> Environment variables can be visible beyond the current process and are not
+> encrypted. You should take special care when setting _secrets_ through
+> environment variables, such as `MADARA_L1_ENDPOINT` or `MADARA_GATEWAY_KEY`
### Configuration File
diff --git a/configs/chain_config.example.yaml b/configs/chain_config.example.yaml
index 1c40f0524..b21df8cab 100644
--- a/configs/chain_config.example.yaml
+++ b/configs/chain_config.example.yaml
@@ -10,7 +10,7 @@ native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201
parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
# Paths to JSON files containing blockifier's constants for different versions
-versioned_constants:
+versioned_constants_path:
"0.13.0": "crates/primitives/chain_config/resources/versioned_constants_13_0.json"
"0.13.1": "crates/primitives/chain_config/resources/versioned_constants_13_1.json"
"0.13.1.1": "crates/primitives/chain_config/resources/versioned_constants_13_1_1.json"
diff --git a/configs/presets/devnet.yaml b/configs/presets/devnet.yaml
index 71fce1d64..620e75dc4 100644
--- a/configs/presets/devnet.yaml
+++ b/configs/presets/devnet.yaml
@@ -2,11 +2,6 @@ chain_name: "Madara"
chain_id: "MADARA_DEVNET"
native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
-versioned_constants:
- "0.13.0": "crates/primitives/chain_config/resources/versioned_constants_13_0.json"
- "0.13.1": "crates/primitives/chain_config/resources/versioned_constants_13_1.json"
- "0.13.1.1": "crates/primitives/chain_config/resources/versioned_constants_13_1_1.json"
- "0.13.2": "crates/primitives/chain_config/resources/versioned_constants_13_2.json"
eth_core_contract_address: "0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057"
latest_protocol_version: "0.13.2"
block_time: "1s"
diff --git a/configs/presets/integration.yaml b/configs/presets/integration.yaml
index 2b522fd3c..eb071072a 100644
--- a/configs/presets/integration.yaml
+++ b/configs/presets/integration.yaml
@@ -2,11 +2,6 @@ chain_name: "Starknet Sepolia"
chain_id: "SN_INTEGRATION_SEPOLIA"
native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
-versioned_constants:
- "0.13.0": "crates/primitives/chain_config/resources/versioned_constants_13_0.json"
- "0.13.1": "crates/primitives/chain_config/resources/versioned_constants_13_1.json"
- "0.13.1.1": "crates/primitives/chain_config/resources/versioned_constants_13_1_1.json"
- "0.13.2": "crates/primitives/chain_config/resources/versioned_constants_13_2.json"
eth_core_contract_address: "0x4737c0c1B4D5b1A687B42610DdabEE781152359c"
latest_protocol_version: "0.13.2"
block_time: "30s"
@@ -30,5 +25,5 @@ bouncer_config:
message_segment_length: 18446744073709551615
n_events: 18446744073709551615
state_diff_size: 131072
-sequencer_address: "0x0"
+sequencer_address: "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8"
max_nonce_for_validation_skip: 2
diff --git a/configs/presets/mainnet.yaml b/configs/presets/mainnet.yaml
index 305f60df7..5c24b7f3c 100644
--- a/configs/presets/mainnet.yaml
+++ b/configs/presets/mainnet.yaml
@@ -2,11 +2,6 @@ chain_name: "Starknet Mainnet"
chain_id: "SN_MAIN"
native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
-versioned_constants:
- "0.13.0": "crates/primitives/chain_config/resources/versioned_constants_13_0.json"
- "0.13.1": "crates/primitives/chain_config/resources/versioned_constants_13_1.json"
- "0.13.1.1": "crates/primitives/chain_config/resources/versioned_constants_13_1_1.json"
- "0.13.2": "crates/primitives/chain_config/resources/versioned_constants_13_2.json"
eth_core_contract_address: "0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4"
latest_protocol_version: "0.13.2"
block_time: "30s"
@@ -30,5 +25,5 @@ bouncer_config:
message_segment_length: 18446744073709551615
n_events: 18446744073709551615
state_diff_size: 131072
-sequencer_address: "0x0"
+sequencer_address: "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8"
max_nonce_for_validation_skip: 2
diff --git a/configs/presets/sepolia.yaml b/configs/presets/sepolia.yaml
index 3186427e3..868a5e36e 100644
--- a/configs/presets/sepolia.yaml
+++ b/configs/presets/sepolia.yaml
@@ -2,11 +2,6 @@ chain_name: "Starknet Sepolia"
chain_id: "SN_SEPOLIA"
native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
-versioned_constants:
- "0.13.0": "crates/primitives/chain_config/resources/versioned_constants_13_0.json"
- "0.13.1": "crates/primitives/chain_config/resources/versioned_constants_13_1.json"
- "0.13.1.1": "crates/primitives/chain_config/resources/versioned_constants_13_1_1.json"
- "0.13.2": "crates/primitives/chain_config/resources/versioned_constants_13_2.json"
eth_core_contract_address: "0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057"
latest_protocol_version: "0.13.2"
block_time: "30s"
@@ -30,5 +25,5 @@ bouncer_config:
message_segment_length: 18446744073709551615
n_events: 18446744073709551615
state_diff_size: 131072
-sequencer_address: "0x0"
+sequencer_address: "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8"
max_nonce_for_validation_skip: 2
diff --git a/crates/client/block_import/Cargo.toml b/crates/client/block_import/Cargo.toml
index b9e1481d1..c827e619a 100644
--- a/crates/client/block_import/Cargo.toml
+++ b/crates/client/block_import/Cargo.toml
@@ -31,7 +31,6 @@ mp-convert.workspace = true
mp-receipt.workspace = true
mp-state-update.workspace = true
mp-transactions.workspace = true
-mp-utils.workspace = true
bonsai-trie.workspace = true
starknet-core.workspace = true
diff --git a/crates/client/db/Cargo.toml b/crates/client/db/Cargo.toml
index 0fe66a000..95438cfef 100644
--- a/crates/client/db/Cargo.toml
+++ b/crates/client/db/Cargo.toml
@@ -35,7 +35,6 @@ bincode = { workspace = true }
log = { workspace = true, default-features = true }
rayon = { workspace = true }
rocksdb.workspace = true
-rstest = { workspace = true }
serde = { workspace = true }
tempfile = { workspace = true, optional = true }
thiserror = { workspace = true }
diff --git a/crates/client/db/src/block_db.rs b/crates/client/db/src/block_db.rs
index 30e542d14..37a5db49a 100644
--- a/crates/client/db/src/block_db.rs
+++ b/crates/client/db/src/block_db.rs
@@ -264,9 +264,9 @@ impl MadaraBackend {
pub(crate) fn id_to_storage_type(&self, id: &BlockId) -> Result