Commit graph

46 commits

Author SHA1 Message Date
Evgenii Stratonikov
f840afb4cc netmap: provide default configuration in _deploy
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-29 15:14:57 +03:00
Alex Vanin
8bd25230fa [#118] *: Encode semver in version number
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-29 15:01:50 +03:00
Alex Vanin
c7ed05cc2e [#112] Remove to v0.9.2 migration code
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 15:03:40 +03:00
Alex Vanin
9840f29372 [#105] netmap: Add docs
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 14:59:05 +03:00
Alex Vanin
b6b3f17cd1 [#105] *: Add doc.go files for each contract
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 14:59:05 +03:00
Alex Vanin
8b7d08cb08 [#105] *: Remove contract from package names
`contract` postfix is redundant and makes autogenerated
docs looks ugly.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 14:59:05 +03:00
Alex Vanin
787bd3b63c [#110] netmap: Store block number of last epoch
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-22 11:08:19 +03:00
Alex Vanin
c368eac796 [#100] netmap: Migrate netmap candidates storage
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 14:13:36 +03:00
Alex Vanin
0b04200815 [#100] netmap: Make AddPeer stable for simultaneous invocations in one block
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 14:13:36 +03:00
Alex Vanin
af21f33657 [#100] *: Use full scope in migration
As soon as migration required changes in memory, we
need bigger scope. Otherwise in requires two step migration
which is unpleasant and annoying.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-01 14:13:36 +03:00
Alex Vanin
01b12bcd56 [#96] *: Specify permissions in contract manifests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-24 16:16:02 +03:00
Alex Vanin
14382d701c [#94] *: Fix parameter types in notification manifest
neo-go v0.95.2+ has strict notification type checker
enabled by default.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-17 16:44:00 +03:00
Alex Vanin
2e2eb15729 [#88] *: Provide data in migrate method of the contracts
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-03 14:09:40 +03:00
Alex Vanin
8b1c8eb689 [#86] netmap: Add netmap candidate list getter
With `NetmapCandidate` storage nodes can monitor
if they are expected to be in the netmap at next
epoch or not. This is also important for monitoring
when some nodes does not bootstrap immediately.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-02 13:46:42 +03:00
Evgenii Stratonikov
db2b1be746 [#79] Panic instead of returning bool value
There is a number of contracts which return only `true` value.
Also handling `FAULT` on the client is easier then also checking return
value.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-06-01 12:10:28 +03:00
Evgenii Stratonikov
dd98bee590 [#72] Replace Init() methods with _deploy
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-05-12 16:56:52 +03:00
Alex Vanin
e4ba936f50 [#74] Log notary disabled flag at init
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
2672e663a0 [#74] netmap: Support notary disabled work flow
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
76aca4c6f5 [#74] netmap: Store inner ring node list when notary disabled
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
622a83e014 [#74] Add notary disabled option to contracts
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:27:24 +03:00
Alex Vanin
7cb7b0905b [#58] netmap: Use alphabet list from chain
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-25 18:19:47 +03:00
Alex Vanin
90f26e3ffd [#61] netmap: Invoke clean up methods on new epoch
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-19 15:04:47 +03:00
Alex Vanin
2ef8c55562 [#60] netmap: Use interop to create multi signature account
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 14:46:06 +03:00
Alex Vanin
9d36a33b9d [#59] netmap: Update multi address generation routine
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 11:23:11 +03:00
Alex Vanin
97a5e27403 [#59] Update to pre-released version of neo-go v0.94.0
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 11:23:11 +03:00
Alex Vanin
7ba5d50fd4 [#59] proxy: Check committee address in Verify function
For committee operations in side chain we can't use 5\7 multi
address, instead we should use 4\7 for this case.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-17 11:23:11 +03:00
Pavel Karpy
8af80e67aa [#37] Use readonly context
Delete initializing of R/W context in `init()`
and start using readonly storage context in
methods where it is possible.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-03-12 10:36:15 +03:00
Pavel Karpy
6cd0808627 [#56] netmap: Fix unsafe methods
Delete unsafe 'addPeer' method from `safemethods`
in contract config.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-03-10 14:14:47 +03:00
Pavel Karpy
8d8482a88e [#26] Add safemethods fields
Fill in `safemethods` fields in contract config files
with methods that do not change contract storages.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-03-09 19:25:47 +03:00
Pavel Karpy
508369be75 [#25] Use go aliases
Change []byte type to interop.*aliasName*
types in contracts where it is suitable to
improve the readability of the contracts.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-03-05 17:13:49 +03:00
Alex Vanin
28a9e2842f [#51] netmap: Support notary contract
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-04 11:26:14 +03:00
Alex Vanin
e4ba9c6840 [#51] netmap: Add Multiaddress method
`Multiaddress` returns multisig address of
5\7 inner ring nodes.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-04 11:26:14 +03:00
Alex Vanin
88c738b736 [#49] Support contract migration
At initialization contract saves master script hash
that allows to re-initialize or migrate contract.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-12 18:33:55 +03:00
Alex Vanin
a4a9a49a76 [#49] Remove trigger check from contracts
This check was useful when there was a single
entry point in contract. But right now there is
no point in this.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-12 18:33:55 +03:00
Alex Vanin
9cdfcd438e [#48] Add contract names
It is required field in contract config for deployment.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:50:01 +03:00
Alex Vanin
cff7688486 [#47] Remove legacy config records
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:31:57 +03:00
Alex Vanin
fd803ef639 [#47] Update iterator interface
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:31:57 +03:00
Leonard Lyubich
3395a886fc [#42] Share InnerRingInvoker function between contracts
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>
2021-02-04 10:31:24 +03:00
Leonard Lyubich
dd0768aaeb [#42] Share InvokeID between contracts
Replace invokeID to common package and export it.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-04 10:31:24 +03:00
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
69c8e7aea9 [#34] netmap: Add snapshot getter by epoch number
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>
2021-01-12 14:08:19 +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
6abe334676 [#33] netmap: Do not save ballots for invalid epoch
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-12-25 14:49:12 +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