Skip to content

Commit

Permalink
feat: protobuf-generated json configs for the main node (BFT-371) (#458)
Browse files Browse the repository at this point in the history
example json config:
```
{
  "httpPort": 3050,
  "httpUrl": "http://localhost:3050",
  "wsPort": 3051,
  "wsUrl": "ws://localhost:3051",
  "reqEntitiesLimit": 10000,
  "filtersLimit": 10000,
  "subscriptionsLimit": 10000,
  "pubsubPollingInterval": "200",
  "threadsPerServer": 1,
  "maxNonceAhead": 50,
  "gasPriceScaleFactor": 1.2,
  "accountPks": {
    "keys": [
      "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=",
      "AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI="
    ]
  },
  "estimateGasScaleFactor": 1.2,
  "estimateGasAcceptableOverestimation": 1000,
  "maxTxSize": "1000000"
}
```
  • Loading branch information
pompon0 committed Jan 26, 2024
1 parent a20af60 commit f938314
Show file tree
Hide file tree
Showing 58 changed files with 3,127 additions and 2 deletions.
39 changes: 39 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ members = [
"core/lib/state",
"core/lib/storage",
"core/lib/types",
"core/lib/protobuf_config",
"core/lib/utils",
"core/lib/vlog",
"core/lib/multivm",
Expand Down
2 changes: 1 addition & 1 deletion core/lib/basic_types/src/basic_fri_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Serialize, Clone, Eq, Hash, PartialEq)]
#[derive(Debug, Deserialize, Serialize, Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
pub struct CircuitIdRoundTuple {
pub circuit_id: u8,
pub aggregation_round: u8,
Expand Down
1 change: 1 addition & 0 deletions core/lib/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ categories = ["cryptography"]
zksync_basic_types = { path = "../../lib/basic_types" }

anyhow = "1.0"
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
2 changes: 1 addition & 1 deletion core/lib/config/src/configs/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl DBConfig {
/// Collection of different database URLs and general PostgreSQL options.
/// All the entries are optional, since some components may only require a subset of them,
/// and any component may have overrides.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub struct PostgresConfig {
/// URL for the main (sequencer) database.
pub master_url: Option<String>,
Expand Down
1 change: 1 addition & 0 deletions core/lib/config/src/configs/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct ProofDataHandlerConfig {
pub protocol_version_loading_mode: ProtocolVersionLoadingMode,
pub fri_protocol_version_id: u16,
}

impl ProofDataHandlerConfig {
pub fn proof_generation_timeout(&self) -> Duration {
Duration::from_secs(self.proof_generation_timeout_in_secs as u64)
Expand Down
1 change: 1 addition & 0 deletions core/lib/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ pub use crate::configs::{
};

pub mod configs;
pub mod testonly;
Loading

0 comments on commit f938314

Please sign in to comment.