mirror of
https://github.com/nspcc-dev/neofs-contract.git
synced 2026-03-01 04:28:59 +00:00
Do not calculate container ID in container.Put method #28
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#28
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 (May 28, 2021).
In current implementation
Containercontract calculates container ID inPutmethod by itself.Contract doesn't return calculated ID, so the calculation is performed on two sides at once: the calling and the contract.
I propose to add explicit argument to
Putcall with container identifier in order to not have a binding of the contract code for the identifier format, which can be dictated by the application logic. It will also reduce the computational load from the contract@realloc commented on GitHub (May 31, 2021):
I suggest to stick with current in-contract ID calculation. Independent ID calculation is the additional guarantee of container structure correctness.
Ideally InnerRing would not modify the container structure, but only ensure its correctness and approve creation.
@realloc commented on GitHub (Aug 12, 2021):
@alexvanin @cthulhu-rider I suggest closing this issue, as the current mechanism assures the correctness of the structure and let's the container creator to make sure he got onchain what he expected.