Skip to content

Commit 75a2b73

Browse files
authored
chore: Remove shall_save_to_public_bucket, public_object_store and related code (#3701)
## What ❔ Remove `shall_save_to_public_bucket`, `public_object_store` and related code. <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ To cleanup outdated feature, reduce code and config size. <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [x] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. ref ZKD-2281
1 parent a07763b commit 75a2b73

File tree

8 files changed

+7
-183
lines changed

8 files changed

+7
-183
lines changed

zkstack_cli/crates/config/src/general.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub struct RocksDbs {
1616
}
1717

1818
pub struct FileArtifacts {
19-
pub public_object_store: PathBuf,
2019
pub prover_object_store: PathBuf,
2120
pub snapshot: PathBuf,
2221
pub core_object_store: PathBuf,
@@ -26,7 +25,6 @@ impl FileArtifacts {
2625
/// Currently all artifacts are stored in one path, but we keep an opportunity to update this paths
2726
pub fn new(path: PathBuf) -> Self {
2827
Self {
29-
public_object_store: path.clone(),
3028
prover_object_store: path.clone(),
3129
snapshot: path.clone(),
3230
core_object_store: path.clone(),
@@ -57,11 +55,6 @@ pub fn set_file_artifacts(
5755
"prover.prover_object_store",
5856
&file_artifacts.prover_object_store,
5957
)?;
60-
set_file_backed_path_if_selected(
61-
config,
62-
"prover.public_object_store",
63-
&file_artifacts.public_object_store,
64-
)?;
6558
set_file_backed_path_if_selected(
6659
config,
6760
"snapshot_creator.object_store",

zkstack_cli/crates/zkstack/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,8 @@ contracts to be deployed.
452452

453453
- `--from-genesis` — Set attester committee to `consensus.genesis_spec.attesters` in general.yaml Mutually exclusive
454454
with `--from-file`.
455-
- `--from-file <PATH>` — Set attester committee to committee specified in yaml file at `PATH`.
456-
Mutually exclusive with `--from-genesis`. File format is specified in
457-
`zk_inception/src/commands/consensus/proto/mod.proto`. Example:
455+
- `--from-file <PATH>` — Set attester committee to committee specified in yaml file at `PATH`. Mutually exclusive with
456+
`--from-genesis`. File format is specified in `zk_inception/src/commands/consensus/proto/mod.proto`. Example:
458457

459458
```yaml
460459
attesters:
@@ -497,16 +496,9 @@ Initialize prover
497496
- `--bucket-name <BUCKET_NAME>`
498497
- `--location <LOCATION>`
499498
- `--project-id <PROJECT_ID>`
500-
- `--shall-save-to-public-bucket <SHALL_SAVE_TO_PUBLIC_BUCKET>`
501499

502500
Possible values: `true`, `false`
503501

504-
- `--public-store-dir <PUBLIC_STORE_DIR>`
505-
- `--public-bucket-base-url <PUBLIC_BUCKET_BASE_URL>`
506-
- `--public-credentials-file <PUBLIC_CREDENTIALS_FILE>`
507-
- `--public-bucket-name <PUBLIC_BUCKET_NAME>`
508-
- `--public-location <PUBLIC_LOCATION>`
509-
- `--public-project-id <PUBLIC_PROJECT_ID>`
510502
- `--bellman-cuda-dir <BELLMAN_CUDA_DIR>`
511503
- `--bellman-cuda`
512504

zkstack_cli/crates/zkstack/completion/_zkstack.zsh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,13 +1896,6 @@ _arguments "${_arguments_options[@]}" : \
18961896
'--bucket-name=[]:BUCKET_NAME:_default' \
18971897
'--location=[]:LOCATION:_default' \
18981898
'--project-id=[]:PROJECT_ID:_default' \
1899-
'--shall-save-to-public-bucket=[]:SHALL_SAVE_TO_PUBLIC_BUCKET:(true false)' \
1900-
'--public-store-dir=[]:PUBLIC_STORE_DIR:_default' \
1901-
'--public-bucket-base-url=[]:PUBLIC_BUCKET_BASE_URL:_default' \
1902-
'--public-credentials-file=[]:PUBLIC_CREDENTIALS_FILE:_default' \
1903-
'--public-bucket-name=[]:PUBLIC_BUCKET_NAME:_default' \
1904-
'--public-location=[]:PUBLIC_LOCATION:_default' \
1905-
'--public-project-id=[]:PUBLIC_PROJECT_ID:_default' \
19061899
'(--clone)--bellman-cuda-dir=[]:BELLMAN_CUDA_DIR:_default' \
19071900
'--bellman-cuda=[]' \
19081901
'--setup-compressor-key=[]' \

zkstack_cli/crates/zkstack/completion/zkstack.fish

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,6 @@ complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_
487487
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bucket-name -r
488488
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l location -r
489489
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l project-id -r
490-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l shall-save-to-public-bucket -r -f -a "{true\t'',false\t''}"
491-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-store-dir -r
492-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-bucket-base-url -r
493-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-credentials-file -r
494-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-bucket-name -r
495-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-location -r
496-
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l public-project-id -r
497490
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bellman-cuda-dir -r
498491
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l bellman-cuda -r -f -a "{true\t'',false\t''}"
499492
complete -c zkstack -n "__fish_zkstack_using_subcommand prover; and __fish_seen_subcommand_from init" -l setup-compressor-key -r -f -a "{true\t'',false\t''}"

zkstack_cli/crates/zkstack/completion/zkstack.sh

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7226,7 +7226,7 @@ _zkstack() {
72267226
return 0
72277227
;;
72287228
zkstack__prover__init)
7229-
opts="-u -d -v -h --dev --proof-store-dir --bucket-base-url --credentials-file --bucket-name --location --project-id --shall-save-to-public-bucket --public-store-dir --public-bucket-base-url --public-credentials-file --public-bucket-name --public-location --public-project-id --clone --bellman-cuda-dir --bellman-cuda --setup-compressor-key --path --region --mode --setup-keys --setup-database --prover-db-url --prover-db-name --use-default --dont-drop --cloud-type --verbose --chain --ignore-prerequisites --help"
7229+
opts="-u -d -v -h --dev --proof-store-dir --bucket-base-url --credentials-file --bucket-name --location --project-id --clone --bellman-cuda-dir --bellman-cuda --setup-compressor-key --path --region --mode --setup-keys --setup-database --prover-db-url --prover-db-name --use-default --dont-drop --cloud-type --verbose --chain --ignore-prerequisites --help"
72307230
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
72317231
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
72327232
return 0
@@ -7256,34 +7256,6 @@ _zkstack() {
72567256
COMPREPLY=($(compgen -f "${cur}"))
72577257
return 0
72587258
;;
7259-
--shall-save-to-public-bucket)
7260-
COMPREPLY=($(compgen -W "true false" -- "${cur}"))
7261-
return 0
7262-
;;
7263-
--public-store-dir)
7264-
COMPREPLY=($(compgen -f "${cur}"))
7265-
return 0
7266-
;;
7267-
--public-bucket-base-url)
7268-
COMPREPLY=($(compgen -f "${cur}"))
7269-
return 0
7270-
;;
7271-
--public-credentials-file)
7272-
COMPREPLY=($(compgen -f "${cur}"))
7273-
return 0
7274-
;;
7275-
--public-bucket-name)
7276-
COMPREPLY=($(compgen -f "${cur}"))
7277-
return 0
7278-
;;
7279-
--public-location)
7280-
COMPREPLY=($(compgen -f "${cur}"))
7281-
return 0
7282-
;;
7283-
--public-project-id)
7284-
COMPREPLY=($(compgen -f "${cur}"))
7285-
return 0
7286-
;;
72877259
--bellman-cuda-dir)
72887260
COMPREPLY=($(compgen -f "${cur}"))
72897261
return 0

zkstack_cli/crates/zkstack/src/commands/prover/args/init.rs

Lines changed: 4 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ use crate::{
2323
MSG_CREATE_GCS_BUCKET_PROJECT_ID_NO_PROJECTS_PROMPT,
2424
MSG_CREATE_GCS_BUCKET_PROJECT_ID_PROMPT, MSG_CREATE_GCS_BUCKET_PROMPT,
2525
MSG_DOWNLOAD_SETUP_COMPRESSOR_KEY_PROMPT, MSG_GETTING_PROOF_STORE_CONFIG,
26-
MSG_GETTING_PUBLIC_STORE_CONFIG, MSG_INITIALIZE_BELLMAN_CUDA_PROMPT,
27-
MSG_PROOF_STORE_CONFIG_PROMPT, MSG_PROOF_STORE_DIR_PROMPT,
28-
MSG_PROOF_STORE_GCS_BUCKET_BASE_URL_ERR, MSG_PROOF_STORE_GCS_BUCKET_BASE_URL_PROMPT,
29-
MSG_PROOF_STORE_GCS_CREDENTIALS_FILE_PROMPT, MSG_PROVER_DB_NAME_HELP,
30-
MSG_PROVER_DB_URL_HELP, MSG_SAVE_TO_PUBLIC_BUCKET_PROMPT, MSG_SETUP_KEYS_PROMPT,
26+
MSG_INITIALIZE_BELLMAN_CUDA_PROMPT, MSG_PROOF_STORE_CONFIG_PROMPT,
27+
MSG_PROOF_STORE_DIR_PROMPT, MSG_PROOF_STORE_GCS_BUCKET_BASE_URL_ERR,
28+
MSG_PROOF_STORE_GCS_BUCKET_BASE_URL_PROMPT, MSG_PROOF_STORE_GCS_CREDENTIALS_FILE_PROMPT,
29+
MSG_PROVER_DB_NAME_HELP, MSG_PROVER_DB_URL_HELP, MSG_SETUP_KEYS_PROMPT,
3130
MSG_USE_DEFAULT_DATABASES_HELP,
3231
},
3332
};
@@ -45,16 +44,6 @@ pub struct ProverInitArgs {
4544
#[clap(flatten)]
4645
pub create_gcs_bucket_config: ProofStorageGCSCreateBucketTmp,
4746

48-
// Public store object
49-
#[clap(long)]
50-
pub shall_save_to_public_bucket: Option<bool>,
51-
#[clap(long)]
52-
pub public_store_dir: Option<String>,
53-
#[clap(flatten)]
54-
pub public_store_gcs_config: PublicStorageGCSTmp,
55-
#[clap(flatten)]
56-
pub public_create_gcs_bucket_config: PublicStorageGCSCreateBucketTmp,
57-
5847
// Bellman cuda
5948
#[clap(flatten)]
6049
pub bellman_cuda_config: InitBellmanCudaArgs,
@@ -119,24 +108,6 @@ pub struct ProofStorageGCSCreateBucketTmp {
119108
pub project_id: Option<String>,
120109
}
121110

122-
#[derive(Clone, Debug, Serialize, Deserialize, Parser, Default)]
123-
pub struct PublicStorageGCSTmp {
124-
#[clap(long)]
125-
pub public_bucket_base_url: Option<String>,
126-
#[clap(long)]
127-
pub public_credentials_file: Option<String>,
128-
}
129-
130-
#[derive(Debug, Clone, Serialize, Deserialize, Parser, Default)]
131-
pub struct PublicStorageGCSCreateBucketTmp {
132-
#[clap(long)]
133-
pub public_bucket_name: Option<String>,
134-
#[clap(long)]
135-
pub public_location: Option<String>,
136-
#[clap(long)]
137-
pub public_project_id: Option<String>,
138-
}
139-
140111
#[derive(Clone, Debug, Serialize, Deserialize, Parser, Default)]
141112
pub struct SetupCompressorKeyConfigTmp {
142113
#[clap(long)]
@@ -181,7 +152,6 @@ pub struct ProverDatabaseConfig {
181152
#[derive(Debug, Clone)]
182153
pub struct ProverInitArgsFinal {
183154
pub proof_store: ProofStorageConfig,
184-
pub public_store: Option<ProofStorageConfig>,
185155
pub compressor_key_args: Option<CompressorKeysArgs>,
186156
pub setup_keys: Option<SetupKeysArgs>,
187157
pub bellman_cuda_config: Option<InitBellmanCudaArgs>,
@@ -197,7 +167,6 @@ impl ProverInitArgs {
197167
chain_config: &ChainConfig,
198168
) -> anyhow::Result<ProverInitArgsFinal> {
199169
let proof_store = self.fill_proof_storage_values_with_prompt(shell)?;
200-
let public_store = self.fill_public_storage_values_with_prompt(shell)?;
201170
let compressor_key_args =
202171
self.fill_setup_compressor_key_values_with_prompt(default_compressor_key_path);
203172
let bellman_cuda_config = self.fill_bellman_cuda_values_with_prompt();
@@ -207,7 +176,6 @@ impl ProverInitArgs {
207176

208177
Ok(ProverInitArgsFinal {
209178
proof_store,
210-
public_store,
211179
compressor_key_args,
212180
setup_keys,
213181
bellman_cuda_config,
@@ -270,80 +238,6 @@ impl ProverInitArgs {
270238
}
271239
}
272240

273-
fn fill_public_storage_values_with_prompt(
274-
&self,
275-
shell: &Shell,
276-
) -> anyhow::Result<Option<ProofStorageConfig>> {
277-
logger::info(MSG_GETTING_PUBLIC_STORE_CONFIG);
278-
279-
if self.dev {
280-
return Ok(None);
281-
}
282-
283-
let shall_save_to_public_bucket = self
284-
.shall_save_to_public_bucket
285-
.unwrap_or_else(|| PromptConfirm::new(MSG_SAVE_TO_PUBLIC_BUCKET_PROMPT).ask());
286-
287-
if !shall_save_to_public_bucket {
288-
return Ok(None);
289-
}
290-
291-
if self.public_store_dir.is_some() {
292-
return Ok(Some(
293-
self.handle_file_backed_config(self.public_store_dir.clone()),
294-
));
295-
}
296-
297-
if self.partial_gcs_config_provided(
298-
self.public_store_gcs_config.public_bucket_base_url.clone(),
299-
self.public_store_gcs_config.public_credentials_file.clone(),
300-
) {
301-
return Ok(Some(self.ask_gcs_config(
302-
self.public_store_gcs_config.public_bucket_base_url.clone(),
303-
self.public_store_gcs_config.public_credentials_file.clone(),
304-
)));
305-
}
306-
307-
if self.partial_create_gcs_bucket_config_provided(
308-
self.public_create_gcs_bucket_config
309-
.public_bucket_name
310-
.clone(),
311-
self.public_create_gcs_bucket_config.public_location.clone(),
312-
self.public_create_gcs_bucket_config
313-
.public_project_id
314-
.clone(),
315-
) {
316-
let project_ids = get_project_ids(shell)?;
317-
return Ok(Some(
318-
self.handle_create_gcs_bucket(
319-
project_ids,
320-
self.public_create_gcs_bucket_config
321-
.public_project_id
322-
.clone(),
323-
self.public_create_gcs_bucket_config
324-
.public_bucket_name
325-
.clone(),
326-
self.public_create_gcs_bucket_config.public_location.clone(),
327-
self.public_store_gcs_config.public_credentials_file.clone(),
328-
),
329-
));
330-
}
331-
332-
match PromptSelect::new(MSG_PROOF_STORE_CONFIG_PROMPT, ProofStoreConfig::iter()).ask() {
333-
ProofStoreConfig::Local => Ok(Some(
334-
self.handle_file_backed_config(self.public_store_dir.clone()),
335-
)),
336-
ProofStoreConfig::GCS => {
337-
let project_ids = get_project_ids(shell)?;
338-
Ok(Some(self.handle_gcs_config(
339-
project_ids,
340-
self.public_store_gcs_config.public_bucket_base_url.clone(),
341-
self.public_store_gcs_config.public_credentials_file.clone(),
342-
)))
343-
}
344-
}
345-
}
346-
347241
fn fill_setup_compressor_key_values_with_prompt(
348242
&self,
349243
default_path: &Path,

zkstack_cli/crates/zkstack/src/commands/prover/init.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<(
5050

5151
let proof_object_store_config =
5252
get_object_store_config(shell, Some(args.proof_store))?.unwrap();
53-
let public_object_store_config = get_object_store_config(shell, args.public_store)?;
5453

5554
if let Some(args) = args.compressor_key_args {
5655
let path = args.path.context(MSG_SETUP_KEY_PATH_ERROR)?;
@@ -67,16 +66,6 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<(
6766
"prover.prover_object_store",
6867
&proof_object_store_config,
6968
)?;
70-
if let Some(public_object_store_config) = public_object_store_config {
71-
general_config.insert("prover.shall_save_to_public_bucket", true)?;
72-
set_object_store(
73-
&mut general_config,
74-
"prover.public_object_store",
75-
&public_object_store_config,
76-
)?;
77-
} else {
78-
general_config.insert("prover.shall_save_to_public_bucket", false)?;
79-
}
8069
general_config.insert_yaml("prover.cloud_type", args.cloud_type)?;
8170
general_config.save().await?;
8271

zkstack_cli/crates/zkstack/src/messages.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,7 @@ pub(super) const MSG_INITIALIZE_BELLMAN_CUDA_PROMPT: &str =
424424
pub(super) const MSG_SETUP_COMPRESSOR_KEY_PATH_PROMPT: &str = "Provide the path to the setup key:";
425425
pub(super) const MSG_GETTING_GCP_PROJECTS_SPINNER: &str = "Getting GCP projects...";
426426
pub(super) const MSG_GETTING_PROOF_STORE_CONFIG: &str = "Getting proof store configuration...";
427-
pub(super) const MSG_GETTING_PUBLIC_STORE_CONFIG: &str = "Getting public store configuration...";
428427
pub(super) const MSG_CREATING_GCS_BUCKET_SPINNER: &str = "Creating GCS bucket...";
429-
pub(super) const MSG_SAVE_TO_PUBLIC_BUCKET_PROMPT: &str = "Do you want to save to public bucket?";
430428
pub(super) const MSG_ROUND_SELECT_PROMPT: &str = "Select the round to run";
431429
pub(super) const MSG_WITNESS_GENERATOR_ROUND_ERR: &str = "Witness generator round not found";
432430
pub(super) const MSG_SETUP_KEY_PATH_ERROR: &str = "Failed to get setup key path";

0 commit comments

Comments
 (0)