Skip to content
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
85 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
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
2e1198b
Merge branch 'main' into rate-limit-jwt
jclapis Jun 9, 2025
ccaf97d
Added JWT auth fields to the example config
jclapis Jun 10, 2025
145ebe8
Started building the JWT config file
jclapis Jun 12, 2025
bb0e023
Added tests
jclapis Jun 12, 2025
71a7605
Started migration from JWTS_ENV to the config file
jclapis Jun 12, 2025
615774e
Signing requests now uses the module's signing ID
jclapis Jun 16, 2025
af6076d
Finished added signing ID support and a quick test
jclapis Jun 17, 2025
cc13a6f
Fixed some example config parameters
jclapis Jun 18, 2025
488547a
Added a test to ensure modules can't create the same sigs
jclapis Jun 18, 2025
ef3d8f2
Merge branch 'rate-limit-jwt' into prevent-cross-module-sigs
jclapis Jun 18, 2025
6fd4327
Made the jwt_config_file optional
jclapis Jun 18, 2025
d9ef82f
Started working on docs
jclapis Jun 24, 2025
83db727
Redid implementation with the original JWTS env var
jclapis Jun 26, 2025
8d08c11
Started the signer doc
jclapis Jun 26, 2025
64b49f2
Overhauled the signing_id setup to be directly in the signed struct
jclapis Jul 1, 2025
8b65b1e
Made proposer commitments nested Merkle trees to allow Dirk support
jclapis Jul 1, 2025
9967033
Added the signer request guide
jclapis Jul 1, 2025
adb1cb8
Added quotes to some HTML
jclapis Jul 1, 2025
1c3a07d
Added some simple JWT secret info
jclapis Jul 2, 2025
daf3147
Adding a closing tag
jclapis Jul 2, 2025
fa36a34
Merge branch 'main' into prevent-cross-module-sigs
jclapis Jul 8, 2025
d5641df
Added prop commit signature verification helpers for modules to use
jclapis Jul 9, 2025
5da31bf
Fixed some params in da_commit
jclapis Jul 10, 2025
bfd72c5
Merge branch 'main' into prevent-cross-module-sigs
jclapis Jul 14, 2025
1a0efec
Cleaned load_module_signing_configs a bit
jclapis Jul 14, 2025
ee282da
Fixed some docs language
jclapis Jul 14, 2025
133447d
Refactored into compute_prop_commit_signing_root
jclapis Jul 15, 2025
9f72aff
Merge branch 'main' into prevent-cross-module-sigs
jclapis Jul 28, 2025
509dba8
Signing IDs are no longer optional in the config
jclapis Jul 28, 2025
2c507d7
Refactored some of the signer consts for consistency
jclapis Jul 28, 2025
d1ad9c9
Merge branch 'refactor-signer-consts' into prevent-cross-module-sigs
jclapis Jul 28, 2025
ff716a0
Updated the Signer API docs
jclapis Jul 29, 2025
de61066
Merge sigp-audit-fixes (#348)
jclapis Jul 30, 2025
db08d77
Merge branch 'sigp-audit-fixes' into prevent-cross-module-sigs
jclapis Jul 30, 2025
ce29c3a
Move from [u8; 32] to B256 everywhere (#347)
jclapis Jul 30, 2025
b837e44
Merge branch 'sigp-audit-fixes' into prevent-cross-module-sigs
jclapis Jul 31, 2025
874e07d
Cleaned up some hashmap usage
jclapis Aug 4, 2025
3ad11a8
Removed compute_tree_hash_root()
jclapis Aug 4, 2025
a75605e
Some minor cleanup
jclapis Aug 4, 2025
d091a90
Fixed some docs
jclapis Aug 4, 2025
0313cc2
Merge branch 'sigp-audit-fixes' into prevent-cross-module-sigs
jclapis Aug 12, 2025
358b3cb
Merge branch 'sigp-audit-fixes' into prevent-cross-module-sigs
jclapis Aug 13, 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
3 changes: 3 additions & 0 deletions bin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ pub mod prelude {
load_pbs_custom_config, LogsSettings, StartCommitModuleConfig, PBS_MODULE_NAME,
},
pbs::{BuilderEvent, BuilderEventClient, OnBuilderApiEvent},
signature::{
verify_proposer_commitment_signature_bls, verify_proposer_commitment_signature_ecdsa,
},
signer::{BlsPublicKey, BlsSignature, EcdsaSignature},
types::Chain,
utils::{initialize_tracing_log, utcnow_ms, utcnow_ns, utcnow_sec, utcnow_us},
Expand Down
6 changes: 4 additions & 2 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ url = "http://0xa119589bb33ef52acbb8116832bec2b58fca590fe5c85eac5d3230b44d5bc09f
# - Dirk: a remote Dirk instance
# - Local: a local Signer module
# More details on the docs (https://commit-boost.github.io/commit-boost-client/get_started/configuration/#signer-module)
# [signer]
[signer]
# Docker image to use for the Signer module.
# OPTIONAL, DEFAULT: ghcr.io/commit-boost/signer:latest
# docker_image = "ghcr.io/commit-boost/signer:latest"
docker_image = "ghcr.io/commit-boost/signer:latest"
# Host to bind the Signer API server to
# OPTIONAL, DEFAULT: 127.0.0.1
host = "127.0.0.1"
Expand Down Expand Up @@ -239,6 +239,8 @@ proxy_dir = "./proxies"
[[modules]]
# Unique ID of the module
id = "DA_COMMIT"
# Unique hash that the Signer service will combine with the incoming data in signing requests to generate a signature specific to this module
signing_id = "0x6a33a23ef26a4836979edff86c493a69b26ccf0b4a16491a815a13787657431b"
Comment thread
ltitanb marked this conversation as resolved.
# Type of the module. Supported values: commit, events
type = "commit"
# Docker image of the module
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/src/docker_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use cb_common::{
PROXY_DIR_KEYS_ENV, PROXY_DIR_SECRETS_DEFAULT, PROXY_DIR_SECRETS_ENV, SIGNER_DEFAULT,
SIGNER_DIR_KEYS_DEFAULT, SIGNER_DIR_KEYS_ENV, SIGNER_DIR_SECRETS_DEFAULT,
SIGNER_DIR_SECRETS_ENV, SIGNER_ENDPOINT_ENV, SIGNER_KEYS_ENV, SIGNER_MODULE_NAME,
SIGNER_URL_ENV,
SIGNER_PORT_DEFAULT, SIGNER_URL_ENV,
},
pbs::{BUILDER_API_PATH, GET_STATUS_PATH},
signer::{ProxyStore, SignerLoader, DEFAULT_SIGNER_PORT},
signer::{ProxyStore, SignerLoader},
types::ModuleId,
utils::random_jwt_secret,
};
Expand Down Expand Up @@ -73,7 +73,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
let mut targets = Vec::new();

// address for signer API communication
let signer_port = cb_config.signer.as_ref().map(|s| s.port).unwrap_or(DEFAULT_SIGNER_PORT);
let signer_port = cb_config.signer.as_ref().map(|s| s.port).unwrap_or(SIGNER_PORT_DEFAULT);
let signer_server =
if let Some(SignerConfig { inner: SignerType::Remote { url }, .. }) = &cb_config.signer {
url.to_string()
Expand Down
1 change: 1 addition & 0 deletions crates/common/src/commit/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl<T: ProxyId> SignedProxyDelegation<T> {
&self.message.delegator,
&self.message,
&self.signature,
None,
COMMIT_BOOST_DOMAIN,
)
}
Expand Down
7 changes: 6 additions & 1 deletion crates/common/src/config/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ pub const SIGNER_MODULE_NAME: &str = "signer";

/// Where the signer module should open the server
pub const SIGNER_ENDPOINT_ENV: &str = "CB_SIGNER_ENDPOINT";
pub const SIGNER_PORT_DEFAULT: u16 = 20000;

// JWT authentication settings
/// Number of auth failures before rate limiting the client
pub const SIGNER_JWT_AUTH_FAIL_LIMIT_ENV: &str = "CB_SIGNER_JWT_AUTH_FAIL_LIMIT";
pub const SIGNER_JWT_AUTH_FAIL_LIMIT_DEFAULT: u32 = 3;

/// How long to rate limit the client after auth failures
pub const SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS_ENV: &str =
"CB_SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS";
pub const SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS_DEFAULT: u32 = 5 * 60;
Comment on lines +41 to +46

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be in this PR or does it need to be rebased?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was some incidental cleanup of #310 that landed in here after it was merged. There are a few little non-functional changes related to it. For cleanliness I can pull all of those out and make a separate PR for them if you'd like, no problem.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep let's do that to keep the PR clean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #346 which has been merged into this now.


/// Comma separated list module_id=jwt_secret
pub const JWTS_ENV: &str = "CB_JWTS";
Expand Down
3 changes: 3 additions & 0 deletions crates/common/src/config/module.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::HashMap;

use alloy::primitives::B256;
use eyre::{ContextCompat, Result};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use toml::Table;
Expand Down Expand Up @@ -37,6 +38,8 @@ pub struct StaticModuleConfig {
/// Type of the module
#[serde(rename = "type")]
pub kind: ModuleKind,
/// Signing ID for the module to use when requesting signatures
pub signing_id: Option<B256>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make it optional?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also worth creating a type alias for clarity

@jclapis jclapis Jul 14, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make it optional?

So this was a concession I had to make in order to support the other use cases where the signature generation pipeline is used with COMMIT_BOOST_DOMAIN, but not tied to a specific module. For example, proxy key generation will do this. Proxy keys are already stored by module ID and don't have any sense of signing ID, so coupling them to the signing ID as well would either involve storing that as part of their path or adding a lookup from module ID to signing ID to the signer. Either way, any time the signing ID changes (e.g, when previous signatures need to be invalidated), you'd have to regenerate all of the proxy keys. It seemed easier to make this field optional to support the existing calls instead of refactoring all of that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we want to still make it optional internally, it should not be optional in the module configuration. After this PR, modules need to have this set

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that makes sense. Fixed in 509dba8.

@ManuelBilbao ManuelBilbao Jul 29, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with making it required for commit modules, but I think for PBS Events modules it's useless as they won't sign anything. With that said, it's not a tedious config to set, so I wouldn't mind to leave it required in favor of a cleaner codebase

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#338 is going to remove PBS events modules anyway, so assuming that goes in soon-ish then this may end up being OBE?

}

/// Runtime config to start a module
Expand Down
Loading