Skip to content

chore(soroban): mark audited vault crates v1#472

Merged
carrion256 merged 4 commits into
devfrom
chore/vault-soroban-v1-open-custodial-ttl
Jun 16, 2026
Merged

chore(soroban): mark audited vault crates v1#472
carrion256 merged 4 commits into
devfrom
chore/vault-soroban-v1-open-custodial-ttl

Conversation

@carrion256

@carrion256 carrion256 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make custodial adapter extend_ttl permissionless and update deployment-wide CLI TTL handling
  • mark audited Soroban vault crates and proxies as v1.0.0
  • move vault proxy crates under contract/vault/soroban while keeping package names/artifact names stable

Validation

  • cargo metadata --locked --format-version 1
  • cargo test -p templar-soroban-custodial-adapter -- --nocapture
  • cargo test -p templar-soroban-vault-cli extend_ttl -- --nocapture
  • cargo test -p templar-4626-proxy-soroban -p templar-curator-proxy-soroban -- --nocapture
  • cargo clippy -p templar-soroban-custodial-adapter -p templar-soroban-vault-cli -p templar-4626-proxy-soroban -p templar-curator-proxy-soroban --all-targets -- -D warnings

Note: clippy exits 0 but the CLI package still emits the existing unknown-lint warning for clippy::ignore_without_reason under this local toolchain.


This change is Reviewable

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a3c45228-c181-4d03-af05-4d8bdbc89990

📥 Commits

Reviewing files that changed from the base of the PR and between 5ff74cf and c52bd38.

📒 Files selected for processing (12)
  • contract/vault/curator-primitives/Cargo.toml
  • contract/vault/kernel/Cargo.toml
  • contract/vault/macros/Cargo.toml
  • contract/vault/near/Cargo.toml
  • contract/vault/soroban/Cargo.toml
  • contract/vault/soroban/blend-adapter/Cargo.toml
  • contract/vault/soroban/curator-proxy/Cargo.toml
  • contract/vault/soroban/custodial-adapter/Cargo.toml
  • contract/vault/soroban/governance/Cargo.toml
  • contract/vault/soroban/proxy-4626/Cargo.toml
  • contract/vault/soroban/share-token/Cargo.toml
  • contract/vault/soroban/shared-types/Cargo.toml

📝 Walkthrough

Summary

1) Permissionless TTL extension (custodial adapter)

  • Updated contract/vault/soroban/custodial-adapter extend_ttl to be permissionless:
    • ABI/signature changed: extend_ttl(env, caller)extend_ttl(env) (no authorization check; any caller can refresh instance liveness).
    • Implementation now directly calls extend_instance_ttl(&env) and returns Ok(()).
  • TTL refresh semantics are implemented via extend_instance_ttl using:
    • INSTANCE_TTL_THRESHOLD = 518_400
    • INSTANCE_TTL_EXTEND_TO = 3_110_400
  • Tests updated/added:
    • Removed expectations that unauthorized callers are rejected for extend_ttl.
    • Added coverage that extend_ttl succeeds from arbitrary callers (extend_ttl_is_open_liveness_maintenance).
    • Confirmed pause behavior: pause_does_not_block_admin_recovery_or_ttl_extension ensures TTL extension still works when paused.
  • Documentation updated to match the new model: extend_ttl() is described as permissionless, “only refreshes instance storage liveness”, and the “transaction caller pays the Soroban resource cost” (contract/vault/soroban/README.md).

2) Vault CLI extend-ttl updated for new custodial behavior

  • Updated tools/soroban-vault-cli extend-ttl command logic:
    • Custodial adapters are now invoked without a --caller argument.
    • Caller/skip logic that previously depended on governance-admin/custodial-admin alignment was removed; CLI only requires caller resolution for other TTL-capable contracts (e.g., share token / blend adapters).
  • CLI unit test updated accordingly:
    • extend_ttl_runs_for_governance_admin_custodial_adapter asserts custodial adapter extend_ttl is called and that --caller is not present for the custodial adapter invocation.

3) Versioning + Soroban vault proxy crate relocation/restructure

  • Marked Soroban vault-related crates/proxies for the audited 1.0.0 release:
    • Crate versions bumped to 1.0.0 (e.g., custodial adapter, runtime, kernel, primitives, share-token, blend adapter, governance, and new proxy crates).
    • License metadata updated to GPL-3.0-only across the affected Soroban vault crates.
  • Workspace/package layout changes:
    • Removed workspace members under the old layout:
      • contract/proxy-4626-soroban
      • contract/proxy-curator-soroban
    • Added new workspace members under contract/vault/soroban/:
      • proxy-4626
      • curator-proxy
    • Updated Cargo path wiring so the relocated proxy crates reference the correct local shared types and related crates (while keeping package/artifact names stable).

4) Validation

  • Includes multi-package validation and quality gates as described:
    • cargo metadata --locked --format-version 1 verification
    • Unit tests covering custodial adapter, vault CLI, and both proxy crates
    • Clippy run across targets with warnings treated as errors, noting an existing local clippy::ignore_without_reason warning that does not fail.

Critical items for review

  1. Authorization regression / access control (Smart contract: “Improper Authorization / Access Control”): confirm no remaining call paths enforce prior admin-only expectations around custodial extend_ttl, and that the permissionless behavior is intended for all operational contexts.
  2. Economic DoS / resource exhaustion (“Denial of Service / Resource Exhaustion”): permissionless TTL refresh is a deliberate surface—verify that Soroban metering and the “caller pays” property make abuse economically unviable, and that no other parts rely on throttling extend_ttl.
  3. ABI / CLI invocation correctness: signature change (extend_ttl(env) vs prior extend_ttl(env, caller)) must match every caller (especially proxy/CLI code paths); ensure no lingering --caller is passed for custodial adapters.
  4. Pause/whitelist interaction: ensure extend_ttl remains available under pause as intended, without unintentionally bypassing pause restrictions for other state-changing operations.
  5. Cargo path/proxy relocation integrity: review the relocated proxy crates’ path dependencies (notably curator-proxy) to ensure they link to the intended shared types/governance/runtime crates and artifacts.

Walkthrough

Proxy contracts relocate to contract/vault/soroban/ with updated workspace membership and internal dependency paths. All crates are bumped to 1.0.0 and licenses changed to GPL-3.0-only. The custodial adapter's extend_ttl entrypoint becomes permissionless by removing the caller parameter and authorization check, with matching CLI and test updates.

Changes

Workspace Restructure and Version Bumps

Layer / File(s) Summary
Workspace member relocation and dependency path fixes
Cargo.toml, contract/vault/soroban/proxy-4626/Cargo.toml, contract/vault/soroban/curator-proxy/Cargo.toml, tools/soroban-vault-cli/Cargo.toml
Root workspace removes contract/proxy-4626-soroban and contract/proxy-curator-soroban, adds contract/vault/soroban/proxy-4626 and contract/vault/soroban/curator-proxy; proxy-4626 and curator-proxy manifests define metadata, library config, and internal dependency paths to shared-types, kernel, curator-primitives, governance, and runtime; CLI manifest updates the curator-proxy-soroban dependency path.
Crate version and license updates
contract/vault/curator-primitives/Cargo.toml, contract/vault/kernel/Cargo.toml, contract/vault/soroban/Cargo.toml, contract/vault/soroban/blend-adapter/Cargo.toml, contract/vault/soroban/custodial-adapter/Cargo.toml, contract/vault/soroban/governance/Cargo.toml, contract/vault/soroban/share-token/Cargo.toml, contract/vault/soroban/shared-types/Cargo.toml, contract/vault/macros/Cargo.toml, contract/vault/near/Cargo.toml
All Soroban and vault contract crate versions bumped from 0.1.0 to 1.0.0; all licenses changed from MIT to GPL-3.0-only.

Permissionless Custodial Adapter extend_ttl

Layer / File(s) Summary
Custodial adapter extend_ttl signature and tests
contract/vault/soroban/custodial-adapter/src/lib.rs, contract/vault/soroban/README.md
extend_ttl(env, caller: Address) is changed to extend_ttl(env) by removing the caller parameter and require_auth check; existing tests updated to match new signature and remove authorization rejection assertions; new test extend_ttl_is_open_liveness_maintenance added; README documents the permissionless rationale and storage liveness behavior.
CLI extend_ttl logic and docs update
tools/soroban-vault-cli/src/commands.rs, tools/soroban-vault-cli/README.md
Custodial adapters excluded from caller-requirement computation; custodial adapter invocation loop drops skip-reason checking and --caller forwarding, invoking with no arguments; custodial_ttl_skip_reason and custodial_adapter_admin helpers removed; CLI unit test renamed and updated to assert custodial adapter is invoked without --caller; README updated to describe permissionless behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • Templar-Protocol/contracts#470: Introduced the custodial adapter with the original admin-only extend_ttl(env, caller) that this PR makes permissionless.
  • Templar-Protocol/contracts#419: Added the original contract/proxy-curator-soroban workspace member that this PR replaces with contract/vault/soroban/curator-proxy.

Suggested reviewers

  • peer2f00l
  • royalf00l
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/vault-soroban-v1-open-custodial-ttl

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • LINEAR integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@contract/vault/soroban/proxy-4626/Cargo.toml`:
- Line 18: The soroban-sdk dependency is pinned to version 25.0.1 which contains
unfixed security vulnerabilities (GHSA-96xm-fv9w-pf3f and GHSA-4chv-4c6w-w254)
that were resolved in versions 25.0.2, 25.1.1, and 25.3.0. Either update the
soroban-sdk version specification from 25.0.1 to 25.3.0 to incorporate these
security fixes and improvements, or if version 25.0.1 is intentionally locked
for compatibility reasons (such as matching an audit scope), add a comment above
the soroban-sdk dependency line in Cargo.toml explaining the pinning reason and
confirming that the documented vulnerabilities do not impact the proxy
contracts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f291655f-7449-4515-b8cd-36c852c702f0

📥 Commits

Reviewing files that changed from the base of the PR and between baabaaf and 283f031.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • Cargo.toml
  • contract/vault/curator-primitives/Cargo.toml
  • contract/vault/kernel/Cargo.toml
  • contract/vault/soroban/Cargo.toml
  • contract/vault/soroban/README.md
  • contract/vault/soroban/blend-adapter/Cargo.toml
  • contract/vault/soroban/curator-proxy/Cargo.toml
  • contract/vault/soroban/curator-proxy/src/contract.rs
  • contract/vault/soroban/curator-proxy/src/error.rs
  • contract/vault/soroban/curator-proxy/src/governance_abi.rs
  • contract/vault/soroban/curator-proxy/src/lib.rs
  • contract/vault/soroban/curator-proxy/src/tests.rs
  • contract/vault/soroban/curator-proxy/tests/integration_tests.rs
  • contract/vault/soroban/custodial-adapter/Cargo.toml
  • contract/vault/soroban/custodial-adapter/src/lib.rs
  • contract/vault/soroban/governance/Cargo.toml
  • contract/vault/soroban/proxy-4626/Cargo.toml
  • contract/vault/soroban/proxy-4626/src/contract.rs
  • contract/vault/soroban/proxy-4626/src/error.rs
  • contract/vault/soroban/proxy-4626/src/lib.rs
  • contract/vault/soroban/proxy-4626/src/tests.rs
  • contract/vault/soroban/proxy-4626/tests/integration_tests.rs
  • contract/vault/soroban/share-token/Cargo.toml
  • contract/vault/soroban/shared-types/Cargo.toml
  • tools/soroban-vault-cli/Cargo.toml
  • tools/soroban-vault-cli/README.md
  • tools/soroban-vault-cli/src/commands.rs

Comment thread contract/vault/soroban/proxy-4626/Cargo.toml Outdated
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@carrion256
carrion256 merged commit f2aede7 into dev Jun 16, 2026
42 of 43 checks passed
@carrion256
carrion256 deleted the chore/vault-soroban-v1-open-custodial-ttl branch June 16, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant