You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three small, independent dedups (bundle or split as convenient; each is mechanical):
1. Shared PruneGuard
crates/node/src/dispatch.rs:266-273 and crates/node/src/rate_limit.rs:234-241 define an identical AtomicBool RAII prune-guard, with near-identical keyed-limiter prune-sweep logic around it. Share one guard (and the sweep shape if it falls out naturally). ~30 lines.
2. EIP-712 domains computed once
runtime/mod.rsrun() re-derives the same signing domains with identical args at multiple sites: slash_judge_domain ×3 (mod.rs:673, 1012, 1613), voucher_domain ×2 (976, 1606), bind_node_id_domain ×2 (978, 1618). Compute each once and clone the handle.
3. Provider factory
ProviderBuilder::new().connect_http(rpc_url…) appears ×10 in run() (mod.rs:715, 725, 766, 908, 1044, 1230, 1382, 1836, …), mostly wrapped in with_poll_interval, in four variants (read-only / wallet / buyer-wallet / plain-head). A small factory with one constructor per variant removes the repetition and makes the poll-interval wiring single-sourced.
Combined ~60-80 prod lines; all low risk, no behavior change. Related contract-address parse blocks (×4, ~8 lines each, e.g. mod.rs:662-671) can ride along with the factory if convenient — note the zero-address guard follow-up in #1219 touches the same parse sites, so coordinate.
Activity
docs(node): correct stale bind_domain reuse comment (#1252)
refactor(node): dedupe runtime helpers (#1252) (#1274)