Skip to content

Commit 9674c23

Browse files
committed
Merge branch 'feat/gossip-source' into feat/ci
2 parents 7292a54 + 8843970 commit 9674c23

File tree

7 files changed

+36
-10
lines changed

7 files changed

+36
-10
lines changed

bin/bridge/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ reth-tracing = { git = "https://github.com/scroll-tech/reth.git" }
6464
# misc
6565
serde_json = { version = "1.0.94", default-features = false, features = ["alloc"] }
6666

67+
[features]
68+
test-utils = []
6769

6870
[[bin]]
6971
name = "bridge"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=Scroll Mainnet - Reth
3+
After=network.target
4+
StartLimitIntervalSec=0
5+
6+
[Service]
7+
Type=simple
8+
Restart=always
9+
RestartSec=1
10+
User=ubuntu
11+
Group=ubuntu
12+
UMask=0002
13+
EnvironmentFile=/etc/bridge.env
14+
ExecStart=/usr/local/bin/bridge node --chain scroll-mainnet --metrics 0.0.0.0:9001 --debug.etherscan https://api.scrollscan.com/api
15+
16+
[Install]
17+
WantedBy=multi-user.target

bin/bridge/src/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl BridgeBlockImport {
6060
trace!(target: "bridge::import", peer_id = %peer_id, block = ?block, "Received new block from eth-wire protocol");
6161

6262
// We trigger a new block event to be sent to the rollup node's network manager. If this
63-
// results in an
63+
// results in an error it means the network manager has been dropped.
6464
let _ =
6565
self.to_scroll_network_manager.send(Event::NewBlock { peer_id, block, signature });
6666
} else {

bin/bridge/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//! Scroll Network Bridge Components.
2+
3+
mod import;
4+
pub use import::BridgeBlockImport;
5+
6+
mod network;
7+
pub use network::ScrollBridgeNetworkBuilder;

bin/bridge/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use network::ScrollBridgeNetworkBuilder;
44
mod import;
55
use import::BridgeBlockImport;
66

7-
#[cfg(test)]
8-
mod test;
9-
107
#[global_allocator]
118
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
129

bin/bridge/src/network.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub struct ScrollBridgeNetworkBuilder {
1616
Option<Box<dyn reth_network::import::BlockImport<reth_scroll_primitives::ScrollBlock>>>,
1717
}
1818

19-
#[cfg(test)]
2019
impl ScrollBridgeNetworkBuilder {
2120
/// Creates a new [`ScrollBridgeNetworkBuilder`] with the provided block import.
22-
pub(crate) fn new(
21+
#[cfg(feature = "test-utils")]
22+
pub fn new(
2323
block_import: Box<
2424
dyn reth_network::import::BlockImport<reth_scroll_primitives::ScrollBlock>,
2525
>,
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "test-utils")]
2+
13
use alloy_primitives::B256;
24
use reth_e2e_test_utils::{node::NodeTestContext, NodeHelperType};
35
use reth_network::{NetworkConfigBuilder, PeersInfo};
@@ -204,7 +206,6 @@ impl BlockImport for TestBlockImport {
204206

205207
// HELPERS
206208
// ---------------------------------------------------------------------------------------------
207-
208209
pub async fn build_bridge_node(
209210
chain_spec: Arc<ScrollChainSpec>,
210211
) -> eyre::Result<(NodeHelperType<ScrollNode>, TaskManager, PeerId)> {
@@ -236,9 +237,11 @@ pub async fn build_bridge_node(
236237
let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config.clone())
237238
.testing_node(exec.clone())
238239
.with_types_and_provider::<ScrollNode, BlockchainProvider<_>>()
239-
.with_components(node.components_builder().network(super::ScrollBridgeNetworkBuilder::new(
240-
Box::new(ValidRethBlockImport::default()),
241-
)))
240+
.with_components(node.components_builder().network(
241+
scroll_bridge::ScrollBridgeNetworkBuilder::new(Box::new(
242+
ValidRethBlockImport::default(),
243+
)),
244+
))
242245
.with_add_ons(node.add_ons())
243246
.launch()
244247
.await?;

0 commit comments

Comments
 (0)