Skip to content

CBST2-12: Improve External HTTP Requests #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c68125d
bump version
ltitanb Apr 2, 2025
d9979a2
Successful cross-compilation, but runtime has memory allocation issues
jclapis May 5, 2025
97ef653
Working with OpenSSL static-linked
jclapis May 6, 2025
91eefe2
Got dynamic linking working, added a feature flag to toggle dynamic v…
jclapis May 6, 2025
de09415
Fixed the vendored build arg
jclapis May 6, 2025
3aee63d
Reintroduced the cargo chef setup
jclapis May 6, 2025
c07c717
Ported the cross-compilation stuff into PBS
jclapis May 6, 2025
699b7ec
Split the dockerfiles into separate builder / image definitions
jclapis May 7, 2025
7165f12
Added a build guide
jclapis May 7, 2025
9438dae
Refactored the Github release action to use the Docker builder
jclapis May 13, 2025
12c020a
Fixed the Docker image binary filenames
jclapis May 13, 2025
53cafc0
Cleaned up the Darwin artifact step
jclapis May 13, 2025
58c6117
Made the CI workflow and justfile use the same toolchain as the source
jclapis May 14, 2025
45e581b
Revert "Made the CI workflow and justfile use the same toolchain as t…
jclapis May 14, 2025
24a10c5
Testing removal of OpenSSL vendored option
jclapis May 14, 2025
e36da54
Updating just in the CI workflow
jclapis May 14, 2025
843b110
Merge branch 'main' into cross-compile
jclapis May 28, 2025
e7c6d19
Refactored the signer to support host and port config settings
jclapis May 21, 2025
6117219
Updated docs
jclapis May 21, 2025
c0f591d
Fixing Clippy in CI workflow
jclapis May 21, 2025
adbd34a
Removed obviated CI setup
jclapis May 28, 2025
e3488b3
Minor dedup of RwLock guard acquisition
jclapis May 20, 2025
c3d7ec4
Added rate limiting for signer clients with repeated JWT auth failures
jclapis May 22, 2025
9ddad64
Added Signer config validation
jclapis May 22, 2025
c62185e
Started unit test setup for the Signer
jclapis May 22, 2025
dc73c62
Finished a basic signer module unit test
jclapis May 28, 2025
6c3d967
Added a JWT failure unit test
jclapis May 28, 2025
6464638
Added a rate limit test and cleaned up a bit
jclapis May 28, 2025
0313f18
Added unique ports to unit tests for parallel execution
jclapis May 28, 2025
346eea4
Cleaned up the build Dockerfile and removed an extra dependency layer
jclapis May 28, 2025
7b20d2f
Ported the build script over to the justfile
jclapis May 29, 2025
cf3f0b1
Merge branch 'main' into cross-compile
jclapis May 29, 2025
ca9f4a1
Added a justfile recipe for installing protoc
jclapis May 29, 2025
3eed526
Merge branch 'cross-compile' into add-ip-bind-to-signer
jclapis May 29, 2025
aa6ad96
Merge branch 'add-ip-bind-to-signer' into rate-limit-jwt
jclapis May 29, 2025
fc872ac
Merge branch 'main' into add-ip-bind-to-signer
jclapis Jun 3, 2025
ca0c6e8
Merge branch 'add-ip-bind-to-signer' into rate-limit-jwt
jclapis Jun 3, 2025
612b072
Added chunked reading to some HTTP response handlers
jclapis Jun 4, 2025
672aacf
Started putting together unit tests for the SSV key loader's HTTP han…
jclapis Jun 5, 2025
40d34aa
Merge branch 'main' into add-ip-bind-to-signer
jclapis Jun 9, 2025
d537288
Update crates/cli/src/docker_init.rs
jclapis Jun 9, 2025
7afb763
Added example signer config params
jclapis Jun 9, 2025
09ac821
Cleaned up signer config loading from feedback
jclapis Jun 9, 2025
cf39d86
Merge remote-tracking branch 'origin/add-ip-bind-to-signer' into add-…
jclapis Jun 9, 2025
2431937
Merge branch 'add-ip-bind-to-signer' into rate-limit-jwt
jclapis Jun 9, 2025
db7c915
Merge branch 'main' into improve-http-handling
jclapis Jun 9, 2025
cb7c8eb
Finished unit tests for the SSV loader
jclapis Jun 9, 2025
2e1198b
Merge branch 'main' into rate-limit-jwt
jclapis Jun 9, 2025
dcf1b0f
Merge branch 'rate-limit-jwt' into improve-http-handling
jclapis Jun 10, 2025
adc4389
Ported HTTP timeout to the PBS event publisher
jclapis Jun 10, 2025
37d299a
Added the http timeout to the example config
jclapis Jun 10, 2025
5df487a
Fixed a test
jclapis Jun 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ base64 = "0.22.1"
bimap = { version = "0.6.3", features = ["serde"] }
blsful = "2.5"
blst = "0.3.11"
bytes = "1.10.1"
cb-cli = { path = "crates/cli" }
cb-common = { path = "crates/common" }
cb-metrics = { path = "crates/metrics" }
Expand All @@ -36,6 +37,7 @@ color-eyre = "0.6.3"
ctr = "0.9.2"
derive_more = { version = "2.0.1", features = ["deref", "display", "from", "into"] }
docker-compose-types = "0.16.0"
docker-image = "0.2.1"
eth2_keystore = { git = "https://github.com/sigp/lighthouse", rev = "8d058e4040b765a96aa4968f4167af7571292be2" }
ethereum_serde_utils = "0.7.0"
ethereum_ssz = "0.8"
Expand All @@ -52,11 +54,14 @@ prometheus = "0.13.4"
prost = "0.13.4"
rand = { version = "0.9", features = ["os_rng"] }
reqwest = { version = "0.12.4", features = ["json", "stream"] }
scopeguard = "1.2.0"
serde = { version = "1.0.202", features = ["derive"] }
serde_json = "1.0.117"
serde_yaml = "0.9.33"
serial_test = "3.2.0"
sha2 = "0.10.8"
ssz_types = "0.10"
tempfile = "3.20.0"
thiserror = "2.0.12"
tokio = { version = "1.37.0", features = ["full"] }
toml = "0.8.13"
Expand Down
3 changes: 3 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ extra_validation_enabled = false
# Execution Layer RPC url to use for extra validation
# OPTIONAL
rpc_url = "https://ethereum-holesky-rpc.publicnode.com"
# Timeout for any HTTP requests sent from the PBS module to other services, in seconds
# OPTIONAL, DEFAULT: 10
http_timeout_seconds = 10

# The PBS module needs one or more [[relays]] as defined below.
[[relays]]
Expand Down
4 changes: 4 additions & 0 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ axum.workspace = true
base64.workspace = true
bimap.workspace = true
blst.workspace = true
bytes.workspace = true
cipher.workspace = true
ctr.workspace = true
derive_more.workspace = true
docker-image.workspace = true
eth2_keystore.workspace = true
ethereum_serde_utils.workspace = true
ethereum_ssz.workspace = true
Expand All @@ -41,3 +43,5 @@ tree_hash_derive.workspace = true
unicode-normalization.workspace = true
url.workspace = true
jsonwebtoken.workspace = true
serial_test.workspace = true
scopeguard.workspace = true
17 changes: 17 additions & 0 deletions crates/common/src/config/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ pub const SIGNER_MODULE_NAME: &str = "signer";
/// Where the signer module should open the server
pub const SIGNER_ENDPOINT_ENV: &str = "CB_SIGNER_ENDPOINT";

// JWT authentication settings
pub const SIGNER_JWT_AUTH_FAIL_LIMIT_ENV: &str = "CB_SIGNER_JWT_AUTH_FAIL_LIMIT";
pub const SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS_ENV: &str =
"CB_SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS";

/// Comma separated list module_id=jwt_secret
pub const JWTS_ENV: &str = "CB_JWTS";

Expand Down Expand Up @@ -67,6 +72,15 @@ pub const PROXY_DIR_KEYS_DEFAULT: &str = "/proxy_keys";
pub const PROXY_DIR_SECRETS_ENV: &str = "CB_PROXY_SECRETS_DIR";
pub const PROXY_DIR_SECRETS_DEFAULT: &str = "/proxy_secrets";

////////////////////////// MUXER //////////////////////////

/// Timeout for HTTP requests, in seconds
pub const HTTP_TIMEOUT_SECONDS_ENV: &str = "CB_HTTP_TIMEOUT_SECONDS";
pub const HTTP_TIMEOUT_SECONDS_DEFAULT: u64 = 10;

/// Max content length for Muxer HTTP responses, in bytes
pub const MUXER_HTTP_MAX_LENGTH: u64 = 1024 * 1024 * 1024 * 10; // 10 MiB

///////////////////////// MODULES /////////////////////////

/// The unique ID of the module
Expand All @@ -81,3 +95,6 @@ pub const SIGNER_URL_ENV: &str = "CB_SIGNER_URL";
/// Events modules
/// Where to receive builder events
pub const BUILDER_PORT_ENV: &str = "CB_BUILDER_PORT";

///////////////////////// TESTING CONSTANTS /////////////////////////
pub const CB_TEST_HTTP_DISABLE_CONTENT_LENGTH_ENV: &str = "CB_TEST_HTTP_DISABLE_CONTENT_LENGTH";
3 changes: 3 additions & 0 deletions crates/common/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ impl CommitBoostConfig {
/// Validate config
pub async fn validate(&self) -> Result<()> {
self.pbs.pbs_config.validate(self.chain).await?;
if let Some(signer) = &self.signer {
signer.validate().await?;
}
Ok(())
}

Expand Down
Loading
Loading