feat: Node Families: initial contract storage#6717
Open
jstuczyn wants to merge 14 commits intofeat/node-familiesfrom
Open
feat: Node Families: initial contract storage#6717jstuczyn wants to merge 14 commits intofeat/node-familiesfrom
jstuczyn wants to merge 14 commits intofeat/node-familiesfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
1adaff8 to
f91d584
Compare
6524959 to
a99cbf2
Compare
b524dce to
6e40e7e
Compare
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.
NYM-1200
Summary
Bootstraps the
node-familiesCosmWasm contract with its full storage layer. No execute/query handlers yet - those will be done in subsequent PRs according to their tickets.What's in here
Storage shape (
storage/mod.rs,storage/storage_indexes.rs)families: IndexedMap<NodeFamilyId, NodeFamily, _>withUniqueIndexes onowner(one-family-per-owner) and onname(globally-unique family names).family_members: Map<NodeId, NodeFamilyId>- current membership lookup.pending_family_invitations:IndexedMapkeyed by(family_id, node_id)with multi-indexes onfamilyandnode.past_family_membersandpast_family_invitations- keyed by((family_id, node_id), counter)with multi-indexes onfamilyandnode. Per-(family, node)counters live in their ownMaps and are bumped vianext_past_member_counter/next_past_invitation_counterto keep archival writes O(1) and disambiguate repeat events that share a block timestamp.node_family_id_counterissues monotonically increasing ids starting from1Storage operations (all
pub(crate), callers in transaction layer responsible for auth/validation)register_new_familyadd_pending_invitationaccept_invitation(checks expiry, removes pending, records membership, bumpsmembers, archives asAccepted)reject_pending_invitation/revoke_pending_invitation(mirror methods, archive asRejected/Revoked; work on expired entries)remove_family_member(shared kick/leave path; archives asPastFamilyMember)disband_family(only on empty families; sweeps remaining pending invitations asRevoked)This change is