Skip to content

Commit 2f785d1

Browse files
jclapisltitanb
andauthored
CBST2-12: Improve External HTTP Requests (#327)
Co-authored-by: eltitanb <[email protected]> Co-authored-by: ltitanb <[email protected]>
1 parent 7192cc2 commit 2f785d1

File tree

18 files changed

+508
-79
lines changed

18 files changed

+508
-79
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ base64 = "0.22.1"
2525
bimap = { version = "0.6.3", features = ["serde"] }
2626
blsful = "2.5"
2727
blst = "0.3.11"
28+
bytes = "1.10.1"
2829
cb-cli = { path = "crates/cli" }
2930
cb-common = { path = "crates/common" }
3031
cb-metrics = { path = "crates/metrics" }

config.example.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ extra_validation_enabled = false
5555
# Execution Layer RPC url to use for extra validation
5656
# OPTIONAL
5757
rpc_url = "https://ethereum-holesky-rpc.publicnode.com"
58+
# Timeout for any HTTP requests sent from the PBS module to other services, in seconds
59+
# OPTIONAL, DEFAULT: 10
60+
http_timeout_seconds = 10
5861
# Maximum number of retries for validator registrations per relay
5962
# OPTIONAL, DEFAULT: 3
6063
register_validator_retry_limit = 3

crates/common/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ axum.workspace = true
1313
base64.workspace = true
1414
bimap.workspace = true
1515
blst.workspace = true
16+
bytes.workspace = true
1617
cipher.workspace = true
1718
ctr.workspace = true
1819
derive_more.workspace = true
@@ -22,6 +23,7 @@ ethereum_serde_utils.workspace = true
2223
ethereum_ssz.workspace = true
2324
ethereum_ssz_derive.workspace = true
2425
eyre.workspace = true
26+
futures.workspace = true
2527
jsonwebtoken.workspace = true
2628
pbkdf2.workspace = true
2729
rand.workspace = true

crates/common/src/config/constants.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ pub const PROXY_DIR_KEYS_DEFAULT: &str = "/proxy_keys";
7272
pub const PROXY_DIR_SECRETS_ENV: &str = "CB_PROXY_SECRETS_DIR";
7373
pub const PROXY_DIR_SECRETS_DEFAULT: &str = "/proxy_secrets";
7474

75+
////////////////////////// MUXER //////////////////////////
76+
77+
/// Timeout for HTTP requests, in seconds
78+
pub const HTTP_TIMEOUT_SECONDS_DEFAULT: u64 = 10;
79+
80+
/// Max content length for Muxer HTTP responses, in bytes
81+
pub const MUXER_HTTP_MAX_LENGTH: usize = 1024 * 1024 * 10; // 10 MiB
82+
7583
///////////////////////// MODULES /////////////////////////
7684

7785
/// The unique ID of the module

0 commit comments

Comments
 (0)