Skip to content

[LIMIT_HEAP] Test chia_rs branch that rejects LIMIT_HEAP in run_block_generator2 - #20651

Closed
richardkiss wants to merge 8 commits into
Chia-Network:mainfrom
richardkiss:limit-heap-error
Closed

[LIMIT_HEAP] Test chia_rs branch that rejects LIMIT_HEAP in run_block_generator2#20651
richardkiss wants to merge 8 commits into
Chia-Network:mainfrom
richardkiss:limit-heap-error

Conversation

@richardkiss

Copy link
Copy Markdown
Contributor

Summary

This PR pins chia_rs to commit 8bcf2006d8730e56c9a2e15ecafa8222f8c87089 from Chia-Network/chia_rs#1396, which makes run_block_generator2 return an error if the LIMIT_HEAP flag is set.

This is a CI test PR — not intended to merge. Its purpose is to reveal which chia-blockchain tests break when LIMIT_HEAP is rejected by the consensus code path.

Background

LIMIT_HEAP is a mempool-policy flag that caps the CLVM allocator to 500 MB. It should not appear in run_block_generator2, which is a consensus code path. Any caller passing MEMPOOL_MODE (which includes LIMIT_HEAP) to run_block_generator2 is mixing mempool policy into consensus validation — a separation-of-concerns bug.

Known suspects in this repo:

  • chia/full_node/full_node_rpc_api.py — calls run_block_generator2 with MEMPOOL_MODE
  • chia/_tests/util/get_name_puzzle_conditions.py — does the same when mempool_mode=True

Changes

  • pyproject.toml: switch chia_rs from PyPI version range to git dependency at the above commit
  • poetry.lock: regenerated to reflect the git source
  • .github/actions/install/action.yml: add Rust toolchain setup (required to build chia_rs from source)

What to look for in CI

Any test failures with GeneratorRuntimeError (error code 117) or similar indicate a call site that should be fixed before the chia_rs PR merges.

Made with Cursor

…sensus tests

This change adds `@pytest.mark.limit_consensus_modes` markers to 9 tests that
don't actually test consensus rule differences. These tests were being run 5x
each (once for each consensus mode: PLAIN, HARD_FORK_2_0, SOFT_FORK_2_6,
HARD_FORK_3_0, HARD_FORK_3_0_AFTER_PHASE_OUT) when they only need to run once.

Tests modified:
- test_wallet_node.py: 3 tests (puzzle hash subscription, error handling)
- test_coin_management.py: 3 tests (CLI argument parsing)
- test_full_node_rpc.py: 3 tests (RPC error handling and mempool queries)

Impact: Reduces test runs by ~80% for these specific tests (5x -> 1x).
Combined with similar optimizations across the test suite, this could reduce
overall test time by 30-40%.

The tests marked test application logic, RPC interfaces, CLI parsing, and
error handling - none of which depend on consensus rule variations.

Made-with: Cursor
…ting

Uses chia_rs@8bcf2006 (Chia-Network/chia_rs#1396) which makes
run_block_generator2 return an error if LIMIT_HEAP is set in flags.

This PR exists to see which chia-blockchain tests break when LIMIT_HEAP
is rejected by the consensus code path. Any test failures indicate sites
that pass MEMPOOL_MODE (which includes LIMIT_HEAP) to run_block_generator2
— a separation-of-concerns bug.

Adds Rust toolchain setup to the install action so poetry can build
chia_rs from source.

Made-with: Cursor
Previous pin was at the "audit" state (callers not updated). This
points to the cleaned-up commit where all callers of run_block_generator2
have LIMIT_HEAP stripped, so CI should pass if no other call sites
in chia-blockchain are affected.

Made-with: Cursor
… wheel check

- poetry.lock was generated with poetry 2.3.2 locally; CI uses 2.2.1,
  causing the poetry pre-commit hook to re-lock and fail
- add chia_rs to excepted_packages in check_dependency_artifacts.py
  since it is a git dependency for this test branch (no PyPI wheel)

Made-with: Cursor
partition('-') on 'chia-rs-0.39.0.zip' yields name='chia', not
'chia_rs'. Use a regex to split at the version boundary instead.

Made-with: Cursor
LIMIT_HEAP is a mempool policy flag that caps the CLVM allocator to
500MB. run_block_generator2 now rejects it to prevent accidentally
applying this mempool restriction on the consensus path.

Update the three call sites that passed MEMPOOL_MODE (which includes
LIMIT_HEAP) to run_block_generator2:
- full_node_rpc_api.py: create_block_generator validation
- _tests/util/get_name_puzzle_conditions.py: strip when dispatching to run_block_generator2
- _tests/core/mempool/test_mempool_manager.py: two validation calls

Made-with: Cursor
@github-actions github-actions Bot added the merge_conflict Branch has conflicts that prevent merge to main label Mar 13, 2026
@richardkiss

Copy link
Copy Markdown
Contributor Author

Closing — LIMIT_HEAP test PR, tied to chia_rs #1396. Will be obsolete once #1396 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge_conflict Branch has conflicts that prevent merge to main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant