Skip to content

Optimise slow block verification tests - #9274

Merged
mergify[bot] merged 5 commits into
sigp:unstablefrom
jimmygchen:optimize-block-verification-tests
Jun 5, 2026
Merged

Optimise slow block verification tests#9274
mergify[bot] merged 5 commits into
sigp:unstablefrom
jimmygchen:optimize-block-verification-tests

Conversation

@jimmygchen

@jimmygchen jimmygchen commented May 7, 2026

Copy link
Copy Markdown
Member

Issue Addressed

Reduce CI time for block_verification tests that exceed 120s on Fulu/Gloas forks.

  • Cache the chain segment across tests using LazyLock<OnceCell> (was rebuilt 10+ times independently)
  • Reduce chain length from 320 to 192 slots (10 epochs to 6 epochs)
  • Reduce BLOCK_INDICES from 7 to 3
  • Reduce chain_segment_varying_chunk_size from 5 to 3

AI assisted, self reviewed.

Before vs After comparison (1 sample only):

  • Before: 19 tests exceeded the 120s slow threshold.
  • After: zero exceed it. Overall: 1,890s down to 797s (-58%).
| Test                                                 |  Before |   After |  Change |
|------------------------------------------------------|---------|---------|---------|
| chain_segment_varying_chunk_size                     |   239s  |     98s |    -59% |
| invalid_signature_attester_slashing                  |   175s  |     64s |    -64% |
| invalid_signature_exit                               |   173s  |     62s |    -64% |
| invalid_signature_deposit                            |   170s  |     60s |    -65% |
| invalid_signature_attestation                        |   165s  |     62s |    -63% |
| invalid_signature_proposer_slashing                  |   161s  |     56s |    -66% |
| block_gossip_verification                            |   154s  |     91s |    -41% |
| invalid_signature_block_proposal                     |   151s  |     58s |    -61% |
| invalid_signature_randao_reveal                      |   149s  |     54s |    -64% |
| invalid_signature_gossip_block                       |   135s  |     46s |    -66% |
|------------------------------------------------------|---------|---------|---------|
| TOTAL                                                |  1890s  |    797s |    -58% |

@jimmygchen
jimmygchen force-pushed the optimize-block-verification-tests branch from 2ae4bd6 to f6bbfb6 Compare May 7, 2026 06:02
@jimmygchen jimmygchen added the test improvement Improve tests label May 7, 2026
@jimmygchen jimmygchen added the ready-for-review The code is ready for review label May 14, 2026
@jimmygchen jimmygchen added the low-hanging-fruit Easy to resolve, get it before someone else does! label Jun 5, 2026

@pawanjay176 pawanjay176 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pawanjay176 pawanjay176 added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jun 5, 2026
@mergify mergify Bot added the queued label Jun 5, 2026
@mergify

mergify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 50 minutes 4 seconds in the queue, including 19 minutes 37 seconds running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@pawanjay176

Copy link
Copy Markdown
Member

@mergify requeue

@mergify

mergify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 30 minutes 33 seconds in the queue, including 28 minutes 48 seconds running CI.

Required conditions to merge

@mergify mergify Bot added queued and removed dequeued labels Jun 5, 2026
mergify Bot added a commit that referenced this pull request Jun 5, 2026
@mergify
mergify Bot merged commit 65f1a83 into sigp:unstable Jun 5, 2026
38 checks passed
@mergify mergify Bot removed the queued label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

low-hanging-fruit Easy to resolve, get it before someone else does! ready-for-merge This PR is ready to merge. test improvement Improve tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants