From 28576801ed71f009698df7eec963f1a626e45617 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Thu, 9 May 2024 20:46:43 +0900 Subject: [PATCH 1/5] fix: increase max gas limit from 10M to 10_000M --- gno.land/cmd/gnoland/start.go | 8 ++++---- gno.land/pkg/gnoland/node_inmemory.go | 8 ++++---- gno.land/pkg/integration/testing_node.go | 2 +- tm2/pkg/bft/types/params.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gno.land/cmd/gnoland/start.go b/gno.land/cmd/gnoland/start.go index aec69d5b338..d47624782a5 100644 --- a/gno.land/cmd/gnoland/start.go +++ b/gno.land/cmd/gnoland/start.go @@ -319,10 +319,10 @@ func generateGenesisFile(genesisFile string, pk crypto.PubKey, c *startCfg) erro gen.ConsensusParams = abci.ConsensusParams{ Block: &abci.BlockParams{ // TODO: update limits. - MaxTxBytes: 1_000_000, // 1MB, - MaxDataBytes: 2_000_000, // 2MB, - MaxGas: 10_0000_00, // 10M gas - TimeIotaMS: 100, // 100ms + MaxTxBytes: 1_000_000, // 1MB, + MaxDataBytes: 2_000_000, // 2MB, + MaxGas: 10_000_000_000, // 10_000M gas + TimeIotaMS: 100, // 100ms }, } diff --git a/gno.land/pkg/gnoland/node_inmemory.go b/gno.land/pkg/gnoland/node_inmemory.go index 05ed59ee491..5cd2b3314d4 100644 --- a/gno.land/pkg/gnoland/node_inmemory.go +++ b/gno.land/pkg/gnoland/node_inmemory.go @@ -40,10 +40,10 @@ func NewDefaultGenesisConfig(pk crypto.PubKey, chainid string) *bft.GenesisDoc { ChainID: chainid, ConsensusParams: abci.ConsensusParams{ Block: &abci.BlockParams{ - MaxTxBytes: 1_000_000, // 1MB, - MaxDataBytes: 2_000_000, // 2MB, - MaxGas: 100_000_000, // 10M gas - TimeIotaMS: 100, // 100ms + MaxTxBytes: 1_000_000, // 1MB, + MaxDataBytes: 2_000_000, // 2MB, + MaxGas: 10_000_000_000, // 10_000M gas + TimeIotaMS: 100, // 100ms }, }, AppState: &GnoGenesisState{ diff --git a/gno.land/pkg/integration/testing_node.go b/gno.land/pkg/integration/testing_node.go index 2676202e083..956e4a7d985 100644 --- a/gno.land/pkg/integration/testing_node.go +++ b/gno.land/pkg/integration/testing_node.go @@ -86,7 +86,7 @@ func DefaultTestingGenesisConfig(t TestingTS, gnoroot string, self crypto.PubKey Block: &abci.BlockParams{ MaxTxBytes: 1_000_000, // 1MB, MaxDataBytes: 2_000_000, // 2MB, - MaxGas: 10_0000_000, // 10M gas + MaxGas: 10_000_000_000, // 10_000M gas TimeIotaMS: 100, // 100ms }, }, diff --git a/tm2/pkg/bft/types/params.go b/tm2/pkg/bft/types/params.go index 461d62a17b3..d5709773e0b 100644 --- a/tm2/pkg/bft/types/params.go +++ b/tm2/pkg/bft/types/params.go @@ -24,7 +24,7 @@ const ( MaxBlockDataBytes int64 = 2000000 // 2MB // MaxBlockMaxGas is the max gas limit for the block - MaxBlockMaxGas int64 = 10000000 // 10M gas + MaxBlockMaxGas int64 = 10000000000 // 10000M gas // BlockTimeIotaMS is the block time iota (in ms) BlockTimeIotaMS int64 = 100 // ms From 365c777979c6c1eaeb078f3c6dd117ffabeafb81 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Thu, 9 May 2024 20:48:26 +0900 Subject: [PATCH 2/5] fix: increase vm cycle limit from 10M to 10_000M --- contribs/gnodev/pkg/dev/node.go | 2 +- gno.land/cmd/gnoland/start.go | 2 +- gno.land/pkg/sdk/vm/common_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contribs/gnodev/pkg/dev/node.go b/contribs/gnodev/pkg/dev/node.go index 7756a1c866d..1b4b8d840ae 100644 --- a/contribs/gnodev/pkg/dev/node.go +++ b/contribs/gnodev/pkg/dev/node.go @@ -541,6 +541,6 @@ func newNodeConfig(tmc *tmcfg.Config, chainid string, appstate gnoland.GnoGenesi PrivValidator: pv, TMConfig: tmc, Genesis: genesis, - GenesisMaxVMCycles: 10_000_000, + GenesisMaxVMCycles: 10_000_000_000, } } diff --git a/gno.land/cmd/gnoland/start.go b/gno.land/cmd/gnoland/start.go index d47624782a5..138a4b2f8e0 100644 --- a/gno.land/cmd/gnoland/start.go +++ b/gno.land/cmd/gnoland/start.go @@ -144,7 +144,7 @@ func (c *startCfg) RegisterFlags(fs *flag.FlagSet) { fs.Int64Var( &c.genesisMaxVMCycles, "genesis-max-vm-cycles", - 10_000_000, + 10_000_000_000, "set maximum allowed vm cycles per operation. Zero means no limit.", ) diff --git a/gno.land/pkg/sdk/vm/common_test.go b/gno.land/pkg/sdk/vm/common_test.go index b65757da403..a9e2e1b0bce 100644 --- a/gno.land/pkg/sdk/vm/common_test.go +++ b/gno.land/pkg/sdk/vm/common_test.go @@ -39,7 +39,7 @@ func setupTestEnv() testEnv { acck := authm.NewAccountKeeper(iavlCapKey, std.ProtoBaseAccount) bank := bankm.NewBankKeeper(acck) stdlibsDir := filepath.Join("..", "..", "..", "..", "gnovm", "stdlibs") - vmk := NewVMKeeper(baseCapKey, iavlCapKey, acck, bank, stdlibsDir, 10_000_000) + vmk := NewVMKeeper(baseCapKey, iavlCapKey, acck, bank, stdlibsDir, 10_000_000_000) vmk.Initialize(ms.MultiCacheWrap()) From 8398a68090883e03b7d8781f6dc6676cc048ad38 Mon Sep 17 00:00:00 2001 From: n3wbie Date: Fri, 10 May 2024 12:40:53 +0900 Subject: [PATCH 3/5] fix: increase vm cycle limit from 10M to 100M --- contribs/gnodev/pkg/dev/node.go | 2 +- examples/gno.land/r/r3v4/diff/diff.gno | 10 ++++++++++ examples/gno.land/r/r3v4/diff/gno.mod | 1 + .../r/r3v4/event_inner/event_inner.gno | 15 +++++++++++++++ examples/gno.land/r/r3v4/event_inner/gno.modA | 1 + .../r/r3v4/event_outer/event_outer.gno | 18 ++++++++++++++++++ examples/gno.land/r/r3v4/event_outer/gno.modA | 1 + examples/gno.land/r/r3v4/returns/gno.mod | 1 + examples/gno.land/r/r3v4/returns/returns.gno | 11 +++++++++++ gno.land/cmd/gnoland/start.go | 2 +- gno.land/pkg/sdk/vm/common_test.go | 2 +- 11 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 examples/gno.land/r/r3v4/diff/diff.gno create mode 100644 examples/gno.land/r/r3v4/diff/gno.mod create mode 100644 examples/gno.land/r/r3v4/event_inner/event_inner.gno create mode 100644 examples/gno.land/r/r3v4/event_inner/gno.modA create mode 100644 examples/gno.land/r/r3v4/event_outer/event_outer.gno create mode 100644 examples/gno.land/r/r3v4/event_outer/gno.modA create mode 100644 examples/gno.land/r/r3v4/returns/gno.mod create mode 100644 examples/gno.land/r/r3v4/returns/returns.gno diff --git a/contribs/gnodev/pkg/dev/node.go b/contribs/gnodev/pkg/dev/node.go index 1b4b8d840ae..4139c274b82 100644 --- a/contribs/gnodev/pkg/dev/node.go +++ b/contribs/gnodev/pkg/dev/node.go @@ -541,6 +541,6 @@ func newNodeConfig(tmc *tmcfg.Config, chainid string, appstate gnoland.GnoGenesi PrivValidator: pv, TMConfig: tmc, Genesis: genesis, - GenesisMaxVMCycles: 10_000_000_000, + GenesisMaxVMCycles: 100_000_000, } } diff --git a/examples/gno.land/r/r3v4/diff/diff.gno b/examples/gno.land/r/r3v4/diff/diff.gno new file mode 100644 index 00000000000..bab55af254a --- /dev/null +++ b/examples/gno.land/r/r3v4/diff/diff.gno @@ -0,0 +1,10 @@ +package diff + +import ( + "std" +) + +func PrintInfo() { + println("diff info") + println("currentRealm:", std.CurrentRealm().PkgPath()) +} diff --git a/examples/gno.land/r/r3v4/diff/gno.mod b/examples/gno.land/r/r3v4/diff/gno.mod new file mode 100644 index 00000000000..e9f3b726c5c --- /dev/null +++ b/examples/gno.land/r/r3v4/diff/gno.mod @@ -0,0 +1 @@ +module gno.land/r/r3v4/diff \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/event_inner/event_inner.gno b/examples/gno.land/r/r3v4/event_inner/event_inner.gno new file mode 100644 index 00000000000..f7e69a3c8e8 --- /dev/null +++ b/examples/gno.land/r/r3v4/event_inner/event_inner.gno @@ -0,0 +1,15 @@ +package event_inner + +import ( + "std" +) + +func EventInner() { + std.Emit("inner", "k1", "v1") + std.Emit("inner", "k2", "v2") +} + +func EventInnerOther() { + std.Emit("inner_other", "k3", "v3") + std.Emit("inner_other", "k4", "v4") +} diff --git a/examples/gno.land/r/r3v4/event_inner/gno.modA b/examples/gno.land/r/r3v4/event_inner/gno.modA new file mode 100644 index 00000000000..3bc43a912bf --- /dev/null +++ b/examples/gno.land/r/r3v4/event_inner/gno.modA @@ -0,0 +1 @@ +module gno.land/r/r3v4/event_inner \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/event_outer/event_outer.gno b/examples/gno.land/r/r3v4/event_outer/event_outer.gno new file mode 100644 index 00000000000..8e1e764f681 --- /dev/null +++ b/examples/gno.land/r/r3v4/event_outer/event_outer.gno @@ -0,0 +1,18 @@ +package event_outer + +import ( + "std" + + inner "gno.land/r/r3v4/event_inner" +) + +func Event() { + std.Emit("outer", "k1", "v1") + inner.EventInner() + std.Emit("outer", "k2", "v2") +} + +func EventOuterOther() { + std.Emit("outer_other", "k3", "v3") + std.Emit("outer_other", "k4", "v4") +} diff --git a/examples/gno.land/r/r3v4/event_outer/gno.modA b/examples/gno.land/r/r3v4/event_outer/gno.modA new file mode 100644 index 00000000000..8f01bbac06b --- /dev/null +++ b/examples/gno.land/r/r3v4/event_outer/gno.modA @@ -0,0 +1 @@ +module gno.land/r/r3v4/event_outer \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/returns/gno.mod b/examples/gno.land/r/r3v4/returns/gno.mod new file mode 100644 index 00000000000..8000dfd9714 --- /dev/null +++ b/examples/gno.land/r/r3v4/returns/gno.mod @@ -0,0 +1 @@ +module gno.land/r/r3v4/returns \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/returns/returns.gno b/examples/gno.land/r/r3v4/returns/returns.gno new file mode 100644 index 00000000000..bfad472c059 --- /dev/null +++ b/examples/gno.land/r/r3v4/returns/returns.gno @@ -0,0 +1,11 @@ +package returns + +func FuncNo() {} + +func Func2() (string, uint64) { + return "asd", 123 +} + +func Func3() (int64, string, uint64) { + return -1, "hmm", 78978 +} diff --git a/gno.land/cmd/gnoland/start.go b/gno.land/cmd/gnoland/start.go index 138a4b2f8e0..6fae4b7e0de 100644 --- a/gno.land/cmd/gnoland/start.go +++ b/gno.land/cmd/gnoland/start.go @@ -144,7 +144,7 @@ func (c *startCfg) RegisterFlags(fs *flag.FlagSet) { fs.Int64Var( &c.genesisMaxVMCycles, "genesis-max-vm-cycles", - 10_000_000_000, + 100_000_000, "set maximum allowed vm cycles per operation. Zero means no limit.", ) diff --git a/gno.land/pkg/sdk/vm/common_test.go b/gno.land/pkg/sdk/vm/common_test.go index a9e2e1b0bce..216de980aff 100644 --- a/gno.land/pkg/sdk/vm/common_test.go +++ b/gno.land/pkg/sdk/vm/common_test.go @@ -39,7 +39,7 @@ func setupTestEnv() testEnv { acck := authm.NewAccountKeeper(iavlCapKey, std.ProtoBaseAccount) bank := bankm.NewBankKeeper(acck) stdlibsDir := filepath.Join("..", "..", "..", "..", "gnovm", "stdlibs") - vmk := NewVMKeeper(baseCapKey, iavlCapKey, acck, bank, stdlibsDir, 10_000_000_000) + vmk := NewVMKeeper(baseCapKey, iavlCapKey, acck, bank, stdlibsDir, 100_000_000) vmk.Initialize(ms.MultiCacheWrap()) From dc35c5b8881f01f932a69f52cc2837f68f7dd7fc Mon Sep 17 00:00:00 2001 From: n3wbie Date: Fri, 10 May 2024 12:43:05 +0900 Subject: [PATCH 4/5] fix: increase max gas limit from 10M to 100M --- gno.land/cmd/gnoland/start.go | 8 ++++---- gno.land/pkg/gnoland/node_inmemory.go | 8 ++++---- gno.land/pkg/integration/testing_node.go | 2 +- tm2/pkg/bft/types/params.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gno.land/cmd/gnoland/start.go b/gno.land/cmd/gnoland/start.go index 6fae4b7e0de..11006d69246 100644 --- a/gno.land/cmd/gnoland/start.go +++ b/gno.land/cmd/gnoland/start.go @@ -319,10 +319,10 @@ func generateGenesisFile(genesisFile string, pk crypto.PubKey, c *startCfg) erro gen.ConsensusParams = abci.ConsensusParams{ Block: &abci.BlockParams{ // TODO: update limits. - MaxTxBytes: 1_000_000, // 1MB, - MaxDataBytes: 2_000_000, // 2MB, - MaxGas: 10_000_000_000, // 10_000M gas - TimeIotaMS: 100, // 100ms + MaxTxBytes: 1_000_000, // 1MB, + MaxDataBytes: 2_000_000, // 2MB, + MaxGas: 100_000_000, // 100M gas + TimeIotaMS: 100, // 100ms }, } diff --git a/gno.land/pkg/gnoland/node_inmemory.go b/gno.land/pkg/gnoland/node_inmemory.go index 5cd2b3314d4..b7fe1161605 100644 --- a/gno.land/pkg/gnoland/node_inmemory.go +++ b/gno.land/pkg/gnoland/node_inmemory.go @@ -40,10 +40,10 @@ func NewDefaultGenesisConfig(pk crypto.PubKey, chainid string) *bft.GenesisDoc { ChainID: chainid, ConsensusParams: abci.ConsensusParams{ Block: &abci.BlockParams{ - MaxTxBytes: 1_000_000, // 1MB, - MaxDataBytes: 2_000_000, // 2MB, - MaxGas: 10_000_000_000, // 10_000M gas - TimeIotaMS: 100, // 100ms + MaxTxBytes: 1_000_000, // 1MB, + MaxDataBytes: 2_000_000, // 2MB, + MaxGas: 100_000_000, // 100M gas + TimeIotaMS: 100, // 100ms }, }, AppState: &GnoGenesisState{ diff --git a/gno.land/pkg/integration/testing_node.go b/gno.land/pkg/integration/testing_node.go index 956e4a7d985..66fc50e7953 100644 --- a/gno.land/pkg/integration/testing_node.go +++ b/gno.land/pkg/integration/testing_node.go @@ -86,7 +86,7 @@ func DefaultTestingGenesisConfig(t TestingTS, gnoroot string, self crypto.PubKey Block: &abci.BlockParams{ MaxTxBytes: 1_000_000, // 1MB, MaxDataBytes: 2_000_000, // 2MB, - MaxGas: 10_000_000_000, // 10_000M gas + MaxGas: 100_000_000, // 100M gas TimeIotaMS: 100, // 100ms }, }, diff --git a/tm2/pkg/bft/types/params.go b/tm2/pkg/bft/types/params.go index d5709773e0b..0b48da9329e 100644 --- a/tm2/pkg/bft/types/params.go +++ b/tm2/pkg/bft/types/params.go @@ -24,7 +24,7 @@ const ( MaxBlockDataBytes int64 = 2000000 // 2MB // MaxBlockMaxGas is the max gas limit for the block - MaxBlockMaxGas int64 = 10000000000 // 10000M gas + MaxBlockMaxGas int64 = 100000000 // 100M gas // BlockTimeIotaMS is the block time iota (in ms) BlockTimeIotaMS int64 = 100 // ms From ea548e2d8c58cc3c707c3706eef9a119e7b8400e Mon Sep 17 00:00:00 2001 From: n3wbie Date: Fri, 10 May 2024 12:45:53 +0900 Subject: [PATCH 5/5] remove --- examples/gno.land/r/r3v4/diff/diff.gno | 10 ---------- examples/gno.land/r/r3v4/diff/gno.mod | 1 - .../r/r3v4/event_inner/event_inner.gno | 15 --------------- examples/gno.land/r/r3v4/event_inner/gno.modA | 1 - .../r/r3v4/event_outer/event_outer.gno | 18 ------------------ examples/gno.land/r/r3v4/event_outer/gno.modA | 1 - examples/gno.land/r/r3v4/returns/gno.mod | 1 - examples/gno.land/r/r3v4/returns/returns.gno | 11 ----------- 8 files changed, 58 deletions(-) delete mode 100644 examples/gno.land/r/r3v4/diff/diff.gno delete mode 100644 examples/gno.land/r/r3v4/diff/gno.mod delete mode 100644 examples/gno.land/r/r3v4/event_inner/event_inner.gno delete mode 100644 examples/gno.land/r/r3v4/event_inner/gno.modA delete mode 100644 examples/gno.land/r/r3v4/event_outer/event_outer.gno delete mode 100644 examples/gno.land/r/r3v4/event_outer/gno.modA delete mode 100644 examples/gno.land/r/r3v4/returns/gno.mod delete mode 100644 examples/gno.land/r/r3v4/returns/returns.gno diff --git a/examples/gno.land/r/r3v4/diff/diff.gno b/examples/gno.land/r/r3v4/diff/diff.gno deleted file mode 100644 index bab55af254a..00000000000 --- a/examples/gno.land/r/r3v4/diff/diff.gno +++ /dev/null @@ -1,10 +0,0 @@ -package diff - -import ( - "std" -) - -func PrintInfo() { - println("diff info") - println("currentRealm:", std.CurrentRealm().PkgPath()) -} diff --git a/examples/gno.land/r/r3v4/diff/gno.mod b/examples/gno.land/r/r3v4/diff/gno.mod deleted file mode 100644 index e9f3b726c5c..00000000000 --- a/examples/gno.land/r/r3v4/diff/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/r3v4/diff \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/event_inner/event_inner.gno b/examples/gno.land/r/r3v4/event_inner/event_inner.gno deleted file mode 100644 index f7e69a3c8e8..00000000000 --- a/examples/gno.land/r/r3v4/event_inner/event_inner.gno +++ /dev/null @@ -1,15 +0,0 @@ -package event_inner - -import ( - "std" -) - -func EventInner() { - std.Emit("inner", "k1", "v1") - std.Emit("inner", "k2", "v2") -} - -func EventInnerOther() { - std.Emit("inner_other", "k3", "v3") - std.Emit("inner_other", "k4", "v4") -} diff --git a/examples/gno.land/r/r3v4/event_inner/gno.modA b/examples/gno.land/r/r3v4/event_inner/gno.modA deleted file mode 100644 index 3bc43a912bf..00000000000 --- a/examples/gno.land/r/r3v4/event_inner/gno.modA +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/r3v4/event_inner \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/event_outer/event_outer.gno b/examples/gno.land/r/r3v4/event_outer/event_outer.gno deleted file mode 100644 index 8e1e764f681..00000000000 --- a/examples/gno.land/r/r3v4/event_outer/event_outer.gno +++ /dev/null @@ -1,18 +0,0 @@ -package event_outer - -import ( - "std" - - inner "gno.land/r/r3v4/event_inner" -) - -func Event() { - std.Emit("outer", "k1", "v1") - inner.EventInner() - std.Emit("outer", "k2", "v2") -} - -func EventOuterOther() { - std.Emit("outer_other", "k3", "v3") - std.Emit("outer_other", "k4", "v4") -} diff --git a/examples/gno.land/r/r3v4/event_outer/gno.modA b/examples/gno.land/r/r3v4/event_outer/gno.modA deleted file mode 100644 index 8f01bbac06b..00000000000 --- a/examples/gno.land/r/r3v4/event_outer/gno.modA +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/r3v4/event_outer \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/returns/gno.mod b/examples/gno.land/r/r3v4/returns/gno.mod deleted file mode 100644 index 8000dfd9714..00000000000 --- a/examples/gno.land/r/r3v4/returns/gno.mod +++ /dev/null @@ -1 +0,0 @@ -module gno.land/r/r3v4/returns \ No newline at end of file diff --git a/examples/gno.land/r/r3v4/returns/returns.gno b/examples/gno.land/r/r3v4/returns/returns.gno deleted file mode 100644 index bfad472c059..00000000000 --- a/examples/gno.land/r/r3v4/returns/returns.gno +++ /dev/null @@ -1,11 +0,0 @@ -package returns - -func FuncNo() {} - -func Func2() (string, uint64) { - return "asd", 123 -} - -func Func3() (int64, string, uint64) { - return -1, "hmm", 78978 -}