Skip to content

feat: Deploy Soroban project TTL refresh operator script and runbook - #1

Open
anuoluwaponiorimi wants to merge 27 commits into
mainfrom
feat/ttl-refresh-operator-script
Open

feat: Deploy Soroban project TTL refresh operator script and runbook#1
anuoluwaponiorimi wants to merge 27 commits into
mainfrom
feat/ttl-refresh-operator-script

Conversation

@anuoluwaponiorimi

Copy link
Copy Markdown
Owner

Summary

This PR implements a comprehensive TTL (Time-To-Live) refresh operator script and operational runbook for the SplitNaira smart contract, enabling operators to maintain project storage and prevent data expiration.

Implementation Details

🔧 TTL Refresh Operator Script (scripts/refresh-project-ttl.mjs)

Key Features:

  • Flexible Operation Modes: Single project, multiple projects, or bulk refresh
  • Safety First: Dry-run mode for safe testing without transaction costs
  • Robust Error Handling: Retry logic with exponential backoff for RPC failures
  • Comprehensive Validation: Project existence checks and configuration validation
  • Progress Tracking: Real-time progress reporting for bulk operations
  • Environment Configuration: Configurable via environment variables

Usage Examples:

# Refresh a single project
npm run refresh:project-ttl -- --project-id "my_project"

# Refresh multiple projects
npm run refresh:project-ttl -- --project-id "proj1" --project-id "proj2"

# Dry run for all projects (safe testing)
npm run refresh:project-ttl -- --all --dry-run

📚 Operational Runbook (docs/runbooks/ttl-refresh-operations.md)

Comprehensive Coverage:

  • TTL Background: Detailed explanation of Soroban TTL mechanics
  • Operational Procedures: Step-by-step maintenance and emergency response
  • Troubleshooting Guide: Common issues and resolution strategies
  • Cost Analysis: Transaction fee estimation and optimization
  • Security Guidelines: Best practices for safe operations
  • Monitoring Recommendations: Proactive TTL management strategies

🔄 Contract Integration

The script leverages the existing refresh_project_storage function in the SplitNaira contract:

  • Permissionless: Any account can call the function (safe by design)
  • Automatic TTL Extension: Extends TTL for project data and collaborator claims
  • Error Handling: Returns clear errors for non-existent projects
  • Idempotent: Safe to call repeatedly

Testing

Contract Tests: All 63 existing tests pass
Script Validation: Help, argument parsing, and error handling verified
Build Process: Contract compilation and type generation successful
Integration: Script properly integrates with existing project structure

Configuration

Required Environment Variables:

  • CONTRACT_ID: SplitNaira contract address
  • OPERATOR_SECRET_KEY: Secret key for transaction signing

Optional Configuration:

  • SOROBAN_RPC_URL: RPC endpoint (defaults to testnet)
  • SOROBAN_NETWORK_PASSPHRASE: Network passphrase
  • SIMULATOR_ACCOUNT: Account for simulation

Security Considerations

  • No Privilege Escalation: Script only extends TTL, cannot modify project data
  • Safe Operations: Dry-run mode prevents accidental mainnet operations
  • Key Management: Environment-based secret key configuration
  • Network Verification: Built-in network and contract validation

Operational Impact

Benefits:

  • Data Preservation: Prevents important project data from expiring
  • Operational Efficiency: Automated bulk operations with progress tracking
  • Cost Optimization: Selective refresh and batch processing capabilities
  • Risk Mitigation: Comprehensive error handling and recovery procedures

Cost Considerations:

  • Single project: ~0.00001 XLM
  • 100 projects: ~0.001 XLM
  • 1000 projects: ~0.01 XLM

Future Enhancements

The runbook outlines potential improvements:

  • Automated TTL monitoring dashboards
  • Smart refresh scheduling based on activity patterns
  • Integration with existing monitoring systems
  • Enhanced reporting and analytics

Related Issues

Closes Split-Naira#363 - Deploy Soroban project TTL refresh operator script and runbook
Closes Split-Naira#357 - Related TTL management requirements
Closes Split-Naira#323 - Operational tooling improvements
Closes Split-Naira#324 - Documentation and runbook updates

Checklist

  • Script implements all required functionality
  • Comprehensive error handling and validation
  • Detailed operational runbook with procedures
  • Integration with existing project structure
  • All existing tests pass
  • Security considerations addressed
  • Documentation updated (runbooks README)
  • Package.json script added for easy access

Ready for Review: This implementation provides a production-ready TTL management solution with comprehensive documentation and operational procedures.

dependabot Bot and others added 27 commits May 27, 2026 01:28
Bumps [@tailwindcss/postcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.0/packages/@tailwindcss-postcss)

---
updated-dependencies:
- dependency-name: "@tailwindcss/postcss"
  dependency-version: 4.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.57.0 to 8.60.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.60.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.60.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@stellar/stellar-sdk](https://github.com/stellar/js-stellar-sdk) from 14.6.1 to 15.1.0.
- [Release notes](https://github.com/stellar/js-stellar-sdk/releases)
- [Changelog](https://github.com/stellar/js-stellar-sdk/blob/master/CHANGELOG.md)
- [Commits](stellar/js-stellar-sdk@v14.6.1...v15.1.0)

---
updated-dependencies:
- dependency-name: "@stellar/stellar-sdk"
  dependency-version: 15.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ocs — closes Split-Naira#401 Split-Naira#377 Split-Naira#368 Split-Naira#361

Security hardening implementation for Wave 5 execution track (issue Split-Naira#401):

contracts/lib.rs:
- Add self-transfer guard in withdraw_unallocated: reject when to ==
  env.current_contract_address() to prevent permanently locking unallocated
  token balances inside the contract (audit finding SH-01).

contracts/errors.rs:
- Add InvalidRecipient = 17 error variant for the new guard.

docs/SECURITY_HARDENING_WAVE5.md (new):
- Full audit findings table (SH-01 to SH-05) with severity and status.
- Implementation plan with before/after code snippets.
- Test coverage requirements with example regression test.
- Operational impact analysis (additive-only, zero state migration).
- Step-by-step rollback procedure linking to existing upgrade runbook.

Closes Split-Naira#401
Closes Split-Naira#377
Closes Split-Naira#368
Closes Split-Naira#361
…#361

- scripts/smoke-testnet.mjs: Node.js script that exercises the full
  create_project → deposit → distribute lifecycle against the live
  testnet contract and verifies claimed basis-point amounts.
  Uses env vars for keys (STELLAR_SECRET_KEY, CONTRACT_ID) — no secrets
  are ever committed.

- .github/workflows/smoke-testnet.yml: manual-dispatch GitHub Actions job
  that runs the smoke script against any supplied contract ID, using
  STELLAR_TESTNET_SECRET_KEY from the 'testnet' GitHub Environment.

- docs/contract-release-and-upgrade-runbook.md: expanded section 6 with
  full usage instructions for the automated script and the CI workflow,
  plus manual fallback steps.

- package.json: added 'smoke:testnet' script alias.

Closes Split-Naira#361
- Add comprehensive TTL refresh operator script (scripts/refresh-project-ttl.mjs)
  - Supports single project, multiple projects, and bulk refresh operations
  - Includes dry-run mode for safe testing
  - Robust error handling and retry logic
  - Detailed progress reporting and validation
  - Configurable via environment variables

- Add detailed operational runbook (docs/runbooks/ttl-refresh-operations.md)
  - Complete TTL management procedures and best practices
  - Troubleshooting guide and recovery procedures
  - Cost considerations and optimization strategies
  - Security guidelines and monitoring recommendations

- Update package.json with new refresh:project-ttl script
- Update runbooks README to include TTL refresh operations

Closes Split-Naira#363, Split-Naira#357, Split-Naira#323, Split-Naira#324
…tracts-deploy-batch

 feat: batch delivery for ops production readiness, contracts observability, and UX timeouts
…ility-for-API-client-and-transaction-flows

feat: implement Sentry observability for API client and transaction flows with automated retry reporting
…377-368-361

security(contracts): Wave 5 hardening — self-transfer guard, smoke test + audit docs
…-wave5-mainnet-launch

feat(contracts): Wave 5 execution track - safety, event emission, and…
PostgreSQL readiness and connection pooling for production
Docker Compose full stack (Postgres + backend + frontend)
…d_yarn/frontend/stellar/stellar-sdk-15.1.0

chore(deps): bump @stellar/stellar-sdk from 14.6.1 to 15.1.0 in /frontend
…_actions/actions/checkout-6

chore(deps): bump actions/checkout from 4 to 6
…d_yarn/frontend/tailwindcss/postcss-4.3.0

chore(deps-dev): bump @tailwindcss/postcss from 4.2.1 to 4.3.0 in /frontend
Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.39.4 to 10.0.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v10.0.1/packages/js)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 10.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…d_yarn/frontend/eslint/js-10.0.1

chore(deps-dev): bump @eslint/js from 9.39.4 to 10.0.1 in /frontend
…d_yarn/frontend/typescript-eslint/eslint-plugin-8.60.0

chore(deps-dev): bump @typescript-eslint/eslint-plugin from 8.57.0 to 8.60.0 in /frontend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

7 participants