Commit graph

6338 commits

Author SHA1 Message Date
Anna Shaleva
a9d32fe8f6 .github: give proper names to CLI binaries and artifact archives 2022-10-06 07:39:31 +03:00
Roman Khimov
1c376ffa62
Merge pull request #2724 from nspcc-dev/rpc-options
rpcsrv: handle preflight OPTIONS with CORS kludge, fix #2721
2022-10-05 17:02:55 +07:00
Roman Khimov
b48d02f4a6 rpcsrv: handle preflight OPTIONS with CORS kludge, fix #2721 2022-10-05 11:09:45 +03:00
Roman Khimov
3609f26cc0
Merge pull request #2710 from nspcc-dev/check-notification-abi-compiliance
runtime: check notifications against ABI
2022-10-05 15:06:39 +07:00
Roman Khimov
8893163803 smartcontract: define parameter lengths as constants and use them 2022-10-05 10:46:21 +03:00
Roman Khimov
317dd42513 *: use uint*Size and SignatureLen constants where appropriate 2022-10-05 10:45:52 +03:00
Roman Khimov
79887f9d78 runtime: check notifications against ABI
Related to #2703, just a logged thing for now.
2022-10-04 17:52:38 +03:00
Roman Khimov
48567fbc61
Merge pull request #2722 from nspcc-dev/docs/cfg-mvub
docs: add MaxValidUntilBlockIncrement to config docs
2022-10-03 18:56:20 +07:00
Anna Shaleva
23795ab6e0 docs: add MaxValidUntilBlockIncrement to config docs 2022-10-03 13:13:20 +03:00
Roman Khimov
7d0840d5d5
Merge pull request #2720 from nspcc-dev/notifications-check
compiler: enforce runtime.Notify parameters cast to proper type
2022-10-01 03:02:29 +07:00
Anna Shaleva
554e48e7b7 compiler: enforce runtime.Notify parameters cast
If notification parameters type can be defined in a compile time then enforce
parameter cast to the desired type got from manifest.
2022-09-30 14:42:43 +03:00
Anna Shaleva
80f71a4e6e compiler: do not enforce variadic event args check on ellipsis usage
In case of ellipsis usage compiler defines argument type as ArrayT
(which is correct, because it's a natural representation of the last
argument, it represents the array of interface{}).
Here goes the problem:
```
=== RUN   TestEventWarnings/variadic_event_args_via_ellipsis
    compiler_test.go:251:
        	Error Trace:	compiler_test.go:251
        	Error:      	Received unexpected error:
        	            	event 'Event' should have 'Integer' as type of 1 parameter, got: Array
        	Test:       	TestEventWarnings/variadic_event_args_via_ellipsis
```

Parsing the last argument in this case is a separate complicated problem
due to the fact that we need to grab types of elements of []interface{} inside the
fully qualified ast node which may looks like:
```
runtime.Notify("Event", (append([]interface{}{1, 2}, (([]interface{}{someVar, 4}))...))...)
```

Temporary solution is to exclude such notifications from analysis until we're
able to properly resolve element types of []interface{}.
2022-09-30 08:42:48 +03:00
Anna Shaleva
08427f23b6 compiler: do not check Any event parameter for compliance
It's possible that declared manifest event has parameter of AnyT for
those cases when parameter type differs from method to method. If so,
then we don't need to enforce type check after compilation.
2022-09-30 08:40:55 +03:00
Roman Khimov
b7be4edf7f
Merge pull request #2718 from nspcc-dev/ok-conversion
compiler: prohibit to compile type assertion with two return values
2022-09-29 02:54:03 +07:00
Anna Shaleva
b98848bf49 compiler: prohibit to compile type assertion with two return values
Close #2692.
2022-09-28 11:27:13 +03:00
Roman Khimov
b2b5303d06
Merge pull request #2716 from nspcc-dev/test
compiler: take into account inlined types info on `append` builtin handling
2022-09-28 13:56:02 +07:00
Anna Shaleva
1828e79412 compiler: add test for foreign function inlining 2022-09-27 15:36:06 +03:00
Anna Shaleva
9ee05d3241 examples: update neo-go dependency 2022-09-27 15:35:15 +03:00
Anna Shaleva
08e2511676 *: update interop dependency 2022-09-27 15:34:20 +03:00
Anna Shaleva
24c107e3a2 interop: refactor address.FromHash160 code
Make it more simple.
2022-09-27 15:32:57 +03:00
Anna Shaleva
5d578fdd95 compiler: consider inlined types info on "append" handling
We need to search for "append" argument type info not only inside local
package type info map, but also inside the inlined type info map.
Close #2696.
2022-09-27 15:32:51 +03:00
Roman Khimov
3dbd36ef70
Merge pull request #2712 from nspcc-dev/upd
*: update dependencies and adjust updator script
2022-09-23 14:08:04 +07:00
Anna Shaleva
c7ece79cb4 scripts: ignore go 1.16 compat for dependency updator script
Otherwise the following error occurs while updating dependency:
```
github.com/nspcc-dev/neo-go/examples/nft-nd-nns tested by
	github.com/nspcc-dev/neo-go/examples/nft-nd-nns.test imports
	github.com/nspcc-dev/neo-go/pkg/compiler imports
	gopkg.in/yaml.v3 tested by
	gopkg.in/yaml.v3.test imports
	gopkg.in/check.v1 imports
	github.com/kr/pretty loaded from github.com/kr/pretty@v0.1.0,
	but go 1.16 would select v0.3.0
github.com/nspcc-dev/neo-go/examples/nft-nd-nns tested by
	github.com/nspcc-dev/neo-go/examples/nft-nd-nns.test imports
	github.com/nspcc-dev/neo-go/pkg/compiler imports
	gopkg.in/yaml.v3 tested by
	gopkg.in/yaml.v3.test imports
	gopkg.in/check.v1 imports
	github.com/kr/pretty imports
	github.com/kr/text loaded from github.com/kr/text@v0.1.0,
	but go 1.16 would select v0.2.0

To upgrade to the versions selected by go 1.16:
	go mod tidy -go=1.16 && go mod tidy -go=1.17
If reproducibility with go 1.16 is not needed:
	go mod tidy -compat=1.17
For other options, see:
	https://golang.org/doc/modules/pruning
```
2022-09-23 09:05:08 +03:00
Anna Shaleva
4ca89d23ec examples: update neo-go dependency 2022-09-23 09:00:26 +03:00
Anna Shaleva
ae511447f9 *: update interop dependency 2022-09-23 08:58:55 +03:00
Roman Khimov
29564bdda2
Merge pull request #2695 from nspcc-dev/call-version
interop: implement System.Contract.CallWithVersion
2022-09-21 21:53:01 +07:00
Anna Shaleva
bfc65d35ce examples: update neo-go dependency 2022-09-21 17:43:15 +03:00
Anna Shaleva
25667914fa *: update interop dependency 2022-09-21 17:40:34 +03:00
Anna Shaleva
ea08a81726 interop: add CallWithVersion helper 2022-09-21 17:38:42 +03:00
Anna Shaleva
df802b6fc6 vm: adjust emit.AppCall comment
There's no APPCALL anymore.
2022-09-21 17:25:45 +03:00
Roman Khimov
5eb4ba772f
Merge pull request #2708 from nspcc-dev/fix-it-doc
interop: adjust Iterator documentation
2022-09-21 14:36:07 +07:00
Anna Shaleva
8d5f97a699 interop: adjust Iterator documentation
The only way to get Iterator is as a result of storage.Find.
2022-09-20 17:09:48 +03:00
Roman Khimov
5a7ab2054d
Merge pull request #2698 from nspcc-dev/address-helpers
interop: add a couple of `interop.Hash160` encoding helpers
2022-09-20 17:07:00 +07:00
Anna Shaleva
293dbf3d1b compiler: adjust test's checkInstrCount
Remove unnecessary code.
2022-09-20 09:45:07 +03:00
Anna Shaleva
2b8271055f examples: update neo-go version 2022-09-20 09:45:07 +03:00
Anna Shaleva
0477f83ea8 *: update interop version 2022-09-20 09:43:37 +03:00
Anna Shaleva
7e13140b04 interop: add Hash160 encoder\decoder helper
Close #2690.
2022-09-20 09:37:04 +03:00
Roman Khimov
113c0ce781
Merge pull request #2699 from nspcc-dev/add-atoi-tests
native: add some tests for stdlib's atoi
2022-09-19 21:39:38 +07:00
Roman Khimov
1b753cd4bc native: add some tests for stdlib's atoi
See neo-project/neo#2804 and neo-project/neo#2813. We're already compatible.
2022-09-19 16:18:53 +03:00
Roman Khimov
b8410a107d
Merge pull request #2697 from nspcc-dev/upd-deps-script
scripts: update dependency-updator script
2022-09-16 21:02:20 +03:00
Anna Shaleva
f1fbd6ad4b scripts: update dependency-updator script
Include Oracle contract to the list of contracts to be updated.
2022-09-16 20:33:48 +03:00
Roman Khimov
1f94ebe03d
Merge pull request #2679 from nspcc-dev/nns-upd
examples: NNS update, part 1
2022-09-16 17:06:38 +03:00
Anna Shaleva
94852ab7f4 nns: add admin to properties
See 14f43ba8cf/src/NameService/NameService.cs (L69).
2022-09-16 12:51:07 +03:00
Anna Shaleva
c03e420355 nns: allow to resolve FQDN
Port 4041924a75.
2022-09-16 12:51:07 +03:00
Anna Shaleva
e97467726c nns: allow hyphen in domain names
Port https://github.com/nspcc-dev/neofs-contract/pull/183.
2022-09-16 12:51:07 +03:00
Anna Shaleva
ce66610369 nns: adjust maxDomainNameFragmentLength
Port https://github.com/nspcc-dev/neofs-contract/pull/238.
2022-09-16 12:51:04 +03:00
Roman Khimov
8ecafaaadf
Merge pull request #2691 from nspcc-dev/sc-builder-len
smartcontract: add Len to Builder
2022-09-14 10:36:01 +03:00
Roman Khimov
18ed26194f smartcontract: add Len to Builder
Which is useful in some cases.
2022-09-14 10:25:10 +03:00
Roman Khimov
bd8d46e11a
Merge pull request #2689 from nspcc-dev/stateroot-shutdown-panic
stateroot: fix panic on shutdown
2022-09-13 13:29:57 +03:00
Roman Khimov
5979138306 stateroot: fix panic on shutdown
Stateroot service is always active, but it might have no wallet.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xc57d41]

goroutine 1 [running]:
github.com/nspcc-dev/neo-go/pkg/wallet.(*Wallet).Close(...)
        github.com/nspcc-dev/neo-go/pkg/wallet/wallet.go:175
github.com/nspcc-dev/neo-go/pkg/services/stateroot.(*service).Shutdown(0xc000105880?)
        github.com/nspcc-dev/neo-go/pkg/services/stateroot/validators.go:77 +0x81
github.com/nspcc-dev/neo-go/pkg/network.(*Server).Shutdown(0xc000105880)
        github.com/nspcc-dev/neo-go/pkg/network/server.go:271 +0x205
github.com/nspcc-dev/neo-go/cli/server.startServer(0xc0002702c0)
        github.com/nspcc-dev/neo-go/cli/server/server.go:641 +0x2675
github.com/urfave/cli.HandleAction({0xe456e0?, 0x1155f20?}, 0x4?)
        github.com/urfave/cli@v1.22.5/app.go:524 +0x50
github.com/urfave/cli.Command.Run({{0xfca38b, 0x4}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xfd6a46, 0x10}, {0xffebe3, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:173 +0x65b
github.com/urfave/cli.(*App).Run(0xc000272000, {0xc00003e180, 0x3, 0x3})
        github.com/urfave/cli@v1.22.5/app.go:277 +0x8a7
main.main()
        ./main.go:21 +0x33
2022-09-13 13:18:13 +03:00