nspcc-dev / neo-go

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

cli: fix `upload-bin` error handling #3638

Closed AliceInHunterland closed 3 weeks ago

AliceInHunterland commented 3 weeks ago

Close #3628 Close https://github.com/nspcc-dev/neo-go/issues/3634

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 0% with 55 lines in your changes missing coverage. Please review.

Project coverage is 83.19%. Comparing base (0b79901) to head (a5e9ab6). Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
cli/util/uploader.go 0.00% 55 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3638 +/- ## ========================================== - Coverage 83.30% 83.19% -0.12% ========================================== Files 334 334 Lines 46464 46486 +22 ========================================== - Hits 38708 38672 -36 - Misses 6180 6241 +61 + Partials 1576 1573 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

AliceInHunterland commented 3 weeks ago

uploaded blocks and 10 index files into mainnet container with a pool of 4 nodes.

(base) ekaterinapavlova@MacBook-Air-4 neo-go % ./bin/neo-go util upload-bin --cid HmP48JvCcmiEbJemG7jFNEg2qkdCTx4thD3EwWUi288Q --wallet-config ./wallet-config.yml --block-attribute block1223 --index-attribute index123 --rpc-endpoint https://rpc.t5.n3.nspcc.ru:20331 -fsr st1.storage.fs.neo.org:8080 -fsr st2.storage.fs.neo.org:8080 -fsr st3.storage.fs.neo.org:8080 -fsr st4.storage.fs.neo.org:8080 --index-file-size 10000
Chain block height: 100000
First block of latest incomplete batch uploaded to NeoFS container: 0
...
Uploaded index file 8
Uploaded index file 9

Run node with config:


  NeoFSBlockFetcher:
    Enabled: true
    Addresses:
      - st1.storage.fs.neo.org:8080
    Timeout: 10m
    DownloaderWorkersCount: 500
    OIDBatchSize: 8000
    BQueueSize: 16000 # must be larger than OIDBatchSize; recommended to be 2*OIDBatchSize or 3*OIDBatchSize
    SkipIndexFilesSearch: false
    IndexFileSize: 10000
    ContainerID: "HmP48JvCcmiEbJemG7jFNEg2qkdCTx4thD3EwWUi288Q"
    BlockAttribute: "block1223"
    IndexFileAttribute: "index123"

successfully got all of the 10 index files and OIDs inside.

2024-10-22T18:47:39.982+0300    INFO    node started    {"blockHeight": 0, "headerHeight": 0}
2024-10-22T18:47:39.983+0300    INFO    starting NeoFS BlockFetcher service

...
2024-10-22T18:49:20.052+0300    INFO    persisted to disk       {"blocks": 805, "keys": 11017, "headerHeight": 83329, "blockHeight": 83329, "took": "25.079792ms"}
2024-10-22T18:49:20.631+0300    INFO    NeoFS BlockFetcher service: no 'index123' object found with index 10, stopping
2024-10-22T18:49:20.631+0300    INFO    shutting down NeoFS BlockFetcher service        {"force": false}

with SkipIndexFilesSearch: true:

2024-10-22T18:53:07.839+0300    INFO    persisted to disk       {"blocks": 3131, "keys": 42148, "headerHeight": 80001, "blockHeight": 80001, "took": "70.7705ms"}
2024-10-22T18:53:10.569+0300    INFO    NeoFS BlockFetcher service: no block found with index 104000, stopping
2024-10-22T18:53:10.569+0300    INFO    shutting down NeoFS BlockFetcher service        {"force": false}

is also okay.