Commit 23e4983
fix: use stability window for slot threshold
- Replace hard-coded blockfetchBatchSlotThreshold with dynamic calculation
- Use correct security parameters based on current era:
* Byron era: K parameter from ByronGenesis.ProtocolConsts.K
* Shelley+ eras: SecurityParam from ShelleyGenesis.SecurityParam
- Update stability window calculation in both chainsync and validation logic
- Calculate stability window as 3k/f for Shelley+ eras, k for Byron era
- Ensures blockfetch operations respect protocol-defined stability window
Fixes the TODO to calculate slot threshold from protocol params
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>1 parent e51acd3 commit 23e4983
File tree
4 files changed
+1569
-38
lines changed- ledger
4 files changed
+1569
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 38 | + | |
| 39 | + | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
| |||
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 270 | + | |
282 | 271 | | |
283 | 272 | | |
284 | 273 | | |
| |||
0 commit comments