Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple MessageRouter from Router #3326

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fuzz/src/chanmon_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ type ChanMan<'a> = ChannelManager<
Arc<KeyProvider>,
Arc<FuzzEstimator>,
&'a FuzzRouter,
&'a FuzzRouter,
Arc<dyn Logger>,
>;

Expand Down Expand Up @@ -709,6 +710,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
monitor.clone(),
broadcast.clone(),
&router,
&router,
Arc::clone(&logger),
keys_manager.clone(),
keys_manager.clone(),
Expand Down Expand Up @@ -777,6 +779,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
chain_monitor: chain_monitor.clone(),
tx_broadcaster: broadcast.clone(),
router: &router,
message_router: &router,
logger,
default_config: config,
channel_monitors: monitor_refs,
Expand Down
2 changes: 2 additions & 0 deletions fuzz/src/full_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ type ChannelMan<'a> = ChannelManager<
Arc<KeyProvider>,
Arc<FuzzEstimator>,
&'a FuzzRouter,
&'a FuzzRouter,
Arc<dyn Logger>,
>;
type PeerMan<'a> = PeerManager<
Expand Down Expand Up @@ -653,6 +654,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc<dyn Logger>) {
monitor.clone(),
broadcast.clone(),
&router,
&router,
Arc::clone(&logger),
keys_manager.clone(),
keys_manager.clone(),
Expand Down
8 changes: 8 additions & 0 deletions lightning-background-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,13 @@ mod tests {
TestScorer,
>,
>,
Arc<
DefaultMessageRouter<
Arc<NetworkGraph<Arc<test_utils::TestLogger>>>,
Arc<test_utils::TestLogger>,
Arc<KeysManager>,
>,
>,
Arc<test_utils::TestLogger>,
>;

Expand Down Expand Up @@ -1579,6 +1586,7 @@ mod tests {
chain_monitor.clone(),
tx_broadcaster.clone(),
router.clone(),
msg_router.clone(),
logger.clone(),
keys_manager.clone(),
keys_manager.clone(),
Expand Down
10 changes: 7 additions & 3 deletions lightning-block-sync/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ where
/// use lightning::chain::channelmonitor::ChannelMonitor;
/// use lightning::chain::chaininterface::BroadcasterInterface;
/// use lightning::chain::chaininterface::FeeEstimator;
/// use lightning::sign;
/// use lightning::sign::{EntropySource, NodeSigner, SignerProvider};
/// use lightning::ln::channelmanager::{ChannelManager, ChannelManagerReadArgs};
/// use lightning::onion_message::messenger::MessageRouter;
/// use lightning::routing::router::Router;
/// use lightning::sign;
/// use lightning::sign::{EntropySource, NodeSigner, SignerProvider};
/// use lightning::util::config::UserConfig;
/// use lightning::util::logger::Logger;
/// use lightning::util::ser::ReadableArgs;
Expand All @@ -69,6 +70,7 @@ where
/// T: BroadcasterInterface,
/// F: FeeEstimator,
/// R: Router,
/// MR: MessageRouter,
/// L: Logger,
/// C: chain::Filter,
/// P: chainmonitor::Persist<SP::EcdsaSigner>,
Expand All @@ -82,6 +84,7 @@ where
/// tx_broadcaster: &T,
/// fee_estimator: &F,
/// router: &R,
/// message_router: &MR,
/// logger: &L,
/// persister: &P,
/// ) {
Expand All @@ -101,11 +104,12 @@ where
/// chain_monitor,
/// tx_broadcaster,
/// router,
/// message_router,
/// logger,
/// config,
/// vec![&mut monitor],
/// );
/// <(BlockHash, ChannelManager<&ChainMonitor<SP::EcdsaSigner, &C, &T, &F, &L, &P>, &T, &ES, &NS, &SP, &F, &R, &L>)>::read(
/// <(BlockHash, ChannelManager<&ChainMonitor<SP::EcdsaSigner, &C, &T, &F, &L, &P>, &T, &ES, &NS, &SP, &F, &R, &MR, &L>)>::read(
/// &mut Cursor::new(&serialized_manager), read_args).unwrap()
/// };
///
Expand Down
Loading
Loading