Closed r3v4s closed 1 year ago
The error here is coming from the virtual machine interpreting your code, not the Gno code itself.
I'll need more information about the Gno version you are executing. Can you provide a specific commit from where you built the binaries? Thanks!
The error here is coming from the virtual machine interpreting your code, not the Gno code itself.
I'll need more information about the Gno version you are executing. Can you provide a specific commit from where you built the binaries? Thanks!
Thx for checking!, I've built binary with current master
branch, so latest commit will be 9041d4769c3af7d422478724b8e8d604ed6297d5
It is important to note that the transactions were executed on test3
which is not master
.
Do you reproduce the issue with a local node built from master
?
It is important to note that the transactions were executed on
test3
which is notmaster
.Do you reproduce the issue with a local node built from
master
?
sorry to give you confusion.
stacktrace is from my local node with master
,
json error msg came from actual test3
so it is happening both test3
and master
https://github.com/gnolang/gno/issues/311
There seems to be a problem with persisting maps because they are non-deterministic. For now, it looks like you're better off using avl.Tree.
UPDATE: looks like map variable isn't being saved (doesn't keep state)
Below example code, there are 2 data types
In init
function, I'm initializing each value
After init, even mymap
and couter
are both global variable, only counter
keep its state while mymap
doesn't.
package maps
var (
mymap map[int64]int64 = make(map[int64]int64)
counter int64
)
func init() {
mymap[4] = 4444
counter = 12345
}
func GetData() (map[int64]int64, int64) {
// gno test returns => map{(4 int64):(4444 int64)}
// gnokey addpkg & maketx call returns => (map{} map[int64]int64) // XXX where did it go?
println(mymap)
// gno test returns => 12345
// gnokey addpkg & maketx call returns => (12345 int64)
println(counter)
return mymap, counter
}
Added a challenge: https://github.com/gnolang/gno/pull/833/files#diff-9be2aeb8ae9c1b2c3eaeeb8b1826d1c5406e18c00b8eded45cdae2fe2c899a88
nice we're using the challenges folder! thank you manfred
Anyone can try this; please add me as reviewer.
Anyone can try this; please add me as reviewer.
@jaekwon @moul See #932 for the fixes
runtime error: invalid memory address or nil pointer dereference
Description
map disappears after first call(not sure this is exact explanation)
Your environment
master
branchmaster
branchSteps to reproduce
Deploy below package
run
gno test
works fine just like belowwhich prints
after addpkg, first maketx call works fine
but second maketx call fail
Expected behaviour
update map value
Actual behaviour
map disappears
Stack Trace