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

fix rpc gas limit #2051

Merged
merged 25 commits into from
May 16, 2022
Merged

fix rpc gas limit #2051

merged 25 commits into from
May 16, 2022

Conversation

ermalkaleci
Copy link
Contributor

@ermalkaleci ermalkaleci commented Apr 21, 2022

  • GasLimit and StorageLimit based on block limits
  • Disable RPC estimate mode for more accurate gas usage calculation
  • Add special methods for RPC calls
  • RPC methods to query evm_blockLimits

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #2051 (2e3ded5) into master (45c4120) will increase coverage by 85.80%.
The diff coverage is 2.70%.

❗ Current head 2e3ded5 differs from pull request most recent head afa8603. Consider uploading reports for the commit afa8603 to get more accurate results

@@             Coverage Diff             @@
##           master    #2051       +/-   ##
===========================================
+ Coverage        0   85.80%   +85.80%     
===========================================
  Files           0       98       +98     
  Lines           0    20074    +20074     
===========================================
+ Hits            0    17225    +17225     
- Misses          0     2849     +2849     
Impacted Files Coverage Δ
modules/evm/rpc/src/lib.rs 8.62% <0.00%> (ø)
primitives/src/evm.rs 90.90% <ø> (ø)
modules/evm/src/runner/stack.rs 53.02% <11.11%> (ø)
modules/prices/src/lib.rs 92.85% <0.00%> (ø)
modules/asset-registry/src/lib.rs 60.55% <0.00%> (ø)
modules/honzon-bridge/src/tests.rs 100.00% <0.00%> (ø)
modules/cdp-treasury/src/tests.rs 100.00% <0.00%> (ø)
primitives/src/bonding/ledger.rs 89.18% <0.00%> (ø)
modules/emergency-shutdown/src/tests.rs 100.00% <0.00%> (ø)
modules/evm/src/precompiles/mod.rs 0.00% <0.00%> (ø)
... and 91 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45c4120...afa8603. Read the comment docs.

modules/evm/rpc/src/lib.rs Outdated Show resolved Hide resolved
@ermalkaleci ermalkaleci marked this pull request as ready for review April 25, 2022 13:45
@ermalkaleci ermalkaleci requested review from xlc and zjb0807 April 25, 2022 13:53
modules/evm/rpc/src/lib.rs Outdated Show resolved Hide resolved
modules/evm/rpc/src/lib.rs Outdated Show resolved Hide resolved
modules/evm/rpc/src/lib.rs Show resolved Hide resolved
modules/evm/rpc/src/lib.rs Outdated Show resolved Hide resolved
runtime/common/src/lib.rs Show resolved Hide resolved
Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The max gas limit for eth_call is usually like 10x of the block gas limit. It is higher to allow people to make some calls that could be resource consuming but not intended to be called within transaction

modules/evm/src/runner/stack.rs Outdated Show resolved Hide resolved
runtime/acala/src/lib.rs Outdated Show resolved Hide resolved
modules/evm/rpc/runtime_api/src/lib.rs Outdated Show resolved Hide resolved
@ermalkaleci ermalkaleci requested review from zjb0807 and xlc May 11, 2022 08:17
@zjb0807 zjb0807 merged commit 004c762 into master May 16, 2022
@zjb0807 zjb0807 deleted the fix_gas_limit branch May 16, 2022 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants