Skip to content

Commit

Permalink
chore: rename vars
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Oct 18, 2024
1 parent d81c4e0 commit 7088d85
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
17 changes: 11 additions & 6 deletions bolt-sidecar/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@

# node + PBS URLs
# Ethereum node connections
BOLT_SIDECAR_EXECUTION_API_URL=http://localhost:4485
BOLT_SIDECAR_BEACON_API_URL=http://localhost:4400
BOLT_SIDECAR_ENGINE_API_URL=http://localhost:4451
BOLT_SIDECAR_ENGINE_JWT_HEX=

# Constraint URL: should point to the constraint API sidecar.
# Usually this corresponds to `mev-boost` or `bolt-boost`
BOLT_SIDECAR_CONSTRAINTS_URL=http://localhost:19550

# Commit-boost specific options (optional)
BOLT_SIDECAR_CB_SIGNER_URL=http://localhost:19551
BOLT_SIDECAR_CB_JWT_HEX=

# server ports
BOLT_SIDECAR_PORT=8000
Expand All @@ -15,14 +21,13 @@ BOLT_SIDECAR_MAX_COMMITMENTS=128
BOLT_SIDECAR_MAX_COMMITTED_GAS=10000000

# chain configs
BOLT_SIDECAR_CHAIN=helder
BOLT_SIDECAR_CHAIN=holesky
BOLT_SIDECAR_COMMITMENT_DEADLINE=8000
BOLT_SIDECAR_SLOT_TIME=12

# sidecar security configs
BOLT_SIDECAR_VALIDATOR_INDEXES=
BOLT_SIDECAR_JWT_HEX=
BOLT_SIDECAR_CB_JWT_HEX=
BOLT_SIDECAR_FEE_RECIPIENT=
BOLT_SIDECAR_BUILDER_PRIVATE_KEY=
BOLT_SIDECAR_PRIVATE_KEY=
BOLT_SIDECAR_CONSTRAINT_PRIVATE_KEY=
BOLT_SIDECAR_COMMITMENT_PRIVATE_KEY=
2 changes: 1 addition & 1 deletion bolt-sidecar/src/builder/payload_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl FallbackPayloadBuilder {
pub fn new(config: &Opts, beacon_api_client: BeaconClient, genesis_time: u64) -> Self {
let engine_hinter = EngineHinter {
client: reqwest::Client::new(),
jwt_hex: config.jwt_hex.to_string(),
jwt_hex: config.engine_jwt_hex.to_string(),
engine_rpc_url: config.engine_api_url.clone(),
};

Expand Down
14 changes: 9 additions & 5 deletions bolt-sidecar/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ pub struct Opts {
#[clap(long, env = "BOLT_SIDECAR_ENGINE_API_URL", default_value = "http://localhost:8551")]
pub engine_api_url: Url,
/// URL for the Constraint sidecar client to use
#[clap(long, env = "BOLT_SIDECAR_CONSTRAINTS_URL", default_value = "http://localhost:3030")]
pub constraints_url: Url,
#[clap(
long,
env = "BOLT_SIDECAR_CONSTRAINTS_API_URL",
default_value = "http://localhost:3030"
)]
pub constraints_api_url: Url,
/// Constraint proxy server port to use
#[clap(long, env = "BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT", default_value_t = DEFAULT_CONSTRAINTS_PROXY_PORT)]
pub constraints_proxy_port: u16,
Expand All @@ -62,8 +66,8 @@ pub struct Opts {
///
/// It can either be a hex-encoded string or a file path to a file
/// containing the hex-encoded secret.
#[clap(long, env = "BOLT_SIDECAR_JWT_HEX", default_value_t)]
pub jwt_hex: JwtSecretConfig,
#[clap(long, env = "BOLT_SIDECAR_ENGINE_JWT_HEX", default_value_t)]
pub engine_jwt_hex: JwtSecretConfig,
/// The fee recipient address for fallback blocks
#[clap(long, env = "BOLT_SIDECAR_FEE_RECIPIENT", default_value_t = Address::ZERO)]
pub fee_recipient: Address,
Expand Down Expand Up @@ -133,7 +137,7 @@ mod tests {
assert_eq!(config.execution_api_url, Url::parse("http://localhost:8545").unwrap());
assert_eq!(config.beacon_api_url, Url::parse("http://localhost:5052").unwrap());
assert_eq!(config.engine_api_url, Url::parse("http://localhost:8551").unwrap());
assert_eq!(config.constraints_url, Url::parse("http://localhost:3030").unwrap());
assert_eq!(config.constraints_api_url, Url::parse("http://localhost:3030").unwrap());
assert_eq!(config.constraints_proxy_port, 18551);
}
}
Expand Down
4 changes: 2 additions & 2 deletions bolt-sidecar/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl<C: StateFetcher, ECDSA: SignerECDSA> SidecarDriver<C, ECDSA> {

let (payload_requests_tx, payload_requests_rx) = mpsc::channel(16);
let builder_proxy_cfg = BuilderProxyConfig {
constraints_url: opts.constraints_url.clone(),
constraints_url: opts.constraints_api_url.clone(),
server_port: opts.constraints_proxy_port,
};

Expand All @@ -198,7 +198,7 @@ impl<C: StateFetcher, ECDSA: SignerECDSA> SidecarDriver<C, ECDSA> {
let (api_events_tx, api_events_rx) = mpsc::channel(1024);
CommitmentsApiServer::new(api_addr).run(api_events_tx).await;

let mut constraints_client = ConstraintsClient::new(opts.constraints_url.clone());
let mut constraints_client = ConstraintsClient::new(opts.constraints_api_url.clone());

// read the delegaitons from disk if they exist and add them to the constraints client
if let Some(delegations_file_path) = opts.constraint_signing.delegations_path.as_ref() {
Expand Down
2 changes: 1 addition & 1 deletion bolt-sidecar/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub(crate) async fn get_test_config() -> Option<Opts> {
if let Some(url) = try_get_engine_api_url().await {
opts.engine_api_url = url.parse().expect("valid URL");
}
opts.jwt_hex = JwtSecretConfig(jwt);
opts.engine_jwt_hex = JwtSecretConfig(jwt);

Some(opts)
}
Expand Down

0 comments on commit 7088d85

Please sign in to comment.