Skip to content

Commit d0a8d93

Browse files
committed
all: rename sync protocol snap -> parallax-snap
1 parent d34e906 commit d0a8d93

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

cmd/devp2p/internal/prltest/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (s *Suite) dialSnap() (*Conn, error) {
104104
if err != nil {
105105
return nil, fmt.Errorf("dial failed: %v", err)
106106
}
107-
conn.caps = append(conn.caps, p2p.Cap{Name: "snap", Version: 1})
107+
conn.caps = append(conn.caps, p2p.Cap{Name: "parallax-snap", Version: 1})
108108
conn.ourHighestSnapProtoVersion = 1
109109
return conn, nil
110110
}
@@ -167,7 +167,7 @@ func (c *Conn) negotiateParallaxProtocol(caps []p2p.Cap) {
167167
if capability.Version > highestParallaxVersion && capability.Version <= c.ourHighestProtoVersion {
168168
highestParallaxVersion = capability.Version
169169
}
170-
case "snap":
170+
case "parallax-snap":
171171
if capability.Version > highestSnapVersion && capability.Version <= c.ourHighestSnapProtoVersion {
172172
highestSnapVersion = capability.Version
173173
}

cmd/devp2p/nodesetcmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func snapFilter(args []string) (nodeFilter, error) {
263263
var snap struct {
264264
Tail []rlp.RawValue `rlp:"tail"`
265265
}
266-
return n.N.Load(enr.WithEntry("snap", &snap)) == nil
266+
return n.N.Load(enr.WithEntry("parallax-snap", &snap)) == nil
267267
}
268268
return f, nil
269269
}

cmd/utils/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ var (
205205
defaultSyncMode = prlconfig.Defaults.SyncMode
206206
SyncModeFlag = TextMarshalerFlag{
207207
Name: "syncmode",
208-
Usage: `Blockchain sync mode ("snap", "full" or "light")`,
208+
Usage: `Blockchain sync mode ("parallax-snap", "full" or "light")`,
209209
Value: &defaultSyncMode,
210210
}
211211
GCModeFlag = cli.StringFlag{

les/downloader/modes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (mode SyncMode) String() string {
4141
case FastSync:
4242
return "fast"
4343
case SnapSync:
44-
return "snap"
44+
return "parallax-snap"
4545
case LightSync:
4646
return "light"
4747
default:
@@ -56,7 +56,7 @@ func (mode SyncMode) MarshalText() ([]byte, error) {
5656
case FastSync:
5757
return []byte("fast"), nil
5858
case SnapSync:
59-
return []byte("snap"), nil
59+
return []byte("parallax-snap"), nil
6060
case LightSync:
6161
return []byte("light"), nil
6262
default:
@@ -70,7 +70,7 @@ func (mode *SyncMode) UnmarshalText(text []byte) error {
7070
*mode = FullSync
7171
case "fast":
7272
*mode = FastSync
73-
case "snap":
73+
case "parallax-snap":
7474
*mode = SnapSync
7575
case "light":
7676
*mode = LightSync

prl/downloader/downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
11891189
}
11901190
log.Warn("Rolled back chain segment",
11911191
"header", fmt.Sprintf("%d->%d", lastHeader, d.lightchain.CurrentHeader().Number),
1192-
"snap", fmt.Sprintf("%d->%d", lastFastBlock, curFastBlock),
1192+
"parallax-snap", fmt.Sprintf("%d->%d", lastFastBlock, curFastBlock),
11931193
"block", fmt.Sprintf("%d->%d", lastBlock, curBlock), "reason", rollbackErr)
11941194
}
11951195
}()

prl/downloader/modes.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (mode SyncMode) String() string {
3838
case FullSync:
3939
return "full"
4040
case SnapSync:
41-
return "snap"
41+
return "parallax-snap"
4242
case LightSync:
4343
return "light"
4444
default:
@@ -51,7 +51,7 @@ func (mode SyncMode) MarshalText() ([]byte, error) {
5151
case FullSync:
5252
return []byte("full"), nil
5353
case SnapSync:
54-
return []byte("snap"), nil
54+
return []byte("parallax-snap"), nil
5555
case LightSync:
5656
return []byte("light"), nil
5757
default:
@@ -63,12 +63,12 @@ func (mode *SyncMode) UnmarshalText(text []byte) error {
6363
switch string(text) {
6464
case "full":
6565
*mode = FullSync
66-
case "snap":
66+
case "parallax-snap":
6767
*mode = SnapSync
6868
case "light":
6969
*mode = LightSync
7070
default:
71-
return fmt.Errorf(`unknown sync mode %q, want "full", "snap" or "light"`, text)
71+
return fmt.Errorf(`unknown sync mode %q, want "full", "parallax-snap" or "light"`, text)
7272
}
7373
return nil
7474
}

prl/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ func (h *handler) unregisterPeer(id string) {
445445
return
446446
}
447447
// Remove the `parallax` peer if it exists
448-
logger.Debug("Removing Parallax peer", "snap", peer.snapExt != nil)
448+
logger.Debug("Removing Parallax peer", "parallax-snap", peer.snapExt != nil)
449449

450450
// Remove the `snap` extension if it exists
451451
if peer.snapExt != nil {

prl/protocols/snap/discovery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ type enrEntry struct {
2828

2929
// ENRKey implements enr.Entry.
3030
func (e enrEntry) ENRKey() string {
31-
return "snap"
31+
return "parallax-snap"
3232
}

prl/protocols/snap/protocol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const (
3232

3333
// ProtocolName is the official short name of the `snap` protocol used during
3434
// devp2p capability negotiation.
35-
const ProtocolName = "snap"
35+
const ProtocolName = "parallax-snap"
3636

3737
// ProtocolVersions are the supported versions of the `snap` protocol (first
3838
// is primary).

prl/protocols/snap/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func NewSyncer(db prldb.KeyValueStore) *Syncer {
462462
peers: make(map[string]SyncPeer),
463463
peerJoin: new(event.Feed),
464464
peerDrop: new(event.Feed),
465-
rates: msgrate.NewTrackers(log.New("proto", "snap")),
465+
rates: msgrate.NewTrackers(log.New("proto", "parallax-snap")),
466466
update: make(chan struct{}, 1),
467467

468468
accountIdlers: make(map[string]struct{}),

0 commit comments

Comments
 (0)