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

Drop contract group scope #2625

Merged
merged 10 commits into from
Oct 31, 2023
Merged

Drop contract group scope #2625

merged 10 commits into from
Oct 31, 2023

Conversation

roman-khimov
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #2625 (5a2292b) into master (eb2b7d0) will increase coverage by 0.17%.
The diff coverage is 0.00%.

❗ Current head 5a2292b differs from pull request most recent head e501986. Consider uploading reports for the commit e501986 to get more accurate results

@@            Coverage Diff             @@
##           master    #2625      +/-   ##
==========================================
+ Coverage   29.04%   29.22%   +0.17%     
==========================================
  Files         417      416       -1     
  Lines       31559    31318     -241     
==========================================
- Hits         9166     9152      -14     
+ Misses      21590    21366     -224     
+ Partials      803      800       -3     
Files Coverage Δ
cmd/neofs-adm/internal/modules/config/config.go 30.98% <ø> (ø)
cmd/neofs-adm/internal/modules/morph/generate.go 36.28% <ø> (-1.65%) ⬇️
...neofs-adm/internal/modules/morph/initialize_nns.go 0.00% <ø> (ø)
...d/neofs-adm/internal/modules/morph/local_client.go 0.00% <ø> (ø)
pkg/morph/client/client.go 0.00% <ø> (ø)
cmd/neofs-adm/internal/modules/morph/n3client.go 0.00% <0.00%> (ø)
cmd/neofs-node/morph.go 0.00% <0.00%> (ø)
pkg/morph/client/notary.go 0.00% <0.00%> (ø)
pkg/innerring/innerring.go 0.00% <0.00%> (ø)
pkg/morph/client/constructor.go 0.00% <0.00%> (ø)
... and 5 more

... and 1 file with indirect coverage changes

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

pkg/morph/client/nns.go Show resolved Hide resolved
pkg/morph/client/nns.go Outdated Show resolved Hide resolved
pkg/innerring/innerring.go Show resolved Hide resolved
pkg/morph/client/nns.go Show resolved Hide resolved
signer.Scopes = transaction.CustomGroups
signer.AllowedGroups = keys.PublicKeys{groupKey}
balanceHash, err := nnsReader.ResolveFSContract(nns.NameBalance)
if err != nil && c.Contracts[balanceContract] != nil {
Copy link
Member

Choose a reason for hiding this comment

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

but what if err != nil and no hash has been cached?

Copy link
Member Author

Choose a reason for hiding this comment

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

It means that we don't know the hash and it stays zero. In this case it's irrelevant, we don't have data from contract, we don't have data from the network, let's hope it works, but if it doesn't we can't help much.

Copy link
Member

Choose a reason for hiding this comment

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

passing zero hash and continuing working scares me. but ok

cmd/neofs-adm/internal/modules/morph/initialize.go Outdated Show resolved Hide resolved
@carpawell
Copy link
Member

Conflicts.

It's a part of a Signer as well and it can be used.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
And fail if SetGroupSignerScope() fails, it MUST work on a valid network.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
It's not the most elegant way to handle the problem since normally each
contract handler should decide on these things by its own (even per-call),
but given the structure we have this is the easiest "universal" set of rules.
It has a downside in that it MUST be synchronized with contracts changes, but
those are not very frequent, so I think it's good enough. Managing group key
is far worse problem than that.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
No longer needed.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

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

I would wait for @AnnaShaleva's review.

@carpawell carpawell merged commit 4e60638 into master Oct 31, 2023
9 checks passed
@carpawell carpawell deleted the contract-group-scope branch October 31, 2023 15:08
@carpawell carpawell restored the contract-group-scope branch October 31, 2023 15:09
@carpawell carpawell deleted the contract-group-scope branch October 31, 2023 15:09
@carpawell
Copy link
Member

I would wait for @AnnaShaleva's review.

Ok, not this time.

cthulhu-rider added a commit that referenced this pull request Nov 15, 2023
Starting from c08e2b5 (#2625), there is
no need to maintain committee group and its private key because
CustomGroups witness scope is no longer used.

Completely purge committee group from NeoFS Sidechain auto-deployment
procedure. As a result, contract manifests are no longer modified.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
cthulhu-rider added a commit that referenced this pull request Nov 15, 2023
Starting from c08e2b5 (#2625), there is
no need to maintain committee group and its private key because
CustomGroups witness scope is no longer used.

Completely purge committee group from NeoFS Sidechain auto-deployment
procedure. As a result, contract manifests are no longer modified.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
cthulhu-rider added a commit that referenced this pull request Nov 15, 2023
Starting from c08e2b5 (#2625), there is
no need to maintain committee group and its private key because
CustomGroups witness scope is no longer used.

Completely purge committee group from NeoFS Sidechain auto-deployment
procedure. As a result, contract manifests are no longer modified.

Closes #2642.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
roman-khimov added a commit to nspcc-dev/neofs-contract that referenced this pull request Nov 29, 2023
I'm not yet sure we need it, but old adm (before nspcc-dev/neofs-node#2625)
creates a broken deploy script with actual data that has no fields inside.
Not a problem for updates, not a problem for newer adm, but still.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
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.

2 participants