You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To improve the deserialization time of our network graph and address #960, we swapped the PublicKeys describing node ids directly in the graph with a new NodeId struct in #1107. This improved performance greatly, but missed that we're still deserializing PublicKeys a ton when reading a NetworkGraph - we store the original gossip messages in the graph itself with PublicKeys and have to do a bunch of key checking when reading the graph again.
Replacing the PublicKeys in gossip messages with NodeIds should give us yet again a huge speedup in the time it takes to read our network grpah.
I can try and pick this up! I see that the structs UnsignedChannelAnnouncement and UnsignedNodeAnnouncement use PublicKey and are embedded in NetworkGraph. Would this mainly involve changing these structs' PublicKey fields to NodeId and adapting the associated serialization?
Yep, basically just that. We'll need to parse them to PublicKeys when checking signatures (and Err for invalid keys), but that also shouldn't be too complicated (just try to avoid parsing each key more than once in the processing of any given message).
Activity
alecchendev commentedon Feb 6, 2023
I can try and pick this up! I see that the structs
UnsignedChannelAnnouncementandUnsignedNodeAnnouncementusePublicKeyand are embedded inNetworkGraph. Would this mainly involve changing these structs'PublicKeyfields toNodeIdand adapting the associated serialization?TheBlueMatt commentedon Feb 6, 2023
Yep, basically just that. We'll need to parse them to
PublicKeys when checking signatures (andErrfor invalid keys), but that also shouldn't be too complicated (just try to avoid parsing each key more than once in the processing of any given message).alecchendev commentedon Feb 6, 2023
Cool, I'll get started on this tomorrow.