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

feat: make it possible to construct a GasDuration #1898

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

Stebalien
Copy link
Member

This lets us construct "gas charge" objects with constant times (for tracing). We primarily need this to convert between different gas duration type versions.

  • Use an explicit enum with 3 options to avoid allocating/using an Arc+OnceCell when we don't need it.
  • Implement Debug manually to hide implementation details.
  • Change the assertion inside GasTimer::new to "debug only". If someone passes a "filled" duration, treat the gas timer as a no-op.

This lets us construct "gas charge" objects with constant times (for
tracing).

- Use an explicit enum with 3 options to avoid allocating/using an
  Arc+OnceCell when we don't need it.
- Implement Debug manually to hide implementation details.
- Change the assertion inside `GasTimer::new` to "debug only". If
  someone passes a "filled" duration, treat the gas timer as a no-op.
@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2023

Codecov Report

Merging #1898 (89a60a5) into master (4edf2f5) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1898      +/-   ##
==========================================
- Coverage   75.55%   75.54%   -0.02%     
==========================================
  Files         152      152              
  Lines       15106    15119      +13     
==========================================
+ Hits        11414    11422       +8     
- Misses       3692     3697       +5     
Files Coverage Δ
fvm/src/gas/timer.rs 83.92% <66.66%> (-6.77%) ⬇️

... and 2 files with indirect coverage changes

fvm/src/gas/timer.rs Show resolved Hide resolved
@Stebalien Stebalien merged commit 932a960 into master Sep 27, 2023
12 checks passed
@Stebalien Stebalien deleted the steb/construct-gas-duration branch September 27, 2023 14:38
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