Merge pull request #827 from input-output-hk/yveshauser/deltaq-report
DeltaQ report
DeltaQ report
Signed-off-by: Chris Gianelloni <[email protected]>
Maps adversarial relay node infrastructure costs to measurable front-running rates, with exploitable yield discounted by FIFO batcher prevalence and DEX order fraction from script mapping. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Move ChainTree, ChainNode, and their 7 unit tests from consensus.rs into chain_tree.rs. Add point() accessor so consensus doesn't reach into ChainTree internals. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Display tip_hash alongside tip_block_no in the inspector panel, matching the format already used in topology nodes (e.g. "5 #a3b2"). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Emit NodeEvent::RolledBack for both peer-triggered rollbacks (NetworkEvent::RolledBack) and consensus fork-switch rollbacks (on_validation_complete returns true). UI shows violet flash on topology nodes and magenta chip in event log. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Track adopted_tip_hash separately from the chain tree's speculative best tip. When on_validation_complete finds the new block is on a different fork than the adopted tip, walk prev_hash links to find the common ancestor and issue InjectRollback before InjectBlock. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace the single local_tip in Consensus with a ChainTree that tracks block headers keyed by hash, linked via prev_hash. Longest chain (highest block_number) is selected as best tip. Blocks deeper than security_param_k (default 2160) are pruned. Block production now receives prev_hash and block_number from consensus so headers contain correct chain linkage and globally consistent height. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Use Typography component="div" so the Chip (renders <div>) isn't nested inside a <p> element. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Track blocks_produced in NodeSeriesPoint and display a green blocks chart in the inspector, matching the aggregate charts style. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Style recharts tooltips in aggregate charts and inspector panel with dark backgrounds and white text to match the dashboard theme. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Dark purple background, larger title left-aligned, node/edge count on the right, white text throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace 1s HTTP polling with Server-Sent Events for event delivery. Events now appear in the UI as they arrive from nodes, making block propagation visible as a wave across the graph. - Add GET /api/events/stream SSE endpoint with broadcast channel - Add useEventStream hook with 50ms batching to avoid render storms - Remove TipAdvanced from flash triggers (redundant with RBReceived) - Protect "produced" flash from being overwritten by "received" Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Sebastian Nagel <[email protected]>
Cleanup
Replace the trivial [slot, hash] CBOR in fake blocks with proper
Shelley+ structure: era-tagged Conway header (10-field header_body with
slot, block_number, issuer_vkey, etc.) wrapped in #6.24, and a
complete block body with header + empty tx/witness/metadata maps.
This makes body.point() and WrappedHeader::parse() work correctly on
fake blocks, so the coordinator can derive the block point from the
body without needing the fetch range passed through.
Reverts the PeerEvent::BlockFetched { from, to, body } workaround
back to the original { body } form. The coordinator uses body.point()
again, which now works for both real and fake blocks. This is the
correct design for future multi-block range fetching.
New test: fake_block_has_parseable_cbor verifies header parsing,
point derivation from both header and body, and slot/era correctness.
324 tests (293 net-core + 31 net-node), 0 clippy warnings.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add telemetry system with event/stats sinks and per-peer bandwidth monitoring: net-core changes: - mux/mod.rs: MuxStats with AtomicU64 bytes_sent/bytes_received counters, exposed via RunningMux - mux/egress.rs, ingress.rs: increment counters per segment (header+payload) - peer/types.rs: PeerEvent::Connected now carries Arc<MuxStats> - multi_peer/types.rs: PeerInfo struct, NetworkCommand::QueryPeers, NetworkEvent::PeerSnapshot for per-peer telemetry snapshots - coordinator.rs: stores mux_stats per peer, handles QueryPeers by building PeerInfo with address, mode, rtt, delay, bytes_sent/received net-node changes: - telemetry.rs: NodeEvent enum (sim-rs compatible JSONL format with serde tagged enum), StatsSnapshot with full peer list including bandwidth, EventSink/StatsSink traits, FileEventSink (JSONL), HttpEventSink (reqwest batched POST), LogStatsSink, HttpStatsSink, TelemetryHandle with counters and periodic flush - config.rs: TelemetryConfig, EventSinkConfig (file/http), StatsSinkConfig (log/http) - main.rs: stats timer sends QueryPeers, PeerSnapshot triggers emit_stats, all events recorded via telemetry.record() 323 tests (293 net-core + 30 net-node), 0 clippy warnings. Live-tested: JSONL file output with correct sim-rs format, periodic peer stats with bytes_sent/received incrementing, delay_ms reported. Marks Stage 5 and all stages complete in test-node-plan.md. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Extend the test node with Leios block types and network delay simulation: - production.rs: EB/vote lotteries at stage boundaries, stage boundary detection, refactored to share lottery logic across block types - consensus.rs: handles LeiosBlockOffered -> FetchLeiosBlock, LeiosVotesOffered -> FetchLeiosVotes, LeiosBlockTxsOffered -> FetchLeiosBlockTxs, logs Leios block/vote reception - config.rs: ib/eb/vote generation probabilities, stage_length_slots, eb/vote validation timing, per-peer inbound_delay_ms - Coordinator per-peer delay: new peer_delays config in CoordinatorConfig, events from delayed peers buffered and delivered after configured duration. Zero overhead when unconfigured (has_any_delays guard). Implemented in coordinator event loop with conditional select branch. 27 net-node tests + 293 net-core tests pass, 0 clippy warnings. Live-tested: Leios EB/vote production and fetch, per-peer 200ms delay visible in timestamps. Marks Stage 4 complete in test-node-plan.md. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The PeerCommand dispatch loop was duplicated nearly verbatim between peer_task.rs and duplex_task.rs. Extract into command_dispatch.rs so adding a new command variant requires a single edit instead of two. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
BlockBody::header() extracts the WrappedHeader directly from block body CBOR, reusing shared try_extract_header() logic with point(). Coordinator now falls back to body.header() when pending_headers misses, and skips chain store insertion if neither produces a header. Post-remediation review: added Resolution subsections for all three residual observations, stripped trailing whitespace. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>