Skip to content

Commit b27741f

Browse files
authored
Merge pull request #296 from chainbound/lore/feat/holesky-launch
Holesky Launch
2 parents ae9b72f + a749cf0 commit b27741f

File tree

127 files changed

+13148
-1558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+13148
-1558
lines changed

.github/.linkspector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ useGitIgnore: true
99

1010
ignorePatterns:
1111
- pattern: "^https://.*etherscan.io/.*$"
12-
12+
- pattern: "^https://.*docs.eigenlayer.xyz/.*$"

.github/workflows/contracts_ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
paths:
1111
- "bolt-contracts/**"
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
check:
1519
name: Foundry project

.github/workflows/linkspector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
reporter: github-pr-review
2424
config_file: .github/.linkspector.yml
2525
fail_on_error: true
26-
filter_mode: nofilter
26+
filter_mode: nofilter

bolt-cli/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Stage 1: Base compiler image with necessary dependencies
2+
FROM rust:1.81.0-slim-bullseye AS base
3+
4+
# Install cargo-chef for dependency caching
5+
RUN cargo install cargo-chef
6+
7+
# Set the working directory to /app
8+
WORKDIR /app
9+
10+
# Stage 2: Planner (generating the recipe)
11+
FROM base AS planner
12+
13+
# Copy only Cargo files to cache dependencies
14+
COPY Cargo.toml Cargo.lock ./
15+
16+
# Copy the main.rs file to allow cargo do detect a binary
17+
COPY src/main.rs ./src/main.rs
18+
19+
# Prepare the recipe for caching dependencies (Cargo.toml/Cargo.lock)
20+
RUN cargo chef prepare --recipe-path recipe.json
21+
22+
# Stage 3: Builder with necessary dependencies for OpenSSL
23+
FROM base AS builder
24+
25+
# Install required dependencies for building Rust projects (OpenSSL, pkg-config)
26+
RUN apt-get update && apt-get install -y \
27+
pkg-config \
28+
libssl-dev \
29+
build-essential \
30+
protobuf-compiler
31+
32+
# Copy the generated recipe from the planner stage
33+
COPY --from=planner /app/recipe.json recipe.json
34+
35+
# Cache the dependencies using the cargo-chef recipe
36+
RUN cargo chef cook --release --recipe-path recipe.json
37+
38+
# Copy the source code and build the project
39+
COPY . .
40+
RUN cargo build --release
41+
42+
# Stage 4: Final runtime image (lean image)
43+
FROM debian:bullseye-slim AS runtime
44+
45+
# Set the working directory for the final container
46+
WORKDIR /usr/local/bin
47+
48+
# Install necessary runtime dependencies (OpenSSL and CA certificates)
49+
RUN apt-get update && apt-get install -y \
50+
libssl-dev \
51+
ca-certificates \
52+
&& rm -rf /var/lib/apt/lists/*
53+
54+
# Copy the compiled binary from the builder stage
55+
COPY --from=builder /app/target/release/bolt /usr/local/bin/bolt
56+
57+
# Define the entrypoint for the container
58+
ENTRYPOINT ["/usr/local/bin/bolt"]

bolt-cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Bolt CLI is a collection of command-line tools for interacting with Bolt pro
77
Prerequisites:
88

99
- [Rust toolchain][rust]
10-
- [Protoc][protoc]
10+
- [Protoc][protoc] (as well as `libprotobuf-dev` for some Linux distributions)
1111

1212
Once you have the necessary prerequisites, you can build the binary in the following way:
1313

bolt-cli/rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "1.81.0"
3+
profile = "default"

bolt-cli/src/cli.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ pub struct SendCommand {
101101
#[clap(long, env = "BLOB", default_value = "false")]
102102
pub blob: bool,
103103

104+
/// The max fee per gas in gwei.
105+
#[clap(long, env = "MAX_FEE")]
106+
pub max_fee: Option<u128>,
107+
108+
/// The max priority fee per gas in gwei.
109+
#[clap(long, env = "PRIORITY_FEE", default_value = "2")]
110+
pub priority_fee: u128,
111+
104112
/// If set, the transaction will target the devnet environment.
105113
/// This is only used in Kurtosis for internal testing purposes
106114
#[clap(long, hide = true, env = "DEVNET", default_value = "false")]

bolt-cli/src/commands/send.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
use std::time::Duration;
22

33
use alloy::{
4-
consensus::{BlobTransactionSidecar, SidecarBuilder, SimpleCoder, Transaction},
4+
consensus::{
5+
constants::GWEI_TO_WEI, BlobTransactionSidecar, SidecarBuilder, SimpleCoder, Transaction,
6+
},
57
eips::eip2718::Encodable2718,
8+
hex,
69
network::{EthereumWallet, TransactionBuilder, TransactionBuilder4844},
710
primitives::{keccak256, Address, B256, U256},
811
providers::{ProviderBuilder, SendableTx},
@@ -73,6 +76,12 @@ impl SendCommand {
7376
for _ in 0..self.count {
7477
// generate a simple self-transfer of ETH
7578
let mut req = create_tx_request(wallet.address(), self.blob);
79+
if let Some(max_fee) = self.max_fee {
80+
req.set_max_fee_per_gas(max_fee * GWEI_TO_WEI as u128);
81+
}
82+
83+
req.set_max_priority_fee_per_gas(self.priority_fee * GWEI_TO_WEI as u128);
84+
7685
if let Some(next_nonce) = next_nonce {
7786
req.set_nonce(next_nonce);
7887
}
@@ -219,9 +228,9 @@ async fn sign_request(
219228
keccak256(data)
220229
};
221230

222-
let signature = hex::encode(wallet.sign_hash(&digest).await?.as_bytes());
231+
let signature = hex::encode_prefixed(wallet.sign_hash(&digest).await?.as_bytes());
223232

224-
Ok(format!("{}:0x{}", wallet.address(), signature))
233+
Ok(format!("{}:{}", wallet.address(), signature))
225234
}
226235

227236
fn prepare_rpc_request(method: &str, params: Value) -> Value {

bolt-cli/src/common/keystore.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ impl KeystoreSecret {
5151
/// Load the keystore passwords from a directory containing individual password files.
5252
pub fn from_directory(root_dir: &str) -> Result<Self> {
5353
let mut secrets = HashMap::new();
54-
for entry in fs::read_dir(root_dir)? {
54+
for entry in fs::read_dir(root_dir)
55+
.wrap_err(format!("failed to read secrets directory. path: {}", &root_dir))?
56+
{
5557
let entry = entry.wrap_err("Failed to read secrets directory entry")?;
5658
let path = entry.path();
5759

@@ -108,12 +110,14 @@ impl Drop for KeystoreSecret {
108110
/// -- ...
109111
/// Reference: https://github.com/chainbound/bolt/blob/4634ff905561009e4e74f9921dfdabf43717010f/bolt-sidecar/src/signer/keystore.rs#L109
110112
pub fn keystore_paths(keys_path: &str) -> Result<Vec<PathBuf>> {
111-
let keys_path = Path::new(keys_path).to_path_buf();
113+
let keys_path_buf = Path::new(keys_path).to_path_buf();
112114
let json_extension = OsString::from("json");
113115

114116
let mut keystores_paths = vec![];
115117
// Iter over the `keys` directory
116-
for entry in read_dir(keys_path)? {
118+
for entry in read_dir(keys_path_buf)
119+
.wrap_err(format!("failed to read keys directory. path: {keys_path}"))?
120+
{
117121
let path = read_path(entry)?;
118122
if path.is_dir() {
119123
for entry in read_dir(path)? {

bolt-contracts/.gas-snapshot

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,25 @@ BoltChallengerTest:testProveTransactionInclusion() (gas: 176543)
1313
BoltChallengerTest:testResolveChallengeFullDefenseSingleTx() (gas: 562694)
1414
BoltChallengerTest:testResolveChallengeFullDefenseStackedTxs() (gas: 939716)
1515
BoltChallengerTest:testResolveExpiredChallenge() (gas: 426457)
16-
BoltManagerEigenLayerTest:testDeregisterOperatorFromAVS() (gas: 755578)
17-
BoltManagerEigenLayerTest:testGetOperatorStake() (gas: 919551)
18-
BoltManagerEigenLayerTest:testNonExistentProposerStatus() (gas: 901546)
19-
BoltManagerEigenLayerTest:testProposerStatus() (gas: 928359)
20-
BoltManagerEigenLayerTest:testProposersLookaheadStatus() (gas: 2221042)
21-
BoltManagerSymbioticTest:testGetNonExistentProposerStatus() (gas: 1168685)
22-
BoltManagerSymbioticTest:testGetProposerStatus() (gas: 1415457)
23-
BoltManagerSymbioticTest:testProposersLookaheadStatus() (gas: 2488651)
24-
BoltManagerSymbioticTest:testReadOperatorStake() (gas: 1448345)
25-
BoltValidatorsTest:testUnsafeRegistration() (gas: 149361)
26-
BoltValidatorsTest:testUnsafeRegistrationFailsIfAlreadyRegistered() (gas: 148862)
27-
BoltValidatorsTest:testUnsafeRegistrationInvalidOperator() (gas: 22820)
28-
BoltValidatorsTest:testUnsafeRegistrationWhenNotAllowed() (gas: 33183)
16+
BoltManagerEigenLayerTest:testDeregisterOperatorFromAVS() (gas: 757038)
17+
BoltManagerEigenLayerTest:testGetOperatorStake() (gas: 916622)
18+
BoltManagerEigenLayerTest:testNonExistentProposerStatus() (gas: 902889)
19+
BoltManagerEigenLayerTest:testProposerStatus() (gas: 927230)
20+
BoltManagerEigenLayerTest:testProposersLookaheadStatus() (gas: 2197665)
21+
BoltManagerSymbioticTest:testGetNonExistentProposerStatus() (gas: 1309103)
22+
BoltManagerSymbioticTest:testGetProposerStatus() (gas: 1556603)
23+
BoltManagerSymbioticTest:testProposersLookaheadStatus() (gas: 2632992)
24+
BoltManagerSymbioticTest:testReadOperatorStake() (gas: 1590527)
25+
BoltValidatorsTest:testUnsafeBatchRegistrationGasUsage() (gas: 29088733)
26+
BoltValidatorsTest:testUnsafeRegistration() (gas: 138036)
27+
BoltValidatorsTest:testUnsafeRegistrationFailsIfAlreadyRegistered() (gas: 135421)
28+
BoltValidatorsTest:testUnsafeRegistrationInvalidOperator() (gas: 17352)
29+
BoltValidatorsTest:testUnsafeRegistrationWhenNotAllowed() (gas: 12330)
30+
BoltValidatorsV2Test:testReadRegisteredValidatorsV2() (gas: 8051)
31+
BoltValidatorsV2Test:testUnauthorizedController() (gas: 3613)
32+
BoltValidatorsV2Test:testUnsafeBatchRegistrationV2() (gas: 29122477)
33+
BoltValidatorsV2Test:testUnsafeRegistrationInvalidOperatorV2() (gas: 10332)
34+
BoltValidatorsV2Test:testUnsafeRegistrationV2() (gas: 215472)
35+
BoltValidatorsV2Test:testUpdateMaxGasLimitV2() (gas: 4434)
2936
TransactionDecoderTest:testDecodeAllTestCases() (gas: 0)
3037
TransactionDecoderTest:testDecodeGasUsage() (gas: 53281)

0 commit comments

Comments
 (0)