Skip to content

Commit

Permalink
[DVT-1060] Fix status message protocol version (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu authored Nov 3, 2023
1 parent fc6ff2c commit aed352b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2p/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func NewEthProtocol(version uint, opts EthProtocolOptions) ethp2p.Protocol {

c.headMutex.RLock()
status := eth.StatusPacket{
ProtocolVersion: 66,
ProtocolVersion: uint32(version),
NetworkID: opts.NetworkID,
Genesis: opts.GenesisHash,
ForkID: forkid.NewID(opts.Genesis.Config, opts.Genesis.ToBlock(), opts.Head.Number, uint64(time.Now().Unix())),
Expand Down
6 changes: 5 additions & 1 deletion p2p/rlpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ func Dial(n *enode.Node) (*rlpxConn, error) {

conn := rlpxConn{
Conn: rlpx.NewConn(fd, n.Pubkey()),
caps: []p2p.Cap{{Name: "eth", Version: 66}},
node: n,
logger: log.With().Str("peer", n.URLv4()).Logger(),
caps: []p2p.Cap{
{Name: "eth", Version: 66},
{Name: "eth", Version: 67},
{Name: "eth", Version: 68},
},
}

if conn.ourKey, err = crypto.GenerateKey(); err != nil {
Expand Down

0 comments on commit aed352b

Please sign in to comment.