forked from cerc-io/plugeth
all: remove notion of trusted checkpoints in the post-merge world (#27147)
* all: remove notion of trusted checkpoints in the post-merge world * light: remove unused function * eth/ethconfig, les: remove unused config option * les: make linter happy --------- Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This commit is contained in:
co-authored by
Gary Rong
parent
d3ece3a07c
commit
1e556d220c
@@ -33,7 +33,6 @@ import (
|
||||
"github.com/ethereum/go-ethereum/light"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
)
|
||||
|
||||
// clientHandler is responsible for receiving and processing all incoming server
|
||||
@@ -41,7 +40,6 @@ import (
|
||||
type clientHandler struct {
|
||||
ulc *ulc
|
||||
forkFilter forkid.Filter
|
||||
checkpoint *params.TrustedCheckpoint
|
||||
fetcher *lightFetcher
|
||||
downloader *downloader.Downloader
|
||||
backend *LightEthereum
|
||||
@@ -54,10 +52,9 @@ type clientHandler struct {
|
||||
syncEnd func(header *types.Header) // Hook called when the syncing is done
|
||||
}
|
||||
|
||||
func newClientHandler(ulcServers []string, ulcFraction int, checkpoint *params.TrustedCheckpoint, backend *LightEthereum) *clientHandler {
|
||||
func newClientHandler(ulcServers []string, ulcFraction int, backend *LightEthereum) *clientHandler {
|
||||
handler := &clientHandler{
|
||||
forkFilter: forkid.NewFilter(backend.blockchain),
|
||||
checkpoint: checkpoint,
|
||||
backend: backend,
|
||||
closeCh: make(chan struct{}),
|
||||
}
|
||||
@@ -69,12 +66,8 @@ func newClientHandler(ulcServers []string, ulcFraction int, checkpoint *params.T
|
||||
handler.ulc = ulc
|
||||
log.Info("Enable ultra light client mode")
|
||||
}
|
||||
var height uint64
|
||||
if checkpoint != nil {
|
||||
height = (checkpoint.SectionIndex+1)*params.CHTFrequency - 1
|
||||
}
|
||||
handler.fetcher = newLightFetcher(backend.blockchain, backend.engine, backend.peers, handler.ulc, backend.chainDb, backend.reqDist, handler.synchronise)
|
||||
handler.downloader = downloader.New(height, backend.chainDb, backend.eventMux, nil, backend.blockchain, handler.removePeer)
|
||||
handler.downloader = downloader.New(0, backend.chainDb, backend.eventMux, nil, backend.blockchain, handler.removePeer)
|
||||
handler.backend.peers.subscribe((*downloaderPeerNotify)(handler))
|
||||
return handler
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user