Skip to content

Commit

Permalink
fix: Increase 'max gas' and 'vm cycle limit' from 10M to 100M (#2065)
Browse files Browse the repository at this point in the history
closes #1788 

similar closed pr #1901 

This pr bumps 2 maximum limits
1. max block gas
2. max vm cycle

AFAIK, to use amount of increased gas, vm cycle also need to be bump
too.

This is temporarily fix pr until we have clear ways to measure gas usage
and vm cycle.

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
  • Loading branch information
r3v4s authored May 15, 2024
1 parent 5a64b25 commit 155aba4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contribs/gnodev/pkg/dev/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: 100_000_000,
}
}
10 changes: 5 additions & 5 deletions gno.land/cmd/gnoland/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (c *startCfg) RegisterFlags(fs *flag.FlagSet) {
fs.Int64Var(
&c.genesisMaxVMCycles,
"genesis-max-vm-cycles",
10_000_000,
100_000_000,
"set maximum allowed vm cycles per operation. Zero means no limit.",
)

Expand Down Expand Up @@ -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: 100_000_000, // 100M gas
TimeIotaMS: 100, // 100ms
},
}

Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/gnoland/node_inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewDefaultGenesisConfig(pk crypto.PubKey, chainid string) *bft.GenesisDoc {
Block: &abci.BlockParams{
MaxTxBytes: 1_000_000, // 1MB,
MaxDataBytes: 2_000_000, // 2MB,
MaxGas: 100_000_000, // 10M gas
MaxGas: 100_000_000, // 100M gas
TimeIotaMS: 100, // 100ms
},
},
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/integration/testing_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: 100_000_000, // 100M gas
TimeIotaMS: 100, // 100ms
},
},
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/sdk/vm/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, 100_000_000)

vmk.Initialize(ms.MultiCacheWrap())

Expand Down
2 changes: 1 addition & 1 deletion tm2/pkg/bft/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 100000000 // 100M gas

// BlockTimeIotaMS is the block time iota (in ms)
BlockTimeIotaMS int64 = 100 // ms
Expand Down

0 comments on commit 155aba4

Please sign in to comment.