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

Feat/replicate with signature #622

Merged
merged 5 commits into from
Sep 4, 2024
Merged

Conversation

carpawell
Copy link
Member

No description provided.

@carpawell carpawell force-pushed the feat/replicate-with-signature branch from 87e4722 to 9e5750d Compare August 28, 2024 13:09
API version is 01229b49e9165e693a48e2b96ccad528df34b55e.

Signed-off-by: Pavel Karpy <[email protected]>
gRPC conflicts if more than one generated package is `init`ed, therefore, it
either local packages or remove neofs-api-go should be used.

Signed-off-by: Pavel Karpy <[email protected]>
@carpawell carpawell force-pushed the feat/replicate-with-signature branch from 9e5750d to d2fcec1 Compare August 28, 2024 13:13
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 57.50000% with 17 lines in your changes missing coverage. Please review.

Project coverage is 53.93%. Comparing base (ab1e38b) to head (b322ea8).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
client/object_replicate.go 71.87% 6 Missing and 3 partials ⚠️
proto/object/service.pb.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #622      +/-   ##
==========================================
- Coverage   53.93%   53.93%   -0.01%     
==========================================
  Files         164      164              
  Lines       19222    19249      +27     
==========================================
+ Hits        10368    10381      +13     
- Misses       8415     8426      +11     
- Partials      439      442       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@carpawell carpawell force-pushed the feat/replicate-with-signature branch from f17c599 to 75f6e88 Compare August 28, 2024 13:32
@carpawell carpawell marked this pull request as ready for review August 28, 2024 16:37

return msg, nil
}

type replicateResponse struct {
err error
_sigRequested bool
Copy link
Contributor

Choose a reason for hiding this comment

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

C-style?

Copy link
Member

Choose a reason for hiding this comment

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

Looks weird. And it's not a response field, really.

Copy link
Member Author

@carpawell carpawell Aug 29, 2024

Choose a reason for hiding this comment

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

this is the only possibility of understanding a signature is missing but was requested in the current code. we also may just do nothing if it is missing and return nil, it is just an RPC wrapper without any logic then, maybe that is good too, not sure

And it's not a response field, really

yes, that is why it is underscored...

Looks weird

... which is available by the language and not prohibited by any of our linters

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.

lgtm overall

1st commit with codegen for proto is inaffectual here, right?

@@ -48,38 +55,38 @@ import (
// replicated object;
// - [apistatus.ErrContainerNotFound]: the container to which the replicated
// object is associated was not found.
func (c *Client) ReplicateObject(ctx context.Context, id oid.ID, src io.ReadSeeker, signer neofscrypto.Signer) error {
func (c *Client) ReplicateObject(ctx context.Context, id oid.ID, src io.ReadSeeker, signer neofscrypto.Signer, signedReplication bool) (*neofscrypto.Signature, error) {
Copy link
Contributor

@cthulhu-rider cthulhu-rider Aug 29, 2024

Choose a reason for hiding this comment

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

in which cases signedReplication gonna be false in practice?

Copy link
Member

Choose a reason for hiding this comment

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

For non-initial replication?

Copy link
Member Author

Choose a reason for hiding this comment

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

also as i understand, it will stiil be possible to skip this for some sort of container after nspcc-dev/neofs-api#300, no @roman-khimov?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, containers with different consistency policies can have different requirements wrt this as well.

client/object_replicate.go Outdated Show resolved Hide resolved
Should have been part of ce6f86d, but IDE
fooled me and did not search test files.

Signed-off-by: Pavel Karpy <[email protected]>
@carpawell carpawell force-pushed the feat/replicate-with-signature branch from 75f6e88 to b322ea8 Compare August 29, 2024 22:56
@carpawell
Copy link
Member Author

1st commit with codegen for proto is inaffectual here, right?

Yes, i had plans for it but they failed, so let it just be a commit that keeps things in sync.

@@ -95,7 +95,7 @@ func RecordN(n int) *eacl.Record {

func TableN(n int) *eacl.Table {
rs := make([]eacl.Record, n)
for i := 0; i < n; i++ {
for i := range n {
Copy link
Member

Choose a reason for hiding this comment

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

Not really related.

@roman-khimov roman-khimov merged commit 3d4a462 into master Sep 4, 2024
11 checks passed
@roman-khimov roman-khimov deleted the feat/replicate-with-signature branch September 4, 2024 18:18
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.

4 participants