Skip to content

Commit

Permalink
update protocol versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nibty committed Feb 2, 2024
1 parent 65c592d commit 0c52342
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/faircrypto/go-ethereum v1.1.4-rc1-3
replace github.com/ethereum/go-ethereum => github.com/faircrypto/go-ethereum v1.1.4-rc1-4

replace github.com/Fantom-foundation/lachesis-base => github.com/faircrypto/lachesis-base v0.0.0-20230817040848-1326ba9aa59b

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
github.com/evalphobia/logrus_sentry v0.8.2 h1:dotxHq+YLZsT1Bb45bB5UQbfCh3gM/nFFetyN46VoDQ=
github.com/evalphobia/logrus_sentry v0.8.2/go.mod h1:pKcp+vriitUqu9KiWj/VRFbRfFNUwz95/UkgG8a6MNc=
github.com/faircrypto/go-ethereum v1.1.4-rc1-3 h1:AgRb8c+QOxAqwrcdgQnm7UscEf/yt6WPVQ8dvE8MPqI=
github.com/faircrypto/go-ethereum v1.1.4-rc1-3/go.mod h1:ah5rnRobPJSTUKXIETbrkyrrEhWPTUPfmF1gPPNr0Tg=
github.com/faircrypto/go-ethereum v1.1.4-rc1-4 h1:1C5SKbOuwFyuMrut1SvD+qyFUlC52cA8P+TKC6igKjg=
github.com/faircrypto/go-ethereum v1.1.4-rc1-4/go.mod h1:ah5rnRobPJSTUKXIETbrkyrrEhWPTUPfmF1gPPNr0Tg=
github.com/faircrypto/lachesis-base v0.0.0-20230817040848-1326ba9aa59b h1:mEofwrV6bMlbuneVS8tnZmNZut7WY2YH++2GI7DxzHg=
github.com/faircrypto/lachesis-base v0.0.0-20230817040848-1326ba9aa59b/go.mod h1:Ogv5etzSmM2rQ4eN3OfmyitwWaaPjd4EIDiW/NAbYGk=
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
Expand Down
2 changes: 1 addition & 1 deletion gossip/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ func (h *handler) handle(p *peer) error {
p.Log().Warn("Leecher peer registration failed", "err", err)
return err
}
if p.RunningCap(ProtocolName, []uint{FTM63}) {
if p.RunningCap(ProtocolName, []uint{FTM65}) {
if err := h.epLeecher.RegisterPeer(p.id); err != nil {
p.Log().Warn("Leecher peer registration failed", "err", err)
return err
Expand Down
2 changes: 1 addition & 1 deletion gossip/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,5 +585,5 @@ func (p *snapPeer) info() *snapPeerInfo {

// eligibleForSnap checks eligibility of a peer for a snap protocol. A peer is eligible for a snap if it advertises `snap` sattelite protocol along with `opera` protocol.
func eligibleForSnap(p *p2p.Peer) bool {
return p.RunningCap(ProtocolName, []uint{FTM63}) && p.RunningCap(snap.ProtocolName, snap.ProtocolVersions)
return p.RunningCap(ProtocolName, []uint{FTM65}) && p.RunningCap(snap.ProtocolName, snap.ProtocolVersions)
}
10 changes: 5 additions & 5 deletions gossip/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ import (

// Constants to match up protocol versions and messages
const (
FTM62 = 62
FTM63 = 63
ProtocolVersion = FTM63
FTM64 = 64
FTM65 = 65
ProtocolVersion = FTM65
)

// ProtocolName is the official short name of the protocol used during capability negotiation.
const ProtocolName = "x1"

// ProtocolVersions are the supported versions of the protocol (first is primary).
var ProtocolVersions = []uint{FTM62, FTM63}
var ProtocolVersions = []uint{FTM64, FTM65}

// protocolLengths are the number of implemented message corresponding to different protocol versions.
var protocolLengths = map[uint]uint64{FTM62: EventsStreamResponse + 1, FTM63: EPsStreamResponse + 1}
var protocolLengths = map[uint]uint64{FTM64: EventsStreamResponse + 1, FTM65: EPsStreamResponse + 1}

const protocolMaxMsgSize = inter.ProtocolMaxMsgSize // Maximum cap on the size of a protocol message

Expand Down

0 comments on commit 0c52342

Please sign in to comment.