A-039 lock virtual offsets after first deposit#435
Closed
carrion256 wants to merge 1 commit into
Closed
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Collaborator
Author
|
Merged into #428 ( |
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.
Merged into #428
Merged into #428. The A-039 commit was cherry-picked into the fee-anchor lifecycle cluster PR as
d31bf3c911f2e1deb417d0024571892f49e72f19, so this standalone per-finding PR is closed as merged into the cluster PR to preserve one-PR-per-cluster audit discipline.Summary
Fixes Halborn/Nexus finding A-039 (
21aa4dfa-595b-42a3-a1a0-cf7cba5e3f93): virtual conversion offsets could be changed after vault capitalization.This PR makes virtual offsets immutable once the vault is capitalized by:
SetGovernanceConfig(VIRTUAL_OFFSETS)when stored accounting is already nonzero,VirtualOffsetsLockedinstance-storage flag after the first successful public deposit,Regression coverage
test_rejects_virtual_offset_updates_after_capitalizationtest_rejects_virtual_offset_updates_after_first_deposit_locktest_set_virtual_offsets_updates_contract_storage,test_loads_virtual_offsets_from_storage, and deposit/preview virtual-offset tests.Verification
Base:
spr/refactor/vault-ergonomics/4f330057cargo fmt --allgit diff --checkCARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/data/tmp/templar-a039/.target-a039 cargo test -p templar-soroban-runtime virtual_offset -- --nocaptureCARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/data/tmp/templar-a039/.target-a039 cargo test -p templar-soroban-runtime test_phase1_deposit_with_min_resource_probe -- --nocaptureCARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/data/tmp/templar-a039/.target-a039 cargo test -p templar-soroban-runtime -- --nocaptureCARGO_INCREMENTAL=0 CARGO_TARGET_DIR=/data/tmp/templar-a039/.target-a039 just -f contract/vault/soroban/justfile size-budget-checkRuntime deploy WASM size:
94280bytes (92.07 KiB) <=131072bytes (128.00 KiB).This change is