Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upd/Bump minimal go version up to 1.19 #2485

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

carpawell
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #2485 (81b89f6) into master (3749ce7) will decrease coverage by 0.01%.
Report is 2 commits behind head on master.
The diff coverage is 31.81%.

❗ Current head 81b89f6 differs from pull request most recent head 9f76159. Consider uploading reports for the commit 9f76159 to get more accurate results

@@            Coverage Diff             @@
##           master    #2485      +/-   ##
==========================================
- Coverage   29.83%   29.83%   -0.01%     
==========================================
  Files         406      406              
  Lines       31026    31019       -7     
==========================================
- Hits         9258     9255       -3     
+ Misses      20958    20954       -4     
  Partials      810      810              
Files Changed Coverage Δ
cmd/neofs-node/config.go 0.00% <0.00%> (ø)
cmd/neofs-node/netmap.go 0.00% <ø> (ø)
pkg/innerring/innerring.go 0.00% <ø> (ø)
.../innerring/processors/governance/process_update.go 0.00% <0.00%> (ø)
...kg/local_object_storage/blobovnicza/blobovnicza.go 82.85% <ø> (ø)
pkg/morph/deploy/util.go 23.64% <ø> (ø)
pkg/util/worker_pool.go 100.00% <ø> (ø)
pkg/local_object_storage/engine/engine.go 50.00% <50.00%> (ø)
pkg/local_object_storage/writecache/state.go 75.75% <50.00%> (ø)
pkg/local_object_storage/blobovnicza/sizes.go 100.00% <100.00%> (ø)
... and 2 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do this until 0.38.0 is out.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@cthulhu-rider cthulhu-rider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roman-khimov
Copy link
Member

Technically, all of nspcc-dev/neo-go#2626, nspcc-dev/neo-go#2627, nspcc-dev/neo-go#2628, nspcc-dev/neo-go#2629 can be relevant here as well.

@cthulhu-rider
Copy link
Contributor

lets convert to draft for now

@carpawell pls check all places for improvement carefully

@carpawell carpawell marked this pull request as ready for review September 14, 2023 17:04
@@ -553,8 +557,8 @@ func initCfg(appCfg *config.Config) *cfg {
scriptHash: contractsconfig.Netmap(appCfg),
state: netState,
workerPool: netmapWorkerPool,
needBootstrap: !relayOnly,
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
needBootstrap: !atomicRelayOnly.Load(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previous code with relayOnly looked much better to me than with atomicRelayOnly.Load(). U could change 2 strings instead of 6

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope i got you right (not sure how that could be 2 vs 6) and fixed

needBootstrap: !relayOnly,
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
needBootstrap: !atomicRelayOnly.Load(),
reBoostrapTurnedOff: atomicRelayOnly,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to drop pointer from this field, afaik it doesn't make any sense right now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they ask not to copy it, it wont pass go vet linter

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.internals.healthStatus.Store(int32(control.HealthStatus_HEALTH_STATUS_UNDEFINED))
c.cfgNetmap.reBoostrapTurnedOff.Store(relayOnly)

below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPE then? can you elaborate on your thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or you meant to rely on the fact that cfg struct is used via the pointer always?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually embed structures, not pointers if we don't copy the structure anyway (always accessing via pointer). And yes, this allows to skip init in many cases (like below).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, changed but explicit create-and-set is better than autoinit-and-set IMO

also changed in one more place where a non-pointer case is suitable

@@ -37,7 +37,7 @@ func newNetworkState() *networkState {
nmStatus.Store(control.NetmapStatus_STATUS_UNDEFINED)

return &networkState{
epoch: atomic.NewUint64(0),
epoch: new(atomic.Uint64),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pointer is not needed too, we could skip explicit initialization of this field

needBootstrap: !relayOnly,
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
needBootstrap: !atomicRelayOnly.Load(),
reBoostrapTurnedOff: atomicRelayOnly,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually embed structures, not pointers if we don't copy the structure anyway (always accessing via pointer). And yes, this allows to skip init in many cases (like below).

pkg/local_object_storage/pilorama/boltdb.go Outdated Show resolved Hide resolved
pkg/local_object_storage/pilorama/boltdb.go Outdated Show resolved Hide resolved
@roman-khimov roman-khimov merged commit 25fcea8 into nspcc-dev:master Sep 19, 2023
7 of 8 checks passed
roman-khimov added a commit that referenced this pull request Sep 19, 2023
  copylocks: resetCaches passes lock by value: github.com/nspcc-dev/neofs-node/cmd/neofs-node.shared contains sync/atomic.Bool contains sync/atomic.noCopy (govet)

Introduced by #2485.

Signed-off-by: Roman Khimov <[email protected]>
@carpawell carpawell deleted the upd/go-version branch September 19, 2023 14:21
roman-khimov added a commit that referenced this pull request Sep 19, 2023
copylocks: resetCaches passes lock by value:
github.com/nspcc-dev/neofs-node/cmd/neofs-node.shared contains
sync/atomic.Bool contains sync/atomic.noCopy (govet)

Introduced by #2485.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants