Integrate BACKBEAT SDK and resolve KACHING license validation
Major integrations and fixes: - Added BACKBEAT SDK integration for P2P operation timing - Implemented beat-aware status tracking for distributed operations - Added Docker secrets support for secure license management - Resolved KACHING license validation via HTTPS/TLS - Updated docker-compose configuration for clean stack deployment - Disabled rollback policies to prevent deployment failures - Added license credential storage (CHORUS-DEV-MULTI-001) Technical improvements: - BACKBEAT P2P operation tracking with phase management - Enhanced configuration system with file-based secrets - Improved error handling for license validation - Clean separation of KACHING and CHORUS deployment stacks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
66
vendor/github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util/io.go
generated
vendored
Normal file
66
vendor/github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util/io.go
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
pool "github.com/libp2p/go-buffer-pool"
|
||||
"github.com/libp2p/go-msgio/pbio"
|
||||
"github.com/multiformats/go-varint"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type DelimitedReader struct {
|
||||
r io.Reader
|
||||
buf []byte
|
||||
}
|
||||
|
||||
// The gogo protobuf NewDelimitedReader is buffered, which may eat up stream data.
|
||||
// So we need to implement a compatible delimited reader that reads unbuffered.
|
||||
// There is a slowdown from unbuffered reading: when reading the message
|
||||
// it can take multiple single byte Reads to read the length and another Read
|
||||
// to read the message payload.
|
||||
// However, this is not critical performance degradation as
|
||||
// - the reader is utilized to read one (dialer, stop) or two messages (hop) during
|
||||
// the handshake, so it's a drop in the water for the connection lifetime.
|
||||
// - messages are small (max 4k) and the length fits in a couple of bytes,
|
||||
// so overall we have at most three reads per message.
|
||||
func NewDelimitedReader(r io.Reader, maxSize int) *DelimitedReader {
|
||||
return &DelimitedReader{r: r, buf: pool.Get(maxSize)}
|
||||
}
|
||||
|
||||
func (d *DelimitedReader) Close() {
|
||||
if d.buf != nil {
|
||||
pool.Put(d.buf)
|
||||
d.buf = nil
|
||||
}
|
||||
}
|
||||
|
||||
func (d *DelimitedReader) ReadByte() (byte, error) {
|
||||
buf := d.buf[:1]
|
||||
_, err := d.r.Read(buf)
|
||||
return buf[0], err
|
||||
}
|
||||
|
||||
func (d *DelimitedReader) ReadMsg(msg proto.Message) error {
|
||||
mlen, err := varint.ReadUvarint(d)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if uint64(len(d.buf)) < mlen {
|
||||
return errors.New("message too large")
|
||||
}
|
||||
|
||||
buf := d.buf[:mlen]
|
||||
_, err = io.ReadFull(d.r, buf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return proto.Unmarshal(buf, msg)
|
||||
}
|
||||
|
||||
func NewDelimitedWriter(w io.Writer) pbio.WriteCloser {
|
||||
return pbio.NewDelimitedWriter(w)
|
||||
}
|
||||
44
vendor/github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util/pbconv.go
generated
vendored
Normal file
44
vendor/github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util/pbconv.go
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb"
|
||||
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
)
|
||||
|
||||
func PeerToPeerInfoV2(p *pbv2.Peer) (peer.AddrInfo, error) {
|
||||
if p == nil {
|
||||
return peer.AddrInfo{}, errors.New("nil peer")
|
||||
}
|
||||
|
||||
id, err := peer.IDFromBytes(p.Id)
|
||||
if err != nil {
|
||||
return peer.AddrInfo{}, err
|
||||
}
|
||||
|
||||
addrs := make([]ma.Multiaddr, 0, len(p.Addrs))
|
||||
|
||||
for _, addrBytes := range p.Addrs {
|
||||
a, err := ma.NewMultiaddrBytes(addrBytes)
|
||||
if err == nil {
|
||||
addrs = append(addrs, a)
|
||||
}
|
||||
}
|
||||
|
||||
return peer.AddrInfo{ID: id, Addrs: addrs}, nil
|
||||
}
|
||||
|
||||
func PeerInfoToPeerV2(pi peer.AddrInfo) *pbv2.Peer {
|
||||
addrs := make([][]byte, 0, len(pi.Addrs))
|
||||
for _, addr := range pi.Addrs {
|
||||
addrs = append(addrs, addr.Bytes())
|
||||
}
|
||||
|
||||
return &pbv2.Peer{
|
||||
Id: []byte(pi.ID),
|
||||
Addrs: addrs,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user