-
Notifications
You must be signed in to change notification settings - Fork 443
Open
Description
Description
Gas usage for the same transaction that writes to realm storage is not deterministic and changes depending on whether the node has been restarted.
Steps to Reproduce
Test 1 (restart)
gnoland start
gnokey maketx addpkg -pkgdir $WORK/realm -pkgpath gno.land/r/foo -gas-fee 1000000ugnot -gas-wanted 20000000 -max-deposit 502500ugnot -broadcast -chainid=tendermint_test test1
gnoland restart
gnokey maketx call -pkgpath gno.land/r/foo -func NewFoo -args "foo" -gas-fee 1000000ugnot -gas-wanted 10000000 -broadcast -chainid=tendermint_test test1
stdout OK!
-- realm/gnomod.toml --
module = "gno.land/r/foo"
gno = "0.9"
-- realm/storage.gno --
package foo
var record *Foo
type Foo struct{
name string
}
func NewFoo(cur realm, name string){
record = &Foo{name}
}
Result:
stdout OK!
GAS USED: 258357
Test 2 (without restart)
gnoland start
gnokey maketx addpkg -pkgdir $WORK/realm -pkgpath gno.land/r/foo -gas-fee 1000000ugnot -gas-wanted 20000000 -max-deposit 502500ugnot -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/foo -func NewFoo -args "foo" -gas-fee 1000000ugnot -gas-wanted 10000000 -broadcast -chainid=tendermint_test test1
stdout OK!
-- realm/gnomod.toml --
module = "gno.land/r/foo"
gno = "0.9"
-- realm/storage.gno --
package foo
var record *Foo
type Foo struct{
name string
}
func NewFoo(cur realm, name string){
record = &Foo{name}
}
Result:
stdout OK!
GAS USED: 252481
Expected Behavior
Gas usage should be identical for the same transaction
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Progress