Browse Source

p2p: rename NodeInfo.DefaultNodeID to NodeID

pull/5850/head
Erik Grinaker 4 years ago
committed by Erik Grinaker
parent
commit
b4ce1de44a
12 changed files with 80 additions and 82 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +2
    -2
      blockchain/v2/reactor_test.go
  3. +3
    -3
      node/node.go
  4. +2
    -2
      p2p/mock/peer.go
  5. +10
    -10
      p2p/node_info.go
  6. +1
    -1
      p2p/peer_test.go
  7. +3
    -3
      p2p/test_util.go
  8. +12
    -12
      p2p/transport_memory.go
  9. +41
    -41
      proto/tendermint/p2p/types.pb.go
  10. +1
    -1
      proto/tendermint/p2p/types.proto
  11. +1
    -4
      proto/tendermint/types/params.pb.go
  12. +3
    -3
      test/maverick/node/node.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -32,6 +32,7 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
- [p2p] Removed unused function `MakePoWTarget`. (@erikgrinaker)
- [libs/bits] \#5720 Validate `BitArray` in `FromProto`, which now returns an error (@melekes)
- [proto/p2p] Renamed `DefaultNodeInfo` and `DefaultNodeInfoOther` to `NodeInfo` and `NodeInfoOther` (@erikgrinaker)
- [proto/p2p] Rename `NodeInfo.default_node_id` to `node_id` (@erikgrinaker)
- [libs/os] Kill() and {Must,}{Read,Write}File() functions have been removed. (@alessio)


+ 2
- 2
blockchain/v2/reactor_test.go View File

@ -46,8 +46,8 @@ func (mp mockPeer) CloseConn() error { return nil }
func (mp mockPeer) NodeInfo() p2p.NodeInfo {
return p2p.NodeInfo{
DefaultNodeID: "",
ListenAddr: "",
NodeID: "",
ListenAddr: "",
}
}
func (mp mockPeer) Status() conn.ConnectionStatus { return conn.ConnectionStatus{} }


+ 3
- 3
node/node.go View File

@ -1265,9 +1265,9 @@ func makeNodeInfo(
state.Version.Consensus.Block,
state.Version.Consensus.App,
),
DefaultNodeID: nodeKey.ID,
Network: genDoc.ChainID,
Version: version.TMCoreSemVer,
NodeID: nodeKey.ID,
Network: genDoc.ChainID,
Version: version.TMCoreSemVer,
Channels: []byte{
bcChannel,
cs.StateChannel, cs.DataChannel, cs.VoteChannel, cs.VoteSetBitsChannel,


+ 2
- 2
p2p/mock/peer.go View File

@ -46,8 +46,8 @@ func (mp *Peer) TrySend(chID byte, msgBytes []byte) bool { return true }
func (mp *Peer) Send(chID byte, msgBytes []byte) bool { return true }
func (mp *Peer) NodeInfo() p2p.NodeInfo {
return p2p.NodeInfo{
DefaultNodeID: mp.addr.ID,
ListenAddr: mp.addr.DialString(),
NodeID: mp.addr.ID,
ListenAddr: mp.addr.DialString(),
}
}
func (mp *Peer) Status() conn.ConnectionStatus { return conn.ConnectionStatus{} }


+ 10
- 10
p2p/node_info.go View File

@ -53,8 +53,8 @@ type NodeInfo struct {
// Authenticate
// TODO: replace with NetAddress
DefaultNodeID NodeID `json:"id"` // authenticated identifier
ListenAddr string `json:"listen_addr"` // accepting incoming
NodeID NodeID `json:"id"` // authenticated identifier
ListenAddr string `json:"listen_addr"` // accepting incoming
// Check compatibility.
// Channels are HexBytes so easier to read as JSON
@ -75,7 +75,7 @@ type NodeInfoOther struct {
// ID returns the node's peer ID.
func (info NodeInfo) ID() NodeID {
return info.DefaultNodeID
return info.NodeID
}
// Validate checks the self-reported NodeInfo is safe.
@ -199,7 +199,7 @@ func (info NodeInfo) ToProto() *tmp2p.NodeInfo {
App: info.ProtocolVersion.App,
}
dni.DefaultNodeID = string(info.DefaultNodeID)
dni.NodeID = string(info.NodeID)
dni.ListenAddr = info.ListenAddr
dni.Network = info.Network
dni.Version = info.Version
@ -223,12 +223,12 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) {
Block: pb.ProtocolVersion.Block,
App: pb.ProtocolVersion.App,
},
DefaultNodeID: NodeID(pb.DefaultNodeID),
ListenAddr: pb.ListenAddr,
Network: pb.Network,
Version: pb.Version,
Channels: pb.Channels,
Moniker: pb.Moniker,
NodeID: NodeID(pb.NodeID),
ListenAddr: pb.ListenAddr,
Network: pb.Network,
Version: pb.Version,
Channels: pb.Channels,
Moniker: pb.Moniker,
Other: NodeInfoOther{
TxIndex: pb.Other.TxIndex,
RPCAddress: pb.Other.RPCAddress,


+ 1
- 1
p2p/peer_test.go View File

@ -217,7 +217,7 @@ func (rp *remotePeer) accept() {
func (rp *remotePeer) nodeInfo() NodeInfo {
return NodeInfo{
ProtocolVersion: defaultProtocolVersion,
DefaultNodeID: rp.Addr().ID,
NodeID: rp.Addr().ID,
ListenAddr: rp.listener.Addr().String(),
Network: "testing",
Version: "1.2.3-rc0-deadbeef",


+ 3
- 3
p2p/test_util.go View File

@ -25,8 +25,8 @@ func CreateRandomPeer(outbound bool) Peer {
p := &peer{
peerConn: peerConn{outbound: outbound},
nodeInfo: NodeInfo{
DefaultNodeID: netAddr.ID,
ListenAddr: netAddr.DialString(),
NodeID: netAddr.ID,
ListenAddr: netAddr.DialString(),
},
metrics: NopMetrics(),
}
@ -224,7 +224,7 @@ func testNodeInfo(id NodeID, name string) NodeInfo {
func testNodeInfoWithNetwork(id NodeID, name, network string) NodeInfo {
return NodeInfo{
ProtocolVersion: defaultProtocolVersion,
DefaultNodeID: id,
NodeID: id,
ListenAddr: fmt.Sprintf("127.0.0.1:%d", getFreePort()),
Network: network,
Version: "1.2.3-rc0-deadbeef",


+ 12
- 12
p2p/transport_memory.go View File

@ -45,7 +45,7 @@ func (n *MemoryNetwork) CreateTransport(
nodeInfo NodeInfo,
privKey crypto.PrivKey,
) (*MemoryTransport, error) {
nodeID := nodeInfo.DefaultNodeID
nodeID := nodeInfo.NodeID
if nodeID == "" {
return nil, errors.New("no node ID")
}
@ -67,8 +67,8 @@ func (n *MemoryNetwork) GenerateTransport() *MemoryTransport {
privKey := ed25519.GenPrivKey()
nodeID := PubKeyToID(privKey.PubKey())
nodeInfo := NodeInfo{
DefaultNodeID: nodeID,
ListenAddr: fmt.Sprintf("%v:%v", MemoryProtocol, nodeID),
NodeID: nodeID,
ListenAddr: fmt.Sprintf("%v:%v", MemoryProtocol, nodeID),
}
t, err := n.CreateTransport(nodeInfo, privKey)
if err != nil {
@ -128,7 +128,7 @@ func newMemoryTransport(
nodeInfo: nodeInfo,
privKey: privKey,
logger: network.logger.With("local",
fmt.Sprintf("%v:%v", MemoryProtocol, nodeInfo.DefaultNodeID)),
fmt.Sprintf("%v:%v", MemoryProtocol, nodeInfo.NodeID)),
acceptCh: make(chan *MemoryConnection),
closeCh: make(chan struct{}),
@ -199,7 +199,7 @@ func (t *MemoryTransport) DialAccept(
) (Connection, Connection, error) {
endpoints := peer.Endpoints()
if len(endpoints) == 0 {
return nil, nil, fmt.Errorf("peer %q not listening on any endpoints", peer.nodeInfo.DefaultNodeID)
return nil, nil, fmt.Errorf("peer %q not listening on any endpoints", peer.nodeInfo.NodeID)
}
acceptCh := make(chan Connection, 1)
@ -224,7 +224,7 @@ func (t *MemoryTransport) DialAccept(
// Close implements Transport.
func (t *MemoryTransport) Close() error {
err := t.network.RemoveTransport(t.nodeInfo.DefaultNodeID)
err := t.network.RemoveTransport(t.nodeInfo.NodeID)
t.closeOnce.Do(func() {
close(t.closeCh)
})
@ -240,8 +240,8 @@ func (t *MemoryTransport) Endpoints() []Endpoint {
default:
return []Endpoint{{
Protocol: MemoryProtocol,
PeerID: t.nodeInfo.DefaultNodeID,
Path: string(t.nodeInfo.DefaultNodeID),
PeerID: t.nodeInfo.NodeID,
Path: string(t.nodeInfo.NodeID),
}}
}
}
@ -363,18 +363,18 @@ func (c *MemoryConnection) FlushClose() error {
// LocalEndpoint returns the local endpoint for the connection.
func (c *MemoryConnection) LocalEndpoint() Endpoint {
return Endpoint{
PeerID: c.local.nodeInfo.DefaultNodeID,
PeerID: c.local.nodeInfo.NodeID,
Protocol: MemoryProtocol,
Path: string(c.local.nodeInfo.DefaultNodeID),
Path: string(c.local.nodeInfo.NodeID),
}
}
// RemoteEndpoint returns the remote endpoint for the connection.
func (c *MemoryConnection) RemoteEndpoint() Endpoint {
return Endpoint{
PeerID: c.remote.nodeInfo.DefaultNodeID,
PeerID: c.remote.nodeInfo.NodeID,
Protocol: MemoryProtocol,
Path: string(c.remote.nodeInfo.DefaultNodeID),
Path: string(c.remote.nodeInfo.NodeID),
}
}


+ 41
- 41
proto/tendermint/p2p/types.pb.go View File

@ -145,7 +145,7 @@ func (m *ProtocolVersion) GetApp() uint64 {
type NodeInfo struct {
ProtocolVersion ProtocolVersion `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version"`
DefaultNodeID string `protobuf:"bytes,2,opt,name=default_node_id,json=defaultNodeId,proto3" json:"default_node_id,omitempty"`
NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
ListenAddr string `protobuf:"bytes,3,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"`
Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
@ -194,9 +194,9 @@ func (m *NodeInfo) GetProtocolVersion() ProtocolVersion {
return ProtocolVersion{}
}
func (m *NodeInfo) GetDefaultNodeID() string {
func (m *NodeInfo) GetNodeID() string {
if m != nil {
return m.DefaultNodeID
return m.NodeID
}
return ""
}
@ -305,37 +305,37 @@ func init() {
func init() { proto.RegisterFile("tendermint/p2p/types.proto", fileDescriptor_c8a29e659aeca578) }
var fileDescriptor_c8a29e659aeca578 = []byte{
// 476 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x52, 0xc1, 0x6e, 0xda, 0x40,
0x10, 0xc5, 0xc6, 0x01, 0x32, 0x94, 0x90, 0xae, 0xa2, 0xca, 0x41, 0xaa, 0x8d, 0x38, 0x71, 0xc2,
0x92, 0xab, 0x1e, 0x72, 0x2c, 0xe5, 0xc2, 0x25, 0xb1, 0x56, 0x55, 0x0f, 0xed, 0xc1, 0x02, 0xef,
0x06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, 0x0b, 0xcf, 0x7a, 0x29, 0x3c, 0xeb, 0x4f, 0xe1, 0x59, 0x3f, 0xf7, 0x5e, 0xe3, 0x65,
0xef, 0x35, 0x7e, 0xed, 0xbd, 0xc6, 0x97, 0xf7, 0x2b, 0xa6, 0xd7, 0x4f, 0xcb, 0x49, 0x22, 0xb6,
0xc1, 0x51, 0x96, 0x8f, 0x63, 0x6d, 0x12, 0x7b, 0x9a, 0xf3, 0x65, 0xcb, 0x74, 0xdf, 0xfd, 0x0d,
0x00, 0x00, 0xff, 0xff, 0xa7, 0xfb, 0xff, 0xd7, 0x00, 0x03, 0x00, 0x00,
// 468 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x52, 0xcd, 0x8e, 0xda, 0x3c,
0x14, 0x25, 0x21, 0x10, 0xe6, 0xf2, 0xcd, 0x8f, 0xac, 0xd1, 0xa7, 0x0c, 0x52, 0x13, 0x44, 0x37,
0xac, 0x12, 0x29, 0x55, 0x17, 0x5d, 0x96, 0xce, 0x86, 0xcd, 0x4c, 0x64, 0x55, 0x5d, 0xb4, 0x0b,
0x04, 0xb1, 0x0b, 0x16, 0x60, 0x5b, 0x8e, 0xdb, 0xd2, 0xb7, 0xe8, 0x5b, 0x75, 0x96, 0xb3, 0xec,
0x2a, 0xaa, 0xc2, 0x8b, 0x54, 0x76, 0x42, 0x0b, 0xec, 0xee, 0xb9, 0xc7, 0xf7, 0xe7, 0x5c, 0x1f,
0x18, 0x68, 0xca, 0x09, 0x55, 0x5b, 0xc6, 0x75, 0x22, 0x53, 0x99, 0xe8, 0xef, 0x92, 0x16, 0xb1,
0x54, 0x42, 0x0b, 0x74, 0xf5, 0x8f, 0x8b, 0x65, 0x2a, 0x07, 0xb7, 0x4b, 0xb1, 0x14, 0x96, 0x4a,
0x4c, 0x54, 0xbf, 0x1a, 0x65, 0x00, 0x0f, 0x54, 0xbf, 0x25, 0x44, 0x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c, 0x16, 0xed, 0xd4, 0x4c, 0x03, 0xd1, 0x00, 0x7a, 0xf9, 0x6a, 0xce, 0x39, 0xdd,
0x14, 0x41, 0x77, 0xe8, 0x8c, 0xff, 0xc3, 0x7f, 0xb1, 0xa9, 0xda, 0x0a, 0xce, 0xd6, 0x54, 0x05,
0x7e, 0x5d, 0xd5, 0x40, 0xf4, 0x06, 0x3a, 0x42, 0xaf, 0xa8, 0x0a, 0x7a, 0x56, 0xf6, 0x8b, 0x73,
0xd9, 0x87, 0x53, 0x3d, 0x9a, 0x47, 0x8d, 0xe8, 0xba, 0x62, 0xf4, 0x09, 0x2e, 0x4f, 0x58, 0x74,
0x07, 0x3d, 0xbd, 0x9b, 0x31, 0x4e, 0xe8, 0xae, 0xfe, 0x7a, 0xec, 0xeb, 0xdd, 0xd4, 0x40, 0x94,
0x40, 0x5f, 0xc9, 0xdc, 0xca, 0xa5, 0x45, 0xd1, 0x9c, 0xe6, 0xaa, 0x2a, 0x23, 0xc0, 0xd9, 0xbb,
0xc6, 0x34, 0x18, 0x94, 0xcc, 0x9b, 0x78, 0xf2, 0xf8, 0x54, 0x85, 0xce, 0x73, 0x15, 0x3a, 0xbf,
0xab, 0xd0, 0xf9, 0xb1, 0x0f, 0x5b, 0xcf, 0xfb, 0xb0, 0xf5, 0x6b, 0x1f, 0xb6, 0x3e, 0xbe, 0x5e,
0x32, 0xbd, 0xfa, 0xb2, 0x88, 0x73, 0xb1, 0x4d, 0x8e, 0x5c, 0x7b, 0x6c, 0x60, 0xeb, 0xcd, 0x53,
0x47, 0x2f, 0xba, 0x36, 0xfb, 0xea, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0x32, 0x6b, 0x65,
0xea, 0x02, 0x00, 0x00,
}
func (m *NetAddress) Marshal() (dAtA []byte, err error) {
@ -483,10 +483,10 @@ func (m *NodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x1a
}
if len(m.DefaultNodeID) > 0 {
i -= len(m.DefaultNodeID)
copy(dAtA[i:], m.DefaultNodeID)
i = encodeVarintTypes(dAtA, i, uint64(len(m.DefaultNodeID)))
if len(m.NodeID) > 0 {
i -= len(m.NodeID)
copy(dAtA[i:], m.NodeID)
i = encodeVarintTypes(dAtA, i, uint64(len(m.NodeID)))
i--
dAtA[i] = 0x12
}
@ -597,7 +597,7 @@ func (m *NodeInfo) Size() (n int) {
_ = l
l = m.ProtocolVersion.Size()
n += 1 + l + sovTypes(uint64(l))
l = len(m.DefaultNodeID)
l = len(m.NodeID)
if l > 0 {
n += 1 + l + sovTypes(uint64(l))
}
@ -959,7 +959,7 @@ func (m *NodeInfo) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeID", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@ -987,7 +987,7 @@ func (m *NodeInfo) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.DefaultNodeID = string(dAtA[iNdEx:postIndex])
m.NodeID = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {


+ 1
- 1
proto/tendermint/p2p/types.proto View File

@ -19,7 +19,7 @@ message ProtocolVersion {
message NodeInfo {
ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false];
string default_node_id = 2 [(gogoproto.customname) = "DefaultNodeID"];
string node_id = 2 [(gogoproto.customname) = "NodeID"];
string listen_addr = 3;
string network = 4;
string version = 5;


+ 1
- 4
proto/tendermint/types/params.pb.go View File

@ -105,10 +105,7 @@ type BlockParams struct {
// Max gas per block.
// Note: must be greater or equal to -1
MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"`
// Minimum time increment between consecutive blocks (in milliseconds) If the
// block header timestamp is ahead of the system clock, decrease this value.
//
// Not exposed to the application.
// This parameter is unused.
TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"`
}


+ 3
- 3
test/maverick/node/node.go View File

@ -1307,9 +1307,9 @@ func makeNodeInfo(
state.Version.Consensus.Block,
state.Version.Consensus.App,
),
DefaultNodeID: nodeKey.ID,
Network: genDoc.ChainID,
Version: version.TMCoreSemVer,
NodeID: nodeKey.ID,
Network: genDoc.ChainID,
Version: version.TMCoreSemVer,
Channels: []byte{
bcChannel,
cs.StateChannel, cs.DataChannel, cs.VoteChannel, cs.VoteSetBitsChannel,


Loading…
Cancel
Save