nspcc-dev / neofs-node

NeoFS is a decentralized distributed object storage integrated with the Neo blockchain
https://fs.neo.org
GNU General Public License v3.0
31 stars 38 forks source link

adm: never use GetContractStateByID(1) to retrieve NNS hash #2841

Closed roman-khimov closed 2 months ago

roman-khimov commented 2 months ago

And use a bit more of NNS wrapper.

Notice that this changes "alphabet X" to "alphabetX" in dump output, but I consider this to be an improvement (since that's the contract name).

It also deoptimizes some carefully crafted code to extract a number of names in one call. Likely it's not a performance issue you care about and it's actually somewhat broken in that it assumes one result per invocation (but you can get zero or more than one).

Many more things can be improved, but let's start with this.

Refs. #2826.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 23.65%. Comparing base (dd9cee4) to head (1eace4a). Report is 9 commits behind head on master.

Files Patch % Lines
...md/neofs-adm/internal/modules/morph/dump_hashes.go 0.00% 15 Missing :warning:
...neofs-adm/internal/modules/morph/initialize_nns.go 0.00% 15 Missing :warning:
cmd/neofs-adm/internal/modules/morph/deploy.go 0.00% 13 Missing :warning:
cmd/neofs-adm/internal/modules/morph/container.go 0.00% 9 Missing :warning:
cmd/neofs-adm/internal/modules/morph/initialize.go 0.00% 9 Missing :warning:
cmd/neofs-adm/internal/modules/morph/config.go 0.00% 8 Missing :warning:
cmd/neofs-adm/internal/modules/morph/balance.go 0.00% 7 Missing :warning:
...fs-adm/internal/modules/morph/initialize_deploy.go 0.00% 6 Missing :warning:
cmd/neofs-adm/internal/modules/morph/estimation.go 0.00% 5 Missing :warning:
...d/neofs-adm/internal/modules/morph/renew_domain.go 0.00% 5 Missing :warning:
... and 4 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2841 +/- ## ========================================== - Coverage 31.34% 23.65% -7.70% ========================================== Files 435 769 +334 Lines 32639 44564 +11925 ========================================== + Hits 10231 10541 +310 - Misses 21517 33172 +11655 + Partials 891 851 -40 ```

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