Fix linter after #3746 and #3747:
```
Running [/home/runner/golangci-lint-1.62.2-linux-amd64/golangci-lint run --path-prefix=scripts --config=/home/runner/work/neo-go/neo-go/nspcc-gh/.golangci.yml] in [/home/runner/work/neo-go/neo-go/scripts] ...
level=error msg="Running error: context loading failed: no go files to analyze: running `go mod tidy` may solve the problem"
Error: golangci-lint exit with code 5
```
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
vX.Y.Z-date-commit is very much different from vX.Y.Z and we can have any of
them for NeoGo (vX.Y.Z is even preferable). Previous code ended up this way
for v0.106.3:
++ sed -E -n -e 's/.*neo-go\s.+-.+-(\w+)/\1/ p' examples/nft-nd-nns//go.mod
+ NEO_GO_COMMIT=
+ git merge-base --is-ancestor '' HEAD
fatal: Not a valid object name
+ die 'examples/nft-nd-nns/: neo-go commit was not found in git'
+ echo 'examples/nft-nd-nns/: neo-go commit was not found in git'
examples/nft-nd-nns/: neo-go commit was not found in git
+ exit 1
Signed-off-by: Roman Khimov <roman@nspcc.ru>
Mostly it's about Go 1.22+ syntax with ranging over integers, but it also
prefers ranging over slices where possible (it makes code a little better to
read).
Notice that we have a number of dangerous loops where slices are mutated
during loop execution, many of these can't be converted since we need proper
length evalutation at every iteration.
Signed-off-by: Roman Khimov <roman@nspcc.ru>
And ignore on dependency checks, we update all the examples at once
anyway, so may safely skip the check for zkp folder.
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
It directly affects node security and the default here MUST BE the safe choice
which is to do the verification. Otherwise it's just dangerous, absent any
VerifyBlocks configuration we'll get an insecure node. This option is not
supposed to be frequently used and it doesn't affect the ability to process
blocks, so breaking compatibility (in a safe manner) should be OK here.
And include some node-specific configurations there with backwards
compatibility. Note that in the future we'll remove Ledger's
fields from the ProtocolConfiguration and it'll be possible to access them in
Blockchain directly (not via .Ledger).
The other option tried was using two configuration types separately, but that
incurs more changes to the codebase, single structure that behaves almost like
the old one is better for backwards compatibility.
Fixes#2676.
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
```
They're misleading now that we have variable number of committee
members/validators. The standby list can be seen in the configuration and the
appropriate numbers can be received from it also.
Allows to quickly find the bad block and compare application
logs. Theoretically could also walk through the MPT to find the difference
there, but it's not needed now.
First argument contains filename, thus we use '.go' suffix to
distinguish between directories and files.
Contract name should be provided in options.
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
scripts/gendump/main.go:95:13: Error return value of `rand.Read` is not checked (errcheck)
rand.Read(key)
^
scripts/gendump/main.go:96:13: Error return value of `rand.Read` is not checked (errcheck)
rand.Read(value)
^
It's not network-tied any more, network is only needed to
sign/verify. Unfortunately we still have to keep network in consensus data
structures because of dbft library interface.