Skip to content

Commit

Permalink
Removed all references to forkid and forkfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
jdowning100 committed May 24, 2023
1 parent a28fc6a commit 6d1b1ab
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 450 deletions.
255 changes: 0 additions & 255 deletions core/forkid/forkid.go

This file was deleted.

6 changes: 1 addition & 5 deletions eth/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ package eth

import (
"github.com/dominant-strategies/go-quai/core"
"github.com/dominant-strategies/go-quai/core/forkid"
"github.com/dominant-strategies/go-quai/p2p/enode"
"github.com/dominant-strategies/go-quai/rlp"
)

// ethEntry is the "eth" ENR entry which advertises eth protocol
// on the discovery network.
type ethEntry struct {
ForkID forkid.ID // Fork identifier

// Ignore additional fields (for forward compatibility).
Rest []rlp.RawValue `rlp:"tail"`
}
Expand Down Expand Up @@ -58,6 +55,5 @@ func (eth *Quai) startEthEntryUpdate(ln *enode.LocalNode) {
}

func (eth *Quai) currentEthEntry() *ethEntry {
return &ethEntry{ForkID: forkid.NewID(eth.core.Config(), eth.core.Genesis().Hash(),
eth.core.CurrentHeader().Number().Uint64())}
return &ethEntry{}
}
6 changes: 1 addition & 5 deletions eth/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

"github.com/dominant-strategies/go-quai/common"
"github.com/dominant-strategies/go-quai/core"
"github.com/dominant-strategies/go-quai/core/forkid"
"github.com/dominant-strategies/go-quai/core/types"
"github.com/dominant-strategies/go-quai/eth/downloader"
"github.com/dominant-strategies/go-quai/eth/fetcher"
Expand Down Expand Up @@ -113,7 +112,6 @@ type handlerConfig struct {

type handler struct {
networkID uint64
forkFilter forkid.Filter // Fork ID filter, constant across the lifetime of the node
slicesRunning []common.Location // Slices running on the node

acceptTxs uint32 // Flag whether we're considered synchronised (enables transaction processing)
Expand Down Expand Up @@ -167,7 +165,6 @@ func newHandler(config *handlerConfig) (*handler, error) {
h := &handler{
networkID: config.Network,
slicesRunning: config.SlicesRunning,
forkFilter: forkid.NewFilter(config.Core),
eventMux: config.EventMux,
database: config.Database,
txpool: config.TxPool,
Expand Down Expand Up @@ -230,8 +227,7 @@ func (h *handler) runEthPeer(peer *eth.Peer, handler eth.Handler) error {
hash = head.Hash()
entropy = head.CalcS()
)
forkID := forkid.NewID(h.core.Config(), h.core.Genesis().Hash(), h.core.CurrentHeader().Number().Uint64())
if err := peer.Handshake(h.networkID, h.slicesRunning, entropy, hash, genesis.Hash(), forkID, h.forkFilter); err != nil {
if err := peer.Handshake(h.networkID, h.slicesRunning, entropy, hash, genesis.Hash()); err != nil {
peer.Log().Debug("Quai handshake failed", "err", err)
return err
}
Expand Down
Loading

0 comments on commit 6d1b1ab

Please sign in to comment.