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

Properly handle gas in pointer precompile #1836

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

codchen
Copy link
Collaborator

@codchen codchen commented Aug 28, 2024

Describe your changes and provide context

Previously gas is tracked in two places for a pointer precompile call: the gas meter in sdk.Context, and suppliedGas. This PR unifies them into sdk.Context so that we don't miscount or double-count gas usage.

Testing performed to validate your change

unit tests

@codchen codchen force-pushed the use-gas-meter-for-precompile-query branch 2 times, most recently from 3b1170f to bab7d80 Compare August 28, 2024 12:11
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 62.16216% with 14 lines in your changes missing coverage. Please review.

Project coverage is 60.73%. Comparing base (18c3e2d) to head (1370350).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
precompiles/pointer/pointer.go 33.33% 8 Missing ⚠️
x/evm/keeper/params.go 44.44% 4 Missing and 1 partial ⚠️
precompiles/common/precompiles.go 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1836      +/-   ##
==========================================
- Coverage   60.90%   60.73%   -0.18%     
==========================================
  Files         257      257              
  Lines       22690    22698       +8     
==========================================
- Hits        13820    13786      -34     
- Misses       7887     7932      +45     
+ Partials      983      980       -3     
Files with missing lines Coverage Δ
x/evm/gov.go 38.46% <100.00%> (ø)
x/evm/keeper/pointer_upgrade.go 74.66% <100.00%> (+1.05%) ⬆️
x/evm/migrations/migrate_all_pointers.go 58.51% <100.00%> (ø)
precompiles/common/precompiles.go 51.23% <50.00%> (+0.93%) ⬆️
x/evm/keeper/params.go 70.96% <44.44%> (-10.86%) ⬇️
precompiles/pointer/pointer.go 36.00% <33.33%> (-0.07%) ⬇️

... and 2 files with indirect coverage changes

@codchen codchen force-pushed the use-gas-meter-for-precompile-query branch from bab7d80 to d0dd890 Compare August 29, 2024 14:52
@codchen codchen force-pushed the use-gas-meter-for-precompile-query branch from d0dd890 to 1370350 Compare August 29, 2024 15:59
@codchen codchen merged commit 7aeb9d1 into main Aug 29, 2024
49 checks passed
@codchen codchen deleted the use-gas-meter-for-precompile-query branch August 29, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants