There is an issue with native contract callback functions
and getting storage context: nspcc-dev/neo-go#1725.
This should fix it for now.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Define InnerRingList function that calls "innerRingList" method of
particular smart contract. Define InnerRingListViaStorage function
that reads address of smart contract from the storage by key, and
calls InnerRingList with the result. Reuse these functions in all
contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Replace getList function to common package and export it. Reuse the function
in Container and Reputation contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define IRNode structure in common package. Replace innerRingInvoker function
in common package and export it. Reuse this function in all contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Replace vote/remoteVotes functions from all contracts (except alphabet) to
common package. Additionally replace setSerialized and bytesEqual. Create
InitVote function and use it in NeoFS and Netmap contracts.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Create common package. Define Ballot struct in common package. Use new type
in all contracts with ballots.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Remove old ballots first so there won't be any
interference with votes of the same tx in the
future after `blockDiff` blocks.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Basic income settlements depends on container estimation that
should be collected in P2P communication between storage nodes
and then stored in container contract. To synchronize these
actions there are two separate notification that inner ring
should produce in consensus.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
EpochProcess method should be invoked by inner ring nodes
and it removes old estimations from contract storage.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Container contract checks signature of eACL iterating through keys
from neofsid contract.
Clients often ask eACL from storage nodes, but it's kinda hard for
them to check signature since they have no direct access to neofsid
contract. So the container contract can make one more iteration
through keys from neofsid contract and return suitable one.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
There are cases when NeoFS applications need to fetch netmap
snapshot of exact epoch. This method provides convenient atomic
way to do that.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
In updated audit scheme, contract stores marshalled audit
result structure and provides interface to list them by
epoch, container or exact audit executor.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Alphabet contracts are holders of NEO token in sidechain.
Inner ring nodes control sidechain validators list through
voting of alphabet contracts.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Sidechain contracts include alphabet contracts for governance
and audit, balance, container, neofsid, netmap, reputation
contracts.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
These methods initiate `transfer` call on internal
balance method that have Fixed12 precision. With this
limit it will not overflow JSON integer bound 2**53-1
Actual limit is 9007, but it was floored.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>