mirror of
https://github.com/nspcc-dev/neofs-contract.git
synced 2026-03-01 04:28:59 +00:00
Use ordered prefixes in contract storage #216
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U1
U2
U3
U4
alphabet
audit
balance
blocked
bug
config
container
discussion
documentation
enhancement
feature
go
good first issue
help wanted
neofs
neofsid
netmap
nns
nns
performance
proxy
question
reputation
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-contract#216
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cthulhu-rider on GitHub (Nov 12, 2025).
Is your feature request related to a problem? Please describe.
nspcc-dev/neofs-contract@f009282d1e/contracts/container/contract.go (L80-L93)longer prefixes are used sometimes
nspcc-dev/neofs-contract@f009282d1e/contracts/container/contract.go (L103)this mixes up the order. It's always difficult to understand the unoccupied prefix for a new space
moreover, the symbol is often not representative. Like
xin this exampleDescribe the solution you'd like
declare sequence of consecutive values
0,1, etc. Migrate existing items. Reserve255to allow more than 255 item spaces. Most likely this wont be neededoverall, the goal is refactoring. However, in cases like
eACL, this will also reduce the storage space@roman-khimov commented on GitHub (Nov 12, 2025):
Not worth the trouble to me. It tried to be semantical (like flags), but it failed to do so. Migration of a lot of values can be painful and we have it all documented anyway. An improvement can be just regrouping/renaming/reordering prefix definitions in code, without value changes.
But it also suggests that
containercontract is the most problematic currently, it's pretty big and stores a lot of things. You don't have this problem withbalancefor example.@cthulhu-rider commented on GitHub (Nov 12, 2025):
lets start with code improvements. I'll make a proposal. At least this way new stuff will be sequential naturally. And taking new prefix will be much easier todo