-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop supporting non-notary deployments #324
Stop supporting non-notary deployments #324
Conversation
cthulhu-rider
commented
Feb 10, 2023
•
edited
Loading
edited
- closes Drop notary-less code and data from all contracts except mainnet one #303
- clean storage
- remove non-notary node from methods
- distribute GAS on Alphabet contract update
- unit tests
0653d82
to
f47058c
Compare
8ebf2db
to
056e5bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding these now, will check tests later.
b076ebf
to
46c46be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried it on the mainnet data?
tests/migration/model.go
Outdated
|
||
// UpdateModel describes storage migration model of some Neo contract. Zero update model | ||
// describes empty post-update contract storage. | ||
type UpdateModel struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This model describes change set in terms of KV pairs, which is fine when:
- we delete some key or a set of keys with some prefix and want to ensure it's gone
- we specifically add some key or a set of keys and want to ensure they're present
- we want to make sure no excessive elements are added
But it's suboptimal when we're dealing with changes. Consider our netmap 0.16.0 migration problem (df2bad0), if we have this omission in the contract we're quite likely to have the same omission in the test, but calling contract APIs could quickly reveal the problem, so I'd say we should describe these in terms of API calls (test invocations) that should have the same (or intentionally different if needed) result before the migration and after the migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO these are two different tests:
- migration of storage items from one format to another
- ability of new contract executable to correctly decode new format
2nd won't help us if there is no corresponding values in the contract at all. But I agree that such API extra check will help us to feel more comfortable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if you're to rely on 2 then you'll catch problems with 1 as well. Contract APIs is what gives access to this data, outside users don't care much about KVs behind these APIs. So I'd say API-bound model is stronger. It may be nontrivial to test in some cases, but it's stronger in general.
tests/migration/storage.go
Outdated
// 5. | ||
contractUpd := newContractUpdater(tb, bLocal, opts.SourceCodeDir, localContract) | ||
|
||
for _, updFail := range opts.UpdateFailures { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These better be independent t.Run()
and maybe better in the test itself.
a32980a
to
fca6c3a
Compare
26f0d0d
to
4145870
Compare
Caught while testing nspcc-dev/neofs-contract#324 with removed `innerRingList` method. Implementation did not comply with the requirements https://pkg.go.dev/github.com/nspcc-dev/neofs-contract@v0.16.0/netmap#InnerRingList
5629bfc
to
04af510
Compare
Upgrade to the latest revisions of `neo-go`, `pkg/interop` and `testify` modules. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
04af510
to
465a6ad
Compare
Make update routine to panic if `notaryDisabled` flag is set. Remove all notary-less artifacts from the contract (storage and methods) on update. Prevent from updating during pending votes. Make GAS transfers on Alphabet contract's update. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Add `tests/dump` package with `Creator` and `Reader` types which provide I/O operations of contract states (including storages). Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Add `cmd/dump` command which accepts Neo RPC endpoint of the NeoFS network and dumps NeoFS contracts into `testdata` directory. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
In previous implementation `common.CheckVersion` allowed contract to be updated to earlier versions. This could be a problem since currently forward-only updates are supported. Make `common.CheckVersion` to panic if original contract version is less than `common.Version` one. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
`defaultRegisterPrice` constant is used in `_deploy` function of the NNS contract. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
465a6ad
to
78ecc40
Compare
See #2612, nspcc-dev/neofs-contract#324. Refs #830. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
See #2612, nspcc-dev/neofs-contract#324. Refs #830. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
After fb13ef9, it is now possible not to create an additional notary request but to sign the original one. See also nspcc-dev/neofs-contract#324 that includes SN in a netmap with `AddPeer` netmap call only (without the formly required `AddPeerIR` call). Closes #830. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
After fb13ef9, it is now possible not to create an additional notary request but to sign the original one. See also nspcc-dev/neofs-contract#324 that includes SN in a netmap with `AddPeer` netmap call only (without the formly required `AddPeerIR` call). Closes #830. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>