Skip to content

Commit 468cec9

Browse files
authored
feat(zkstack-cli): add prove & execute wallets (#4477)
## What ❔ * Added wallet for prove & execute * It is optional - so that we are backwards compatible with old configs. ## Why ❔ * it will be used by zkos new sequencer
1 parent 1ee5eac commit 468cec9

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

zkstack_cli/crates/config/src/forge_interface/register_chain/input.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ pub struct ChainL1Config {
5959
pub validium_mode: bool,
6060
pub validator_sender_operator_commit_eth: Address,
6161
pub validator_sender_operator_blobs_eth: Address,
62+
/// Additional validators that can be used for prove & execute (when these are handled by different entities).
63+
#[serde(skip_serializing_if = "Option::is_none")]
64+
pub validator_sender_operator_prove: Option<Address>,
65+
#[serde(skip_serializing_if = "Option::is_none")]
66+
pub validator_sender_operator_execute: Option<Address>,
6267
pub base_token_gas_price_multiplier_nominator: u64,
6368
pub base_token_gas_price_multiplier_denominator: u64,
6469
pub governance_security_council_address: Address,
@@ -121,6 +126,14 @@ impl RegisterChainL1Config {
121126
== L1BatchCommitmentMode::Validium,
122127
validator_sender_operator_commit_eth: wallets_config.operator.address,
123128
validator_sender_operator_blobs_eth: wallets_config.blob_operator.address,
129+
validator_sender_operator_prove: wallets_config
130+
.prove_operator
131+
.as_ref()
132+
.map(|w| w.address),
133+
validator_sender_operator_execute: wallets_config
134+
.execute_operator
135+
.as_ref()
136+
.map(|w| w.address),
124137
allow_evm_emulator: chain_config.evm_emulator,
125138
},
126139
owner_address: wallets_config.governor.address,

zkstack_cli/crates/config/src/wallet_creation.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,15 @@ pub fn create_localhost_wallets(
6464
5,
6565
)?),
6666
test_wallet: None,
67+
prove_operator: Some(Wallet::from_mnemonic(
68+
&eth_mnemonic.test_mnemonic,
69+
&base_path,
70+
6,
71+
)?),
72+
execute_operator: Some(Wallet::from_mnemonic(
73+
&eth_mnemonic.test_mnemonic,
74+
&base_path,
75+
7,
76+
)?),
6777
})
6878
}

zkstack_cli/crates/config/src/wallets.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ use crate::{
1010
#[derive(Debug, Clone, Serialize, Deserialize)]
1111
pub struct WalletsConfig {
1212
pub deployer: Option<Wallet>,
13+
/// This wallet can be used for any operations (commit, prove, execute, etc.)
1314
pub operator: Wallet,
15+
/// This wallet should be used only for 'commit' when using blobs.
1416
pub blob_operator: Wallet,
17+
/// These are optional wallets, that can be used for prove & execute (when these are handled by different entities).
18+
pub prove_operator: Option<Wallet>,
19+
pub execute_operator: Option<Wallet>,
20+
1521
pub fee_account: Wallet,
1622
pub governor: Wallet,
1723
pub token_multiplier_setter: Option<Wallet>,
@@ -27,6 +33,8 @@ impl WalletsConfig {
2733
operator: Wallet::random(rng),
2834
blob_operator: Wallet::random(rng),
2935
fee_account: Wallet::random(rng),
36+
prove_operator: Some(Wallet::random(rng)),
37+
execute_operator: Some(Wallet::random(rng)),
3038
governor: Wallet::random(rng),
3139
token_multiplier_setter: Some(Wallet::random(rng)),
3240
test_wallet: None,
@@ -39,6 +47,8 @@ impl WalletsConfig {
3947
deployer: Some(Wallet::empty()),
4048
operator: Wallet::empty(),
4149
blob_operator: Wallet::empty(),
50+
prove_operator: None,
51+
execute_operator: None,
4252
fee_account: Wallet::empty(),
4353
governor: Wallet::empty(),
4454
token_multiplier_setter: Some(Wallet::empty()),

0 commit comments

Comments
 (0)