Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit acb8230

Browse files
committedFeb 28, 2025·
Update chain spec files
PR #2402 forgot to update the chain specs. This also adds a script to easily update the spec files for all networks.
1 parent 0912c83 commit acb8230

9 files changed

+17
-18
lines changed
 

‎z2/resources/chain-specs/zq2-devnet.toml

-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ consensus.minimum_stake = "10_000_000_000_000_000_000_000_000"
2121
consensus.eth_block_gas_limit = 84000000
2222
consensus.gas_price = "4_761_904_800_000"
2323
consensus.scilla_call_gas_exempt_addrs = []
24-
consensus.contract_upgrade_block_heights = { deposit_v3 = 3600, deposit_v4 = 428400 }
2524

2625
api_servers = [{ port = 4201, enabled_apis = [{ namespace = "eth", apis = ["blockNumber"] }] }, { port = 4202, enabled_apis = ["admin", "debug", "erigon", "eth", "net", "ots", "trace", "txpool", "web3", "zilliqa"] }]

‎z2/resources/chain-specs/zq2-infratest.toml

-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ consensus.minimum_stake = "10_000_000_000_000_000_000_000_000"
2020
consensus.eth_block_gas_limit = 84000000
2121
consensus.gas_price = "4_761_904_800_000"
2222
consensus.scilla_call_gas_exempt_addrs = []
23-
consensus.contract_upgrade_block_heights = { deposit_v4 = 0 }
2423

2524
api_servers = [{ port = 4201, enabled_apis = [{ namespace = "eth", apis = ["blockNumber"] }] }, { port = 4202, enabled_apis = ["admin", "debug", "erigon", "eth", "net", "ots", "trace", "txpool", "web3", "zilliqa"] }]

‎z2/resources/chain-specs/zq2-perftest.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
p2p_port = 3333
2-
bootstrap_address = [ "12D3KooWS1GB4h6Et6XZmW1bkrVWo8ur7BWFyZaM9mH6dGUnuMaf", "/dns/bootstrap.zq2-perftest.zilstg.dev/tcp/3333" ]
2+
3+
bootstrap_address = [
4+
"12D3KooWS1GB4h6Et6XZmW1bkrVWo8ur7BWFyZaM9mH6dGUnuMaf",
5+
"/dns/bootstrap.zq2-perftest.zilstg.dev/tcp/3333"
6+
]
37

48
[[nodes]]
59
eth_chain_id = 33469
@@ -16,6 +20,5 @@ consensus.minimum_stake = "10_000_000_000_000_000_000_000_000"
1620
consensus.eth_block_gas_limit = 84000000
1721
consensus.gas_price = "4_761_904_800_000"
1822
consensus.scilla_call_gas_exempt_addrs = []
19-
consensus.contract_upgrade_block_heights = { deposit_v4 = 0 }
2023

2124
api_servers = [{ port = 4201, enabled_apis = [{ namespace = "eth", apis = ["blockNumber"] }] }, { port = 4202, enabled_apis = ["admin", "debug", "erigon", "eth", "net", "ots", "trace", "txpool", "web3", "zilliqa"] }]

‎z2/resources/chain-specs/zq2-protomainnet.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ consensus.genesis_fork = { at_height = 0, call_mode_1_sets_caller_to_parent_call
2727
consensus.forks = [
2828
{ at_height = 5342400, failed_scilla_call_from_gas_exempt_caller_causes_revert = true, call_mode_1_sets_caller_to_parent_caller = true },
2929
{ at_height = 7966800, scilla_messages_can_call_evm_contracts = true, scilla_contract_creation_increments_account_balance = true, scilla_json_preserve_order = true },
30-
]
30+
]

‎z2/resources/chain-specs/zq2-prototestnet.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ consensus.forks = [
2828
{ at_height = 8404000, failed_scilla_call_from_gas_exempt_caller_causes_revert = true, call_mode_1_sets_caller_to_parent_caller = true },
2929
{ at_height = 10200000, scilla_messages_can_call_evm_contracts = true },
3030
{ at_height = 11152000, scilla_contract_creation_increments_account_balance = true, scilla_json_preserve_order = true },
31-
]
31+
]

‎z2/resources/config.tera.toml

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ consensus.minimum_stake = "10_000_000_000_000_000_000_000_000"
2020
consensus.eth_block_gas_limit = 84000000
2121
consensus.gas_price = "4_761_904_800_000"
2222
consensus.scilla_call_gas_exempt_addrs = {{ whitelisted_evm_contract_addresses }}
23+
{%- if contract_upgrade_block_heights %}
2324
consensus.contract_upgrade_block_heights = {{ contract_upgrade_block_heights }}
25+
{%- endif %}
2426

2527
{%- if role == "checkpoint" %}
2628
# Checkpoint configuration

‎z2/src/chain.rs

+6-11
Original file line numberDiff line numberDiff line change
@@ -165,27 +165,22 @@ impl Chain {
165165
}
166166

167167
// Warning: Contract upgrades occur only at epoch boundaries, ie at block heights which are a multiple of blocks_per_epoch
168-
pub fn get_contract_upgrades_block_heights(&self) -> ContractUpgradesBlockHeights {
168+
pub fn get_contract_upgrades_block_heights(&self) -> Option<ContractUpgradesBlockHeights> {
169169
match self {
170-
Self::Zq2Devnet => ContractUpgradesBlockHeights {
171-
deposit_v3: None,
172-
deposit_v4: None,
173-
deposit_v5: Some(0),
174-
},
175-
Self::Zq2ProtoMainnet => ContractUpgradesBlockHeights {
170+
Self::Zq2ProtoMainnet => Some(ContractUpgradesBlockHeights {
176171
// estimated: 2024-12-20T23:33:12Z
177172
deposit_v3: Some(5342400),
178173
// estimated: 2025-02-12T13:25:00Z
179174
deposit_v4: Some(7966800),
180175
deposit_v5: None,
181-
},
182-
Self::Zq2ProtoTestnet => ContractUpgradesBlockHeights {
176+
}),
177+
Self::Zq2ProtoTestnet => Some(ContractUpgradesBlockHeights {
183178
deposit_v3: Some(8406000),
184179
// estimated: 2025-02-03T13:55:00Z
185180
deposit_v4: Some(10890000),
186181
deposit_v5: None,
187-
},
188-
_ => ContractUpgradesBlockHeights::default(),
182+
}),
183+
_ => None,
189184
}
190185
}
191186

‎z2/src/chain/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ impl ChainNode {
895895
);
896896
ctx.insert(
897897
"contract_upgrade_block_heights",
898-
&contract_upgrade_block_heights.to_toml().to_string(),
898+
&contract_upgrade_block_heights.map(|c| c.to_toml().to_string()),
899899
);
900900
// convert json to toml formatting
901901
let toml_servers: toml::Value = serde_json::from_value(api_servers)?;

‎z2/update-chain-specs.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
for network in {protomainnet,prototestnet,devnet,infratest,perftest,richard,uccbtest}; do z2 deployer get-config-file zq2-$network.yaml --out z2/resources/chain-specs/zq2-$network.toml; done

0 commit comments

Comments
 (0)
Please sign in to comment.