fix: correct grammar in handler.rs comment#3422
Merged
rakita merged 2 commits intoexpose-gasfrom Feb 12, 2026
Merged
Conversation
5 tasks
Co-authored-by: rakita <13179220+rakita@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update ResultGas struct in ExecutionResult refactor
fix: correct grammar in handler.rs comment
Feb 12, 2026
rakita
added a commit
that referenced
this pull request
Feb 12, 2026
* refactor!: add `ResultGas` struct to `ExecutionResult` Replace loose `gas_used` and `gas_refunded` fields in all three `ExecutionResult` variants with a single `gas: ResultGas` struct that exposes richer gas accounting: `gas_used`, `gas_refunded`, `gas_spent` (pre-refund), and `floor_gas` (EIP-7623). * refactor: simplify ResultGas to store only independent fields Remove the redundant `gas_used` field from `ResultGas` since it can always be derived as `gas_spent - gas_refunded`. The struct now stores only three independent values (gas_spent, gas_refunded, floor_gas) and exposes `gas_used()` as a method. * refactor: refine ResultGas field naming and add Display impl - Rename fields to align with Gas struct methods: gas_spent → spent, gas_refunded → refunded, gas_used() → used() Eliminates redundant gas.gas_spent pattern (now gas.spent) - Add #[serde(rename)] to preserve JSON key stability - Add Display impl for ResultGas (conditionally shows refunded/floor) - Simplify ExecutionResult Display to delegate to ResultGas Display - Improve documentation with source mapping table - Add tests for ResultGas Display and used() method * feat: add gas limit to ResultGas for self-contained gas accounting Add `limit` field to `ResultGas` so it contains all gas information without requiring external context. Also add `remaining()` derived method (limit - spent) to complement `used()` (spent - refunded). ResultGas now mirrors the full Gas struct snapshot: - limit: transaction gas limit - spent: gas consumed before refund - refunded: gas refund amount - floor_gas: EIP-7623 floor gas - used(): spent - refunded (derived) - remaining(): limit - spent (derived) * feat: add `intrinsic_gas` to `ResultGas` and return it from `post_execution` Add intrinsic_gas field to ResultGas so it carries the initial tx overhead gas. Change post_execution to return ResultGas directly, and have execution_result receive a pre-built ResultGas instead of InitialAndFloorGas. * chore: fix formatting * feat: encapsulate ResultGas fields with getters, setters, and builders - Make all ResultGas fields private - Add getter methods: limit(), spent(), refunded(), floor_gas(), intrinsic_gas() - Add builder methods: with_limit(), with_spent(), with_refunded(), with_floor_gas(), with_intrinsic_gas() - Add setter methods: set_limit(), set_spent(), set_refunded(), set_floor_gas(), set_intrinsic_gas() - Add derived methods: final_used(), inner_refunded(), final_refunded() * docs: update ResultGas comments to reflect encapsulated API - Rewrite struct doc table to reference getter methods instead of fields - Fix used() doc formula to include floor_gas: max(spent - refunded, floor_gas) - Fix incomplete refunded field doc, point to final_refunded() - Remove stale final_used() reference, remove refunded() getter (replaced by inner_refunded) * chore: fix typo in handler comment * Update crates/context/interface/src/result.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: correct grammar in handler.rs comment (#3422) * Initial plan * fix: correct grammar in handler.rs comment --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
rakita
added a commit
that referenced
this pull request
Feb 23, 2026
* refactor!: add `ResultGas` struct to `ExecutionResult` Replace loose `gas_used` and `gas_refunded` fields in all three `ExecutionResult` variants with a single `gas: ResultGas` struct that exposes richer gas accounting: `gas_used`, `gas_refunded`, `gas_spent` (pre-refund), and `floor_gas` (EIP-7623). * refactor: simplify ResultGas to store only independent fields Remove the redundant `gas_used` field from `ResultGas` since it can always be derived as `gas_spent - gas_refunded`. The struct now stores only three independent values (gas_spent, gas_refunded, floor_gas) and exposes `gas_used()` as a method. * refactor: refine ResultGas field naming and add Display impl - Rename fields to align with Gas struct methods: gas_spent → spent, gas_refunded → refunded, gas_used() → used() Eliminates redundant gas.gas_spent pattern (now gas.spent) - Add #[serde(rename)] to preserve JSON key stability - Add Display impl for ResultGas (conditionally shows refunded/floor) - Simplify ExecutionResult Display to delegate to ResultGas Display - Improve documentation with source mapping table - Add tests for ResultGas Display and used() method * feat: add gas limit to ResultGas for self-contained gas accounting Add `limit` field to `ResultGas` so it contains all gas information without requiring external context. Also add `remaining()` derived method (limit - spent) to complement `used()` (spent - refunded). ResultGas now mirrors the full Gas struct snapshot: - limit: transaction gas limit - spent: gas consumed before refund - refunded: gas refund amount - floor_gas: EIP-7623 floor gas - used(): spent - refunded (derived) - remaining(): limit - spent (derived) * feat: add `intrinsic_gas` to `ResultGas` and return it from `post_execution` Add intrinsic_gas field to ResultGas so it carries the initial tx overhead gas. Change post_execution to return ResultGas directly, and have execution_result receive a pre-built ResultGas instead of InitialAndFloorGas. * chore: fix formatting * feat: encapsulate ResultGas fields with getters, setters, and builders - Make all ResultGas fields private - Add getter methods: limit(), spent(), refunded(), floor_gas(), intrinsic_gas() - Add builder methods: with_limit(), with_spent(), with_refunded(), with_floor_gas(), with_intrinsic_gas() - Add setter methods: set_limit(), set_spent(), set_refunded(), set_floor_gas(), set_intrinsic_gas() - Add derived methods: final_used(), inner_refunded(), final_refunded() * docs: update ResultGas comments to reflect encapsulated API - Rewrite struct doc table to reference getter methods instead of fields - Fix used() doc formula to include floor_gas: max(spent - refunded, floor_gas) - Fix incomplete refunded field doc, point to final_refunded() - Remove stale final_used() reference, remove refunded() getter (replaced by inner_refunded) * chore: fix typo in handler comment * feat(revme): validate block gas used in blockchain tests Add cumulative gas tracking per block and validate against the expected gas_used from block headers. Uses EIP-7778 logic for Amsterdam+ where block gas excludes refunds (spent vs floor_gas), falling back to the standard used() calculation for earlier specs. * Update crates/context/interface/src/result.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: correct grammar in handler.rs comment (#3422) * Initial plan * fix: correct grammar in handler.rs comment --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses grammar feedback from PR #3413 review discussion.
Changed comment from "This include all necessary fields" to "This includes all necessary fields" in
crates/handler/src/handler.rs:236.Documentation-only change with no functional impact.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.