neoneo-go/pkg/core
Anna Shaleva c5c5e4c208 core: do not panic if transaction with empty script is being serialized
See https://github.com/nspcc-dev/neo-go/pull/2485#discussion_r872695786.

Allows to avoid panic:
```
(18:28:29)[sergio@transient:morph-control-load]% downloads/neofs-adm morph -c configuration/config.yaml init --contracts downloads/neofs-contract-v0.15.1
Stage 1: transfer GAS to alphabet nodes.
Waiting for transactions to persist...
Stage 2: set notary and alphabet nodes in designate contract.
Stage 2: already performed.
Stage 3: deploy NNS contract.
NNS contract is already deployed.
Stage 4: deploy NeoFS contracts.
Alphabet contract #0 is already deployed.
Alphabet contract #1 is already deployed.
Alphabet contract #2 is already deployed.
Alphabet contract #3 is already deployed.
audit contract is already deployed.
balance contract is already deployed.
container contract is already deployed.
neofsid contract is already deployed.
netmap contract is already deployed.
proxy contract is already deployed.
reputation contract is already deployed.
subnet contract is already deployed.
Waiting for transactions to persist...
Stage 4.1: Transfer GAS to proxy contract.
Stage 5: register candidates.
Stage 6: transfer NEO to alphabet contracts.
Stage 7: set addresses in NNS.
NNS: Set alphabet0.neofs -> 2efeb27866fa774ec6bfb43babaadcc7b28f9bb7
NNS: Set alphabet1.neofs -> 5606bc6598a538ac59ded3caa842247b9b26097a
NNS: Set alphabet2.neofs -> 2a8308cfd2706ddd5f67adfdf3954c6836806b5d
NNS: Set alphabet3.neofs -> 718d0459e6787f0f13f1e1898bf2ce6bc4bb452d
NNS: Set audit.neofs -> 54d516b36c3380efa2b2f26bda300b6c6302b8e7
NNS: Set balance.neofs -> 72b3255944524cb822788a7542c9d06cba208c0c
NNS: Set container.neofs -> 20a20f4352a49f161eccb7d5a806fd46dcab81ea
NNS: Set neofsid.neofs -> 04a3a71535689b820093cefe7ae188ed7591ad27
NNS: Set netmap.neofs -> 9a34c97b2ba6bd986fd9140a9c3d59059fa430f4
NNS: Set proxy.neofs -> 4eba34ec016f8709a511b02765a1195e31a921ea
NNS: Set reputation.neofs -> 77b5b2cf596957cc05ca3d57503ef08d72792301
NNS: Set subnet.neofs -> b0abe16bc7f56b2e7e0694ae2b36207c6aaa8636
panic: error serializing *transaction.Transaction: transaction has no script

goroutine 1 [running]:
github.com/nspcc-dev/neo-go/pkg/io.GetVarSize({0xbf6240, 0xc0003634a0})
	github.com/nspcc-dev/neo-go@v0.98.2/pkg/io/size.go:68 +0x6fd
github.com/nspcc-dev/neo-go/pkg/rpc/client.(*Client).AddNetworkFee(0xc0004080c0, 0xc0003634a0, 0x0, {0xc00000e248, 0x1, 0x93})
	github.com/nspcc-dev/neo-go@v0.98.2/pkg/rpc/client/rpc.go:966 +0x6b
github.com/nspcc-dev/neo-go/pkg/rpc/client.(*Client).CreateTxFromScript(0x0, {0x0, 0x0, 0x0}, 0x1, 0x0, 0x0, {0xc0001c7990, 0x1, 0x1})
	github.com/nspcc-dev/neo-go@v0.98.2/pkg/rpc/client/nep17.go:128 +0x345
github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph.(*initializeContext).sendCommitteeTx(0xc00014a370, {0x0, 0x0, 0x0}, 0xc0016bcf30, 0x2)
	github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph/initialize.go:336 +0x131
github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph.(*initializeContext).updateNNSGroup(0xc0001c7c88, {0x13, 0xd3, 0x6b, 0x85, 0x3e, 0x86, 0xbe, 0x77, 0xb7, ...}, ...)
	github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph/initialize_nns.go:89 +0x134
github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph.(*initializeContext).setNNS(0xc00014a370)
	github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph/initialize_nns.go:74 +0x8c5
github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph.initializeSideChainCmd(0x12a00e0, {0xc22a22, 0x4, 0x4})
	github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph/initialize.go:94 +0x2bc
github.com/spf13/cobra.(*Command).execute(0x12a00e0, {0xc00013a6c0, 0x4, 0x4})
	github.com/spf13/cobra@v1.1.3/command.go:852 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0x129c760)
	github.com/spf13/cobra@v1.1.3/command.go:960 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.1.3/command.go:897
github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules.Execute(...)
	github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/root.go:48
main.main()
	github.com/nspcc-dev/neofs-node/cmd/neofs-adm/main.go:10 +0x25
zsh: exit 2     downloads/neofs-adm morph -c configuration/config.yaml init --contracts
```
2022-05-16 15:19:17 +03:00
..
block [#2442] English Check 2022-05-04 19:48:27 +03:00
blockchainer [#2442] English Check 2022-05-04 19:48:27 +03:00
chaindump [#2442] English Check 2022-05-04 19:48:27 +03:00
dao core: fix race during native cache persist 2022-05-06 13:46:17 +03:00
fee vm: add MODMUL and MODPOW opcodes 2022-05-12 14:25:14 +03:00
interop core: allow to create hard-fork 2022-05-11 14:21:38 +03:00
mempool [#2442] English Check 2022-05-04 19:48:27 +03:00
mempoolevent [#2442] English Check 2022-05-04 19:48:27 +03:00
mpt [#2442] English Check 2022-05-04 19:48:27 +03:00
native Merge pull request #2478 from nspcc-dev/mainnet-fixes 2022-05-12 10:04:53 +03:00
state [#2442] English Check 2022-05-04 19:48:27 +03:00
stateroot core, rpc: support [invokefunction, invokescript, invokecontractverify]historic 2022-04-29 16:10:04 +03:00
statesync storage: drop (KeyPrefix).Bytes() API 2022-02-18 15:19:57 +03:00
storage core: move native cache from MemCachedStore to DAO 2022-04-29 16:10:04 +03:00
test_data core: refactor helper test contracts generation 2022-03-30 11:46:29 +03:00
transaction core: do not panic if transaction with empty script is being serialized 2022-05-16 15:19:17 +03:00
basic_chain_test.go core: fix typo in TestCreateBasicChain 2022-04-29 16:10:04 +03:00
bench_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
blockchain.go core: allow to create hard-fork 2022-05-11 14:21:38 +03:00
blockchain_core_test.go core: use dao-binded cache for native contracts 2022-04-29 16:10:04 +03:00
blockchain_neotest_test.go core: fix broken stateroot storage 2022-04-22 18:37:56 +03:00
doc.go core: add Blockchain event subscription mechanism 2020-05-25 00:27:39 +03:00
helper_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
interop_system.go core: change Create[Standard, Multisig]Account prices 2022-05-11 14:21:43 +03:00
interop_system_core_test.go core: move native cache from MemCachedStore to DAO 2022-04-29 16:10:04 +03:00
interop_system_neotest_test.go core: change Create[Standard, Multisig]Account prices 2022-05-11 14:21:43 +03:00
interops.go core: change Create[Standard, Multisig]Account prices 2022-05-11 14:21:43 +03:00
interops_test.go core: use dao-binded cache for native contracts 2022-04-29 16:10:04 +03:00
native_contract_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
native_designate_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
native_management_test.go *: refactor TestCreateBasicChain and its dependencies 2022-03-30 11:32:26 +03:00
native_neo_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
native_policy_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
notary_test.go core: rebase core tests onto neotest 2022-03-30 19:00:53 +03:00
oracle_test.go [#2442] English Check 2022-05-04 19:48:27 +03:00
prometheus.go stateroot: move state-root related logic to core/stateroot 2021-03-09 13:48:29 +03:00
stateroot_test.go core, rpc: support [invokefunction, invokescript, invokecontractverify]historic 2022-04-29 16:10:04 +03:00
statesync_test.go *: refactor TestCreateBasicChain and its dependencies 2022-03-30 11:32:26 +03:00
util.go core: drop GetStandBy* methods 2022-01-31 23:14:38 +03:00
util_test.go core/block: add Nonce field to header 2021-07-15 15:58:49 +03:00