Skip to content

Commit 0ff7fba

Browse files
committed
Better describe the NodeId type and why it exists
1 parent c46f299 commit 0ff7fba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/routing/gossip.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ const MAX_EXCESS_BYTES_FOR_RELAY: usize = 1024;
7272
/// This value ensures a reply fits within the 65k payload limit and is consistent with other implementations.
7373
const MAX_SCIDS_PER_REPLY: usize = 8000;
7474

75-
/// Represents the compressed public key of a node
75+
/// A compressed pubkey which a node uses to sign announcements and decode HTLCs routed through it.
76+
///
77+
/// This type stores a simple byte array which is not checked for validity (i.e. that it describes
78+
/// a point which lies on the secp256k1 curve), unlike [`PublicKey`], as validity checking would
79+
/// otherwise represent a large portion of [`NetworkGraph`] deserialization time (and RGS
80+
/// application).
7681
#[derive(Clone, Copy, PartialEq, Eq)]
7782
pub struct NodeId([u8; PUBLIC_KEY_SIZE]);
7883

0 commit comments

Comments
 (0)