Skip to content

Feat/contracts with original requests - #4245

Merged
roman-khimov merged 2 commits into
masterfrom
feat/contracts-with-original-requests
Oct 27, 2026
Merged

roman-khimov merged 2 commits into
masterfrom
feat/contracts-with-original-requests

Conversation

@carpawell

Copy link
Copy Markdown
Member

No description provided.

@carpawell carpawell self-assigned this Oct 21, 2026
@carpawell
carpawell force-pushed the feat/contracts-with-original-requests branch from 261b014 to 11dbdf2 Compare October 22, 2026 17:34
@carpawell
carpawell marked this pull request as ready for review October 22, 2026 17:39
@roman-khimov
roman-khimov requested a balanced review from Copilot October 22, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved authorization gaps and signature compatibility regressions can approve unauthorized changes or reject legitimate requests.

7 open issues
What changed in this PR

This PR carries original container API requests through contract calls so Inner Ring processors can validate them before approving container creation, deletion, and eACL updates.

Changes:

  • Forward serialized requests from the container service through blockchain clients.
  • Parse original-request contract arguments and add Inner Ring validation.
  • Update the contract dependency, test doubles, and changelog.
File Description
pkg/​services/​container/​service_internal_test.go Update mock contract signatures.
pkg/​services/​container/​server.go Serialize and forward original API requests.
pkg/​services/​container/​server_test.go Adapt test contracts to the new parameters.
pkg/​morph/​event/​container/​notary_requests.go Parse legacy and original-request call formats.
pkg/​morph/​contracts/​methods.go Add original-request fields to contract parameters.
pkg/​morph/​client/​container/​put.go Support creation calls carrying original requests.
pkg/​morph/​client/​container/​eacl_set.go Support eACL calls carrying original requests.
pkg/​morph/​client/​container/​delete.go Support deletion calls carrying original requests.
pkg/​innerring/​processors/​container/​process_eacl.go Add original-request validation for eACL updates.
pkg/​innerring/​processors/​container/​process_container.go Add shared request validation for container operations.
go.sum Update contract dependency checksums.
go.mod Advance the contract dependency.
cmd/​neofs-node/​container.go Forward original requests to blockchain clients.
CHANGELOG.md Document Inner Ring request validation.

Review effort: Balanced

Comment thread pkg/innerring/processors/container/process_container.go Outdated
Comment thread pkg/innerring/processors/container/process_container.go Outdated
signedReq, _ := protoencoding.EncodeRequest(nil, reqBody, reqMetaHeader)
sig := reqVerifHeader.GetRequestSignature()

err := cp.verifySignature(signatureVerificationData{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To be fixed separately.

Comment thread pkg/innerring/processors/container/process_eacl.go
Comment thread pkg/innerring/processors/container/process_container.go Outdated
Comment thread pkg/innerring/processors/container/process_container.go Outdated
Comment thread pkg/innerring/processors/container/process_container.go Outdated
carpawell added a commit to nspcc-dev/neofs-sdk-go that referenced this pull request Oct 23, 2026
These cases are special, they require any signature routine to be done by
container owner, that is why it is passed as a func param. In particular, it
allows nspcc-dev/neofs-node#4245 exchanging container,
containerID, and container eACL signatures with the whole request signatures.
Refs nspcc-dev/neofs-api#446.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
@carpawell
carpawell force-pushed the feat/contracts-with-original-requests branch from 11dbdf2 to 1c3bac2 Compare October 23, 2026 16:47
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 8.20896% with 246 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.25%. Comparing base (3dd7719) to head (1f53dc2).

Files with missing lines Patch % Lines
...nnerring/processors/container/process_container.go 0.00% 121 Missing ⚠️
pkg/morph/event/container/notary_requests.go 0.00% 76 Missing ⚠️
pkg/innerring/processors/container/process_eacl.go 0.00% 15 Missing ⚠️
pkg/morph/client/container/put.go 0.00% 12 Missing ⚠️
pkg/morph/client/container/delete.go 0.00% 7 Missing ⚠️
pkg/morph/client/container/eacl_set.go 0.00% 7 Missing ⚠️
pkg/services/container/server.go 81.48% 5 Missing ⚠️
cmd/neofs-node/container.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4245      +/-   ##
==========================================
- Coverage   32.37%   32.25%   -0.13%     
==========================================
  Files         673      673              
  Lines       41430    41622     +192     
==========================================
+ Hits        13412    13424      +12     
- Misses      28018    28198     +180     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@carpawell carpawell added blocked Can't be done because of something and removed blocked Can't be done because of something labels Oct 23, 2026
@carpawell
carpawell force-pushed the feat/contracts-with-original-requests branch from 1c3bac2 to b6eb42e Compare October 26, 2026 16:54

@roman-khimov roman-khimov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebase, please.

Comment thread pkg/morph/event/container/notary_requests.go Outdated
signedReq, _ := protoencoding.EncodeRequest(nil, reqBody, reqMetaHeader)
sig := reqVerifHeader.GetRequestSignature()

err := cp.verifySignature(signatureVerificationData{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To be fixed separately.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread pkg/innerring/processors/container/process_container.go
Comment thread pkg/innerring/processors/container/process_container.go
Comment thread pkg/innerring/processors/container/process_eacl.go
Comment thread pkg/innerring/processors/container/process_container.go
@carpawell
carpawell force-pushed the feat/contracts-with-original-requests branch from b6eb42e to 223ec1e Compare October 27, 2026 12:53
It now has container RPC signed by container owner (or by an authorized key) and
allows IRs checking original requests by its signatures, not by request fields.
Refs nspcc-dev/neofs-api#446,
nspcc-dev/neofs-sdk-go#898.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Implementation of nspcc-dev/neofs-contract#637.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
@carpawell
carpawell force-pushed the feat/contracts-with-original-requests branch from 223ec1e to 1f53dc2 Compare October 27, 2026 12:55
@roman-khimov
roman-khimov merged commit 0455b95 into master Oct 27, 2026
20 of 22 checks passed
@roman-khimov
roman-khimov deleted the feat/contracts-with-original-requests branch October 27, 2026 13:26
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