Skip to content

make fast forward a bit stricted - #1498

Merged
arvidn merged 1 commit into
mainfrom
fast-forward
Jul 30, 2026
Merged

make fast forward a bit stricted#1498
arvidn merged 1 commit into
mainfrom
fast-forward

Conversation

@arvidn

@arvidn arvidn commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Tightens consensus validation for singleton fast-forward; callers that relied on amount changes during fast-forward will now fail, but the change protects mempool cost invariants.

Overview
Singleton fast-forward now rejects spends where the rewritten lineage proof or solution would use different amounts than the target parent/coin, so serialized spend size and run cost stay unchanged.

fast_forward_singleton adds a check that lineage_proof.parent_amount matches new_parent.amount and new_solution.amount matches new_coin.amount before updating those fields (both are variable-size in CLVM). Integration tests no longer vary parent/coin amounts; they always use the original spend amount, and test_amount_mismatch covers mismatches on the new coin and new parent as well as the spent coin.

Reviewed by Cursor Bugbot for commit fc59ad5. Bugbot is set up for automated code reviews on this repo. Configure here.

@arvidn
arvidn requested a review from AmineKhaldi July 29, 2026 15:36

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 337b88e. Configure here.

Comment thread crates/chia-consensus/src/fast_forward.rs
@coveralls-official

Copy link
Copy Markdown

Coverage Report for CI Build 30468228464

Coverage increased (+0.01%) to 81.829%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: 16 of 16 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 19900
Covered Lines: 16284
Line Coverage: 81.83%
Coverage Strength: 11661514.64 hits per line

💛 - Coveralls

@arvidn
arvidn merged commit cdf6d64 into main Jul 30, 2026
84 checks passed
@arvidn
arvidn deleted the fast-forward branch July 30, 2026 05:05
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