Repository navigation
fix(contracts): small consistency fixes in the vault and oracle - #424
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hpmaxi
marked this pull request as ready for review
November 2, 2026 16:23
luchobonatti
approved these changes
Nov 2, 2026
8 tasks
This branch was successfully deployed
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
Closes #423
Four small consistency fixes in the vault and oracle, found in review: one guard read an oracle view directly instead of through its trapping-safe form, one entrypoint was missing a setup guard every sibling entrypoint already has, and two doc comments described behavior the code no longer matches.
Changes
guards::feed_validnow callstry_state()and treats a trap or anErrthe same as any other invalid state, refusing withFeedNotValid. A swapped-in oracle that traps onstate()no longer abortsrequest_depositwith a host error.feed_validhas one caller (request, indeposit.rs);epoch.rsandhealth.rsalready used thetry_form.wind_down::proposenow calls the same setup guard every other setup-gated entrypoint uses, refusing a wind-down proposal while setup is open withSetupOpen. Updated the entrypoint's# Errorsdoc, thepropose_wind_downrow indocs/AUTHORIZATION_MATRIX.md, and the setup-gating lines indocs/kit-spec.mdand the design doc.OracleStateincontracts/nav-oracle/src/state.rs: the guardian or the admin pauses the NAV, only the admin lifts it, and onStale/Pausedthe vault refuses a new deposit request and prices no epoch, while a redemption request, a cancellation and a claim already owed stay open.docs/kit-spec.mdstating that the share token'sburnis manager-only, with the vault as the sole manager, and that the token has noburn_from.Test plan
Automated tests
cargo test --locked(full workspace) — all green;async-vault528 passed (two new tests),nav-oracle111,share-token114,compliance42,identity-verifier7, unchanged elsewhere.cargo clippy --workspace --all-targets --locked -- -D warnings— clean.cargo fmt --all -- --check— clean.npm run format:check— clean.docs/TESTING.md(--features upgrade_wasm,with_wasm) — 4 passed inasync-vault, 2 passed innav-oracle.test::oracle_swap::a_feed_that_traps_on_its_state_refuses_a_deposit_requestfailed with the feed's own host error before the fix, and passes withFeedNotValidafter it.test::wind_down::a_wind_down_cannot_be_proposed_while_setup_is_openfailed (the call succeeded) before the fix, and passes withSetupOpenafter it.Manual verification
None needed for the doc-only items.
Breaking changes
None.
SetupOpenandFeedNotValidare both existing errors; no entrypoint's error set or signature changed, so no bindings or harness updates were needed.