��# Issue 15: Implement Batch Ballot Recording
Problem
Recording multiple ballots requires N separate transactions. No batch operation for efficiency.
Solution
- Add
record_ballots_batch(ballot_ids: Vec<String>) function in lib.rs
- Process atomically (all succeed or all fail)
- TypeScript helper
sorobanRecordBallotsBatch() to invoke batches
- Reduces transaction overhead and improves throughput
Implementation Tasks
Note for Contributors
Complete Issue #1 (ballot metadata storage) first. Batch processing must be atomic: either all ballots are recorded or none are (all-or-nothing semantics). Validate all ballots in the batch before writing any, then write all together. Return a Result with all ballot hashes on success, or error on any failure. The batch function should respect the same authorization guards as individual record_ballot calls. Limit batch size (e.g., max 100 ballots per call) to prevent resource exhaustion. TypeScript helper should handle retries at the batch level, not individual items. Consider transaction size limits imposed by Soroban.
��# Issue 15: Implement Batch Ballot Recording
Problem
Recording multiple ballots requires N separate transactions. No batch operation for efficiency.
Solution
record_ballots_batch(ballot_ids: Vec<String>)function in lib.rssorobanRecordBallotsBatch()to invoke batchesImplementation Tasks
record_ballots_batch()in lib.rssorobanRecordBallotsBatch()Note for Contributors
Complete Issue #1 (ballot metadata storage) first. Batch processing must be atomic: either all ballots are recorded or none are (all-or-nothing semantics). Validate all ballots in the batch before writing any, then write all together. Return a Result with all ballot hashes on success, or error on any failure. The batch function should respect the same authorization guards as individual
record_ballotcalls. Limit batch size (e.g., max 100 ballots per call) to prevent resource exhaustion. TypeScript helper should handle retries at the batch level, not individual items. Consider transaction size limits imposed by Soroban.