Skip to content

Expose blinded paths' advance_path_by_one #3182

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

Merged
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
9 changes: 4 additions & 5 deletions fuzz/src/chanmon_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin::hashes::Hash as TraitImport;
use bitcoin::WPubkeyHash;

use lightning::blinded_path::message::MessageContext;
use lightning::blinded_path::payment::ReceiveTlvs;
use lightning::blinded_path::BlindedPath;
use lightning::blinded_path::message::{BlindedMessagePath, MessageContext};
use lightning::blinded_path::payment::{BlindedPaymentPath, ReceiveTlvs};
use lightning::chain;
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
use lightning::chain::channelmonitor::{ChannelMonitor, MonitorEvent};
Expand Down Expand Up @@ -127,7 +126,7 @@ impl Router for FuzzRouter {
fn create_blinded_payment_paths<T: secp256k1::Signing + secp256k1::Verification>(
&self, _recipient: PublicKey, _first_hops: Vec<ChannelDetails>, _tlvs: ReceiveTlvs,
_amount_msats: u64, _secp_ctx: &Secp256k1<T>,
) -> Result<Vec<(BlindedPayInfo, BlindedPath)>, ()> {
) -> Result<Vec<(BlindedPayInfo, BlindedPaymentPath)>, ()> {
unreachable!()
}
}
Expand All @@ -142,7 +141,7 @@ impl MessageRouter for FuzzRouter {
fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
&self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey>,
_secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()> {
) -> Result<Vec<BlindedMessagePath>, ()> {
unreachable!()
}
}
Expand Down
9 changes: 4 additions & 5 deletions fuzz/src/full_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ use bitcoin::hashes::Hash as _;
use bitcoin::hex::FromHex;
use bitcoin::WPubkeyHash;

use lightning::blinded_path::message::MessageContext;
use lightning::blinded_path::payment::ReceiveTlvs;
use lightning::blinded_path::BlindedPath;
use lightning::blinded_path::message::{BlindedMessagePath, MessageContext};
use lightning::blinded_path::payment::{BlindedPaymentPath, ReceiveTlvs};
use lightning::chain;
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
use lightning::chain::chainmonitor;
Expand Down Expand Up @@ -164,7 +163,7 @@ impl Router for FuzzRouter {
fn create_blinded_payment_paths<T: secp256k1::Signing + secp256k1::Verification>(
&self, _recipient: PublicKey, _first_hops: Vec<ChannelDetails>, _tlvs: ReceiveTlvs,
_amount_msats: u64, _secp_ctx: &Secp256k1<T>,
) -> Result<Vec<(BlindedPayInfo, BlindedPath)>, ()> {
) -> Result<Vec<(BlindedPayInfo, BlindedPaymentPath)>, ()> {
unreachable!()
}
}
Expand All @@ -179,7 +178,7 @@ impl MessageRouter for FuzzRouter {
fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
&self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey>,
_secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()> {
) -> Result<Vec<BlindedMessagePath>, ()> {
unreachable!()
}
}
Expand Down
7 changes: 3 additions & 4 deletions fuzz/src/invoice_request_deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ use crate::utils::test_logger;
use bitcoin::secp256k1::{self, Keypair, Parity, PublicKey, Secp256k1, SecretKey};
use core::convert::TryFrom;
use lightning::blinded_path::payment::{
Bolt12OfferContext, ForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext, PaymentRelay,
ReceiveTlvs,
BlindedPaymentPath, Bolt12OfferContext, ForwardNode, ForwardTlvs, PaymentConstraints,
PaymentContext, PaymentRelay, ReceiveTlvs,
};
use lightning::blinded_path::BlindedPath;
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
use lightning::ln::features::BlindedHopFeatures;
use lightning::ln::types::PaymentSecret;
Expand Down Expand Up @@ -118,7 +117,7 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
node_id: pubkey(43),
htlc_maximum_msat: 1_000_000_000_000,
}];
let payment_path = BlindedPath::new_for_payment(
let payment_path = BlindedPaymentPath::new(
&intermediate_nodes,
pubkey(42),
payee_tlvs,
Expand Down
6 changes: 3 additions & 3 deletions fuzz/src/onion_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use bitcoin::secp256k1::ecdsa::RecoverableSignature;
use bitcoin::secp256k1::schnorr;
use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1, SecretKey};

use lightning::blinded_path::message::{MessageContext, OffersContext};
use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
use lightning::blinded_path::message::{BlindedMessagePath, MessageContext, OffersContext};
use lightning::blinded_path::EmptyNodeIdLookUp;
use lightning::ln::features::InitFeatures;
use lightning::ln::msgs::{self, DecodeError, OnionMessageHandler};
use lightning::ln::script::ShutdownScript;
Expand Down Expand Up @@ -98,7 +98,7 @@ impl MessageRouter for TestMessageRouter {
fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
&self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey>,
_secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()> {
) -> Result<Vec<BlindedMessagePath>, ()> {
unreachable!()
}
}
Expand Down
7 changes: 3 additions & 4 deletions fuzz/src/refund_deser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ use crate::utils::test_logger;
use bitcoin::secp256k1::{self, Keypair, PublicKey, Secp256k1, SecretKey};
use core::convert::TryFrom;
use lightning::blinded_path::payment::{
Bolt12RefundContext, ForwardNode, ForwardTlvs, PaymentConstraints, PaymentContext,
PaymentRelay, ReceiveTlvs,
BlindedPaymentPath, Bolt12RefundContext, ForwardNode, ForwardTlvs, PaymentConstraints,
PaymentContext, PaymentRelay, ReceiveTlvs,
};
use lightning::blinded_path::BlindedPath;
use lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA;
use lightning::ln::features::BlindedHopFeatures;
use lightning::ln::types::PaymentSecret;
Expand Down Expand Up @@ -96,7 +95,7 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
node_id: pubkey(43),
htlc_maximum_msat: 1_000_000_000_000,
}];
let payment_path = BlindedPath::new_for_payment(
let payment_path = BlindedPaymentPath::new(
&intermediate_nodes,
pubkey(42),
payee_tlvs,
Expand Down
11 changes: 4 additions & 7 deletions fuzz/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use bitcoin::constants::ChainHash;
use bitcoin::script::Builder;
use bitcoin::transaction::TxOut;

use lightning::blinded_path::{BlindedHop, BlindedPath, IntroductionNode};
use lightning::blinded_path::payment::BlindedPaymentPath;
use lightning::blinded_path::BlindedHop;
use lightning::chain::transaction::OutPoint;
use lightning::ln::channel_state::{ChannelCounterparty, ChannelDetails, ChannelShutdownState};
use lightning::ln::channelmanager;
Expand Down Expand Up @@ -380,7 +381,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
let mut last_hops_unblinded = Vec::new();
last_hops!(last_hops_unblinded);
let dummy_pk = PublicKey::from_slice(&[2; 33]).unwrap();
let last_hops: Vec<(BlindedPayInfo, BlindedPath)> = last_hops_unblinded
let last_hops: Vec<(BlindedPayInfo, BlindedPaymentPath)> = last_hops_unblinded
.into_iter()
.map(|hint| {
let hop = &hint.0[0];
Expand All @@ -402,11 +403,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
}
(
payinfo,
BlindedPath {
introduction_node: IntroductionNode::NodeId(hop.src_node_id),
blinding_point: dummy_pk,
blinded_hops,
},
BlindedPaymentPath::from_raw(hop.src_node_id, dummy_pk, blinded_hops),
)
})
.collect();
Expand Down
Loading
Loading