• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Chia-Network / chia-blockchain / 39258501453
90%

Build:
DEFAULT BRANCH: main
Ran 19 Oct 2026 03:20PM UTC
Jobs 1
Files 940
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Oct 2026 11:21AM UTC coverage: 90.33% (-0.02%) from 90.349%
39258501453

push

github

web-flow
cap the batch size when creating block generators (#21418)

<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->

### Purpose:

feed the block builder/serializer smaller batches of work. In case it's
slow, we'll get stuck for a shorter time before checking the timeout.

### Current Behavior:

We maximize the batch

### New Behavior:

We submit the batch as soon as it exceeds 100 spends

<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->

### Testing Notes:

<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes farming/block-assembly batching in a hot path; behavior under
timeout or very large items may differ, but consensus limits and
inclusion rules are unchanged.
> 
> **Overview**
> **Block generator creation** now flushes pending mempool transactions
to `BlockBuilder` in smaller chunks instead of growing one batch until
block cost is hit.
> 
> `create_block_generator2()` introduces **`MAX_SPENDS_PER_BATCH`
(100)** and commits the in-flight batch when adding the next item would
push **`batch_spends + len(unique_coin_spends)`** over that limit (in
addition to the existing max-block-cost flush). The goal is to bound
work per `add_spend_bundles()` call so the generation **timeout** can be
checked between batches. A single mempool item with more than 100 spends
is still submitted as **one** batch—it is not split.
> 
> A new unit test **`test_create_block_generator2_spend_batch_cap`**
monkeypatches `BlockBuilder.add_spend_bundles` and asserts batch sizes
`[50, MAX_SPENDS_PER_BATCH + 5]` for 50 single-spend items p... (continued)

20045 of 25014 branches covered (80.14%)

Branch coverage included in aggregate %.

25 of 25 new or added lines in 2 files covered. (100.0%)

21 existing lines in 8 files now uncovered.

117986 of 127793 relevant lines covered (92.33%)

1.85 hits per line

Coverage Regressions

Lines Coverage ∆ File
7
77.16
-0.89% chia/daemon/server.py
7
80.15
-1.76% chia/server/server.py
2
86.16
-0.18% chia/full_node/full_node_api.py
1
84.38
-0.04% chia/full_node/full_node.py
1
84.29
-0.2% chia/seeder/dns_server.py
1
89.38
1.33% chia/_tests/core/util/test_lockfile.py
1
96.88
-3.13% chia/_tests/util/test_replace_str_to_bytes.py
1
91.67
-1.67% chia/util/files.py
Jobs
ID Job ID Ran Files Coverage
1 39258501453.1 19 Oct 2026 03:20PM UTC 1880
90.33
GitHub Action Run
Source Files on build 39258501453
  • Tree
  • List 940
  • Changed 18
  • Source Changed 2
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #39258501453
  • f7162427 on github
  • Prev Build on main (#39035397859)
  • Next Build on main (#39283186220)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc