Commit graph

54 commits

Author SHA1 Message Date
Pavel Karpy
27c97237cf [#184] *: Delete method prefix from runtime.Log()
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-11-30 12:14:19 +03:00
Pavel Karpy
2ee2344e5f [#184] *: Move all panics on witness checks in common
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-11-30 12:14:19 +03:00
Pavel Karpy
ac89694eeb [#184] *: Remove method prefix in panic messages
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-11-30 12:14:19 +03:00
Pavel Karpy
4961e9b436 [#186] *: Add // V2 format comment
Add `// V2 format` comment to V2 specific code
in contracts. In `subnet` contract change comment
to sync with other.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-11-30 11:51:01 +03:00
Evgenii Stratonikov
da7f7eb88f [#164] *: provide version as the last argument
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-19 13:38:15 +03:00
Leonard Lyubich
68eac87e64 [#154] netmap: allow only alphabet calls in updateState
This reverts commit a9503b5c
2021-11-16 17:26:26 +03:00
Evgenii Stratonikov
a9503b5cf8 Revert "[#152] netmap: allow only alphabet calls in updateState"
This reverts commit e1ee1c203c.
2021-10-19 17:46:26 +03:00
Evgenii Stratonikov
81c12b3f24 Revert "[#152] netmap: allow only alphabet calls in addPeer"
This reverts commit c008910157.
2021-10-19 17:46:26 +03:00
Evgenii Stratonikov
2472678b9f [#151] netmap: fix error message in _deploy
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 13:11:53 +03:00
Evgenii Stratonikov
c5e026c6e7 [#151] netmap: allow to update config values in _deploy
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 13:11:53 +03:00
Evgenii Stratonikov
e1ee1c203c [#152] netmap: allow only alphabet calls in updateState
If notary is enabled only alphabet calls are expected.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 12:46:19 +03:00
Evgenii Stratonikov
c008910157 [#152] netmap: allow only alphabet calls in addPeer
If notary is enabled only alphabet calls are expected.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 12:46:19 +03:00
Evgenii Stratonikov
a72392f672 [#146] netmap: allow to update peer info
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 12:02:19 +03:00
Alex Vanin
6d0c5d110c [#107] Remove contract owner argument at contract deploy
Contract owner entity does exist anymore. Contract migration
now managed by side chain committee which are Alphabet nodes of
the Inner Ring.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 11:06:48 +03:00
Alex Vanin
edd4864e39 [#130] Panic at contract update failures
There is no practical cases not to panic at contract
update routine.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 09:54:52 +03:00
Alex Vanin
b555e200f4 [#128] Rename migrate methods to update
Neo Legacy used migration mechanism to update contracts.
N3 provides update method in native management contract.
Therefore, it makes sense to rename `Migrate` to `Update`.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-21 12:28:35 +03:00
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
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
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
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
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