Skip to content

Subspacesplus#192

Open
spacesops wants to merge 32 commits intospacesprotocol:subspacesfrom
spacesops:subspacesplus
Open

Subspacesplus#192
spacesops wants to merge 32 commits intospacesprotocol:subspacesfrom
spacesops:subspacesplus

Conversation

@spacesops
Copy link
Copy Markdown

@spacesops spacesops commented May 5, 2026

Buffrr, here's my changes to the subspaces branch. Mostly it's a callback registration system for watching for txs. However, there were a bunch of small changes along the line and I fear they've all glommed together so it might be a bit of a chore picking through them. If so, let me know. -Andrew

buffrr and others added 30 commits October 10, 2025 23:24
Update README with Subspaces development details
Fix data inconsistency in RevokeReason::Expired handling that caused
panics when querying spaces that were revoked due to expiration.

Root cause: Expired revocations only removed Outpoint->Spaceout mapping
but left Space->Outpoint mapping, creating inconsistent state.

Changes:
- Remove Space->Outpoint mapping in Expired revocation handler
- Handle inconsistencies gracefully in get_space_info by returning None
  and cleaning up orphaned Space->Outpoint mappings instead of panicking
Fix data inconsistency handling in prepare_open that caused panics
when opening spaces that were revoked due to expiration.

Root cause: When an outpoint exists but spaceout doesn't (due to
inconsistent state from Expired revocations), the code would panic
with 'spaceout exists' instead of handling it gracefully.

Changes:
- Replace expect() with match statement to handle None case
- Treat missing spaceout as new space (space was revoked, so it's
  effectively not registered anymore)
Implements the TX_CALLBACK_API: clients can register HTTP endpoints
and watch-lists of txids; when a watched tx appears in a block the
daemon POSTs a JSON notification asynchronously without blocking
block processing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Exposes Bitcoin Core estimatesmartfee via RPC and CLI,
converting BTC/kB to sat/vB for convenient fee estimation.

Made-with: Cursor
Brings in 16 upstream commits (v0.0.9 bump, bug fixes, lint fixes):
- Graceful handling of revoked-space data inconsistency in
  protocol/src/script.rs, client/src/store/spaces.rs, and
  client/src/client.rs (replaces .expect() panics)
- Wallet recovery now scans from genesis block height instead of
  current chain tip
- Rust lifetime lint fixes across wallet and protocol crates
- macOS GitHub Actions fix
- [workspace.package] version = "0.0.9" added to Cargo.toml

Conflict resolutions:
- veritas/: kept deletion (crate was removed in borsh refactor)
- Cargo.toml: adopted [workspace.package] block, kept branch members/deps
- Cargo.lock: kept branch version, dropped obsolete spaces_veritas entry
- client/src/bin/space-cli.rs: trivial whitespace conflict, kept HEAD
- client/src/client.rs: kept branch named-method API for Expired revoke
- client/src/store/spaces.rs: dropped upstream old open_db function
- protocol/src/script.rs: applied graceful fix to load_open_context,
  discarded upstreams eval/op_open restructure (branch uses different layout)

Made-with: Cursor
Made-with: Cursor

# Conflicts:
#	client/src/wallets.rs
- Add Subject::Handle(SName) with FromStr: multi-label names (e.g. sub@space)
  parse as handles; single-label SNames map to Label for backward compatibility.
- Reject handles in wallet/RPC paths that require a concrete space or num
  (setfallback, transfer, operate, delegate, etc.).
- Implement get_fallback for handles: scan merged spaces/nums block index for
  SIP-7 payloads with TXT key "handle" matching the canonical handle string;
  return the latest match by height and tx position when available.
- Add SqliteIndex list_*_blocks_merged, Chain helpers, and
  ChainStateCommand::FindFallbackByHandle.
- Update rpc schema docs for getfallback; add unit tests for parsing and scan.

Made-with: Cursor
Support * (multi-char) and ? (single-char) wildcards in getfallback
subjects. Space-name patterns (@*, @m?d) match SIP-7 TXT records with
key "space"; handle patterns (*@mad, *@*) match TXT records with key
"handle". Returns a JSON object keyed by matched name.

- Add Subject::HandlePattern variant for wildcard-containing inputs
- Unified merge_scan_txt_wildcard scans indexed blocks by TXT key
- Change get_fallback RPC return type to serde_json::Value
- Add ChainStateCommand::SearchFallbackByPattern
- Reject HandlePattern in wallet/transfer/operate/setfallback paths
- 17 unit tests for glob matching, scan, and key isolation

Made-with: Cursor
spacesops and others added 2 commits April 26, 2026 12:54
Bring in upstream release/CI and crate updates while preserving subspacesplus RPC and callback functionality, and resolve merge conflicts to keep local feature behavior intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

4 participants