feat: Add bundled transaction support#874
Conversation
Signed-off-by: JosephDenman <joseph.denman@iohk.io>
Unit Test Results - MidnightJS 28 files 88 suites 4m 35s ⏱️ Results for commit e10fb37. |
E2E Tests Resultse2e_tests_reports: Run #3634
🎉 All tests passed!Suites120 passed, 0 failed, and 4 other
Github Test Reporter by CTRF 💚 |
Review — PR #874: Add bundled transaction supportThanks for the work — the architecture is solid, mirrors the existing A few items I'd like to see addressed before approval. Blockers1. Terminology — "SDK" vs "framework"
Several are user-visible — line 260 is an error message thrown at runtime, and line 45 leaks via 2. Structural cast on const ledgerParametersBytes: Uint8Array = (
cached.states.ledgerParameters as { serialize(): Uint8Array }
).serialize();
3. Silent partial-persistence after on-chain success — for (const [psId, call] of latestByPsId) {
await psp.set(psId, call.callData.private.nextPrivateState);
}This loop runs after the chain has already advanced. If the second
Subsequent calls against B will then read stale local state and produce transcripts that disagree with the chain. Please either (a) 4. Missing integration test for
Important5. 6. 7. 8. Test coverage gaps
Test quality nits
Strengths
|
Adds
withMultiContractScopedTransactionfor batching circuit calls to different contracts into a single ledger intent. Same shape aswithContractScopedTransaction, but the scope is contract-polymorphic —ctx.for(contract)widens the type at each call site.Cross-contract unshielded flows (A.send / B.receive) only validate when both calls share an intent segment and guaranteed/fallible half. The ledger's effects check (
verify.rs:1599-1651) matchesclaimed_unshielded_spendsagainstunshielded_inputskeyed on(intent_seg, is_guaranteed_half, token_type, recipient, value). merge()splices independently-partitioned intents, so alignment is on us;Transaction.addCallsjointly partitions, so it's on the ledger. We want the latter.