8000 Release KZP Mini 0.2.0 by vvylym · Pull Request #1 · vvylym/kzp-mini · GitHub
[go: up one dir, main page]

Skip to content

Release KZP Mini 0.2.0 - #1

Merged
vvylym merged 27 commits into
mainfrom
release/0.2.0
Jun 27, 2026
Merged

vvylym merged 27 commits into
mainfrom
release/0.2.0

Conversation

@vvylym
@vvylym vvylym commented Jun 27, 2026
Copy link
Copy Markdown
Owner

Summary

  • Preserves the original bounty submission as release/0.1.0 / v0.1.0 and releases the hardened revision as release/0.2.0 / v0.2.0.
  • Hardens trustless enforcement with borrower pending-loan reservation, reserved guarantor liability, due-date default settlement, permissionless default cranking, and terminal loan closure.
  • Updates the program/CLI package versions to 0.2.0, keeps the existing program ID, and refreshes README devnet proof with 0.2.0 lifecycle transactions.

Verification

  • bash scripts/ci.sh
  • cargo fmt --all -- --check
  • git diff --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace
  • cargo build-sbf --manifest-path programs/kzp-mini/Cargo.toml --sbf-out-dir /home/gmi/Deza/pkzp/target/deploy
  • bash scripts/deploy.sh devnet
  • bash scripts/devnet-demo.sh
  • Aikido scan on changed release scripts: no issues

Release refs

  • 0.1 archive: release/0.1.0, v0.1.0
  • 0.2 release: release/0.2.0, v0.2.0
  • Program ID preserved: GsjUnBFvYtcxNwCrydPUjQTngGTqdx5v7APnWahnqwkx

vvylym added 27 commits June 27, 2026 11:14
Keep comparison-only IDE project data out of version control before starting the hardening lifecycle.
Track each hardening case through documentation, test, implementation, verification, and commit so the branch can progress in atomic green slices.
Bound pool names to the PDA seed limit and use checked arithmetic for member counts. Adds validation coverage plus a maximum-length initialization test.

Verification:
- cargo test -p kzp-mini pool_name_validation
- cargo test -p kzp-tests initialize_pool_accepts_max_length_name
Track pending borrower loans on member state so nonce-based loan history cannot bypass the one-unresolved-loan rule. Clear the reservation on cancel or activation, recheck activation eligibility, and block pool exit while a borrower loan is pending.

Verification:
- NO_DNA=1 anchor build --ignore-keys
- cargo test -p kzp-mini operations::
- cargo test -p kzp-tests request_loan
- cargo test -p kzp-tests cancel_loan
- cargo test -p kzp-tests co_sign_loan_fails_when_guarantor_now_has_active_loan
- cargo test -p kzp-tests exit_pool_fails_with_pending_borrower_loan
- cargo test -p kzp-tests
Reserve each guarantor's fixed 50/50 liability from their savings before loan disbursement, release it on repayment/default, and block exits while reserved savings remain.

Verification:
- cargo fmt
- NO_DNA=1 anchor build --ignore-keys
- cargo test -p kzp-mini operations::
- cargo test -p kzp-tests co_sign_loan
- cargo test -p kzp-tests repay_loan_full_nominal
- cargo test -p kzp-tests settle_default_nominal
- cargo test -p kzp-tests exit_pool_fails_with_active_guarantees
- cargo test -p kzp-tests
Store a due timestamp on each loan request and reject admin default settlement before that timestamp. Default settlement now uses the liability reserved at activation and no longer requires fresh guarantor signatures or token transfers.

Verification:
- cargo fmt
- NO_DNA=1 anchor build --ignore-keys
- cargo test -p kzp-mini operations::
- cargo test -p kzp-tests settle_default
- cargo test -p kzp-tests request_loan
- cargo test -p kzp-cli
- cargo test -p kzp-tests
- git diff --check
Reject pool and loan accounts not owned by this program before the CLI deserializes them. This keeps follow-up account derivation from trusting arbitrary RPC account data.

Verification:
- cargo fmt
- cargo test -p kzp-cli owner_check
- cargo test -p kzp-cli
- cargo test -p kzp-tests
- git diff --check
Add regression coverage for rejecting co-sign withdrawal after activation and for non-nominated members attempting to withdraw a co-sign.

Verification:
- NO_DNA=1 anchor build --ignore-keys
- cargo test -p kzp-tests withdraw_cosign
- cargo test -p kzp-tests
- git diff --check
- user-aikido-mcp scan: issues=[]
Keep Solana crate patch versions coherent so workspace metadata and focused hardening tests resolve cleanly.
Add synthetic-state tests for borrower active-loan drift and underfunded vault activation failure, keeping loan and member state pending on rejection.
Verify odd default liability splits reconcile exactly and drifted borrower state only clears when it still references the settled loan.
Verify exit rejects an underfunded vault before mutating pool counters, member state, or token balances.
Align the workspace with stable host Rust, Anchor 1.1 crates, and Solana 4.x dependencies while documenting the SBF compiler caveat for local tests.
Ensure member accounts consistently prove both owner and pool membership before loan request and default settlement state changes.
Collapse thin handler modules into their matching instruction modules so account constraints and orchestration live together without changing program behavior.
Make guarantee lifecycle changes explicit through narrow transition helpers and replace positional loan request validation with named checks.
Add a shared integration assertion for vault coverage of liquid savings and apply it across representative pool lifecycle flows.
Replace per-member guarantee vectors with compact obligation counts while storing exact locked backing on each loan for release on repay or default.
Use Rust 2024 and unique instruction handler names so dispatch remains clean without ambiguous handler re-exports.
Move single-instruction invariants into their owning handlers so operations exposes only helpers shared across instruction flows.
Load activation and finalization accounts only when co-sign or repayment reaches the terminal path, reducing account locks for partial flows.
8000
Allow any signer to settle due defaults and close terminal loan accounts so repayment and default lifecycles release rent and obligations together.
Update instruction, state, security, CLI, and use-case references for slim account flows, permissionless defaults, and closed terminal loans.
Keep the integration test coverage notes aligned with the due-date crank settlement model.
Update the releasable crates and lockfile metadata for the hardened 0.2 release while leaving the internal test crate unchanged.
Preserve the 0.1 bounty references while documenting the 0.2 upgrade, hardened lifecycle transactions, and demo script changes for reserved guarantor backing.
Align security, state, accounting, CLI, and use-case docs with unresolved-loan limits, slim account flows, and terminal loan closure semantics.
@vvylym
vvylym commented Jun 27, 2026
Copy link
Copy Markdown
97DC
Owner Author

Release review completed after the docs audit pause.

Verified before merge:

  • GitHub CI is green: rustfmt, SBF build, clippy + nextest.
  • Local final check passed with bash scripts/ci.sh after the documentation corrections.
  • release/0.2.0 and v0.2.0 both resolve to the docs-audited release commit.
  • Program ID remains unchanged: GsjUnBFvYtcxNwCrydPUjQTngGTqdx5v7APnWahnqwkx.

Ready to merge into main.

@vvylym
vvylym merged commit af69cd0 into main Jun 27, 2026
3 checks passed
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

0