Skip to content

Commit 43ef62d

Browse files
authored
feat: add public bucket address config variable (#4392)
## What ❔ Add config variable for ETH proof manager component which defines public bucket url address ## Why ❔ Because public URL for reads doesn't match the private one for writes ## 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. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`.
1 parent 76d3b56 commit 43ef62d

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

core/lib/config/src/configs/eth_proof_manager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ pub struct EthProofManagerConfig {
1111
/// HTTP RPC URL of L2(where contracts are deployed)
1212
#[config(default_t = "http://127.0.0.1:8545".to_string())]
1313
pub http_rpc_url: String,
14+
/// Public object store URL
15+
#[config(default_t = "".to_string())]
16+
pub public_object_store_url: String,
1417
/// Object store config
1518
#[config(nest, default)]
1619
pub object_store: ObjectStoreConfig,

core/lib/object_store/src/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub enum Bucket {
2424
}
2525

2626
impl Bucket {
27-
pub(crate) fn as_str(self) -> &'static str {
27+
pub fn as_str(self) -> &'static str {
2828
match self {
2929
Self::ProverJobs => "prover_jobs",
3030
Self::WitnessInput => "witness_inputs",

core/node/eth_proof_manager/src/sender/submit_proof_request.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use zksync_config::configs::{
55
eth_proof_manager::EthProofManagerConfig, proof_data_handler::ProvingMode,
66
};
77
use zksync_dal::{ConnectionPool, Core, CoreDal};
8-
use zksync_object_store::ObjectStore;
8+
use zksync_object_store::{Bucket, ObjectStore};
99
use zksync_proof_data_handler::{Locking, Processor};
1010
use zksync_prover_interface::inputs::PublicWitnessInputData;
1111
use zksync_types::{L1BatchId, L1BatchNumber, L2ChainId};
@@ -111,9 +111,7 @@ impl ProofRequestSubmitter {
111111
let witness_input_data =
112112
PublicWitnessInputData::new(proof_generation_data.witness_input_data.clone());
113113

114-
let bucket = self
115-
.public_blob_store
116-
.get_storage_prefix::<PublicWitnessInputData>();
114+
let bucket = Bucket::PublicWitnessInputs;
117115
let key = self
118116
.public_blob_store
119117
.put(
@@ -125,7 +123,12 @@ impl ProofRequestSubmitter {
125123
anyhow::anyhow!("Failed to put proof generation data into blob store: {}", e)
126124
})?;
127125

128-
let url = format!("{bucket}/{key}");
126+
let url = format!(
127+
"{}/{}/{}",
128+
self.config.public_object_store_url,
129+
bucket.as_str(),
130+
key
131+
);
129132

130133
self.connection_pool
131134
.connection()

core/node/eth_proof_manager/src/tests/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl TestContext {
6060
EthProofManagerConfig {
6161
l2_chain_id: 270,
6262
http_rpc_url: "http://127.0.0.1:3050".to_string(),
63+
public_object_store_url: "".to_string(),
6364
object_store: ObjectStoreConfig {
6465
mode: ObjectStoreMode::FileBacked {
6566
file_backed_base_path: "/tmp/zksync/object_store".to_string().into(),

0 commit comments

Comments
 (0)