@@ -11,6 +11,7 @@ use apollo_config::dumping::{
1111 ser_param,
1212 SerializeConfig ,
1313} ;
14+ use apollo_config:: secrets:: Sensitive ;
1415use apollo_config:: { ParamPath , ParamPrivacyInput , SerializedParam } ;
1516use blockifier:: blockifier:: config:: ContractClassManagerConfig ;
1617use blockifier:: blockifier_versioned_constants:: VersionedConstantsOverrides ;
@@ -23,6 +24,7 @@ use validator::Validate;
2324use crate :: compiler_version:: VersionId ;
2425
2526const JSON_RPC_VERSION : & str = "2.0" ;
27+ const DEFAULT_BUCKET_NAME : & str = "proof-archive" ;
2628
2729#[ derive( Clone , Debug , Serialize , Deserialize , Validate , PartialEq ) ]
2830pub struct GatewayConfig {
@@ -33,6 +35,7 @@ pub struct GatewayConfig {
3335 pub block_declare : bool ,
3436 #[ serde( default , deserialize_with = "deserialize_comma_separated_str" ) ]
3537 pub authorized_declarer_accounts : Option < Vec < ContractAddress > > ,
38+ pub proof_archive_writer_config : ProofArchiveWriterConfig ,
3639}
3740
3841impl Default for GatewayConfig {
@@ -47,6 +50,7 @@ impl Default for GatewayConfig {
4750 chain_info : ChainInfo :: default ( ) ,
4851 block_declare : false ,
4952 authorized_declarer_accounts : None ,
53+ proof_archive_writer_config : ProofArchiveWriterConfig :: default ( ) ,
5054 }
5155 }
5256}
@@ -80,6 +84,10 @@ impl SerializeConfig for GatewayConfig {
8084 Addresses are in hex format and separated by a comma with no space.",
8185 ParamPrivacyInput :: Public ,
8286 ) ) ;
87+ dump. extend ( prepend_sub_config_name (
88+ self . proof_archive_writer_config . dump ( ) ,
89+ "proof_archive_writer_config" ,
90+ ) ) ;
8391 dump
8492 }
8593}
@@ -292,3 +300,25 @@ impl SerializeConfig for StatefulTransactionValidatorConfig {
292300 dump
293301 }
294302}
303+
304+ #[ derive( Clone , Debug , Serialize , Deserialize , Validate , PartialEq ) ]
305+ pub struct ProofArchiveWriterConfig {
306+ pub bucket_name : Sensitive < String > ,
307+ }
308+
309+ impl Default for ProofArchiveWriterConfig {
310+ fn default ( ) -> Self {
311+ Self { bucket_name : DEFAULT_BUCKET_NAME . to_string ( ) . into ( ) }
312+ }
313+ }
314+
315+ impl SerializeConfig for ProofArchiveWriterConfig {
316+ fn dump ( & self ) -> BTreeMap < ParamPath , SerializedParam > {
317+ BTreeMap :: from_iter ( [ ser_param (
318+ "bucket_name" ,
319+ & self . bucket_name ,
320+ "The name of the bucket to write proofs to." ,
321+ ParamPrivacyInput :: Private ,
322+ ) ] )
323+ }
324+ }
0 commit comments