Skip to content

feat: introduce stateless Mantle transaction validation - #183

Open
aimendj wants to merge 3 commits into
unstablefrom
refactor/two-tier-tx-validation
Open

feat: introduce stateless Mantle transaction validation#183
aimendj wants to merge 3 commits into
unstablefrom
refactor/two-tier-tx-validation

Conversation

@aimendj

@aimendj aimendj commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

This PR splits Mantle transaction validation into two stages: stateless validation at ingress for structural checks and cryptographic verification, and stateful validation during ledger execution for state-dependent checks and mutations. This avoids repeating expensive signature and zkSNARK verification, moves PoC verification into the Mantle layer, adds defense-in-depth checks, and wires stateless validation into block ingress with clearer error handling.

…structural verification from state-dependent logic
@aimendj
aimendj requested review from munna0908 and tersec August 29, 2026 16:21
@aimendj aimendj self-assigned this Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

Unit Test Results

       5 files  ±  0     690 suites   - 5   1m 5s ⏱️ ±0s
   655 tests +13     642 ✔️ +13  13 💤 ±0  0 ±0 
3 405 runs  +35  3 340 ✔️ +35  65 💤 ±0  0 ±0 

Results for commit df55f3e. ± Comparison against base commit 333c4d0.

This pull request removes 16 and adds 29 tests. Note that renamed tests count towards both.
ChannelTransfer op with wrong proof kind → InvalidProof
LeaderClaim op wired through LedgerState
Transfer op with wrong proof kind → InvalidProof
configurationThreshold == 0 → InvalidChannelConfig
configurationThreshold > keys.len → InvalidChannelConfig
duplicate input NoteId → DoubleSpend
empty keys → InvalidChannelConfig
no inputs → EmptyInputs
ops/proofs count mismatch → InvalidProof
rejects invalid proof
…
ChannelConfig: rejects configurationThreshold > keys.len
ChannelConfig: rejects empty keys
ChannelConfig: rejects zero configurationThreshold
ChannelConfig: rejects zero transferThreshold
ChannelDeposit: rejects duplicate inputs
ChannelDeposit: rejects empty inputs
ChannelInscribe: verifies Ed25519 signer signature
ChannelTransfer: rejects duplicate inputs
ChannelTransfer: rejects empty inputs
ChannelTransfer: rejects zero-value output note
…

♻️ This comment has been updated with latest results.

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.

1 participant