]> git.bitcoin.ninja Git - rapid-gossip-sync-server/commitdiff
Update to LDK 0.0.111, rust-bitcoin 0.29
authorMatt Corallo <git@bluematt.me>
Sun, 11 Sep 2022 22:39:59 +0000 (22:39 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 13 Sep 2022 16:17:40 +0000 (16:17 +0000)
Cargo.toml
src/downloader.rs
src/serialization.rs
src/tracking.rs
src/types.rs

index d2e1435536ccf2053021c678c5c72034bf6b38d4..79fa1d75d7c08a89bf94650e4f7fba85684a42e3 100644 (file)
@@ -4,10 +4,10 @@ version = "0.1.0"
 edition = "2018"
 
 [dependencies]
-bitcoin = "0.28.1"
-lightning = { version = "0.0.110" }
-lightning-block-sync = { version = "0.0.110", features=["rest-client"] }
-lightning-net-tokio = { version = "0.0.110" }
+bitcoin = "0.29"
+lightning = { version = "0.0.111" }
+lightning-block-sync = { version = "0.0.111", features=["rest-client"] }
+lightning-net-tokio = { version = "0.0.111" }
 tokio = { version = "1.14.1", features = ["full"] }
 tokio-postgres = { version="0.7.5" }
 futures = "0.3"
index 997e9977061019558547dc2507fd075e98c74e95..504db2a4ec4b2eb91595fa112e7227ee27be1543 100644 (file)
@@ -1,6 +1,7 @@
 use std::sync::{Arc, RwLock};
 
 use bitcoin::secp256k1::PublicKey;
+use lightning::ln::features::{InitFeatures, NodeFeatures};
 use lightning::ln::msgs::{ChannelAnnouncement, ChannelUpdate, Init, LightningError, NodeAnnouncement, QueryChannelRange, QueryShortChannelIds, ReplyChannelRange, ReplyShortChannelIdsEnd, RoutingMessageHandler};
 use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
 use lightning::util::events::{MessageSendEvent, MessageSendEventsProvider};
@@ -97,12 +98,12 @@ impl RoutingMessageHandler for GossipRouter {
                Ok(output_value)
        }
 
-       fn get_next_channel_announcements(&self, starting_point: u64, batch_amount: u8) -> Vec<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)> {
-               self.native_router.get_next_channel_announcements(starting_point, batch_amount)
+       fn get_next_channel_announcement(&self, starting_point: u64) -> Option<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)> {
+               self.native_router.get_next_channel_announcement(starting_point)
        }
 
-       fn get_next_node_announcements(&self, starting_point: Option<&PublicKey>, batch_amount: u8) -> Vec<NodeAnnouncement> {
-               self.native_router.get_next_node_announcements(starting_point, batch_amount)
+       fn get_next_node_announcement(&self, starting_point: Option<&PublicKey>) -> Option<NodeAnnouncement> {
+               self.native_router.get_next_node_announcement(starting_point)
        }
 
        fn peer_connected(&self, their_node_id: &PublicKey, init: &Init) {
@@ -124,4 +125,12 @@ impl RoutingMessageHandler for GossipRouter {
        fn handle_query_short_channel_ids(&self, their_node_id: &PublicKey, msg: QueryShortChannelIds) -> Result<(), LightningError> {
                self.native_router.handle_query_short_channel_ids(their_node_id, msg)
        }
+
+       fn provided_init_features(&self, their_node_id: &PublicKey) -> InitFeatures {
+               self.native_router.provided_init_features(their_node_id)
+       }
+
+       fn provided_node_features(&self) -> NodeFeatures {
+               self.native_router.provided_node_features()
+       }
 }
index 847c754f8cd209d59228650657a876321677f85f..f7db29dd0f3278dc79cec7364cd53a8b893e9d31 100644 (file)
@@ -2,6 +2,7 @@ use std::cmp::max;
 use std::collections::HashMap;
 
 use bitcoin::BlockHash;
+use bitcoin::hashes::Hash;
 use lightning::ln::msgs::{UnsignedChannelAnnouncement, UnsignedChannelUpdate};
 use lightning::util::ser::{BigSize, Writeable};
 
@@ -93,7 +94,7 @@ pub(super) fn serialize_delta_set(delta_set: DeltaSet, last_sync_timestamp: u32)
                announcements: vec![],
                updates: vec![],
                full_update_defaults: Default::default(),
-               chain_hash: Default::default(),
+               chain_hash: BlockHash::all_zeros(),
                latest_seen: 0,
        };
 
index 83e1887e09a594fc613bb145c744eea506b1d410..810a037828c328e0fc8f6e38dbcf25d4c1272552 100644 (file)
@@ -36,10 +36,12 @@ pub(crate) async fn download_gossip(persistence_sender: mpsc::Sender<GossipMessa
        let message_handler = MessageHandler {
                chan_handler: ErroringMessageHandler::new(),
                route_handler: Arc::clone(&router),
+               onion_message_handler: IgnoringMessageHandler {},
        };
        let peer_handler = Arc::new(PeerManager::new(
                message_handler,
                our_node_secret,
+               0xdeadbeef,
                &random_data,
                TestLogger::new(),
                IgnoringMessageHandler {},
index 1bb3821ccf66677689525ac952263c8002406fc2..5b7434ee0de5b5d2d63055845fc664644539bd57 100644 (file)
@@ -9,7 +9,7 @@ use crate::downloader::GossipRouter;
 use crate::verifier::ChainVerifier;
 
 pub(crate) type GossipChainAccess = Arc<ChainVerifier>;
-pub(crate) type GossipPeerManager = Arc<PeerManager<lightning_net_tokio::SocketDescriptor, ErroringMessageHandler, Arc<GossipRouter>, TestLogger, IgnoringMessageHandler>>;
+pub(crate) type GossipPeerManager = Arc<PeerManager<lightning_net_tokio::SocketDescriptor, ErroringMessageHandler, Arc<GossipRouter>, IgnoringMessageHandler, TestLogger, IgnoringMessageHandler>>;
 
 #[derive(Debug)]
 pub(crate) enum GossipMessage {