feat: define atomicity semantics for batch_add_to_goals#381
Open
abbakargarba wants to merge 10 commits intoRemitwise-Org:mainfrom
Open
feat: define atomicity semantics for batch_add_to_goals#381abbakargarba wants to merge 10 commits intoRemitwise-Org:mainfrom
abbakargarba wants to merge 10 commits intoRemitwise-Org:mainfrom
Conversation
- Implement batch_add_to_goals with all-or-nothing atomicity - Add comprehensive validation upfront to prevent partial failures - Include overflow protection and authorization checks - Emit structured events for batch start/completion/failure - Add extensive test coverage for edge cases and security - Update documentation with NatSpec-style comments - Enforce batch size limits to prevent gas exhaustion
- Update all crates to use soroban-sdk 21.1.1 for consistency - Resolve ed25519-dalek dependency conflicts causing CI failures - Ensure uniform SDK version across remitwise-common and all contracts
- Add Debug derive to SavingsGoalsError - Fix symbol lengths for batch events (batch_str, batch_end, batch_err) - Fix match arm syntax with braces - Update test assertions to use new symbol names - Fix type casting for batch size validation - Fix duplicate function signature in insurance crate - Prefix unused variable with underscore
…(test)] inline test module
Contributor
|
Please resolve the conflicts |
Contributor
Author
|
this build error is heart breaking, whats going on bro😅 |
…tor/remittance_split; pass cargo check workspace
Contributor
|
@abbakargarba Please resolve the conflicts |
Contributor
Author
conflict resolved🌊 |
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.
closes issue #261
Overview
This PR implements atomic batch funding operations for the
savings_goalscontract, ensuring all-or-nothing semantics to prevent inconsistent partial updates.Changes Made
Core Implementation (
savings_goals/src/lib.rs)Rewrote
batch_add_to_goals()with 6-phase atomic processing:New Error Types:
BatchTooLarge: Enforces 50-goal limitBatchValidationFailed: Invalid data/authorizationBatchProcessingFailed: Processing errorsNew Event Types:
BatchStartedEvent: Processing initiationBatchCompletedEvent: Successful completionBatchFailedEvent: Failure notificationSecurity & Reliability
Comprehensive Testing (
savings_goals/src/test.rs)Added 8 new test functions covering:
Documentation Updated (
savings_goals/README.md)batch_add_to_goalsContributionItemdata structure documentationTesting
Run tests with:
cargo test -p savings_goalsNote: Tests are comprehensive but couldn't be executed due to workspace dependency conflicts. Code follows established patterns and is ready for validation.
Checklist