Skip to content

docs(escrow): authoritative DataKey storage reference#296

Open
Vvictor-commits wants to merge 1 commit into
Liquifact:mainfrom
Vvictor-commits:docs/data-model-keys
Open

docs(escrow): authoritative DataKey storage reference#296
Vvictor-commits wants to merge 1 commit into
Liquifact:mainfrom
Vvictor-commits:docs/data-model-keys

Conversation

@Vvictor-commits
Copy link
Copy Markdown

@Vvictor-commits Vvictor-commits commented May 28, 2026

Closes #273


Summary

Rewrites docs/escrow-data-model.md into a complete, code-aligned reference for every DataKey variant. Adds two tests that verify documented defaults hold at runtime.

What was missing from the previous doc

  • No schema version column — impossible to know when a key was introduced
  • Missing variants: MaxPerInvestorCap, PendingAdmin, AllowlistActive, InvestorRefunded, DistributedPrincipal
  • status == 4 (cancelled) not documented in the state machine table
  • No explicit note on the persistent/instance TTL mismatch for InvestorAllowlisted
  • No test coverage for default-on-absence behavior

Changes

docs/escrow-data-model.md

  • Complete DataKey table: storage tier, value type, default when absent, schema version added, mutability
  • Schema version changelog cross-referenced with the one in lib.rs
  • Per-address keys section calling out instance vs persistent split
  • State machine table with all 5 status values including cancelled (4)
  • Additive-vs-breaking rules from ADR-007
  • Security notes: DistributedPrincipal liability floor, double-refund guard, InvestorClaimed event-only semantics, TTL mismatch warning

escrow/src/tests/init.rs

  • datakey_defaults_on_fresh_init — verifies every key documented as absent-default actually returns its default on a fresh deployment
  • datakey_distributed_principal_starts_at_zero_and_increments_on_refund — verifies the counter introduced in the liability floor PR

- Rewrite docs/escrow-data-model.md with complete DataKey table:
  storage tier, value type, default-on-absence, schema version added
- Add DistributedPrincipal, MaxPerInvestorCap, PendingAdmin,
  AllowlistActive, InvestorRefunded — all missing from previous doc
- Document status == 4 (cancelled) in the state machine table
- Add persistent vs instance TTL mismatch warning for allowlist keys
- Add two tests in escrow/src/tests/init.rs:
  datakey_defaults_on_fresh_init: verifies every absent-default key
  datakey_distributed_principal_starts_at_zero_and_increments_on_refund
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@Vvictor-commits Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Document the storage DataKey map and additive-key policy in docs/escrow-data-model.md

2 participants