Skip to content

Fix/ip registry 1144 1145 1146 1147 - #1274

Merged
fejilaup-cloud merged 7 commits into
AtomicIP:mainfrom
emekaabraham666:fix/ip-registry-1144-1145-1146-1147
Oct 21, 2026
Merged

fejilaup-cloud merged 7 commits into
AtomicIP:mainfrom
emekaabraham666:fix/ip-registry-1144-1145-1146-1147

Conversation

@emekaabraham666

Copy link
Copy Markdown
Contributor

Title

fix(ip-registry): revoke/expiry checks, transfer policy and TTL literals (#1144 #1145 #1146 #1147)

Body

Closes #1144
Closes #1145
Closes #1146
Closes #1147

Changes

Known gaps

  • CI is not green. The ip_registry test target has pre-existing compile errors (160), and atomic_swap fails to build and trips the disabled-test gate. Neither is touched here.
  • The lifecycle tests (17) pass in a scratch copy with the broken test modules excluded.

main no longer built: lib.rs carried a stale DataKey enum that shadowed
the one in types.rs, and several definitions from 350aec4 (AtomicIP#974-AtomicIP#977) and
the OwnershipShare/expiry/challenge work were dropped.

- Merge DataKey into a single enum in lib.rs (remove the types.rs copy)
- Restore MerkleProof, MerkleRootRecord, TimeLockRecord,
  CommitmentAmendment, PrivacyLevel and CommitmentPrivacy in types.rs
- Restore missing DataKey variants (OwnershipShares, ExpiryNotified, ...)
- Add CommitmentArchived, InvalidShareTotal, ChallengeExpired and
  ChallengeAlreadyAnswered with new codes 60-63 (36/37/39 were taken)
- Rename private verify_merkle_proof helper to verify_merkle_leaf_path
  to resolve the clash with the public AtomicIP#974 entry point
- Replace require! (undefined) with explicit checks, use Symbol::new for
  event names longer than 9 chars, fix usize/u32 length comparisons
)

verify_commitment only checked the Archived flag, so a revoked IP still
verified for the correct secret and blinding factor. It now returns false
when record.revoked is set.

- Add lifecycle_tests with verify-before and verify-after-revoke regression tests
- Document verify_commitment's on-chain rejection rules in commitment-scheme.md
- Add missing unlock_time/privacy_level fields to validation.rs test fixtures
… out of read path (AtomicIP#1145)

verify_commitment wrote ExpiryNotified and emitted EXPIRY_TOPIC, and it
returned a hash match for an expired commitment.

- verify_commitment is now read-only and returns false once the ledger
  reaches expiry_timestamp + grace_period_seconds (grace still verifies)
- Add notify_ip_expiry, a state-changing entry point that emits the
  expiry event once per transition
- Update expiry event test to use notify_ip_expiry
- Add tests for verify before, during and after grace, the no-event
  guarantee on reads, and once-per-transition notification
- Document the rules in commitment-scheme.md
…tomicIP#1146)

transfer_ip only moved OwnerIps, CommitmentOwner and IpRecord. Access
grants, licenses, co-owner shares and threshold configuration stayed
bound to the previous owner, so their grantees kept live access.

- Add clear_owner_scoped_state with a documented per-key policy: authority
  keys are cleared, history and attestation keys are retained
- transfer_ip calls it and resets co_owners to the new sole owner
- Add tests that grants, licenses, co-owners and threshold config do not
  survive a transfer, audit history is retained, and the new owner can
  grant access afterwards
- Document the transfer policy in commitment-scheme.md
…#1147)

transfer_ip, revoke_ip and grant_ip_access passed the literal 50000 as
the TTL, so record lifetimes depended on which path last touched them.
Two metadata.rs calls and several commitment paths also passed literal
values.

- Replace every literal TTL argument with LEDGER_BUMP (8 call sites)
- Add extend_ttl_uses_ledger_bump_policy, which scans all src files and
  fails on numeric literal TTL arguments, with scanner self-tests
- Document the TTL policy in soroban-resource-limits.md
The comment cited an issue number that does not correspond to this key.
@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@emekaabraham666 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

@fejilaup-cloud
fejilaup-cloud merged commit 337d01b into AtomicIP:main Oct 21, 2026
0 of 2 checks passed
gabrielujelistic-collab pushed a commit to Stellar-drive/stellar-drive-atomic-ip that referenced this pull request Nov 9, 2026
…-1144-1145-1146-1147

Fix/ip registry 1144 1145 1146 1147
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants