Skip to content

feat: Node Families: initial contract storage#6717

Open
jstuczyn wants to merge 14 commits intofeat/node-familiesfrom
feat/nf-families-contract
Open

feat: Node Families: initial contract storage#6717
jstuczyn wants to merge 14 commits intofeat/node-familiesfrom
feat/nf-families-contract

Conversation

@jstuczyn
Copy link
Copy Markdown
Contributor

@jstuczyn jstuczyn commented Apr 29, 2026

NYM-1200

Summary

Bootstraps the node-families CosmWasm 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, _> with UniqueIndexes on owner (one-family-per-owner) and on name (globally-unique family names).
  • family_members: Map<NodeId, NodeFamilyId> - current membership lookup.
  • pending_family_invitations: IndexedMap keyed by (family_id, node_id) with multi-indexes on family and node.
  • Two append-only archives - past_family_members and past_family_invitations - keyed by ((family_id, node_id), counter) with multi-indexes on family and node. Per-(family, node) counters live in their own Maps and are bumped via next_past_member_counter / next_past_invitation_counter to keep archival writes O(1) and disambiguate repeat events that share a block timestamp.
  • node_family_id_counter issues monotonically increasing ids starting from 1

Storage operations (all pub(crate), callers in transaction layer responsible for auth/validation)

  • register_new_family
  • add_pending_invitation
  • accept_invitation (checks expiry, removes pending, records membership, bumps members, archives as Accepted)
  • reject_pending_invitation / revoke_pending_invitation (mirror methods, archive as Rejected / Revoked; work on expired entries)
  • remove_family_member (shared kick/leave path; archives as PastFamilyMember)
  • disband_family (only on empty families; sweeps remaining pending invitations as Revoked)

This change is Reviewable

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nym-explorer-v2 Ready Ready Preview, Comment Apr 30, 2026 0:53am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs-nextra Ignored Ignored Preview Apr 30, 2026 0:53am
nym-node-status Ignored Ignored Preview Apr 30, 2026 0:53am

Request Review

@jstuczyn jstuczyn force-pushed the feat/node-families branch from 1adaff8 to f91d584 Compare April 30, 2026 08:47
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