go-nitro
go-nitro copied to clipboard
Undefined "amount" in create virtual channel RPC request causes node to crash
This actually causes the nitro node to crash, which is something we should look into separately:
{"time":"2023-09-13T06:31:49.184521+01:00","level":"INFO","msg":"handling new objective request","address":"0xAAA6628Ec44A8a742987EF3A114dDFE2D4F7aDCE","objective-id":"VirtualFund-0x8f3291c17c49760237b5ba51f92d96c3e1c51bc925f3cb7252172ef9f5eee549"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1046a1c94]
goroutine 158 [running]:
math/big.(*Int).Set(...)
/opt/homebrew/Cellar/go/1.21.0/libexec/src/math/big/int.go:98
github.com/statechannels/go-nitro/channel/state/outcome.Allocation.Clone({{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
/Users/georgeknee/statechannels/go-nitro/channel/state/outcome/allocation.go:37 +0x54
github.com/statechannels/go-nitro/channel/state/outcome.Allocations.Clone(...)
/Users/georgeknee/statechannels/go-nitro/channel/state/outcome/allocation.go:63
github.com/statechannels/go-nitro/channel/state/outcome.SingleAssetExit.Clone({{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
/Users/georgeknee/statechannels/go-nitro/channel/state/outcome/exit.go:41 +0x110
github.com/statechannels/go-nitro/channel/state/outcome.Exit.Clone(...)
/Users/georgeknee/statechannels/go-nitro/channel/state/outcome/exit.go:75
github.com/statechannels/go-nitro/channel/state.State.Clone({{0x14000153680, 0x3, 0x4}, 0x9e034e285bd8a121, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...})
/Users/georgeknee/statechannels/go-nitro/channel/state/state.go:210 +0x2f4
github.com/statechannels/go-nitro/channel.New({{0x14000153680, 0x3, 0x4}, 0x9e034e285bd8a121, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}, ...)
/Users/georgeknee/statechannels/go-nitro/channel/channel.go:61 +0x51c
github.com/statechannels/go-nitro/channel.NewVirtualChannel({{0x14000153680, 0x3, 0x4}, 0x9e034e285bd8a121, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}, ...)
/Users/georgeknee/statechannels/go-nitro/channel/virtual.go:30 +0x12c
github.com/statechannels/go-nitro/protocols/virtualfund.constructFromState(0x0?, {{0x14000153680, 0x3, 0x4}, 0x9e034e285bd8a121, {0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}, ...)
/Users/georgeknee/statechannels/go-nitro/protocols/virtualfund/virtualfund.go:202 +0x134
github.com/statechannels/go-nitro/protocols/virtualfund.NewObjective({{0x1400050e210, 0x1, 0x1}, {0xbb, 0xb6, 0x76, 0xf9, 0xcf, 0xf8, 0xd2, ...}, ...}, ...)
/Users/georgeknee/statechannels/go-nitro/protocols/virtualfund/virtualfund.go:155 +0x234
github.com/statechannels/go-nitro/node/engine.(*Engine).handleObjectiveRequest(0x1400091a240, {0x105b4fa40?, 0x1400048aa80?})
/Users/georgeknee/statechannels/go-nitro/node/engine/engine.go:450 +0xf58
github.com/statechannels/go-nitro/node/engine.(*Engine).run(0x1400091a240, {0x105b53f20, 0x1400065a500})
/Users/georgeknee/statechannels/go-nitro/node/engine/engine.go:185 +0x274
created by github.com/statechannels/go-nitro/node/engine.New in goroutine 1
/Users/georgeknee/statechannels/go-nitro/node/engine/engine.go:158 +0x490
Originally posted by @geoknee in https://github.com/statechannels/go-nitro/pull/1689#discussion_r1323996328