mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
In this commit, we add a benchmark for the WriteMessage method. This is the first step in an upcoming optimizooor series of commits. The baseline is: ``` goos: darwin goarch: arm64 pkg: github.com/lightningnetwork/lnd/brontide cpu: Apple M4 Max BenchmarkWriteMessage-16 22736 50667 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 23217 50463 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 24241 49941 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 23574 51021 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 23784 49926 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 24230 50538 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 24058 49971 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 23762 50224 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 24266 53034 ns/op 73788 B/op 5 allocs/op BenchmarkWriteMessage-16 23317 50045 ns/op 73788 B/op 5 allocs/op PASS ok github.com/lightningnetwork/lnd/brontide 17.433s ```
brontide
The brontide package implements a secure crypto messaging protocol based off of the Noise Protocol Framework. The package exposes the raw state machine that handles the handshake and subsequent message encryption/decryption scheme. Additionally, the package exposes a net.Conn and a net.Listener interface implementation which allows the encrypted transport to be seamlessly integrated into a codebase.
The secure messaging scheme implemented within this package is described in detail in BOLT #8 of the Lightning Network specifications.
This package has intentionally been designed so it can be used as a standalone package for any projects needing secure encrypted+authenticated communications between network enabled programs.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/brontide