@@ -13,7 +13,7 @@ import (
1313
1414 storageApi "github.com/oasisprotocol/oasis-core/go/storage/api"
1515 "github.com/oasisprotocol/oasis-core/go/storage/mkvs/checkpoint"
16- storageSync "github.com/oasisprotocol/oasis-core/go/worker/storage/p2p/sync "
16+ "github.com/oasisprotocol/oasis-core/go/worker/storage/p2p/checkpointsync "
1717)
1818
1919const (
@@ -55,7 +55,7 @@ type chunk struct {
5555 * checkpoint.ChunkMetadata
5656
5757 // checkpoint points to the checkpoint this chunk originated from.
58- checkpoint * storageSync .Checkpoint
58+ checkpoint * checkpointsync .Checkpoint
5959}
6060
6161type chunkHeap struct {
@@ -101,7 +101,7 @@ func (n *Node) checkpointChunkFetcher(
101101 defer cancel ()
102102
103103 // Fetch chunk from peers.
104- rsp , pf , err := n .storageSync .GetCheckpointChunk (chunkCtx , & storageSync .GetCheckpointChunkRequest {
104+ rsp , pf , err := n .checkpointSync .GetCheckpointChunk (chunkCtx , & checkpointsync .GetCheckpointChunkRequest {
105105 Version : chunk .Version ,
106106 Root : chunk .Root ,
107107 Index : chunk .Index ,
@@ -157,7 +157,7 @@ func (n *Node) checkpointChunkFetcher(
157157 }
158158}
159159
160- func (n * Node ) handleCheckpoint (check * storageSync .Checkpoint , maxParallelRequests uint ) (cpStatus int , rerr error ) {
160+ func (n * Node ) handleCheckpoint (check * checkpointsync .Checkpoint , maxParallelRequests uint ) (cpStatus int , rerr error ) {
161161 if err := n .localStorage .Checkpointer ().StartRestore (n .ctx , check .Metadata ); err != nil {
162162 // Any previous restores were already aborted by the driver up the call stack, so
163163 // things should have been going smoothly here; bail.
@@ -276,11 +276,11 @@ func (n *Node) handleCheckpoint(check *storageSync.Checkpoint, maxParallelReques
276276 }
277277}
278278
279- func (n * Node ) getCheckpointList () ([]* storageSync .Checkpoint , error ) {
279+ func (n * Node ) getCheckpointList () ([]* checkpointsync .Checkpoint , error ) {
280280 ctx , cancel := context .WithTimeout (n .ctx , cpListsTimeout )
281281 defer cancel ()
282282
283- list , err := n .storageSync .GetCheckpoints (ctx , & storageSync .GetCheckpointsRequest {
283+ list , err := n .checkpointSync .GetCheckpoints (ctx , & checkpointsync .GetCheckpointsRequest {
284284 Version : 1 ,
285285 })
286286 if err != nil {
@@ -297,8 +297,8 @@ func (n *Node) getCheckpointList() ([]*storageSync.Checkpoint, error) {
297297}
298298
299299// sortCheckpoints sorts the slice in-place (descending by version, peers, hash).
300- func sortCheckpoints (s []* storageSync .Checkpoint ) {
301- slices .SortFunc (s , func (a , b * storageSync .Checkpoint ) int {
300+ func sortCheckpoints (s []* checkpointsync .Checkpoint ) {
301+ slices .SortFunc (s , func (a , b * checkpointsync .Checkpoint ) int {
302302 return cmp .Or (
303303 cmp .Compare (b .Root .Version , a .Root .Version ),
304304 cmp .Compare (len (b .Peers ), len (a .Peers )),
@@ -307,7 +307,7 @@ func sortCheckpoints(s []*storageSync.Checkpoint) {
307307 })
308308}
309309
310- func (n * Node ) checkCheckpointUsable (cp * storageSync .Checkpoint , remainingMask outstandingMask , genesisRound uint64 ) bool {
310+ func (n * Node ) checkCheckpointUsable (cp * checkpointsync .Checkpoint , remainingMask outstandingMask , genesisRound uint64 ) bool {
311311 namespace := n .commonNode .Runtime .ID ()
312312 if ! namespace .Equal (& cp .Root .Namespace ) {
313313 // Not for the right runtime.
@@ -357,7 +357,7 @@ func (n *Node) syncCheckpoints(genesisRound uint64, wantOnlyGenesis bool) (*bloc
357357
358358 // If we only want the genesis checkpoint, filter it out.
359359 if wantOnlyGenesis && len (cps ) > 0 {
360- var filteredCps []* storageSync .Checkpoint
360+ var filteredCps []* checkpointsync .Checkpoint
361361 for _ , cp := range cps {
362362 if cp .Root .Version == genesisRound {
363363 filteredCps = append (filteredCps , cp )
0 commit comments