feat(contracts): add agent identity registry per ADR-0002 - #56
Merged
Merged
Conversation
set_agent_uri wrote UriIndex(new_uri) without extending its TTL, so the index could be archived long before the URI it points to (4,095 vs 1,036,800 ledgers in tests). ADR-0002 requires every write to extend the keys it writes. The test now asserts the index TTL.
openspec/ is tooling configuration unrelated to #13; keep this PR scoped to the contract.
Deploying puls3 with
|
| Latest commit: |
2654019
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://31252e31.puls3-4lw.pages.dev |
| Branch Preview URL: | https://feat-identity-registry.puls3-4lw.pages.dev |
XxHugheadxX
reviewed
Sep 26, 2026
XxHugheadxX
left a comment
Contributor
There was a problem hiding this comment.
Reviewed against ADR-0002 and #13. The contract is in good shape: all 23 public functions, the error codes (1–8, 9–11 reserved, 100), the three events with their topics, the storage keys and types, and extend_ttl match the ADR. The auth test runs without mock_all_auths(), and the TTL tests follow the ADR's method.
Gates, run locally (CI does not build contracts yet, #29)
stellar contract build ✅ identity_registry.wasm (12 KB)
cargo test ✅ 15/15 (+ placeholder 1/1)
cargo clippy --all-targets -- -D warnings ✅
cargo fmt --all -- --check ✅
Fixed in this branch (2 commits on top of yours, no force-push)
eb8a4a7— TTL of the new URI index.set_agent_uriwroteUriIndex(new_uri)but did not extend its TTL, while ADR-0002 requires every write to extend the keys it writes. In tests the new index was left at 4,095 ledgers whileAgentUrigot 1,036,800, so the index could be archived long before the URI, breakingagent_id_by_uriand the duplicate check. The fix extends it, andset_agent_uri_updates_lookup_and_frees_old_urinow asserts the index TTL. The new assertion fails on the original code (left: 4095, right: 1036800) and passes with the fix.2654019— removedopenspec/. It is tooling configuration unrelated to #13 (scope rule in CONTRIBUTING). Feel free to propose it in its own PR.
All four gates pass again after both commits.
Optional, your call
- After
unset_agent_wallet,get_metadata("agentWallet")returnsSome(empty bytes)(asserted intest.rs). Stellar 8004 returnsNonethere, since it reads the wallet slot. ReturningNonewould keep clients written for Stellar 8004 working unchanged. MAX_METADATA_KEYScountsagentWallet, so 99 keys are left for the builder; Stellar 8004 does not count it. Fine either way, but worth a line in ADR-0002.- The
identity*.jsonpattern incontracts/.gitignorewould silently ignore any deployment artifact named like that (#15). A narrower pattern may be safer.
@moises-cisneros please confirm the two commits look right to you; after that this is good to merge.
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.
Closes #13
Summary
identity-registrySoroban contract implementing the ADR-0002 interface (sequential IDs from 0, unique URIs, owner metadata, dual-auth payment wallet).IdentityErrorenum (codes frozen, 9–11 reserved),Registered/UriUpdated/MetadataSetevents, TTL extend-on-write..gitignorefiles (env, keys, secrets, Stellar identities).Acceptance criteria
mock_all_auths()stellar contract build,cargo testandcargo clippy --all-targets -- -D warningspassVerification evidence