Merge pull request #7526 from yyforyongyu/enhanced-logging

multi: add more trace logs regarding link activate flow
This commit is contained in:
Oliver Gugger 2023-03-23 10:37:13 +01:00 committed by GitHub
commit 3dc4ab736f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 3 deletions

View file

@ -1294,7 +1294,7 @@ func (d *AuthenticatedGossiper) sendRemoteBatch(annBatch []msgWithSenders) {
// We'll first attempt to filter out this new message for all peers
// that have active gossip syncers active.
for pub, syncer := range syncerPeers {
log.Tracef("Sending messages batch to GossipSyncer(%x)", pub)
log.Tracef("Sending messages batch to GossipSyncer(%s)", pub)
syncer.FilterGossipMsgs(annBatch...)
}

View file

@ -111,7 +111,11 @@ func messageStoreKey(msg lnwire.Message, peerPubKey [33]byte) ([]byte, error) {
// AddMessage adds a message to the store for this peer.
func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error {
// Construct the key for which we'll find this message with in the store.
log.Tracef("Adding message of type %v to store for peer %x",
msg.MsgType(), peerPubKey)
// Construct the key for which we'll find this message with in the
// store.
msgKey, err := messageStoreKey(msg, peerPubKey)
if err != nil {
return err
@ -137,6 +141,9 @@ func (s *MessageStore) AddMessage(msg lnwire.Message, peerPubKey [33]byte) error
func (s *MessageStore) DeleteMessage(msg lnwire.Message,
peerPubKey [33]byte) error {
log.Tracef("Deleting message of type %v from store for peer %x",
msg.MsgType(), peerPubKey)
// Construct the key for which we'll find this message with in the
// store.
msgKey, err := messageStoreKey(msg, peerPubKey)

View file

@ -710,6 +710,9 @@ func (l *channelLink) syncChanStates() error {
// first message sent MUST be the ChanSync message.
select {
case msg := <-l.upstream:
l.log.Tracef("Received msg=%v from peer(%x)", msg.MsgType(),
l.cfg.Peer.PubKey())
remoteChanSyncMsg, ok := msg.(*lnwire.ChannelReestablish)
if !ok {
return fmt.Errorf("first message sent to sync "+

View file

@ -776,7 +776,8 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
chanID := lnwire.NewChanIDFromOutPoint(chanPoint)
p.log.Infof("loading ChannelPoint(%v)", chanPoint)
p.log.Infof("Loading ChannelPoint(%v), isPending=%v",
chanPoint, lnChan.IsPending())
// Skip adding any permanently irreconcilable channels to the
// htlcswitch.
@ -1318,6 +1319,8 @@ func (ms *msgStream) AddMsg(msg lnwire.Message) {
func waitUntilLinkActive(p *Brontide,
cid lnwire.ChannelID) htlcswitch.ChannelUpdateHandler {
p.log.Tracef("Waiting for link=%v to be active", cid)
// Subscribe to receive channel events.
//
// NOTE: If the link is already active by SubscribeChannelEvents, then
@ -1395,6 +1398,7 @@ func newChanMsgStream(p *Brontide, cid lnwire.ChannelID) *msgStream {
// If the link is still not active and the calling function
// errored out, just return.
if chanLink == nil {
p.log.Warnf("Link=%v is not active")
return
}
}