Repository navigation
feat(settlement): add record_deductions batch entrypoint - #1453
Open
EmperorNexus wants to merge 1 commit into
Open
EmperorNexus wants to merge 1 commit into
EmperorNexus wants to merge 1 commit into
Conversation
|
@EmperorNexus Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
EmperorNexus
force-pushed
the
feat/issue-1398-add-settlement-record-deductions-batch
branch
from
October 21, 2026 23:06
01a780c to
2997a33
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds a
record_deductions(items)batch entrypoint to the settlement contract so thatCalloraVault::batch_deductcan make a single cross-contract call instead of one per item. It also adds typed errors and events for the new entrypoint, extends the settlement test suite to cover the new function, documents the required upgrade order, and records the new gas baseline entries.Related Issue
Changes
📦 Settlement batch entrypoint
[MODIFY]
contracts/settlement/src/errors.rsrecord_deductions: empty batch, over-max-length, invalid amount, duplicate request id, and pool overflow, so the batch path can reject atomically with a specific error.[MODIFY]
contracts/settlement/src/events.rsdeduction_recordedevent emission helper used byrecord_deductions, so a batch emits one event per item and stays event-parity with N singlerecord_deductioncalls.[MODIFY]
contracts/settlement/src/test_record_deduction.rs📝 Docs and gas baseline
[MODIFY]
docs/UPGRADE.mdrecord_deductions) before the vault is upgraded to call it.[MODIFY]
contracts/.gas-baseline.json[MODIFY]
docs/GAS_SNAPSHOT.mdVerification Results
record_deductionsimplemented, documented, covered by every test-plan rowtest_record_deduction.rsbatch_deductmakes exactly one settlement callrecord_deductionsonce after the token transfercargo fmt --all -- --checkandcargo test --workspacepass, CI greendocs/GAS_SNAPSHOT.mdandcontracts/.gas-baseline.jsontest_record_deduction.rssuiteCloses #1398