Skip to content

Comments

fix: correct grammar in handler.rs comment#3422

Merged
rakita merged 2 commits intoexpose-gasfrom
copilot/sub-pr-3413
Feb 12, 2026
Merged

fix: correct grammar in handler.rs comment#3422
rakita merged 2 commits intoexpose-gasfrom
copilot/sub-pr-3413

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

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.

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
Copilot AI requested a review from rakita February 12, 2026 01:11
@rakita rakita marked this pull request as ready for review February 12, 2026 01:14
@rakita rakita merged commit 7f24d05 into expose-gas Feb 12, 2026
1 check passed
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2026

Merging this PR will not alter performance

✅ 173 untouched benchmarks


Comparing copilot/sub-pr-3413 (f087f92) with expose-gas (b6759dc)

Open in CodSpeed

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>
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.

2 participants