Skip to content

Commit a75b588

Browse files
committed
refactor(lighthouse_facade): update dependencies and restructure project
- Removed the deprecated `lighthouse_wrapper` crate and replaced it with `lighthouse_facade` for improved architecture. - Updated various dependencies in `Cargo.lock` to their latest versions, including `bitflags`, `parking_lot`, `tokio-util`, and `syn`. - Adjusted `Cargo.toml` files to reflect the new structure and removed references to obsolete crates. - Enhanced the application code to utilize the new `lighthouse_facade` crate, ensuring compatibility with the updated dependencies. - Added a new documentation file outlining the upgrade implementation plan for future reference. These changes streamline the codebase, improve maintainability, and prepare for upcoming enhancements.
1 parent fc8298e commit a75b588

38 files changed

+4595
-3658
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
members = [
33
"app",
44

5-
"crates/lighthouse_wrapper",
6-
"crates/lighthouse_wrapper_v2",
7-
"crates/lighthouse_compat",
5+
"crates/lighthouse_facade",
86
"crates/miner",
97
"crates/actor_system",
108
"tests"

app/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ edition = "2021"
1717
#store = { git = "https://github.com/sigp/lighthouse", rev = "441fc16" }
1818
#bls = { git = "https://github.com/sigp/lighthouse", rev = "441fc16" }
1919

20-
lighthouse_wrapper = { package = "lighthouse_wrapper", path = "../crates/lighthouse_wrapper" }
21-
22-
23-
2420
# workspace
2521
actor_system = { path = "../crates/actor_system" }
26-
lighthouse_wrapper_v2 = { path = "../crates/lighthouse_wrapper_v2" }
22+
lighthouse_facade = { path = "../crates/lighthouse_facade" }
2723

2824
# misc
2925
clap = { workspace = true }
@@ -114,7 +110,7 @@ bincode = "1.3" # Fast serialization for network messages
114110
wide = { version = "0.7", features = ["std"], optional = true }
115111

116112
[dependencies.libp2p]
117-
version = "0.53"
113+
version = "0.54"
118114
default-features = false
119115
features = ["identify", "yamux", "mdns", "noise", "gossipsub", "dns", "tcp", "tokio", "plaintext", "secp256k1", "macros", "ecdsa", "quic","kad", "request-response", "ping"]
120116

app/src/actors/auxpow/difficulty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use actix::prelude::*;
99
use tracing::*;
1010

1111
use bitcoin::CompactTarget;
12-
use lighthouse_wrapper::types::{MainnetEthSpec, Uint256 as U256};
12+
use lighthouse_facade::types::{MainnetEthSpec, Uint256 as U256};
1313
use rust_decimal::prelude::*;
1414

1515
use crate::{

app/src/actors/chain/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use std::time::Duration;
88
use actor_system::SupervisionConfig;
99
use super::state::FederationConfig;
10-
use lighthouse_wrapper::bls::SecretKey;
10+
use lighthouse_facade::bls::SecretKey;
1111

1212
/// Configuration for ChainActor behavior and performance
1313
#[derive(Debug, Clone)]

app/src/actors/engine/client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ use tokio::sync::RwLock;
99
use tracing::*;
1010
use serde::{Deserialize, Serialize};
1111

12-
use lighthouse_wrapper::execution_layer::{
12+
use lighthouse_facade::execution_layer::{
1313
auth::{Auth, JwtKey},
1414
HttpJsonRpc, BlockByNumberQuery, ForkchoiceState, PayloadAttributes,
1515
DEFAULT_EXECUTION_ENDPOINT, LATEST_TAG,
1616
};
17-
use lighthouse_wrapper::sensitive_url::SensitiveUrl;
18-
use lighthouse_wrapper::types::{Address, ExecutionBlockHash, ExecutionPayload, MainnetEthSpec};
17+
use lighthouse_facade::sensitive_url::SensitiveUrl;
18+
use lighthouse_facade::types::{Address, ExecutionBlockHash, ExecutionPayload, MainnetEthSpec};
1919

2020
use crate::types::*;
2121
use super::{config::EngineConfig, state::ClientHealthStatus, EngineError, EngineResult, ClientError};
@@ -355,19 +355,19 @@ impl ExecutionClient {
355355
// Get network ID
356356
let network_id = client.rpc_request::<String>("net_version", serde_json::Value::Null, Duration::from_secs(5))
357357
.await
358-
.and_then(|s| s.parse::<u64>().map_err(|_| lighthouse_wrapper::execution_layer::Error::InvalidPayloadBody("Invalid network ID".to_string())))
358+
.and_then(|s| s.parse::<u64>().map_err(|_| lighthouse_facade::execution_layer::Error::InvalidPayloadBody("Invalid network ID".to_string())))
359359
.unwrap_or(0);
360360

361361
// Get chain ID
362362
let chain_id = client.rpc_request::<String>("eth_chainId", serde_json::Value::Null, Duration::from_secs(5))
363363
.await
364-
.and_then(|s| u64::from_str_radix(s.trim_start_matches("0x"), 16).map_err(|_| lighthouse_wrapper::execution_layer::Error::InvalidPayloadBody("Invalid chain ID".to_string())))
364+
.and_then(|s| u64::from_str_radix(s.trim_start_matches("0x"), 16).map_err(|_| lighthouse_facade::execution_layer::Error::InvalidPayloadBody("Invalid chain ID".to_string())))
365365
.unwrap_or(0);
366366

367367
// Get latest block number
368368
let latest_block = client.rpc_request::<String>("eth_blockNumber", serde_json::Value::Null, Duration::from_secs(5))
369369
.await
370-
.and_then(|s| u64::from_str_radix(s.trim_start_matches("0x"), 16).map_err(|_| lighthouse_wrapper::execution_layer::Error::InvalidPayloadBody("Invalid block number".to_string())))
370+
.and_then(|s| u64::from_str_radix(s.trim_start_matches("0x"), 16).map_err(|_| lighthouse_facade::execution_layer::Error::InvalidPayloadBody("Invalid block number".to_string())))
371371
.unwrap_or(0);
372372

373373
// Check sync status

app/src/actors/engine/engine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ use tokio::sync::RwLock;
1111
use tokio::time::sleep;
1212
use tracing::{debug, info, trace, warn};
1313

14-
use lighthouse_wrapper::execution_layer::{
14+
use lighthouse_facade::execution_layer::{
1515
auth::{Auth, JwtKey},
1616
BlockByNumberQuery, ExecutionBlockWithTransactions, ForkchoiceState, HttpJsonRpc,
1717
PayloadAttributes, DEFAULT_EXECUTION_ENDPOINT, LATEST_TAG,
1818
};
19-
use lighthouse_wrapper::sensitive_url::SensitiveUrl;
20-
use lighthouse_wrapper::types::{
19+
use lighthouse_facade::sensitive_url::SensitiveUrl;
20+
use lighthouse_facade::types::{
2121
Address, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadCapella, MainnetEthSpec,
2222
Uint256, Withdrawal,
2323
};
24-
use lighthouse_wrapper::{execution_layer, types};
24+
use lighthouse_facade::{execution_layer, types};
2525
use serde_json::json;
2626
use ssz_types::VariableList;
2727

app/src/actors/engine/handlers/forkchoice_handlers.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use std::time::{Duration, Instant};
77
use tracing::*;
88
use actix::prelude::*;
99

10-
use lighthouse_wrapper::execution_layer::ForkchoiceState;
11-
use lighthouse_wrapper::types::{Address, MainnetEthSpec};
10+
use lighthouse_facade::execution_layer::ForkchoiceState;
11+
use lighthouse_facade::types::{Address, MainnetEthSpec};
1212

1313
use crate::types::*;
1414
use super::super::{
@@ -56,7 +56,7 @@ impl Handler<ForkchoiceUpdatedMessage> for EngineActor {
5656

5757
// Convert payload attributes if provided
5858
let payload_attributes = msg.payload_attributes.map(|attrs| {
59-
lighthouse_wrapper::execution_layer::PayloadAttributes::new(
59+
lighthouse_facade::execution_layer::PayloadAttributes::new(
6060
attrs.timestamp,
6161
attrs.prev_randao,
6262
attrs.suggested_fee_recipient,
@@ -145,9 +145,9 @@ impl Handler<SetFinalizedBlockMessage> for EngineActor {
145145

146146
/// Convert lighthouse payload status to our format
147147
fn convert_payload_status(
148-
status: lighthouse_wrapper::execution_layer::PayloadStatus
148+
status: lighthouse_facade::execution_layer::PayloadStatus
149149
) -> PayloadStatusType {
150-
use lighthouse_wrapper::execution_layer::PayloadStatus;
150+
use lighthouse_facade::execution_layer::PayloadStatus;
151151

152152
match status {
153153
PayloadStatus::Valid => PayloadStatusType::Valid,

app/src/actors/engine/tests/chaos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use actix::prelude::*;
99
use tracing_test::traced_test;
1010
use rand::{Rng, thread_rng};
1111

12-
use lighthouse_wrapper::types::{Hash256, Address};
12+
use lighthouse_facade::types::{Hash256, Address};
1313

1414
use crate::types::*;
1515
use super::super::{

app/src/actors/engine/tests/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
55
use std::time::{Duration, SystemTime};
66
use actix::prelude::*;
7-
use lighthouse_wrapper::types::{Hash256, Address, MainnetEthSpec};
8-
use lighthouse_wrapper::execution_layer::PayloadAttributes;
7+
use lighthouse_facade::types::{Hash256, Address, MainnetEthSpec};
8+
use lighthouse_facade::execution_layer::PayloadAttributes;
99

1010
use crate::types::*;
1111
use super::super::{

0 commit comments

Comments
 (0)