nspcc-dev / neo-go

Go Node and SDK for the Neo blockchain
MIT License
123 stars 79 forks source link

Updating index files in uploader should look at last incomplete batch and finish without error #3669

Open AliceInHunterland opened 3 days ago

AliceInHunterland commented 3 days ago

Is your feature request related to a problem? Please describe.

  |   | 2024-11-11 07:21:18.049 | Index file 51: fetching missing block 6528014 |  
  |   | 2024-11-11 07:20:50.957 | Index file 51: fetching missing block 6528013 |  
  |   | 2024-11-11 07:20:50.957 | Index file 51 generated, checking for the missing blocks... |  
  |   | 2024-11-11 07:13:21.266 | Uploading index files... |  
  |   | 2024-11-11 07:13:21.266 | First block of latest incomplete batch uploaded to NeoFS container: 6590000 |  
  |   | 2024-11-11 07:12:17.371 | Chain block height: 6669814

It should not fetching, but stopping.

Describe the solution you'd like

func uploadBlocks(ctx *cli.Context, p *pool.Pool, rpc *rpcclient.Client, signer user.Signer, containerID cid.ID, acc *wallet.Account, attr string, oldestMissingBlockIndex int, currentBlockHeight uint, homomorphicHashingDisabled bool, numWorkers, maxRetries int)

Add oldestMissingBlockIndex as a parameter and calculate the number of index files based on it.

Describe alternatives you've considered

Errors at the end.

AnnaShaleva commented 3 days ago

Errors at the end.

Let's not consider this as an alternative. The proposed solution to adjust uploadBlocks LGTM.