Skip to content

feat: mic moc#5486

Open
nugaon wants to merge 5 commits into
masterfrom
feat/micmoc
Open

feat: mic moc#5486
nugaon wants to merge 5 commits into
masterfrom
feat/micmoc

Conversation

@nugaon
Copy link
Copy Markdown
Member

@nugaon nugaon commented Jun 3, 2026

Description

Adds WebSocket subscription endpoints for receiving real-time Single Owner Chunk (SOC) payloads filtered by owner address (MIC) or identifier (MOC):

  • MIC (Mined ID Chunk): Subscribe to all SOCs from a specific owner Ethereum address via /mic/subscribe/{owner}
  • MOC (Mined Owner Chunk): Subscribe to all SOCs with a specific identifier regardless of owner via /moc/subscribe/{id}

Both listeners integrate with push/pull sync to dispatch matching SOC payloads to WebSocket subscribers.

Includes optimized SOC listener implementation using RWMutex with atomic fast-path to minimize lock contention on the hot sync path. The same optimization is applied to the existing GSOC listener for consistency.

Open API Spec Version Changes (if applicable)

8.1.0 → 8.2.0 (new endpoints are additive features per SemVer)

Motivation and Context (Optional)

Enables real-time notifications for specific SOC patterns without polling.

Related Issue (Optional)

PubSub SWIP

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

nugaon added 5 commits June 2, 2026 19:06
- Use RWMutex instead of Mutex for handler map access
- Add atomic subscription counter to skip locking when no subscriptions exist
- Hold read lock during handler iteration to prevent concurrent mutations
- Extract payload once before dispatching to handlers
- Inline getHandlers to reduce function call overhead
- Apply optimizations consistently across gsoc, mic, and moc packages
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