BREAKING EXPERIMENTAL: Holepunch-native hard migration (RPC core, shared storage, SDK v2)

BREAKING: All nodes must upgrade together. Legacy p2ns.core-request string
messages are rejected; invite/consensus control plane uses protomux-rpc
(invite.request, invite.ack, invite.relay*, consensus.*). Shared Corestore
namespaces are the default for plugin DBs and drives; USE_SHARED_CORESTORE_NAMESPACES=false
is debug-only. Admin plugin actions with params are validated before run.

EXPERIMENTAL: End-to-end RPC invite path reuses existing handlers via adapters;
invite wire still ships on the invite channel. Multi-peer invite/relay
integration tests are not in CI yet (core-rpc-smoke only).

SDK & channels:
- channel-rpc.js, sdk.channels.rpc (register/request/event)
- core-rpc.js for p2ns.core; action-params + plugin route validation
- sdk.db.getCore/reopen, sdk.state.getPeerChannelSnapshot,
  sdk.metrics.getHolepunchStats (schema v1)

Runtime:
- p2ns.js: RPC-first core invite/consensus; Hyperswarm firewall/reconnect
- channel-manager: required protomux-rpc per peer
- db-shared-namespace-migration; drive-manager shared namespaces
- proxy-server: invite.request RPC for joiners

Plugins: file.drop, global.profile, peer.directory, domain.consensus,
peer.visualize, example.plugin (RPC demo); peer.directory UI polish

Also: CI/smoke scripts, diagnostics hardening, plugin config schema validation,
admin action param modal, docs/RFCS, package-lock + engines.node >= 18
This commit is contained in:
Raven Scott
2026-05-28 10:51:19 -04:00
parent 4b783801c5
commit ea9124c429
49 changed files with 6576 additions and 215 deletions
@@ -41,6 +41,14 @@ async function handleStatsRoutes(req, res) {
try {
const startTime = Date.now();
const stats = getMetrics();
if (state.hypercoreStats && typeof state.hypercoreStats.toJson === 'function') {
try {
const { normalizeHolepunchStats } = require('../../../infrastructure/holepunch-stats-schema');
stats.holepunch = normalizeHolepunchStats(state.hypercoreStats.toJson());
} catch (err) {
logDebug('Admin', `Failed to collect hypercore stats: ${err.message}`);
}
}
const holesailChildren = [];
const pidStatsPromises = [];