refactor: layered (DDD) architecture + dead-code cleanup#1
Merged
Conversation
Reorganize src/ into four layers with dependencies pointing inward (domain ← infrastructure ← application ← presentation; main is the composition root). No behavioral change — all 28 tests pass unchanged. Layers: - domain/ analysis, scoring, collector, timing, clock, config, warmup - application/ run (race/latency/full), slots, throughput pipelines - infrastructure/ geyser (provider + client), proto, sntp, config_file - presentation/ output (console/json/csv), html Split mixed modules onto layer boundaries: - clock math (domain) vs NTP UDP probe (infrastructure::sntp) - config value objects (domain) vs TOML loading (infrastructure::config_file) - protobuf created_at extraction + commitment conversion moved to infrastructure::geyser so domain no longer depends on generated protobuf - race/latency/full orchestration extracted from main into application::run - slot/throughput console renderers moved to presentation::output Dead-code cleanup: - remove BenchConfig.duration_secs (write-only) - drop unused deps chrono + duplicate tokio-stream (kept as dev-dep) - inline dead subscribe_with_request branch; drop SubscribeSendError variant Public module paths moved (breaking for library consumers) -> v0.4.0. Adds ARCHITECTURE.md (layer map + ubiquitous language). clippy -D warnings and fmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the private copy of `percentile` in application/slots.rs and call the canonical `domain::analysis::percentile` instead (identical nearest-rank impl). Addresses the code-review cleanup finding. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI failed with "'cargo-fmt' is not installed for the toolchain '1.90.0'": dtolnay/rust-toolchain@stable installed rustfmt/clippy for `stable`, but rust-toolchain.toml pins 1.90.0, so cargo selected a toolchain without the components. Pin the action to @1.90.0 (ci.yml components; release.yml target) so the installed toolchain matches the one cargo uses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CSFeo
added a commit
that referenced
this pull request
Jul 15, 2026
refactor: layered (DDD) architecture + dead-code cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reorganizes
src/into four layers with dependencies pointing inward(
domain←infrastructure←application←presentation;mainis thecomposition root). No behavioral change — the same 28 tests pass;
clippy -D warningsandfmtare clean.Layers
analysis,scoring,collector,timing,clock,config,warmup(pure model + logic; no I/O, no protobuf)run(race/latency/full),slots,throughputpipelinesgeyser(provider + gRPC client),proto,sntp,config_fileoutput(console/json/csv),htmlModule splits (onto layer boundaries)
domain::clock) vs NTP UDP probe (infrastructure::sntp)domain::config) vs TOML loading (infrastructure::config_file)created_atextraction + commitment conversion moved toinfrastructure::geyser—domainno longer depends on generated protobufmain→application::runpresentation::outputDead-code cleanup
BenchConfig.duration_secs(write-only)chrono+ duplicatetokio-stream(kept as dev-dep)subscribe_with_requestbranch; dropped orphanedSubscribeSendErrorNotes
chainbench_grpc::analysis→chainbench_grpc::domain::analysis). Bumped to v0.4.0.ARCHITECTURE.md(layer map, dependency rule, ubiquitous language, run flow).🤖 Generated with Claude Code