Skip to content

Improves/sub call check - #35

Merged
cedricfung merged 15 commits into
mainfrom
improves/sub-call-check
Nov 13, 2026
Merged

cedricfung merged 15 commits into
mainfrom
improves/sub-call-check

Conversation

@hundredark

Copy link
Copy Markdown
Contributor

No description provided.

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

🟡 Changes recommended

Cleanup validation can authorize unintended transfers, burns, or mints, while also rejecting valid SOL-dust cleanups and accepting mismatched token decimals.

4 open issues
What changed in this PR

This PR strengthens Solana subsystem-call validation and simplifies the store lookup used to detect unfinished prepare calls.

Changes:

  • Validates prepare movements by asset, amount, source, and destination, and requires a prepare call when referenced assets exist.
  • Separates transfers from burns during post-process and deposit validation.
  • Replaces the unfinished-sub-call transaction with a single existence query.
File Description
store/​call.go Simplifies the pending prepare-call existence check.
solana/​system_call.go Adds movement-ledger validation for prepare, post-process, and deposit calls.
solana/​mvm.go Enforces required prepare calls and supplies validation context.
apps/​solana/​common.go Adds typed extraction of initial transfers and burns.

Review effort: Max

Comment thread solana/system_call.go Resolved
Comment thread solana/system_call.go Resolved
Comment thread solana/system_call.go Resolved
Comment thread solana/system_call.go Resolved

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

🟡 Changes recommended

The ungated policy change risks historical replay failures and mixed-version confirmation disagreements, while missing user accounts can trigger repeated observer crashes.

3 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Add focused Prepare validation tests

solana/​system_call.go:551

The new Prepare rejection paths have no focused tests, leaving recipient, authority, program, and movement validation unprotected against regressions. Add table-driven cases for wrong recipients or owners, disallowed programs, and missing or unexpected movements. These cases can build transactions locally without RPC or store fixtures.

Medium severity Add focused deposit comparison tests

solana/​system_call.go:812

The deposit comparison now filters expectations by receiver, separates transfers from burns, and rejects unexpected movements, but these paths have no focused tests. Add cases for multiple receivers, deployed-asset burns, and unexpected transfers, while preserving the SOL-dust and NFT exemptions. The existing cached-account fixtures can keep these tests independent of live RPC.

4 resolved since last review

Review effort: Max

Comment thread solana/solana.go
Comment on lines +38 to +39
solanaCleanupDustLamports uint64 = 100_000
solanaCleanupRentLamports uint64 = 650_240
Comment thread solana/solana.go Resolved
Comment thread solana/system_call.go Resolved

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

🟡 Changes recommended

The cleanup-policy change lacks a protocol activation boundary, causing previously valid confirmations to fail replay and old and upgraded validators to disagree.

4 open issues
2 resolved since last review

Review effort: Max

Comment thread solana/solana.go Resolved
Comment thread solana/solana.go Resolved
Comment thread solana/system_call.go Resolved

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

🟡 Changes recommended

The cleanup policy lacks a consensus activation boundary, so historical confirmations can fail replay and mixed-version nodes can derive different settlement results.

5 open issues

Review effort: Max

Comment thread solana/system_call.go Resolved

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

🔵 Needs a closer look

The consensus-critical cleanup policy changes lack an activation boundary, which can invalidate historical confirmations and cause nodes running different versions to disagree on the same action.

4 open issues
1 resolved since last review

Review effort: Max

@cedricfung
cedricfung merged commit 4abb200 into main Nov 13, 2026
4 checks passed
@cedricfung
cedricfung deleted the improves/sub-call-check branch November 13, 2026 12:39
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