erigon-pulse/polygon/sync/sentry.go
milen 64072ce6c7
polygon/sync: implement header downloader (#9030)
Co-authored-by: battlmonstr <battlmonstr@users.noreply.github.com>
2023-12-22 10:44:55 +00:00

18 lines
460 B
Go

package sync
import (
"context"
"math/big"
"github.com/ledgerwatch/erigon/core/types"
"github.com/ledgerwatch/erigon/polygon/sync/peerinfo"
)
//go:generate mockgen -destination=./mock/sentry_mock.go -package=mock . Sentry
type Sentry interface {
MaxPeers() int
PeersWithBlockNumInfo() peerinfo.PeersWithBlockNumInfo
DownloadHeaders(ctx context.Context, start *big.Int, end *big.Int, peerID string) ([]*types.Header, error)
Penalize(peerID string)
}