Skip to content

Commit

Permalink
Merge branch 'main' into rf/net/peer-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Aug 30, 2024
2 parents 74df142 + ab14a33 commit dec8c4d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bin/hera/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ categories.workspace = true
# Local Dependencies
rollup = { path = "../../crates/rollup" }

# Superchain
superchain-registry.workspace = true

# Workspace
eyre.workspace = true
alloy.workspace = true
Expand Down
11 changes: 9 additions & 2 deletions bin/hera/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#![doc(issue_tracker_base_url = "https://github.com/paradigmxyz/op-rs/issues/")]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use alloy::primitives::address;
use clap::Parser;
use eyre::Result;
use op_net::driver::NetworkDriver;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use superchain_registry::ROLLUP_CONFIGS;

/// The default L2 chain ID to use. This corresponds to OP Mainnet.
pub const DEFAULT_L2_CHAIN_ID: u64 = 10;
Expand All @@ -28,7 +28,14 @@ async fn main() -> Result<()> {

tracing::info!("Hera OP Stack Rollup node");

let signer = address!("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
let signer = ROLLUP_CONFIGS
.get(&args.l2_chain_id)
.ok_or(eyre::eyre!("No rollup config found for chain ID"))?
.genesis
.system_config
.as_ref()
.ok_or(eyre::eyre!("No system config found for chain ID"))?
.batcher_address;
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 9099);
let mut driver = NetworkDriver::builder()
.with_chain_id(args.l2_chain_id)
Expand Down
2 changes: 1 addition & 1 deletion crates/net/src/types/enr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mod tests {
use alloy::primitives::{bytes, Bytes};

#[test]
fn rountrip_op_stack_enr() {
fn roundtrip_op_stack_enr() {
arbtest::arbtest(|u| {
let op_stack_enr = OpStackEnr::new(u.arbitrary()?, 0);
let bytes = alloy_rlp::encode(op_stack_enr).to_vec();
Expand Down

0 comments on commit dec8c4d

Please sign in to comment.