0xMiden / 0xMiden/protocol

Batch kernel: apply the 1024 note limit to post-erasure counts

Offen
#3,184 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
kernels
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

Follow-up from the PR #2905 review (thread on `asm/kernels/batch/lib/prologue.masm`).

## Problem

`ProposedBatch` enforces `MAX_INPUT_NOTES_PER_BATCH` / `MAX_OUTPUT_NOTES_PER_BATCH` (= 1024) on the **post-erasure** note sets. The batch kernel instead stores the **pre-erasure** union of every transaction's notes in fixed 1024-entry regions, and asserts the pre-erasure length ≤ 1024 before writing.

So a batch with >1024 pre-erasure notes that erases down to ≤ 1024 passes `ProposedBatch` but is rejected by the kernel. It is memory-safe, but some valid batches cannot be proven.

## Temporary mitigation (landed in #2905)

`BatchExecutor::execute` rejects a batch whose pre-erasure input/output union exceeds `MAX_*_NOTES_PER_BATCH`.

## Proper fix

The 1024 limit should stay a **post-erasure** limit

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.