Skip to content

perf(test): chain_index::tests::proptest_blockgen::make_chain is slow (~10.3 s) #1038

@zancas

Description

@zancas

Parent: #1035

Task description

chain_index::tests::proptest_blockgen::make_chain takes ~10.285 s under cargo nextest run on commit cd5d8adc (speed_up_unit_tests). Alongside sync_blocks_after_startup, this test dominates the unit-test wall clock.

Location

packages/zaino-state/src/chain_index/tests/proptest_blockgen.rs:357

Context

Recent commits on this branch already reduced the cost of this file substantially:

  • cd5d8adc — memoize best_branch and add a tx-hash index in ProptestMockchain
  • ef6a4a5c — lower ProptestMockchain delay from 1 s to 100 ms

Further work is needed before this test belongs in the hot unit-test loop.

Acceptance criteria

  • Profile make_chain to identify remaining hot spots (mockchain setup? block generation? state-machine transitions?)
  • Land a fix that either (a) drops wall time below ~2 s at the default proptest case count, or (b) gates the larger case count behind an opt-in feature while keeping a fast smoke version in the default run
  • No regression in the two flakes tracked under the parent: get_mempool_stream_correct_expected_chain_tip and get_mempool_stream_for_stale_snapshot

Area

Testing / CI, chain_index

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt that needs to be addressedtest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions