refactor: dissolve benches/examples crates into host crates - #740
Conversation
Move every bench and example target out of the nectar-benches and nectar-examples aggregators into the crate it exercises, and delete the two aggregators. Swap the dormant codspeed-criterion-compat shim for plain criterion. Targets that need a non-default feature carry required-features, and lint.yml gains the two feature passes that build them.
|
Correction to the member count, for the record, since stage 2's gate is that the final count is written down and correct. The brief I gave said 22 members before and 20 after. That was wrong in both directions, and the red-team caught it. The workspace declares The true figures are 23 members before this pull request and 21 after. The directory count under This matters beyond bookkeeping: stage 2's exit gate in |
Closes #618
Summary
Dissolved
crates/benchesandcrates/examplesinto their host crates and swapped the codspeed shim for plain criterion.Bench homing:
address,bmt_bench,encryption_bench,primitives,proofstonectar-primitives;latency_benchtonectar-file;mantaray_benchtonectar-mantaray;verifytonectar-postage;signandupload_pipelinetonectar-postage-issuer. Example homing:basic_usageandbuilder_patternstonectar-primitives;dump_deploymentstonectar-contracts;stamp_pipelinetonectar-postage-issuer;roam_between_machinestonectar-postage-usage. All fifteen files moved withgit mvso history follows.Feature gating uses
required-features, not a self dev-dependency. A self dev-dependency (the tokio pattern) would have unified the extra feature into every build of the host package that activates dev-dependencies, silently turning the default-feature CI matrix rows into feature-on rows.crates/benchesandcrates/examplesare removed as workspace members; theirCargo.tomlandsrc/lib.rsare deleted.Testing
All commands run inside
nix develop --commandat2c18d09c(branchrefactor/618-dissolve-bench-crates, based onorigin/main@1ea486b3). Toolchain: rustc 1.94.0, which equals the declared MSRV (.github/scripts/declared-msrv.sh->1.94), so the build below doubles as the MSRV lane'scargo check --workspace --all-targets --locked.Workspace member count (
cargo metadata --no-deps): 23 before -> 21 after.nectar-benchesandnectar-examplesare the two removed members.Build and target relocation
cargo build --workspace --all-targets --locked: pass. Every moved bench and example builds in its new host crate.cargo bench --workspace --locked --no-run: pass (default-feature benches).cargo bench --locked -p nectar-postage --features parallel --no-run: pass (verify).cargo bench --locked -p nectar-mantaray --features hazmat: pass (mantaray_bench).lint.ymlpass with-D warnings.cargo fmt,cargo deny check(advisories/bans/sources/licenses), andcargo-macheteare clean.nextestis 573/573 on the seven touched crates.cargo run -p nectar-contracts --example dump_deploymentsemits the JSONupstream-addresses.ymlconsumes.nostd.ymluses plaincargo check; no bench target can leak onto the bare-metal lane.AI Assistance
Implemented by claude-opus-5. Red-teamed by claude-opus-5. PR description by claude-sonnet-5.