Skip to content

Feat/unpaid containers handling#531

Merged
roman-khimov merged 6 commits intomasterfrom
feat/unpaid-containers-handling
Nov 14, 2025
Merged

Feat/unpaid containers handling#531
roman-khimov merged 6 commits intomasterfrom
feat/unpaid-containers-handling

Conversation

@carpawell
Copy link
Member

No description provided.

@carpawell carpawell requested a review from End-rey October 23, 2025 23:34
@carpawell carpawell force-pushed the feat/unpaid-containers-handling branch from 1d0fa2f to 33fcbda Compare October 23, 2025 23:43
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 60.13514% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.32%. Comparing base (d07eec9) to head (d6b31d3).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
contracts/balance/contract.go 45.97% 47 Missing ⚠️
contracts/container/contract.go 79.66% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #531      +/-   ##
==========================================
- Coverage   63.87%   63.32%   -0.56%     
==========================================
  Files          24       25       +1     
  Lines        2655     2773     +118     
==========================================
+ Hits         1696     1756      +60     
- Misses        953     1011      +58     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 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 added a commit to nspcc-dev/neofs-node that referenced this pull request Oct 24, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
carpawell added a commit to nspcc-dev/neofs-node that referenced this pull request Oct 24, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@carpawell carpawell force-pushed the feat/unpaid-containers-handling branch 2 times, most recently from 4902125 to 416b710 Compare November 7, 2025 14:38
@carpawell carpawell force-pushed the feat/unpaid-containers-handling branch from 416b710 to 28cfa44 Compare November 13, 2025 18:45
}

func (t Token) transfer(ctx storage.Context, from, to interop.Hash160, amount int, innerRing bool, details []byte) bool {
func (t Token) _transfer(ctx storage.Context, from, to interop.Hash160, amount int, innerRing bool) bool {
Copy link
Member

Choose a reason for hiding this comment

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

It MUST emit Transfer event per NEP-17.

Copy link
Member Author

Choose a reason for hiding this comment

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

idk, i thought we had talked about it. ok, returned.

Copy link
Member

Choose a reason for hiding this comment

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

We talked about TransferX, that's a completely different thing that you can basically do whatever you want with. But balance is NEP-17 compatible so all token movements MUST produce Transfer event.

It will allow caching faults without panic from other contracts. Also, this make
it closer to regular `Transfer`. Refs #493.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
None of NEP-17 contracts do it.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Required for billing. Also returns API back changed after #527 to be fully
compatible with 0.24.0 release.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This minimizes rounding error.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@carpawell carpawell force-pushed the feat/unpaid-containers-handling branch from 28cfa44 to 3b50ed5 Compare November 14, 2025 16:42
Use generated RPC bindings where appropriate.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Contracts have all necessary information for payment distribution. From now,
payments are done with `PayForContainer` method that must be multi-signed by
actual Alphabet. Payments are done using actual storage reports, basic income
rate and network epoch. If payment cannot be done, container is marked as
an unpaid one, corresponding `IsUnpaid` method for storage nodes is also
included. Closes #493.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@carpawell carpawell force-pushed the feat/unpaid-containers-handling branch from 3b50ed5 to d6b31d3 Compare November 14, 2025 16:47
case r.LatestEpoch == currEpoch-1:
size = r.LatestEpochAverageSize
default:
size = 0
Copy link
Member

Choose a reason for hiding this comment

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

But it's zero anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, i know, just for explicitness

@roman-khimov roman-khimov merged commit d7ec7dd into master Nov 14, 2025
8 of 10 checks passed
@roman-khimov roman-khimov deleted the feat/unpaid-containers-handling branch November 14, 2025 19:11
carpawell added a commit to nspcc-dev/neofs-node that referenced this pull request Nov 18, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
carpawell added a commit to nspcc-dev/neofs-node that referenced this pull request Nov 18, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
carpawell added a commit to nspcc-dev/neofs-node that referenced this pull request Nov 19, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
carpawell added a commit to nspcc-dev/neofs-node that referenced this pull request Nov 19, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
carpawell added a commit to nspcc-dev/neofs-node that referenced this pull request Nov 20, 2025
Implementation of nspcc-dev/neofs-contract#531.

Signed-off-by: Pavel Karpy <carpawell@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