-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
286 lines (259 loc) · 11.3 KB
/
Copy pathCargo.toml
File metadata and controls
286 lines (259 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
[workspace]
resolver = "2"
members = [
"crates/bp-common",
"crates/bp-config",
"crates/bp-db",
"crates/bp-bitcoin",
"crates/bp-template-distribution",
"crates/bp-share",
"crates/bp-mining-job",
"crates/bp-vardiff",
"crates/bp-jobs-lifecycle",
"crates/bp-inflight-cache",
"crates/bp-cron-utils",
"crates/bp-coinbase-snapshot",
"crates/bp-pplns",
"crates/bp-pplns-engine",
"crates/bp-group-solo-engine",
"crates/bp-group-mgmt",
"crates/bp-group-mgmt-engine",
"crates/bp-blockparty",
"crates/bp-blockparty-engine",
"crates/bp-stats",
"crates/bp-share-stats-sink",
"crates/bp-session-persistence",
"crates/bp-share-hook",
"crates/bp-share-stream",
"crates/bp-mining-mode",
"crates/bp-notifications",
"crates/bp-stratum-v1",
"crates/bp-stratum-v2",
"crates/bp-protocol-detect",
"crates/bp-api",
"crates/bp-metrics",
"crates/bp-geoip",
"crates/bp-regtest-harness",
"crates/bp-test-support",
"bin/blitzpool",
]
[workspace.package]
# Tracks the pool semver so /api/info/version returns the same v<semver>
# the UI compares against.
version = "2.2.6"
edition = "2021"
rust-version = "1.85"
authors = ["Blitzpool contributors"]
publish = false
license = "AGPL-3.0-or-later"
# Central dependency declarations. Crates pull only what they actually need via
# `dep.workspace = true`. Keeps versions consistent across the workspace.
[workspace.dependencies]
# Process-wide allocator (Linux only). Replaces glibc malloc to bound
# RSS under the pool's small-alloc / free pattern (per-connection
# Stratum buffers + sqlx / redis query results across 600+ concurrent
# clients). The TS port hit unbounded RSS growth on glibc and only
# stabilised under jemalloc; we adopt the same allocator preemptively
# so we don't re-discover the same fragmentation problem in production.
tikv-jemallocator = "0.6"
# Async runtime
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["codec", "io"] }
# Low-level socket options (TCP keepalive on accepted stratum sockets)
socket2 = "0.6"
futures = "0.3"
async-trait = "0.1"
# Lock-free copy-on-write for read-mostly shared state (the accepted-share
# fan-out list: appended once at startup, then read on every share).
arc-swap = "1"
# Observability + errors
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "json"] }
thiserror = "1"
anyhow = "1"
# Serialization / wire
serde = { version = "1", features = ["derive"] }
# `raw_value` is used by bp-bitcoin/bp-api (serde_json::value::RawValue).
# Declared explicitly here rather than relying on cross-crate feature
# unification, so `-p <crate> --tests` subset builds also see it.
serde_json = { version = "1", features = ["raw_value"] }
simd-json = { version = "0.17", default-features = false, features = ["serde_impl", "swar-number-parsing"] }
bytes = "1"
hex = "0.4"
faster-hex = { version = "0.10", default-features = false, features = ["std"] }
smallvec = { version = "1", features = ["union", "const_generics"] }
parking_lot = "0.12"
# Zero-alloc composite-key lookups (Equivalent trait) on the share hot path.
hashbrown = "0.15"
# Database
sqlx = { version = "0.8", default-features = false, features = [
"postgres",
"runtime-tokio-rustls",
"macros",
"migrate",
"uuid",
"json",
] }
uuid = { version = "1", features = ["v4", "serde"] }
# Cache / outbound HTTP
redis = { version = "0.27", default-features = false, features = ["tokio-rustls-comp", "aio", "connection-manager", "script", "streams"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
# HTTP server
axum = "0.7"
# Typed config file (bp-config / bin/blitzpool).
toml = "0.8"
# CLI argument parsing for the binary.
clap = { version = "4", features = ["derive"] }
# Metrics — `metrics` facade + Prometheus exporter (text-format /metrics
# endpoint with histogram-bucket support). Used by `bp-metrics`.
metrics = "0.24"
metrics-exporter-prometheus = { version = "0.16", default-features = false, features = ["http-listener"] }
tower = "0.5"
tower-http = { version = "0.6", features = ["cors", "trace"] }
# Bitcoin
bitcoin = "0.32"
secp256k1 = "0.29"
# Base58Check round-trip for SV2 authority-key conversion in
# `bin/blitzpool/src/stratum_v2.rs` (config holds the key as hex;
# stratum-apps's `Secp256k1SecretKey::FromStr` only parses base58check).
bs58 = { version = "0.5", features = ["check"] }
# Hashing + big integer arithmetic (pure math, no Bitcoin-crate dep needed)
sha2 = { version = "0.10", features = ["asm"] }
num-bigint = "0.4"
num-traits = "0.2"
# CSPRNG byte fill — used for admin/invitation token generation in
# bp-group-mgmt. Tiny wrapper around the OS RNG; no convenience layer,
# which is fine for one-shot calls.
getrandom = "0.2"
# Constant-time equality check for hashed-token verification. Same crate
# the rust-crypto ecosystem standardises on.
subtle = "2.6"
# Dev / testing
proptest = "1"
# Bitcoin Core IPC bridge (Cap'n-Proto over UNIX socket → SV2 TDP/JDP).
# git-Dep mit Commit-Pin (RUNTIME-Dep, MIT/Apache — konform mit unserer
# non-commercial Lizenz-Linie, kein Source-Copy). Cargo cached den Checkout
# in ~/.cargo/git, der lokale sv2-apps-Clone ist NICHT Build-Voraussetzung.
# Pinnt bitcoin-core v31.0 + capnproto/libcapnp-dev als system deps. Beim
# Hochziehen auf neuen sv2-apps-Stand: rev tauschen + `cargo update -p
# bitcoin_core_sv2`.
#
# UPSTREAM-PIN: stratum-mining/sv2-apps RELEASE TAG v0.7.0 (rev d7d556d1).
# Der Fork ist WEG. Er trug genau einen Patch — skip-statt-sleep im
# v31x-TDP-Monitor gegen sv2-apps#541 — und v0.7.0 löst dasselbe Problem
# besser: im min_interval-Fenster wird `fee_threshold = MAX_MONEY` gesetzt,
# damit Core gar nicht erst wegen Fees aufweckt; `waitNext` bleibt permanent
# offen, Tip-Wechsel werden sofort erkannt (Commit 4b4a55cd, 2026-07-07).
# Baut weiter auf binary_sv2 v6 (stratum-core 0.5.1).
bitcoin_core_sv2 = { git = "https://github.com/stratum-mining/sv2-apps.git", tag = "v0.7.0" }
# stratum-core liefert `parsers_sv2::TemplateDistribution` und die Subprotokoll-
# Strukturen, die wir zum Bauen von SubmitSolution/CoinbaseOutputConstraints
# brauchen. bitcoin_core_sv2 re-exportiert das (noch) nicht.
# Fester crates.io-semver — exakt die Version, die sv2-apps v0.7.0 pinnt, damit
# Cargo EINEN stratum-core-Graph (binary_sv2 v6) baut.
stratum-core = "0.5.1"
# stratum-apps liefert die App-Layer-Helfer für SV2 (Noise-wrapped tokio
# TcpStream via `network_helpers::accept_noise_connection`, key_utils,
# task_manager, custom_mutex). Feature `pool` zieht network + config + core
# + with_buffer_pool. Selber tag wie bitcoin_core_sv2 damit Cargo nur einen
# stratum-core-Graph baut. Runtime-Dep, kein Source-Copy.
stratum-apps = { git = "https://github.com/stratum-mining/sv2-apps.git", tag = "v0.7.0", features = ["pool"] }
# SRIs eigene JDS-Bibliothek. Wir brauchen daraus genau
# `job_declarator::job_validation::bitcoin_core_ipc::BitcoinCoreIPCEngine`:
# den gepflegten Weg, einen deklarierten Job von bitcoin-core per `checkBlock`
# prüfen zu lassen (SV2-Spec §6.1 "Maintaining an internal mempool") und eine
# Lösung über den JDP-IPC zu propagieren (§6.4.9 MUST). Reines `[lib]`-Crate,
# selber tag damit Cargo einen Graph baut.
jd_server_sv2 = { git = "https://github.com/stratum-mining/sv2-apps.git", tag = "v0.7.0" }
# SipHash-2-4 als pure-math-Lib für SHORT_TX_ID-Hashing
# (TS portiert eigene Impl in sv2-siphash.ts; in Rust nehmen wir
# `siphasher` — die aktuell gepflegte Standard-Crate, MIT/Apache).
# `siphash` (singular) ist seit Jahren stagnant bei 0.0.5.
siphasher = "1"
# async-channel: vom obigen Crate genutzte channel-Lib für die TDP-IO-Boundary.
# Wir matchen die exakte Version damit Sender/Receiver kompatibel sind.
async-channel = "1.5"
# Date/time math (cron next-3am-UTC, abandoned-balance day calculation).
# `clock` feature pulls in `Utc::now()`; we deliberately skip `serde` since
# we keep epoch-ms `u64` on the wire and only render DateTime for cron
# arithmetic.
chrono = { version = "0.4", default-features = false, features = ["clock"] }
# IANA-TZ-aware datetime math for the per-group scheduled-reset cron
# (each group picks its own admin-local timezone for the calendar
# boundary fires). `chrono-tz` ships the TZ database compiled in, no
# OS dependency. Default features OK — pulls in just `chrono`.
chrono-tz = "0.10"
# SMTP transport for the email-notification adapter. `rustls-tls` keeps
# us off OpenSSL (the rest of the workspace uses rustls everywhere);
# `tokio1-rustls-tls` gives us the async `tokio1` runtime adapter.
# `builder` enables the `Message::builder()` typed-header API.
lettre = { version = "0.11", default-features = false, features = [
"smtp-transport",
"tokio1-rustls-tls",
"builder",
"hostname",
] }
# JWT signing for FCM (RS256 with the service-account RSA key) and for
# VAPID (ES256 with the pool's P-256 private key). One crate, both algos.
jsonwebtoken = "9"
# Base64 + base64url encoding for VAPID `k=` header + general use.
base64 = "0.22"
# Test fixtures + scratch dirs
tempfile = "3"
# Internal crates — declared centrally so consumers do
# bp-common = { workspace = true }
# without repeating the path.
bp-common = { path = "crates/bp-common" }
bp-config = { path = "crates/bp-config" }
bp-db = { path = "crates/bp-db" }
bp-bitcoin = { path = "crates/bp-bitcoin" }
bp-template-distribution = { path = "crates/bp-template-distribution" }
bp-share = { path = "crates/bp-share" }
bp-mining-job = { path = "crates/bp-mining-job" }
bp-vardiff = { path = "crates/bp-vardiff" }
bp-jobs-lifecycle = { path = "crates/bp-jobs-lifecycle" }
bp-inflight-cache = { path = "crates/bp-inflight-cache" }
bp-cron-utils = { path = "crates/bp-cron-utils" }
bp-coinbase-snapshot = { path = "crates/bp-coinbase-snapshot" }
bp-pplns = { path = "crates/bp-pplns" }
bp-pplns-engine = { path = "crates/bp-pplns-engine" }
bp-group-solo-engine = { path = "crates/bp-group-solo-engine" }
bp-group-mgmt = { path = "crates/bp-group-mgmt" }
bp-group-mgmt-engine = { path = "crates/bp-group-mgmt-engine" }
bp-blockparty = { path = "crates/bp-blockparty" }
bp-blockparty-engine = { path = "crates/bp-blockparty-engine" }
bp-stats = { path = "crates/bp-stats" }
bp-share-stats-sink = { path = "crates/bp-share-stats-sink" }
bp-session-persistence = { path = "crates/bp-session-persistence" }
bp-share-hook = { path = "crates/bp-share-hook" }
bp-share-stream = { path = "crates/bp-share-stream" }
bp-mining-mode = { path = "crates/bp-mining-mode" }
bp-notifications = { path = "crates/bp-notifications" }
bp-stratum-v1 = { path = "crates/bp-stratum-v1" }
bp-stratum-v2 = { path = "crates/bp-stratum-v2" }
bp-protocol-detect = { path = "crates/bp-protocol-detect" }
bp-api = { path = "crates/bp-api" }
bp-metrics = { path = "crates/bp-metrics" }
bp-geoip = { path = "crates/bp-geoip" }
bp-regtest-harness = { path = "crates/bp-regtest-harness" }
bp-test-support = { path = "crates/bp-test-support" }
# Workspace-wide lints. Each crate opts in with `[lints] workspace = true`.
[workspace.lints.rust]
unsafe_code = "deny"
unused_must_use = "deny"
unreachable_pub = "warn"
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
print_stdout = "deny"
print_stderr = "deny"
dbg_macro = "deny"
todo = "warn"
unimplemented = "warn"
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
strip = "symbols"
[profile.dev]
opt-level = 0
debug = true