feat: added Sandbox Mode for Testing New Features with Real Data#688
Merged
Jagadeeshftw merged 8 commits intoJagadeeshftw:masterfrom Feb 26, 2026
Merged
feat: added Sandbox Mode for Testing New Features with Real Data#688Jagadeeshftw merged 8 commits intoJagadeeshftw:masterfrom
Jagadeeshftw merged 8 commits intoJagadeeshftw:masterfrom
Conversation
|
@okekefrancis112 is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
please resolve the conflicts |
Resolved 3 conflicting files: - escrow/lib.rs: kept master's reentrancy-guarded partial_release with dual escrow type handling, preserved sandbox test module - test_e2e_upgrade_with_pause.rs: adopted master's cleaner test structure with token_client API - grainlify-core/lib.rs: kept master's optimized wasm path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
conflicts resolved. @Jagadeeshftw |
- Remove dead create_token_contract call in test_e2e_upgrade_with_pause.rs - Remove unused Ledger import - Add set_anonymous_resolver admin method (contract reads AnonymousResolver from storage but had no setter, causing test_anonymization compilation error) - Add missing token transfer in partial_release (state was updated but tokens were never transferred to the contributor) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
This PR implements a sandbox (shadow) mode for testing new contract features against real-ish data without impacting production state (Closes #614). The core addition is a
SandboxManagerin the Go backend (backend/internal/soroban/sandbox.go) that mirrors selected escrow operations (lock, release, refund, payout) to physically separate Soroban contract instances deployed at different addresses. Shadow operations run asynchronously in bounded goroutines with detached contexts, use a separate Stellar keypair to avoidtx_bad_seqconflicts with production, and are fully fire-and-forget — failures are logged but never block or affect production calls. Configuration is driven entirely by environment variables (SANDBOX_ENABLED,SANDBOX_ESCROW_CONTRACT_ID,SANDBOX_SHADOWED_OPERATIONS, etc.), with per-operation toggling and a configurable concurrency cap. Adeploy-sandbox.shscript wraps the existing deployment tooling to stand up sandbox contract instances. The PR also includes 9 Go unit tests validating enable/disable logic, semaphore bounds, and startup validation, plus 3 Soroban-level Rust tests proving that two contract instances deployed from the same WASM are fully independent — operations on one never affect the other's balances. A minor pre-existing bug (ambiguous integer type inlib.rs:344) was fixed to unblock the WASM build.Closes: #614