Skip to content

fix: secp message gas floor - #7652

Merged
LesnyRumcajs merged 2 commits into
mainfrom
fix-secp-gas-floor
Sep 24, 2026
Merged

LesnyRumcajs merged 2 commits into
mainfrom
fix-secp-gas-floor

Conversation

@LesnyRumcajs

@LesnyRumcajs LesnyRumcajs commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Summary of changes

Changes introduced in this pull request:

  • fix an edge case with under-estimating messages (not applicable right now, but will be once Forest is present as block-producing node)
  • tests to ensure eternal compliance and small refactor to a shared MessageChecker

Reference issue to close (if applicable)

Related to #7651 and #7644

Other information and links

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 chain message validation during block processing.
    • Corrected gas accounting for signed and delegated messages, including signature encoding.
    • Added consistent checks for virtual-machine message inclusion and account sequence ordering.
    • Fixed chain-length calculations to accurately reflect encoded message data and signature types.
    • Improved handling when messages or signatures are modified, ensuring validation and identifiers remain consistent.

@LesnyRumcajs
LesnyRumcajs requested a review from a team as a code owner September 22, 2026 21:08
@LesnyRumcajs
LesnyRumcajs requested review from akaladarshi and sudo-shashank and removed request for a team September 22, 2026 21:08
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Essentials

Run ID: 845be6fd-3da7-409d-beae-d2e1353c7bcf

📥 Commits

Reviewing files that changed from the base of the PR and between 8da4ad6 and 703295e.

📒 Files selected for processing (1)
  • src/chain_sync/tipset_syncer.rs
🔗 Linked repositories identified

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

  • filecoin-project/lotus (manual)

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

The change adds VM-message and chain-length APIs, centralizes BLS and SECP message validation, charges gas from full chain-message encodings, and adds encoding and gas-floor tests. It also changes the memoize dictionary entry.

Changes

Message encoding validation

Layer / File(s) Summary
Message encoding contract
src/message/mod.rs, src/message/signed_message.rs
MessageRead now exposes vm_message() and fallible chain_length(). Implementations account for unsigned, BLS, SECP256K1, and delegated encodings. Tests verify CID and encoding-length consistency, mutations, and signed gas floors.
Shared message checking
src/chain_sync/tipset_syncer.rs
MessageChecker validates VM-message inclusion, charges gas from full chain-message encoding, enforces block limits, and tracks sender sequences for BLS and SECP messages. Tests cover SECP signed-encoding gas floors.

Dictionary entry

Layer / File(s) Summary
Memoize dictionary entry
.config/forest.dic
The memoize entry now uses the /D suffix flag.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant TipsetSyncer
  participant MessageChecker
  participant MessageRead
  participant StateTree
  TipsetSyncer->>MessageChecker: Check BLS and SECP messages
  MessageChecker->>MessageRead: Read vm_message and chain_length
  MessageChecker->>StateTree: Validate actors and sequences
  MessageChecker-->>TipsetSyncer: Return validation result
Loading

Merge Risk: ⚪ Minimal · up to 70329

The message gas-floor change has no identified merge-blocking issue.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.06% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing the gas floor for SECP messages.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.0)

Clippy execution timed out


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

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.25000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.44%. Comparing base (44f9a53) to head (703295e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/chain_sync/tipset_syncer.rs 96.84% 0 Missing and 3 partials ⚠️
src/message/signed_message.rs 95.65% 0 Missing and 2 partials ⚠️
src/message/mod.rs 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/message/mod.rs 92.59% <94.73%> (+0.35%) ⬆️
src/message/signed_message.rs 89.43% <95.65%> (+5.95%) ⬆️
src/chain_sync/tipset_syncer.rs 78.38% <96.84%> (+3.27%) ⬆️

... and 14 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 44f9a53...703295e. 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.

@akaladarshi

Copy link
Copy Markdown
Contributor

@LesnyRumcajs CI is failing

@LesnyRumcajs

Copy link
Copy Markdown
Member Author

@LesnyRumcajs CI is failing

Not sure who should change - me using British forms of verbs or the CI. I'm tempted to ask AI to do some British Empire encore here. 🤣

Comment thread src/message/mod.rs
@LesnyRumcajs
LesnyRumcajs added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit 07762f8 Sep 24, 2026
39 checks passed
@LesnyRumcajs
LesnyRumcajs deleted the fix-secp-gas-floor branch September 24, 2026 13:29
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