feat(core,internal/ethapi): add MaxUsedGas field to eth_simulateV1 response #31735 #32789 #34820#2430
feat(core,internal/ethapi): add MaxUsedGas field to eth_simulateV1 response #31735 #32789 #34820#2430gzliudan wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new maxUsedGas value to eth_simulateV1 call results by plumbing an additional gas metric from core execution into the RPC response. This improves simulation output by exposing both refunded (gasUsed) and pre-refund (“gross”) gas usage.
Changes:
- Extend
core.ExecutionResultwithMaxUsedGasand compute it in the state transition before applying refunds (and adjusted for Prague floor gas). - Extend
internal/ethapi’seth_simulateV1per-call response object to includemaxUsedGas.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/ethapi/simulate.go | Adds maxUsedGas to the JSON response for each simulated call. |
| core/state_transition.go | Computes and returns ExecutionResult.MaxUsedGas alongside UsedGas. |
1502a8f to
9f90dbb
Compare
9f90dbb to
c0a73b2
Compare
Proposed changes
Ref:
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that