Skip to content

Commit 653c288

Browse files
ltitanbjclapis
andauthored
fulu support (#385)
Co-authored-by: Joe Clapis <[email protected]>
1 parent 6f32b95 commit 653c288

34 files changed

+1714
-1565
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ axum = { version = "0.8.1", features = ["macros"] }
2424
axum-extra = { version = "0.10.0", features = ["typed-header"] }
2525
base64 = "0.22.1"
2626
bimap = { version = "0.6.3", features = ["serde"] }
27-
blst = "^0.3.15"
2827
blsful = "^2.5"
28+
blst = "^0.3.15"
2929
bytes = "1.10.1"
3030
cb-cli = { path = "crates/cli" }
3131
cb-common = { path = "crates/common" }
@@ -48,6 +48,7 @@ headers = "0.4.0"
4848
indexmap = "2.2.6"
4949
jsonwebtoken = { version = "9.3.1", default-features = false }
5050
lazy_static = "1.5.0"
51+
lh_eth2 = { package = "eth2", git = "https://github.com/sigp/lighthouse", tag = "v8.0.0-rc.0" }
5152
lh_eth2_keystore = { package = "eth2_keystore", git = "https://github.com/sigp/lighthouse", tag = "v8.0.0-rc.0" }
5253
lh_types = { package = "types", git = "https://github.com/sigp/lighthouse", tag = "v8.0.0-rc.0" }
5354
parking_lot = "0.12.3"
@@ -82,4 +83,4 @@ url = { version = "2.5.0", features = ["serde"] }
8283
uuid = { version = "1.8.0", features = ["fast-rng", "serde", "v4"] }
8384

8485
[patch.crates-io]
85-
blstrs_plus = { git = "https://github.com/Commit-Boost/blstrs" }
86+
blstrs_plus = { git = "https://github.com/Commit-Boost/blstrs" }

config.example.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ late_in_slot_time_ms = 2000
5454
extra_validation_enabled = false
5555
# Execution Layer RPC url to use for extra validation
5656
# OPTIONAL
57-
rpc_url = "https://ethereum-holesky-rpc.publicnode.com"
57+
# rpc_url = "https://ethereum-holesky-rpc.publicnode.com"
5858
# Timeout for any HTTP requests sent from the PBS module to other services, in seconds
5959
# OPTIONAL, DEFAULT: 10
6060
http_timeout_seconds = 10

crates/common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ethereum_ssz_derive.workspace = true
2323
eyre.workspace = true
2424
futures.workspace = true
2525
jsonwebtoken.workspace = true
26+
lh_eth2.workspace = true
2627
lh_eth2_keystore.workspace = true
2728
lh_types.workspace = true
2829
pbkdf2.workspace = true

crates/common/src/config/mod.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,33 @@ impl CommitBoostConfig {
6868
let chain = match helper_config.chain {
6969
ChainLoader::Path { path, genesis_time_secs } => {
7070
// check if the file path is overridden by env var
71-
let (slot_time_secs, genesis_fork_version) =
71+
let (slot_time_secs, genesis_fork_version, fulu_fork_slot) =
7272
if let Some(path) = load_optional_env_var(CHAIN_SPEC_ENV) {
7373
load_chain_from_file(path.parse()?)?
7474
} else {
7575
load_chain_from_file(path)?
7676
};
77-
Chain::Custom { genesis_time_secs, slot_time_secs, genesis_fork_version }
77+
Chain::Custom {
78+
genesis_time_secs,
79+
slot_time_secs,
80+
genesis_fork_version,
81+
fulu_fork_slot,
82+
}
7883
}
7984
ChainLoader::Known(known) => Chain::from(known),
80-
ChainLoader::Custom { genesis_time_secs, slot_time_secs, genesis_fork_version } => {
85+
ChainLoader::Custom {
86+
genesis_time_secs,
87+
slot_time_secs,
88+
genesis_fork_version,
89+
fulu_fork_slot,
90+
} => {
8191
let genesis_fork_version: ForkVersion = genesis_fork_version.as_ref().try_into()?;
82-
Chain::Custom { genesis_time_secs, slot_time_secs, genesis_fork_version }
92+
Chain::Custom {
93+
genesis_time_secs,
94+
slot_time_secs,
95+
genesis_fork_version,
96+
fulu_fork_slot,
97+
}
8398
}
8499
};
85100

crates/common/src/pbs/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub const HEADER_VERSION_KEY: &str = "X-CommitBoost-Version";
1717
pub const HEADER_VERSION_VALUE: &str = COMMIT_BOOST_VERSION;
1818
pub const HEADER_START_TIME_UNIX_MS: &str = "Date-Milliseconds";
1919
pub const HEADER_TIMEOUT_MS: &str = "X-Timeout-Ms";
20+
pub const HEADER_CONSENSUS_VERSION: &str = "Eth-Consensus-Version";
2021

2122
pub const DEFAULT_PBS_JWT_KEY: &str = "DEFAULT_PBS";
2223

crates/common/src/pbs/error.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use alloy::primitives::{B256, U256};
22
use thiserror::Error;
33

4-
use crate::{types::BlsPublicKey, utils::ResponseReadError};
4+
use crate::{types::BlsPublicKeyBytes, utils::ResponseReadError};
55

66
#[derive(Debug, Error)]
77
pub enum PbsError {
@@ -55,7 +55,7 @@ pub enum ValidationError {
5555
EmptyBlockhash,
5656

5757
#[error("pubkey mismatch: expected {expected} got {got}")]
58-
PubkeyMismatch { expected: Box<BlsPublicKey>, got: Box<BlsPublicKey> },
58+
PubkeyMismatch { expected: BlsPublicKeyBytes, got: BlsPublicKeyBytes },
5959

6060
#[error("parent hash mismatch: expected {expected} got {got}")]
6161
ParentHashMismatch { expected: B256, got: B256 },
@@ -96,4 +96,7 @@ pub enum ValidationError {
9696

9797
#[error("payload mismatch: request: {request} response: {response}")]
9898
PayloadVersionMismatch { request: &'static str, response: &'static str },
99+
100+
#[error("unsupported fork")]
101+
UnsupportedFork,
99102
}

crates/common/src/pbs/types/beacon_block.rs

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)