Commit graph

68 commits

Author SHA1 Message Date
Evgenii Stratonikov
624cc0f1c4 [#224] netmap: Increase snapshot history size to 10
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-21 18:57:43 +03:00
Evgenii Stratonikov
666e1d6d8d [#224] netmap: Add tests for NewEpoch
Ensure snapshots are handled properly.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-21 18:57:43 +03:00
Evgenii Stratonikov
9884f8e68f [#224] netmap: Refactor snapshot processing
Swap keys instead of unmarshaling/marshaling snapshot during `NewEpoch`.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-21 18:57:43 +03:00
Evgenii Stratonikov
f6766a144f [#225] netmap: Do not emit some events in notary-enabled mode
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-17 16:32:20 +03:00
Evgenii Stratonikov
a4f9d52cfc [#225] netmap: Rename Register to AddPeerIR
Similar to `UpdateState`/`UpdateStateIR` pair.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-17 16:32:20 +03:00
Evgenii Stratonikov
9662f9f4db [#225] netmap: Split UpdateState method for notary-enabled environment
Split methods similar to `AddPeer`/`Register` pair from b104a2ccbc .

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-17 16:32:20 +03:00
Evgenii Stratonikov
b0872bb54c *: remove update migration code
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-07 17:49:07 +03:00
Evgenii Stratonikov
74cc2d0aea [#204] *: check contract version during update
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-01-11 11:55:04 +03:00
Evgenii Stratonikov
1944a4332b [#202] *: remove owner from contract storage
It is no longer used and should've be removed on update.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-28 13:32:28 +03:00
Evgenii Stratonikov
b104a2ccbc [#154] netmap: implement Register method
For notary-disabled environment it makes sense to split node
registration and actual candidate update into separate methods.
This way we have less complicate logic in `AddPeer` and overall
registration flow is more understandable.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-06 11:03:33 +03:00
Pavel Karpy
53a6b198d9 [#184] *: Cast to struct `iterator.Value() k/v pair
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-02 13:09:50 +03:00
Pavel Karpy
e6a33e8193 [#185] *: Use storage.DeserializeValues flag for search
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-02 13:09:50 +03:00
Pavel Karpy
23d9799e51 [#185] *: Use neo-go's interop constants instead of local
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-02 13:09:50 +03:00
Pavel Karpy
f78a0e32b8 [#185] *: Cast args of _deploy method to struct
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-02 13:09:50 +03:00
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