Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose max_gas_burnt_view as part of client config #3080

Closed
evgenykuzyakov opened this issue Aug 4, 2020 · 4 comments · Fixed by #4381
Closed

Expose max_gas_burnt_view as part of client config #3080

evgenykuzyakov opened this issue Aug 4, 2020 · 4 comments · Fixed by #4381
Assignees
Labels
A-RPC Area: rpc Node Node team T-node Team: issues relevant to the node experience team

Comments

@evgenykuzyakov
Copy link
Collaborator

max_gas_burnt_view defines the maximum burnt gas for a view call.

Since it doesn't influence the protocol (only affects RPC), it should be part of the client config instead of genesis config.

@alsakhaev
Copy link

alsakhaev commented May 5, 2021

I ran into the GasLimitExceeded error in my contract when calling the read function.

I started looking for where to change the gas limit in the node configuration. I have not found documentation for client configs anywhere. By examining the source code, it turned out that this parameter lies in the genesis (genesis.json), which is 5 GB in size. The built-in Linux text editors didn't want to work with such a large file. I discovered a HEX editor that can handle this. Replaced 200Tgas with 999Tgas.
image

Launched the client. It noticed the change by comparing the genesis hashes and cleared the entire state.
image

Well, the synchronization of the node started from the very beginning.
image

So, now it's impossible to change the gas limit for view functions.

@bowenwang1996
Copy link
Collaborator

So, now it's impossible to change the gas limit for view functions.

The config you modified is in genesis and is part of the protocol, so that doesn't work. What is proposed here is to add a separate client config that does not affect the protocol to increase the limit on view calls.

@ethernian
Copy link

Yes, please fix the issue.

It should be a no-brainer fix, max 10 lines of code to replace the source where the read-only gas limit comes from, isn't it?
I do really not understand why the read-only gas limit is part of genesis and thus part of the consensus.

@bowenwang1996 bowenwang1996 added the A-RPC Area: rpc label Jun 19, 2021
mina86 added a commit to mina86/nearcore that referenced this issue Jun 20, 2021
The ‘max_gas_burnt_view’ affects the RPCs only and as such does not
change the protocol.  Therefore it does not need to be part of the
consensus and all nodes could have this value customised rather than
using an agreed upon value from genesis runtime configuration.

Introduce a ‘max_gas_burnt_view’ field to ClientConfig and
a corresponding flag to ‘init’ subcommand.  When present, it will
override the limit used by the node ignoring whatever is stored in
genesis configuration.

Fixes: near#3080
mina86 added a commit to mina86/nearcore that referenced this issue Jun 20, 2021
The ‘max_gas_burnt_view’ affects the RPCs only and therefore doesn’t
need to be part of the consensus.  In other words, all nodes could
have this value customised rather than using an agreed upon value
from genesis configuration.

Introduce a ‘max_gas_burnt_view’ field to ClientConfig and
a corresponding flag to ‘init’ and ‘run’ subcommands.  When present,
it will override the limit used by the node ignoring whatever is
stored in genesis configuration.

Fixes: near#3080
mina86 added a commit to mina86/nearcore that referenced this issue Jun 21, 2021
The ‘max_gas_burnt_view’ affects the RPCs only and therefore doesn’t
need to be part of the consensus.  In other words, all nodes could
have this value customised rather than using an agreed upon value
from genesis configuration.

Introduce a ‘max_gas_burnt_view’ field to ClientConfig and
a corresponding flag to ‘init’ and ‘run’ subcommands.  When present,
it will override the limit used by the node ignoring whatever is
stored in genesis configuration.

Fixes: near#3080
@janewang janewang added the T-node Team: issues relevant to the node experience team label Jun 23, 2021
mina86 added a commit to mina86/nearcore that referenced this issue Jun 24, 2021
The ‘max_gas_burnt_view’ affects the RPCs only and therefore doesn’t
need to be part of the consensus.  In other words, all nodes could
have this value customised rather than using an agreed upon value
from genesis configuration.

Introduce a ‘max_gas_burnt_view’ field to ClientConfig and
a corresponding flag to ‘init’ and ‘run’ subcommands.  When present,
it will override the limit used by the node ignoring whatever is
stored in genesis configuration.

Fixes: near#3080
mina86 added a commit to mina86/nearcore that referenced this issue Jun 25, 2021
The ‘max_gas_burnt_view’ affects the RPCs only and therefore doesn’t
need to be part of the consensus.  In other words, all nodes could
have this value customised rather than using an agreed upon value
from genesis configuration.

Introduce a ‘max_gas_burnt_view’ field to ClientConfig and
a corresponding flag to ‘init’ and ‘run’ subcommands.  When present,
it will override the limit used by the node ignoring whatever is
stored in genesis configuration.

Fixes: near#3080
mina86 added a commit that referenced this issue Jun 28, 2021
…4381)

The ‘max_gas_burnt_view’ affects the RPCs only and therefore doesn’t
need to be part of the consensus.  In other words, all nodes could
have this value customised rather than using an agreed upon value
from genesis configuration.

Introduce a ‘max_gas_burnt_view’ field to ClientConfig and
a corresponding flag to ‘init’ and ‘run’ subcommands.  When present,
it will override the limit used by the node ignoring whatever is
stored in genesis configuration.

Fixes: #3080
@mina86
Copy link
Contributor

mina86 commented Jun 28, 2021

This isn’t yet available in a production release but if anyone wishes to test it in betanet et al with a nightly build neard will now accept --max-gas-burnt-view switch for its init and run commands. It’s also possible to add max_gas_burnt_view key to the config.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-RPC Area: rpc Node Node team T-node Team: issues relevant to the node experience team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants