feat(p2p): add tx_count and subtree_count to node_status message#24
Conversation
… support - Fix capacity calculation in BlockHeaderMeta.Bytes() to include all fields - Add ProcessedAt field to BlockHeaderMeta struct for tracking block processing time - Update serialization/deserialization to handle ProcessedAt timestamp (8 bytes) - Add ProcessedAt to protobuf GetBlockHeaderResponse with proper timestamp type conversion - Update HTTP API responses to include Invalid and ProcessedAt fields - Fix frontend date parsing to handle RFC 3339 timestamp format from JSON API
- Add hasCoinbaseColumn parameter to processBlockHeadersRows - Fix GetBlockHeadersFromOldest to include processed_at column - Remove dynamic column detection to improve performance - Fix variable shadowing with err declaration
Add transaction count and subtree count fields to node status messages to provide visibility into block assembly state across the P2P network. Changes: - Add TxCount and SubtreeCount fields to NodeStatusMessage struct - Fetch block assembly state via GetBlockAssemblyState() API - Include counts in both WebSocket notifications and P2P broadcasts - Reuse existing TxCount field in notificationMsg for block assembly count
Update the dashboard UI to use the new top-level tx_count and subtree_count fields instead of the old block_assembly_details structure. Changes: - Update p2pStore.ts to handle new field structure from backend - Add subtree_count column to network nodes table - Update network page comparison logic for new fields - Add i18n translation for subtree_assembly column - Fix baseUrl reference in block message handling
|
/claude-review |
|
Claude finished @oskarszoon's task —— View job Code Review Complete ✅
Review SummaryThe implementation correctly adds Backend (Go):
Frontend (TypeScript/Svelte):
Good practices observed:
Minor Observations
No blocking issues found. The implementation is clean and follows existing patterns. |
Summary
tx_countandsubtree_countfields to node status messagesChanges
services/p2p/Server.go:
TxCountandSubtreeCountfields toNodeStatusMessagestructGetBlockAssemblyState()API ingetNodeStatusMessage()handleNodeStatusNotification()services/p2p/HandleWebsocket.go:
SubtreeCountcomment to clarify it's for block assemblyTxCountfield is reused for both block notifications and block assembly countContext
PR #8 removed
BlockAssemblyDetailsfrom node status but didn't add the intended replacement fields. This PR completes that work by adding simple count fields instead of the full state object.Test plan
make lint)tx_countandsubtree_countfields