Commit graph

11 commits

Author SHA1 Message Date
Leonard Lyubich
c3efe152d6 [#42] Share Vote/RemoteVotes between contracts
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>
2021-02-04 10:31:24 +03:00
Leonard Lyubich
f9f2a03078 [#42] Share ballot structure between contracts
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>
2021-02-04 10:31:24 +03:00
Alex Vanin
e87765b733 [#44] Fix processing order in voting
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>
2021-02-02 19:02:56 +03:00
Alex Vanin
b1063e66b9 [#41] container: Produce notification to control container estimations
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>
2021-01-28 17:48:23 +03:00
Alex Vanin
a04d9b7e70 [#40] container: Cleanup container size estimations at new epoch
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>
2021-01-26 11:11:37 +03:00
Alex Vanin
73277b88dc [#40] container: Save container size estimations
Container size estimations used for basic income settlement.
Also may be used for network statistic.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-01-26 11:11:37 +03:00
Alex Vanin
8d7e5ce20a [#35] container: Return public key along with eACL signature
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>
2021-01-15 13:53:21 +03:00
Alex Vanin
806dbbb487 [#23] *: Update notification types
- rename ByteString to ByteArray type
- use Hash256 on transaction hashes

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-12-29 14:15:26 +03:00
Alex Vanin
189a83d9d6 [#23] *: Replace engine.AppCall with contract.Call 2020-12-29 14:15:26 +03:00
Alex Vanin
62448ecdd6 [#29] container: Return all available containers in List(nil)
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-12-29 14:13:14 +03:00
Alex Vanin
bf391b57dd [#18] Add sidechain contracts
Sidechain contracts include alphabet contracts for governance
and audit, balance, container, neofsid, netmap, reputation
contracts.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-27 17:33:56 +03:00