feat: add --no-blockchain mode for routing commits/identity updates to nodes#2004
feat: add --no-blockchain mode for routing commits/identity updates to nodes#2004api-Hypernova wants to merge 11 commits into
Conversation
…ates to nodes Adds feature flags (XMTPD_PAYER_NO_BLOCKCHAIN, XMTPD_API_NO_BLOCKCHAIN) that bypass blockchain for commit and identity update messages, routing them to dedicated nodes instead. This enables testing XMTPD without Arbitrum L2 dependency as proposed in the "xmtpd without chain" experiment. Changes: - Add NoBlockchain, CommitNodeID, IdentityNodeID to PayerOptions and APIOptions - Modify payer groupEnvelopes() to route blockchain-bound messages to nodes - Make 3 node-side rejection points conditional on NoBlockchain flag - Wire config through gateway builder with WithNoBlockchain option - Add triple profile to docker-compose with 3rd postgres (port 8767) - Add dev/run-3 and dev/run-no-chain convenience scripts - Add 3rd Anvil account to local.env and node registration in dev/docker/up Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The determineRetentionPolicy function panicked for identity updates and commit messages because they were never expected to go through the node publish path. In no-blockchain mode they do, so return default retention instead of panicking. Adds unit test verifying identity updates route to node (not blockchain) when WithNoBlockchain is enabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three tests verify the no-blockchain experiment: 1. Identity updates route to dedicated node (not blockchain publisher) 2. Commit messages route to dedicated node and are stored successfully 3. Regular messages still use normal node selector path Also adds WithTestNoBlockchain() option to test API server configuration to enable NoBlockchain on the message service for test scenarios. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Measures 50 iterations of commit publish via no-blockchain node path vs regular message publish. Results show identical latency (~13ms), confirming the blockchain elimination works. Production blockchain path adds 2-15s per commit (Arbitrum L2 finality). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies that unreachable commit/identity nodes produce errors (not silent drops), and that mixed batches fail atomically when one target is down. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- GatewayE2E_CommitThroughPayer: 5 sequential commits through payer → node - GatewayE2E_IdentityUpdateThroughPayer: identity update through dedicated node - MultiGroupOrdering: 10 groups verify monotonic sequence IDs at commit node - MixedWorkload: regular message + commit + identity update + welcome in sequence - SequentialCommitLatency: 50-iteration latency benchmark (avg=13.8ms) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Commit flow: payer → dedicated commit node → stored successfully - Identity update flow: payer → dedicated identity node - Mixed traffic: regular messages + commits routed to correct destinations - Multi-group ordering: 10 groups, all commits → single commit node Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary by OctaneNew ContractsNo new contracts were added. Updated Contracts
🔗 Commit Hash: 01347dd |
- Break long AssertNotCalled/EqualValues lines for golines - Remove extra blank line after closing paren for gofumpt - Use integer range loops (Go 1.22+) for intrange Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace EqualValues with Equal where types match - Keep EqualValues where type coercion needed (int vs uint32) - Use range-over-int for iteration loops - Break long lines for golines Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The publishToNodeWithRetry path calls GetNodes for banlist retry, which wasn't mocked in TestNoBlockchain_IdentityUpdateRoutedToNode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Overview
Detailed findings
|
Summary
--no-blockchainconfig flags to payer and API servicesCode Changes
pkg/config/options.goNoBlockchain,CommitNodeID,IdentityNodeIDflagspkg/api/payer/service.gopkg/api/payer/config.goWithNoBlockchainoptionpkg/api/message/service.gopkg/gateway/builder.gopkg/testutils/api/api.goWithTestNoBlockchain()test optionTest Coverage
Performance Results
Test plan
Generated with Claude Code
Note
Add
--no-blockchainmode to route commits and identity updates directly to nodesNoBlockchainexperiment flag to both the payer and API services, withCommitNodeIDandIdentityNodeIDconfig fields specifying which nodes receive those message types instead of the blockchain.groupEnvelopesroutes identity updates toIdentityNodeIDand commit/proposal messages toCommitNodeIDwhen no-blockchain mode is active;determineRetentionPolicynow handles these types without panicking.NoBlockchainis enabled, and allowsDependsOnnode IDs ≥ 100.tripleDocker Compose profile with a third Postgres on port 8767, for local multi-node testing.pkg/api/payer/.Macroscope summarized 01347dd. (Automatic summaries will resume when PR exits draft mode or review begins).