Mandos test fails if I use self.blockchain().get_sc_balance
Closed this issue · 2 comments
MWFIAE commented
Hi everyone,
I'm using elrond-wasm 0.20.1 and noticed that my mandos tests are now crashing.
I could pinpoint it to the following line:
let sc_token_balance = self.blockchain().get_sc_balance(&token_ident, 0u64);
//let sc_token_balance = BigUint::from(0u64);
Commenting out the first line and using the second line instead fixes the error.
This is the error i get for the first line.
goroutine 69 [running, locked to thread]:
runtime.throw(0xa2860a, 0x2d)
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/runtime/panic.go:1116 +0x72 fp=0xc00004cb20 sp=0xc00004caf0 pc=0x45c752
runtime.exitsyscall()
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/runtime/proc.go:3225 +0x22a fp=0xc00004cb50 sp=0xc00004cb20 pc=0x48c4ca
runtime.cgocall(0x88e830, 0xc00004cbb8, 0xbb4670)
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/runtime/cgocall.go:152 +0x9e fp=0xc00004cb88 sp=0xc00004cb50 pc=0x42ab1e
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/wasmer._Cfunc_wasmer_instance_call(0x7f63982adfd0, 0x1a57190, 0xc0001820c0, 0x0, 0xc0001820e0, 0xc000000000, 0xc000000002)
_cgo_gotypes.go:457 +0x4d fp=0xc00004cbb8 sp=0xc00004cb88 pc=0x72e32d
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/wasmer.cWasmerInstanceCall(...)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/wasmer/bridge.go:241
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/wasmer.callWasmFunction(0x7f63982adfd0, 0xc0000b0474, 0x9, 0x0, 0xedec88, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/wasmer/function_wrapper_helpers.go:82 +0x1bf fp=0xc00004cc30 sp=0xc00004cbb8 pc=0x72a5bf
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/wasmer.createExportedFunctionWrapper.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/wasmer/instance_helpers.go:144 +0x190 fp=0xc00004cce8 sp=0xc00004cc30 pc=0x730a70
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwen/host.(*vmHost).callSCMethod(0xc000130300, 0xc00020a000, 0x4967)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwen/host/execution.go:871 +0x502 fp=0xc00004cdd0 sp=0xc00004cce8 pc=0x8202a2
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwen/host.(*vmHost).doRunSmartContractCall(0xc000130300, 0xc00013c780, 0x0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwen/host/execution.go:182 +0x6d7 fp=0xc00004cf08 sp=0xc00004cdd0 pc=0x81a1f7
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwen/host.(*vmHost).RunSmartContractCall.func1(0xc0000b6840, 0xc00013c780, 0xc000130300, 0xc0000105b0, 0xc00008e420)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwen/host/arwen.go:424 +0xbc fp=0xc00004cfb8 sp=0xc00004cf08 pc=0x8217fc
runtime.goexit()
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc00004cfc0 sp=0xc00004cfb8 pc=0x490581
created by github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwen/host.(*vmHost).RunSmartContractCall
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwen/host/arwen.go:411 +0x3be
goroutine 1 [select]:
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwen/host.(*vmHost).RunSmartContractCall(0xc000130300, 0xc00013c780, 0x0, 0x0, 0x0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwen/host/arwen.go:441 +0x49f
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwenmandos.(*ArwenTestExecutor).scCall(0xc0000b6240, 0xc0004fc851, 0xa, 0xc0000c05a0, 0x100000, 0x0, 0x0, 0x0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwenmandos/stepRunTx.go:240 +0x342
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwenmandos.(*ArwenTestExecutor).executeTx(0xc0000b6240, 0xc0004fc851, 0xa, 0xc0000c05a0, 0x0, 0x0, 0x0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwenmandos/stepRunTx.go:81 +0x1d2
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwenmandos.(*ArwenTestExecutor).ExecuteTxStep(0xc0000b6240, 0xc0000c2580, 0xc0001457c8, 0x88d642, 0xc0000ccb60)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwenmandos/execScenario.go:149 +0x125
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwenmandos.(*ArwenTestExecutor).ExecuteStep(0xc0000b6240, 0xbc1060, 0xc0000c2580, 0x0, 0x0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwenmandos/execScenario.go:68 +0x111
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/arwenmandos.(*ArwenTestExecutor).ExecuteScenario(0xc0000b6240, 0xc0000d3bd0, 0xbcb0a0, 0xc0000a85c0, 0x5f, 0xc0000d3bd0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/arwenmandos/execScenario.go:42 +0x1e5
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/mandos-go/controller.(*ScenarioRunner).RunSingleJSONScenario(0xc000145f38, 0xc00008e120, 0x5f, 0xc0000b0301, 0x5f, 0x7fff55461f85)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/mandos-go/controller/scenarioOne.go:38 +0xc8
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/mandos-go/controller.(*ScenarioRunner).RunAllJSONScenariosInDirectory.func1(0xc00008e120, 0x5f, 0xbcd3a0, 0xc0001505b0, 0x0, 0x0, 0x4fa5bd, 0xc0001505b0)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/mandos-go/controller/scenarioDir.go:33 +0x334
path/filepath.walk(0xc00008e120, 0x5f, 0xbcd3a0, 0xc0001505b0, 0xc000145d60, 0x0, 0x0)
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/path/filepath/path.go:360 +0x423
path/filepath.walk(0xc0000b20a0, 0x4b, 0xbcd3a0, 0xc00022e000, 0xc000145d60, 0x0, 0x0)
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/path/filepath/path.go:384 +0x2fe
path/filepath.walk(0xc0000b20f0, 0x46, 0xbcd3a0, 0xc00009d380, 0xc000145d60, 0x0, 0x46)
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/path/filepath/path.go:384 +0x2fe
path/filepath.Walk(0xc0000b20f0, 0x46, 0xc0000d7d60, 0xc0000b20f0, 0x46)
/home/wagnerm/elrondsdk/golang/go1.15.2/go/src/path/filepath/path.go:406 +0x105
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/mandos-go/controller.(*ScenarioRunner).RunAllJSONScenariosInDirectory(0xc0000d7f38, 0x7fff55461f85, 0x46, 0x0, 0x0, 0xa14897, 0xa, 0xc0000d7e40, 0x0, 0x0, ...)
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/mandos-go/controller/scenarioDir.go:24 +0x1d4
github.com/ElrondNetwork/arwen-wasm-vm/v1_4/cmd/mandostestcli.MandosTestCLI()
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/cmd/mandostestcli/mandosTestCLI.go:71 +0x845
main.main()
/home/wagnerm/elrondsdk/vmtools/v1.4.42/wasm-vm-1.4.42/cmd/test/mandosTestLegacy.go:7 +0x25
Just wanted to let you know :)
Ultimately I executed the tests just to make sure everything runs well before I update the elrond-wasm version.
So nothing that needs immediate fixing.
MWFIAE commented
Update: Noticed that it also happens with 0.29.2 🙏
dorin-iancu commented
I believe this was fixed. You have to update your VM version via erdpy:
erdpy deps install vmtools --overwrite