• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 13211764208

08 Feb 2025 03:08AM UTC coverage: 49.288% (-9.5%) from 58.815%
13211764208

Pull #9489

github

calvinrzachman
itest: verify switchrpc server enforces send then track

We prevent the rpc server from allowing onion dispatches for
attempt IDs which have already been tracked by rpc clients.

This helps protect the client from leaking a duplicate onion
attempt. NOTE: This is not the only method for solving this
issue! The issue could be addressed via careful client side
programming which accounts for the uncertainty and async
nature of dispatching onions to a remote process via RPC.
This would require some lnd ChannelRouter changes for how
we intend to use these RPCs though.
Pull Request #9489: multi: add BuildOnion, SendOnion, and TrackOnion RPCs

474 of 990 new or added lines in 11 files covered. (47.88%)

27321 existing lines in 435 files now uncovered.

101192 of 205306 relevant lines covered (49.29%)

1.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lnwire/kickoff_sig.go
1
package lnwire
2

3
import (
4
        "bytes"
5
        "io"
6
)
7

8
// KickoffSig is the message used to transmit the signature for a kickoff
9
// transaction during the execution phase of a dynamic commitment negotiation
10
// that requires a reanchoring step.
11
type KickoffSig struct {
12
        // ChanID identifies the channel id for which this signature is
13
        // intended.
14
        ChanID ChannelID
15

16
        // Signature contains the ECDSA signature that signs the kickoff
17
        // transaction.
18
        Signature Sig
19

20
        // ExtraData is the set of data that was appended to this message to
21
        // fill out the full maximum transport message size. These fields can
22
        // be used to specify optional data such as custom TLV fields.
23
        ExtraData ExtraOpaqueData
24
}
25

26
// A compile time check to ensure that KickoffSig implements the lnwire.Message
27
// interface.
28
var _ Message = (*KickoffSig)(nil)
29

30
// Encode serializes the target KickoffSig into the passed bytes.Buffer
31
// observing the specified protocol version.
32
//
33
// This is part of the lnwire.Message interface.
UNCOV
34
func (ks *KickoffSig) Encode(w *bytes.Buffer, _ uint32) error {
×
UNCOV
35
        if err := WriteChannelID(w, ks.ChanID); err != nil {
×
36
                return err
×
37
        }
×
UNCOV
38
        if err := WriteSig(w, ks.Signature); err != nil {
×
39
                return err
×
40
        }
×
41

UNCOV
42
        return WriteBytes(w, ks.ExtraData)
×
43
}
44

45
// Decode deserializes a serialized KickoffSig message stored in the passed
46
// io.Reader observing the specified protocol version.
47
//
48
// This is part of the lnwire.Message interface.
UNCOV
49
func (ks *KickoffSig) Decode(r io.Reader, _ uint32) error {
×
UNCOV
50
        return ReadElements(r, &ks.ChanID, &ks.Signature, &ks.ExtraData)
×
UNCOV
51
}
×
52

53
// MsgType returns the integer uniquely identifying KickoffSig on the wire.
54
//
55
// This is part of the lnwire.Message interface.
UNCOV
56
func (ks *KickoffSig) MsgType() MessageType { return MsgKickoffSig }
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc