diff --git a/core/crypto/pb/crypto.pb.go b/core/crypto/pb/crypto.pb.go index d960889763..8bbc6a6077 100644 --- a/core/crypto/pb/crypto.pb.go +++ b/core/crypto/pb/crypto.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: core/crypto/pb/crypto.proto package pb @@ -83,12 +83,11 @@ func (KeyType) EnumDescriptor() ([]byte, []int) { } type PublicKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type *KeyType `protobuf:"varint,1,req,name=Type,enum=crypto.pb.KeyType" json:"Type,omitempty"` + Data []byte `protobuf:"bytes,2,req,name=Data" json:"Data,omitempty"` unknownFields protoimpl.UnknownFields - - Type *KeyType `protobuf:"varint,1,req,name=Type,enum=crypto.pb.KeyType" json:"Type,omitempty"` - Data []byte `protobuf:"bytes,2,req,name=Data" json:"Data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PublicKey) Reset() { @@ -136,12 +135,11 @@ func (x *PublicKey) GetData() []byte { } type PrivateKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type *KeyType `protobuf:"varint,1,req,name=Type,enum=crypto.pb.KeyType" json:"Type,omitempty"` + Data []byte `protobuf:"bytes,2,req,name=Data" json:"Data,omitempty"` unknownFields protoimpl.UnknownFields - - Type *KeyType `protobuf:"varint,1,req,name=Type,enum=crypto.pb.KeyType" json:"Type,omitempty"` - Data []byte `protobuf:"bytes,2,req,name=Data" json:"Data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PrivateKey) Reset() { diff --git a/core/peer/pb/peer_record.pb.go b/core/peer/pb/peer_record.pb.go index 8249ba4009..566b8b7a49 100644 --- a/core/peer/pb/peer_record.pb.go +++ b/core/peer/pb/peer_record.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: core/peer/pb/peer_record.proto package pb @@ -29,16 +29,15 @@ const ( // See https://github.com/libp2p/go-libp2p/blob/master/core/record/pb/envelope.proto for // the SignedEnvelope definition. type PeerRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // peer_id contains a libp2p peer id in its binary representation. PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // seq contains a monotonically-increasing sequence counter to order PeerRecords in time. Seq uint64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"` // addresses is a list of public listen addresses for the peer. - Addresses []*PeerRecord_AddressInfo `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` + Addresses []*PeerRecord_AddressInfo `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PeerRecord) Reset() { @@ -95,11 +94,10 @@ func (x *PeerRecord) GetAddresses() []*PeerRecord_AddressInfo { // AddressInfo is a wrapper around a binary multiaddr. It is defined as a // separate message to allow us to add per-address metadata in the future. type PeerRecord_AddressInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Multiaddr []byte `protobuf:"bytes,1,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"` unknownFields protoimpl.UnknownFields - - Multiaddr []byte `protobuf:"bytes,1,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"` + sizeCache protoimpl.SizeCache } func (x *PeerRecord_AddressInfo) Reset() { diff --git a/core/record/pb/envelope.pb.go b/core/record/pb/envelope.pb.go index 8da0e0eea5..d449959a99 100644 --- a/core/record/pb/envelope.pb.go +++ b/core/record/pb/envelope.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: core/record/pb/envelope.proto package pb @@ -29,10 +29,7 @@ const ( // can be deserialized deterministically. Often, this byte string is a // multicodec. type Envelope struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // public_key is the public key of the keypair the enclosed payload was // signed with. PublicKey *pb.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` @@ -44,7 +41,9 @@ type Envelope struct { // signature is the signature produced by the private key corresponding to // the enclosed public key, over the payload, prefixing a domain string for // additional security. - Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Envelope) Reset() { diff --git a/core/sec/insecure/pb/plaintext.pb.go b/core/sec/insecure/pb/plaintext.pb.go index 64ab191b99..45e90ac31b 100644 --- a/core/sec/insecure/pb/plaintext.pb.go +++ b/core/sec/insecure/pb/plaintext.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: core/sec/insecure/pb/plaintext.proto package pb @@ -22,12 +22,11 @@ const ( ) type Exchange struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Pubkey *pb.PublicKey `protobuf:"bytes,2,opt,name=pubkey" json:"pubkey,omitempty"` unknownFields protoimpl.UnknownFields - - Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Pubkey *pb.PublicKey `protobuf:"bytes,2,opt,name=pubkey" json:"pubkey,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Exchange) Reset() { diff --git a/p2p/host/autonat/pb/autonat.pb.go b/p2p/host/autonat/pb/autonat.pb.go index 46eed5986b..013c1ad378 100644 --- a/p2p/host/autonat/pb/autonat.pb.go +++ b/p2p/host/autonat/pb/autonat.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/host/autonat/pb/autonat.proto package pb @@ -142,13 +142,12 @@ func (Message_ResponseStatus) EnumDescriptor() ([]byte, []int) { } type Message struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type *Message_MessageType `protobuf:"varint,1,opt,name=type,enum=autonat.pb.Message_MessageType" json:"type,omitempty"` + Dial *Message_Dial `protobuf:"bytes,2,opt,name=dial" json:"dial,omitempty"` + DialResponse *Message_DialResponse `protobuf:"bytes,3,opt,name=dialResponse" json:"dialResponse,omitempty"` unknownFields protoimpl.UnknownFields - - Type *Message_MessageType `protobuf:"varint,1,opt,name=type,enum=autonat.pb.Message_MessageType" json:"type,omitempty"` - Dial *Message_Dial `protobuf:"bytes,2,opt,name=dial" json:"dial,omitempty"` - DialResponse *Message_DialResponse `protobuf:"bytes,3,opt,name=dialResponse" json:"dialResponse,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Message) Reset() { @@ -203,12 +202,11 @@ func (x *Message) GetDialResponse() *Message_DialResponse { } type Message_PeerInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs" json:"addrs,omitempty"` unknownFields protoimpl.UnknownFields - - Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs" json:"addrs,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Message_PeerInfo) Reset() { @@ -256,11 +254,10 @@ func (x *Message_PeerInfo) GetAddrs() [][]byte { } type Message_Dial struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Peer *Message_PeerInfo `protobuf:"bytes,1,opt,name=peer" json:"peer,omitempty"` unknownFields protoimpl.UnknownFields - - Peer *Message_PeerInfo `protobuf:"bytes,1,opt,name=peer" json:"peer,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Message_Dial) Reset() { @@ -301,13 +298,12 @@ func (x *Message_Dial) GetPeer() *Message_PeerInfo { } type Message_DialResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Status *Message_ResponseStatus `protobuf:"varint,1,opt,name=status,enum=autonat.pb.Message_ResponseStatus" json:"status,omitempty"` + StatusText *string `protobuf:"bytes,2,opt,name=statusText" json:"statusText,omitempty"` + Addr []byte `protobuf:"bytes,3,opt,name=addr" json:"addr,omitempty"` unknownFields protoimpl.UnknownFields - - Status *Message_ResponseStatus `protobuf:"varint,1,opt,name=status,enum=autonat.pb.Message_ResponseStatus" json:"status,omitempty"` - StatusText *string `protobuf:"bytes,2,opt,name=statusText" json:"statusText,omitempty"` - Addr []byte `protobuf:"bytes,3,opt,name=addr" json:"addr,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Message_DialResponse) Reset() { diff --git a/p2p/host/peerstore/pstoreds/pb/pstore.pb.go b/p2p/host/peerstore/pstoreds/pb/pstore.pb.go index 5130bb3865..a6ea3b906b 100644 --- a/p2p/host/peerstore/pstoreds/pb/pstore.pb.go +++ b/p2p/host/peerstore/pstoreds/pb/pstore.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/host/peerstore/pstoreds/pb/pstore.proto package pb @@ -22,16 +22,15 @@ const ( // AddrBookRecord represents a record for a peer in the address book. type AddrBookRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The peer ID. Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The multiaddresses. This is a sorted list where element 0 expires the soonest. Addrs []*AddrBookRecord_AddrEntry `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"` // The most recently received signed PeerRecord. CertifiedRecord *AddrBookRecord_CertifiedRecord `protobuf:"bytes,3,opt,name=certified_record,json=certifiedRecord,proto3" json:"certified_record,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AddrBookRecord) Reset() { @@ -87,15 +86,14 @@ func (x *AddrBookRecord) GetCertifiedRecord() *AddrBookRecord_CertifiedRecord { // AddrEntry represents a single multiaddress. type AddrBookRecord_AddrEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Addr []byte `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` // The point in time when this address expires. Expiry int64 `protobuf:"varint,2,opt,name=expiry,proto3" json:"expiry,omitempty"` // The original TTL of this address. - Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"` + Ttl int64 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AddrBookRecord_AddrEntry) Reset() { @@ -152,14 +150,13 @@ func (x *AddrBookRecord_AddrEntry) GetTtl() int64 { // CertifiedRecord contains a serialized signed PeerRecord used to // populate the signedAddrs list. type AddrBookRecord_CertifiedRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The Seq counter from the signed PeerRecord envelope Seq uint64 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"` // The serialized bytes of the SignedEnvelope containing the PeerRecord. - Raw []byte `protobuf:"bytes,2,opt,name=raw,proto3" json:"raw,omitempty"` + Raw []byte `protobuf:"bytes,2,opt,name=raw,proto3" json:"raw,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AddrBookRecord_CertifiedRecord) Reset() { diff --git a/p2p/protocol/autonatv2/pb/autonatv2.pb.go b/p2p/protocol/autonatv2/pb/autonatv2.pb.go index 3c1016fefd..ab2247947c 100644 --- a/p2p/protocol/autonatv2/pb/autonatv2.pb.go +++ b/p2p/protocol/autonatv2/pb/autonatv2.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/protocol/autonatv2/pb/autonatv2.proto package pb @@ -168,17 +168,16 @@ func (DialBackResponse_DialBackStatus) EnumDescriptor() ([]byte, []int) { } type Message struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Msg: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Msg: // // *Message_DialRequest // *Message_DialResponse // *Message_DialDataRequest // *Message_DialDataResponse - Msg isMessage_Msg `protobuf_oneof:"msg"` + Msg isMessage_Msg `protobuf_oneof:"msg"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Message) Reset() { @@ -211,37 +210,45 @@ func (*Message) Descriptor() ([]byte, []int) { return file_p2p_protocol_autonatv2_pb_autonatv2_proto_rawDescGZIP(), []int{0} } -func (m *Message) GetMsg() isMessage_Msg { - if m != nil { - return m.Msg +func (x *Message) GetMsg() isMessage_Msg { + if x != nil { + return x.Msg } return nil } func (x *Message) GetDialRequest() *DialRequest { - if x, ok := x.GetMsg().(*Message_DialRequest); ok { - return x.DialRequest + if x != nil { + if x, ok := x.Msg.(*Message_DialRequest); ok { + return x.DialRequest + } } return nil } func (x *Message) GetDialResponse() *DialResponse { - if x, ok := x.GetMsg().(*Message_DialResponse); ok { - return x.DialResponse + if x != nil { + if x, ok := x.Msg.(*Message_DialResponse); ok { + return x.DialResponse + } } return nil } func (x *Message) GetDialDataRequest() *DialDataRequest { - if x, ok := x.GetMsg().(*Message_DialDataRequest); ok { - return x.DialDataRequest + if x != nil { + if x, ok := x.Msg.(*Message_DialDataRequest); ok { + return x.DialDataRequest + } } return nil } func (x *Message) GetDialDataResponse() *DialDataResponse { - if x, ok := x.GetMsg().(*Message_DialDataResponse); ok { - return x.DialDataResponse + if x != nil { + if x, ok := x.Msg.(*Message_DialDataResponse); ok { + return x.DialDataResponse + } } return nil } @@ -275,12 +282,11 @@ func (*Message_DialDataRequest) isMessage_Msg() {} func (*Message_DialDataResponse) isMessage_Msg() {} type DialRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Addrs [][]byte `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` + Nonce uint64 `protobuf:"fixed64,2,opt,name=nonce,proto3" json:"nonce,omitempty"` unknownFields protoimpl.UnknownFields - - Addrs [][]byte `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` - Nonce uint64 `protobuf:"fixed64,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DialRequest) Reset() { @@ -328,12 +334,11 @@ func (x *DialRequest) GetNonce() uint64 { } type DialDataRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AddrIdx uint32 `protobuf:"varint,1,opt,name=addrIdx,proto3" json:"addrIdx,omitempty"` + NumBytes uint64 `protobuf:"varint,2,opt,name=numBytes,proto3" json:"numBytes,omitempty"` unknownFields protoimpl.UnknownFields - - AddrIdx uint32 `protobuf:"varint,1,opt,name=addrIdx,proto3" json:"addrIdx,omitempty"` - NumBytes uint64 `protobuf:"varint,2,opt,name=numBytes,proto3" json:"numBytes,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DialDataRequest) Reset() { @@ -381,13 +386,12 @@ func (x *DialDataRequest) GetNumBytes() uint64 { } type DialResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Status DialResponse_ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=autonatv2.pb.DialResponse_ResponseStatus" json:"status,omitempty"` + AddrIdx uint32 `protobuf:"varint,2,opt,name=addrIdx,proto3" json:"addrIdx,omitempty"` + DialStatus DialStatus `protobuf:"varint,3,opt,name=dialStatus,proto3,enum=autonatv2.pb.DialStatus" json:"dialStatus,omitempty"` unknownFields protoimpl.UnknownFields - - Status DialResponse_ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=autonatv2.pb.DialResponse_ResponseStatus" json:"status,omitempty"` - AddrIdx uint32 `protobuf:"varint,2,opt,name=addrIdx,proto3" json:"addrIdx,omitempty"` - DialStatus DialStatus `protobuf:"varint,3,opt,name=dialStatus,proto3,enum=autonatv2.pb.DialStatus" json:"dialStatus,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DialResponse) Reset() { @@ -442,11 +446,10 @@ func (x *DialResponse) GetDialStatus() DialStatus { } type DialDataResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DialDataResponse) Reset() { @@ -487,11 +490,10 @@ func (x *DialDataResponse) GetData() []byte { } type DialBack struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Nonce uint64 `protobuf:"fixed64,1,opt,name=nonce,proto3" json:"nonce,omitempty"` unknownFields protoimpl.UnknownFields - - Nonce uint64 `protobuf:"fixed64,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DialBack) Reset() { @@ -532,11 +534,10 @@ func (x *DialBack) GetNonce() uint64 { } type DialBackResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Status DialBackResponse_DialBackStatus `protobuf:"varint,1,opt,name=status,proto3,enum=autonatv2.pb.DialBackResponse_DialBackStatus" json:"status,omitempty"` unknownFields protoimpl.UnknownFields - - Status DialBackResponse_DialBackStatus `protobuf:"varint,1,opt,name=status,proto3,enum=autonatv2.pb.DialBackResponse_DialBackStatus" json:"status,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DialBackResponse) Reset() { diff --git a/p2p/protocol/circuitv2/pb/circuit.pb.go b/p2p/protocol/circuitv2/pb/circuit.pb.go index fda13bcbbc..cc346e4749 100644 --- a/p2p/protocol/circuitv2/pb/circuit.pb.go +++ b/p2p/protocol/circuitv2/pb/circuit.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/protocol/circuitv2/pb/circuit.proto package pb @@ -184,17 +184,16 @@ func (StopMessage_Type) EnumDescriptor() ([]byte, []int) { } type HopMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // This field is marked optional for backwards compatibility with proto2. // Users should make sure to always set this. - Type *HopMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=circuit.pb.HopMessage_Type,oneof" json:"type,omitempty"` - Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"` - Reservation *Reservation `protobuf:"bytes,3,opt,name=reservation,proto3,oneof" json:"reservation,omitempty"` - Limit *Limit `protobuf:"bytes,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"` - Status *Status `protobuf:"varint,5,opt,name=status,proto3,enum=circuit.pb.Status,oneof" json:"status,omitempty"` + Type *HopMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=circuit.pb.HopMessage_Type,oneof" json:"type,omitempty"` + Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"` + Reservation *Reservation `protobuf:"bytes,3,opt,name=reservation,proto3,oneof" json:"reservation,omitempty"` + Limit *Limit `protobuf:"bytes,4,opt,name=limit,proto3,oneof" json:"limit,omitempty"` + Status *Status `protobuf:"varint,5,opt,name=status,proto3,enum=circuit.pb.Status,oneof" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *HopMessage) Reset() { @@ -263,16 +262,15 @@ func (x *HopMessage) GetStatus() Status { } type StopMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // This field is marked optional for backwards compatibility with proto2. // Users should make sure to always set this. - Type *StopMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=circuit.pb.StopMessage_Type,oneof" json:"type,omitempty"` - Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"` - Limit *Limit `protobuf:"bytes,3,opt,name=limit,proto3,oneof" json:"limit,omitempty"` - Status *Status `protobuf:"varint,4,opt,name=status,proto3,enum=circuit.pb.Status,oneof" json:"status,omitempty"` + Type *StopMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=circuit.pb.StopMessage_Type,oneof" json:"type,omitempty"` + Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"` + Limit *Limit `protobuf:"bytes,3,opt,name=limit,proto3,oneof" json:"limit,omitempty"` + Status *Status `protobuf:"varint,4,opt,name=status,proto3,enum=circuit.pb.Status,oneof" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StopMessage) Reset() { @@ -334,14 +332,13 @@ func (x *StopMessage) GetStatus() Status { } type Peer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // This field is marked optional for backwards compatibility with proto2. // Users should make sure to always set this. - Id []byte `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` - Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"` + Id []byte `protobuf:"bytes,1,opt,name=id,proto3,oneof" json:"id,omitempty"` + Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Peer) Reset() { @@ -389,15 +386,14 @@ func (x *Peer) GetAddrs() [][]byte { } type Reservation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // This field is marked optional for backwards compatibility with proto2. // Users should make sure to always set this. - Expire *uint64 `protobuf:"varint,1,opt,name=expire,proto3,oneof" json:"expire,omitempty"` // Unix expiration time (UTC) - Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"` // relay addrs for reserving peer - Voucher []byte `protobuf:"bytes,3,opt,name=voucher,proto3,oneof" json:"voucher,omitempty"` // reservation voucher + Expire *uint64 `protobuf:"varint,1,opt,name=expire,proto3,oneof" json:"expire,omitempty"` // Unix expiration time (UTC) + Addrs [][]byte `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"` // relay addrs for reserving peer + Voucher []byte `protobuf:"bytes,3,opt,name=voucher,proto3,oneof" json:"voucher,omitempty"` // reservation voucher + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Reservation) Reset() { @@ -452,12 +448,11 @@ func (x *Reservation) GetVoucher() []byte { } type Limit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Duration *uint32 `protobuf:"varint,1,opt,name=duration,proto3,oneof" json:"duration,omitempty"` // seconds + Data *uint64 `protobuf:"varint,2,opt,name=data,proto3,oneof" json:"data,omitempty"` // bytes unknownFields protoimpl.UnknownFields - - Duration *uint32 `protobuf:"varint,1,opt,name=duration,proto3,oneof" json:"duration,omitempty"` // seconds - Data *uint64 `protobuf:"varint,2,opt,name=data,proto3,oneof" json:"data,omitempty"` // bytes + sizeCache protoimpl.SizeCache } func (x *Limit) Reset() { diff --git a/p2p/protocol/circuitv2/pb/voucher.pb.go b/p2p/protocol/circuitv2/pb/voucher.pb.go index 5837d4de23..31b2ded0ea 100644 --- a/p2p/protocol/circuitv2/pb/voucher.pb.go +++ b/p2p/protocol/circuitv2/pb/voucher.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/protocol/circuitv2/pb/voucher.proto package pb @@ -21,15 +21,14 @@ const ( ) type ReservationVoucher struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // These fields are marked optional for backwards compatibility with proto2. // Users should make sure to always set these. - Relay []byte `protobuf:"bytes,1,opt,name=relay,proto3,oneof" json:"relay,omitempty"` - Peer []byte `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"` - Expiration *uint64 `protobuf:"varint,3,opt,name=expiration,proto3,oneof" json:"expiration,omitempty"` + Relay []byte `protobuf:"bytes,1,opt,name=relay,proto3,oneof" json:"relay,omitempty"` + Peer []byte `protobuf:"bytes,2,opt,name=peer,proto3,oneof" json:"peer,omitempty"` + Expiration *uint64 `protobuf:"varint,3,opt,name=expiration,proto3,oneof" json:"expiration,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ReservationVoucher) Reset() { diff --git a/p2p/protocol/holepunch/pb/holepunch.pb.go b/p2p/protocol/holepunch/pb/holepunch.pb.go index c8ab6f16c4..58ef725c8f 100644 --- a/p2p/protocol/holepunch/pb/holepunch.pb.go +++ b/p2p/protocol/holepunch/pb/holepunch.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/protocol/holepunch/pb/holepunch.proto package pb @@ -78,12 +78,11 @@ func (HolePunch_Type) EnumDescriptor() ([]byte, []int) { // spec: https://github.com/libp2p/specs/blob/master/relay/DCUtR.md type HolePunch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type *HolePunch_Type `protobuf:"varint,1,req,name=type,enum=holepunch.pb.HolePunch_Type" json:"type,omitempty"` + ObsAddrs [][]byte `protobuf:"bytes,2,rep,name=ObsAddrs" json:"ObsAddrs,omitempty"` unknownFields protoimpl.UnknownFields - - Type *HolePunch_Type `protobuf:"varint,1,req,name=type,enum=holepunch.pb.HolePunch_Type" json:"type,omitempty"` - ObsAddrs [][]byte `protobuf:"bytes,2,rep,name=ObsAddrs" json:"ObsAddrs,omitempty"` + sizeCache protoimpl.SizeCache } func (x *HolePunch) Reset() { diff --git a/p2p/protocol/identify/pb/identify.pb.go b/p2p/protocol/identify/pb/identify.pb.go index 66f4cb703a..b26bc0323b 100644 --- a/p2p/protocol/identify/pb/identify.pb.go +++ b/p2p/protocol/identify/pb/identify.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/protocol/identify/pb/identify.proto package pb @@ -21,10 +21,7 @@ const ( ) type Identify struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // protocolVersion determines compatibility between peers ProtocolVersion *string `protobuf:"bytes,5,opt,name=protocolVersion" json:"protocolVersion,omitempty"` // e.g. ipfs/1.0.0 // agentVersion is like a UserAgent string in browsers, or client version in bittorrent @@ -48,6 +45,8 @@ type Identify struct { // see github.com/libp2p/go-libp2p/core/record/pb/envelope.proto and // github.com/libp2p/go-libp2p/core/peer/pb/peer_record.proto for message definitions. SignedPeerRecord []byte `protobuf:"bytes,8,opt,name=signedPeerRecord" json:"signedPeerRecord,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Identify) Reset() { diff --git a/p2p/security/noise/pb/payload.pb.go b/p2p/security/noise/pb/payload.pb.go index 45a104e222..e6c7bdd164 100644 --- a/p2p/security/noise/pb/payload.pb.go +++ b/p2p/security/noise/pb/payload.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/security/noise/pb/payload.proto package pb @@ -21,12 +21,11 @@ const ( ) type NoiseExtensions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - WebtransportCerthashes [][]byte `protobuf:"bytes,1,rep,name=webtransport_certhashes,json=webtransportCerthashes" json:"webtransport_certhashes,omitempty"` - StreamMuxers []string `protobuf:"bytes,2,rep,name=stream_muxers,json=streamMuxers" json:"stream_muxers,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + WebtransportCerthashes [][]byte `protobuf:"bytes,1,rep,name=webtransport_certhashes,json=webtransportCerthashes" json:"webtransport_certhashes,omitempty"` + StreamMuxers []string `protobuf:"bytes,2,rep,name=stream_muxers,json=streamMuxers" json:"stream_muxers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NoiseExtensions) Reset() { @@ -74,13 +73,12 @@ func (x *NoiseExtensions) GetStreamMuxers() []string { } type NoiseHandshakePayload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + IdentityKey []byte `protobuf:"bytes,1,opt,name=identity_key,json=identityKey" json:"identity_key,omitempty"` + IdentitySig []byte `protobuf:"bytes,2,opt,name=identity_sig,json=identitySig" json:"identity_sig,omitempty"` + Extensions *NoiseExtensions `protobuf:"bytes,4,opt,name=extensions" json:"extensions,omitempty"` unknownFields protoimpl.UnknownFields - - IdentityKey []byte `protobuf:"bytes,1,opt,name=identity_key,json=identityKey" json:"identity_key,omitempty"` - IdentitySig []byte `protobuf:"bytes,2,opt,name=identity_sig,json=identitySig" json:"identity_sig,omitempty"` - Extensions *NoiseExtensions `protobuf:"bytes,4,opt,name=extensions" json:"extensions,omitempty"` + sizeCache protoimpl.SizeCache } func (x *NoiseHandshakePayload) Reset() { diff --git a/p2p/transport/webrtc/pb/message.pb.go b/p2p/transport/webrtc/pb/message.pb.go index d7d4d583af..68eb45dda2 100644 --- a/p2p/transport/webrtc/pb/message.pb.go +++ b/p2p/transport/webrtc/pb/message.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 -// protoc v5.28.2 +// protoc-gen-go v1.36.0 +// protoc v5.29.2 // source: p2p/transport/webrtc/pb/message.proto package pb @@ -91,12 +91,11 @@ func (Message_Flag) EnumDescriptor() ([]byte, []int) { } type Message struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Flag *Message_Flag `protobuf:"varint,1,opt,name=flag,enum=Message_Flag" json:"flag,omitempty"` + Message []byte `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` unknownFields protoimpl.UnknownFields - - Flag *Message_Flag `protobuf:"varint,1,opt,name=flag,enum=Message_Flag" json:"flag,omitempty"` - Message []byte `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Message) Reset() { diff --git a/scripts/.gitignore b/scripts/.gitignore new file mode 100644 index 0000000000..7371c9e452 --- /dev/null +++ b/scripts/.gitignore @@ -0,0 +1,2 @@ +protobuf-bin/ +protoc-gen-go diff --git a/scripts/download-protoc.sh b/scripts/download-protoc.sh new file mode 100755 index 0000000000..6870c22c9f --- /dev/null +++ b/scripts/download-protoc.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +set -eou pipefail + +# Specify the protobuf release version +PROTOBUF_VERSION="29.2" + +# Define SHA-256 hashes for each supported platform +# Update these hashes by running ./print-protoc-hashes.sh +declare -A SHA256_HASHES=( + ["linux-aarch64"]="0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5" + ["linux-x86_64"]="52e9e7ece55c7e30e7e8bbd254b4b21b408a5309bca826763c7124b696a132e9" + ["darwin-aarch64"]="0e153a38d6da19594c980e7f7cd3ea0ddd52c9da1068c03c0d8533369fbfeb20" +) + +# Determine the platform +OS="$(uname -s | tr '[:upper:]' '[:lower:]')" +ARCH="$(uname -m)" +[[ "${ARCH}" == "arm64" ]] && ARCH="aarch64" + +PLATFORM="${OS}-${ARCH}" + +# Set the download URL based on the platform +case "${PLATFORM}" in +linux-x86_64) + PROTOC_ZIP="protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" + ;; +linux-aarch64) + PROTOC_ZIP="protoc-${PROTOBUF_VERSION}-linux-aarch64.zip" + ;; +darwin-aarch64) + PROTOC_ZIP="protoc-${PROTOBUF_VERSION}-osx-aarch_64.zip" + ;; +*) + echo "Unsupported platform: ${PLATFORM}" >&2 + exit 1 + ;; +esac + +# Download the specified version of protobuf +DOWNLOAD_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_ZIP}" +echo "Downloading from: ${DOWNLOAD_URL}" >&2 +curl -LO "${DOWNLOAD_URL}" + +# Verify checksum +EXPECTED_SHA256="${SHA256_HASHES[${PLATFORM}]}" +if command -v shasum >/dev/null 2>&1; then + ACTUAL_SHA256=$(shasum -a 256 "${PROTOC_ZIP}" | cut -d' ' -f1) +else + ACTUAL_SHA256=$(sha256sum "${PROTOC_ZIP}" | cut -d' ' -f1) +fi + +if [[ "${ACTUAL_SHA256}" != "${EXPECTED_SHA256}" ]]; then + echo "Checksum verification failed!" >&2 + echo "Expected: ${EXPECTED_SHA256}" >&2 + echo "Got: ${ACTUAL_SHA256}" >&2 + rm "${PROTOC_ZIP}" + exit 1 +fi + +echo "Checksum verified successfully" >&2 + +# Create a directory for extraction +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +INSTALL_DIR="$SCRIPT_DIR/protobuf-bin/protoc-${PROTOBUF_VERSION}" +mkdir -p "${INSTALL_DIR}" + +# Unzip the downloaded file +unzip -q -o "${PROTOC_ZIP}" -d "${INSTALL_DIR}" + +# Clean up the zip file +rm "${PROTOC_ZIP}" + +# Return a new PATH with the protobuf binary +PROTOC_BIN="${INSTALL_DIR}/bin" +echo "Installed protoc ${PROTOBUF_VERSION} to ${INSTALL_DIR}" >&2 + +# Return the protoc bin path to stdout +printf "${PROTOC_BIN}" diff --git a/scripts/gen-proto.sh b/scripts/gen-proto.sh index d06187bb67..dac2cff2f9 100755 --- a/scripts/gen-proto.sh +++ b/scripts/gen-proto.sh @@ -4,25 +4,32 @@ set -eou pipefail root=$1 proto_array=( - core/crypto/pb/crypto.proto - core/record/pb/envelope.proto - core/peer/pb/peer_record.proto - core/sec/insecure/pb/plaintext.proto - p2p/host/autonat/pb/autonat.proto - p2p/security/noise/pb/payload.proto - p2p/transport/webrtc/pb/message.proto - p2p/protocol/identify/pb/identify.proto - p2p/protocol/circuitv2/pb/circuit.proto - p2p/protocol/circuitv2/pb/voucher.proto - p2p/protocol/autonatv2/pb/autonatv2.proto - p2p/protocol/holepunch/pb/holepunch.proto - p2p/host/peerstore/pstoreds/pb/pstore.proto + core/crypto/pb/crypto.proto + core/record/pb/envelope.proto + core/peer/pb/peer_record.proto + core/sec/insecure/pb/plaintext.proto + p2p/host/autonat/pb/autonat.proto + p2p/security/noise/pb/payload.proto + p2p/transport/webrtc/pb/message.proto + p2p/protocol/identify/pb/identify.proto + p2p/protocol/circuitv2/pb/circuit.proto + p2p/protocol/circuitv2/pb/voucher.proto + p2p/protocol/autonatv2/pb/autonatv2.proto + p2p/protocol/holepunch/pb/holepunch.proto + p2p/host/peerstore/pstoreds/pb/pstore.proto ) proto_paths="" for path in "${proto_array[@]}"; do - proto_paths+="$path " + proto_paths+="$path " done +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROTOC_BIN_PATH="$("${SCRIPT_DIR}/download-protoc.sh")" +export PATH="$PROTOC_BIN_PATH:$PATH" + echo protoc --version $(protoc --version) -protoc --proto_path=$root --go_out=$root --go_opt=paths=source_relative $proto_paths +(cd ${SCRIPT_DIR} && go build -o protoc-gen-go google.golang.org/protobuf/cmd/protoc-gen-go) + +echo protoc-gen-go --version $(${SCRIPT_DIR}/protoc-gen-go --version) +protoc --plugin="${SCRIPT_DIR}/protoc-gen-go" --proto_path=$root --go_out=$root --go_opt=paths=source_relative $proto_paths diff --git a/scripts/print-protoc-hashes.sh b/scripts/print-protoc-hashes.sh new file mode 100755 index 0000000000..9a9d270a30 --- /dev/null +++ b/scripts/print-protoc-hashes.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +set -eou pipefail + +# Specify the protobuf release version +PROTOBUF_VERSION="29.2" + +# Define the platforms +PLATFORMS=("linux-x86_64" "linux-aarch64" "darwin-aarch64") + +# Array to store the hashes +declare -A HASHES + +# Function to download and calculate the SHA-256 hash +calculate_hash() { + local platform=$1 + local protoc_zip + + case "${platform}" in + linux-x86_64) + protoc_zip="protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" + ;; + linux-aarch64) + protoc_zip="protoc-${PROTOBUF_VERSION}-linux-aarch64.zip" + ;; + darwin-aarch64) + protoc_zip="protoc-${PROTOBUF_VERSION}-osx-aarch_64.zip" + ;; + *) + echo "Unsupported platform: ${platform}" + exit 1 + ;; + esac + + # Download the specified version of protobuf + download_url="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${protoc_zip}" + echo "Downloading from: ${download_url}" + curl -LO "${download_url}" + + # Calculate the SHA-256 hash + if command -v shasum >/dev/null 2>&1; then + sha256_hash=$(shasum -a 256 "${protoc_zip}" | cut -d' ' -f1) + else + sha256_hash=$(sha256sum "${protoc_zip}" | cut -d' ' -f1) + fi + + # Store the hash in the array + HASHES["${platform}"]="${sha256_hash}" + + # Clean up the zip file + rm "${protoc_zip}" +} + +# Iterate over the platforms and calculate the hashes +for platform in "${PLATFORMS[@]}"; do + calculate_hash "${platform}" +done + +# Print all the hashes together at the end +echo "Expected SHA-256 hashes for protobuf ${PROTOBUF_VERSION}:" +for platform in "${!HASHES[@]}"; do + echo "[\"${platform}\"]=\"${HASHES[${platform}]}\"" +done