Commit e122913
authored
execution/stagedsync: check batch fullness after every block (#21193)
## Summary
Move the batch-fullness check out of a 5-second ticker and into
per-block. When blocks process quickly, exec was overshooting the
configured `--batchSize` by hundreds of MB between ticks. With 4 blk/s
and 33 MB of CommitmentVals per block, 5 s of unchecked exec adds ~660
MB to the buffer — well past a configured 100 MB or 256 MB batchSize.
Smaller batchSize → worse overshoot ratio.
The check itself is cheap (a single
`readState().SizeEstimateBeforeCommitment()` call), so per-block is
fine.
This lets `--batchSize` actually bound the per-commit working set, which
directly bounds the per-CommitCycle trie-hash cost — the dominant
slowdown source on heavy-state runs.
## Test plan
- [ ] CI on `performance`
- [ ] Mainnet sync still healthy1 parent e574a75 commit e122913
1 file changed
Lines changed: 11 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
| |||
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
241 | 235 | | |
242 | 236 | | |
243 | 237 | | |
244 | 238 | | |
245 | | - | |
| 239 | + | |
| 240 | + | |
246 | 241 | | |
247 | 242 | | |
248 | 243 | | |
| |||
258 | 253 | | |
259 | 254 | | |
260 | 255 | | |
261 | | - | |
262 | 256 | | |
263 | 257 | | |
264 | 258 | | |
| |||
0 commit comments