Skip to content

chore: rm leftover InvocResult - #7457

Merged
LesnyRumcajs merged 3 commits into
mainfrom
optimize-call-with-gas
Aug 6, 2026
Merged

chore: rm leftover InvocResult#7457
LesnyRumcajs merged 3 commits into
mainfrom
optimize-call-with-gas

Conversation

@LesnyRumcajs

@LesnyRumcajs LesnyRumcajs commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary of changes

Changes introduced in this pull request:

  • I think fix(rpc): Filecoin.StateReplay #4413 made it redundant but for some reason we didn't remove it and kept constructing it. Not a huge deal, a couple of wasteful allocations but still, str8 to purgatory.

Reference issue to close (if applicable)

Closes

Other information and links

On top of #7456

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • This pull request is based on an issue that a maintainer has accepted (see Before Opening a Pull Request).
  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Bug Fixes
    • Improved gas estimation reliability by validating execution results directly.
    • Gas estimation now reports unsuccessful execution as an error instead of returning an invalid fallback value.
    • Preserved existing gas-search behavior while simplifying call result handling.

@LesnyRumcajs
LesnyRumcajs requested a review from a team as a code owner August 6, 2026 10:17
@LesnyRumcajs
LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team August 6, 2026 10:17
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Gas simulation and estimation no longer return or construct InvocResult. Callers now consume ApplyRet directly, and gas-limit estimation reports unsuccessful execution using the application result.

Changes

Gas estimation result simplification

Layer / File(s) Summary
Reduce simulation result contract
src/rpc/methods/state/types.rs, src/state_manager/message_simulation.rs
Removed the public InvocResult type. call_with_gas now returns ApplyRet, execution duration, and an optional state root.
Update gas estimation consumers
src/rpc/methods/gas.rs, src/rpc/methods/eth.rs
Gas estimation and gas search now consume reduced tuples. estimate_gas_limit validates ApplyRet directly and returns execution errors instead of using receipt fallback handling.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: hanabi1224, sudo-shashank

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: removing the redundant InvocResult.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize-call-with-gas
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch optimize-call-with-gas

Comment @coderabbitai help to get the list of available commands.

hanabi1224
hanabi1224 previously approved these changes Aug 6, 2026
sudo-shashank
sudo-shashank previously approved these changes Aug 6, 2026
Base automatically changed from limit-msg-clones to main August 6, 2026 12:40
@LesnyRumcajs
LesnyRumcajs dismissed stale reviews from sudo-shashank and hanabi1224 August 6, 2026 12:40

The base branch was changed.

@LesnyRumcajs
LesnyRumcajs enabled auto-merge August 6, 2026 12:45
@LesnyRumcajs
LesnyRumcajs disabled auto-merge August 6, 2026 12:49
@LesnyRumcajs
LesnyRumcajs enabled auto-merge August 6, 2026 12:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/rpc/methods/gas.rs (1)

212-212: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the return tuple.

estimate_call_with_gas is public and returns an unnamed three-value tuple. Document each value and state that ApplyRet carries the execution status.

Proposed change
+    /// Simulates a message with the block gas limit.
+    ///
+    /// Returns the application result, pending messages applied before the
+    /// simulation, and the simulation tipset.
     pub async fn estimate_call_with_gas(

As per coding guidelines, “Document public functions and structs with doc comments”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/rpc/methods/gas.rs` at line 212, Document the public
estimate_call_with_gas function by adding a doc comment that names and explains
all three returned values—ApplyRet, Arc<Vec<ChainMessage>>, and Tipset—and
explicitly states that ApplyRet contains the execution status.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/rpc/methods/gas.rs`:
- Line 212: Document the public estimate_call_with_gas function by adding a doc
comment that names and explains all three returned values—ApplyRet,
Arc<Vec<ChainMessage>>, and Tipset—and explicitly states that ApplyRet contains
the execution status.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b0db3bcf-c8ea-41e8-a608-48108b42d524

📥 Commits

Reviewing files that changed from the base of the PR and between f5cb544 and 0cbd7d3.

📒 Files selected for processing (4)
  • src/rpc/methods/eth.rs
  • src/rpc/methods/gas.rs
  • src/rpc/methods/state/types.rs
  • src/state_manager/message_simulation.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • filecoin-project/lotus (manual)
💤 Files with no reviewable changes (1)
  • src/rpc/methods/state/types.rs

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.10%. Comparing base (f5cb544) to head (0cbd7d3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/rpc/methods/eth.rs 0.00% 2 Missing ⚠️
src/rpc/methods/gas.rs 77.77% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/rpc/methods/state/types.rs 100.00% <ø> (ø)
src/state_manager/message_simulation.rs 78.71% <100.00%> (-0.52%) ⬇️
src/rpc/methods/eth.rs 68.60% <0.00%> (ø)
src/rpc/methods/gas.rs 86.76% <77.77%> (+0.16%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5cb544...0cbd7d3. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LesnyRumcajs
LesnyRumcajs added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 1528693 Aug 6, 2026
34 checks passed
@LesnyRumcajs
LesnyRumcajs deleted the optimize-call-with-gas branch August 6, 2026 13:41
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