Skip to content

Conversation

@usmansaleem
Copy link
Collaborator

@usmansaleem usmansaleem commented Oct 27, 2025

PR Description

Performance test to investigate timeouts of aggregation slot timeouts in Teku.


Note

Adds a 30k-validator aggregation-slot signing load test (batched, concurrent, throttled) and includes Teku metrics dependencies.

  • Acceptance Tests:
    • Performance Load Test: Introduces AggregationSlotLoadTest to stress Eth2 AGGREGATION_SLOT signing for 30,000 validators.
      • Covers batched (4 slots per batch with 500ms delay), fully concurrent, and limited-concurrency (priority queue) scenarios.
      • Uses custom HTTP client to send /api/v1/eth2/sign/{pubkey} requests and verifies signatures against local BLS.
      • Generates and registers validator keys, then verifies all keys are loaded before tests.
  • Build/Dependencies:
    • Adds tech.pegasys.teku.internal:metrics and its test-fixtures to acceptance-tests.
    • Includes metrics in the managed tech.pegasys.teku.internal dependency set in gradle/versions.gradle.

Written by Cursor Bugbot for commit f6beb1a. This will update automatically on new commits. Configure here.


for (int i = 0; i < validatorsPerSlot; i++) {
final int validatorIdx = (int) (slot * validatorsPerSlot + i);
if (validatorIdx >= NUM_VALIDATORS) break;

Check warning

Code scanning / CodeQL

Useless comparison test Warning test

Test is always false, because of
this condition
.
Test is always false, because of
this condition
.
Test is always false, because of
this condition
.

for (int i = 0; i < validatorsForSlot; i++) {
final int validatorIdx = (int) (slot * validatorsPerSlot + i);
if (validatorIdx >= NUM_VALIDATORS) break;

Check warning

Code scanning / CodeQL

Useless comparison test Warning test

Test is always false, because of
this condition
.
Test is always false, because of
this condition
.
Test is always false, because of
this condition
.
for (int i = 0; i < validatorsPerSlot; i++) {
final int validatorIdx = (int) (slot * validatorsPerSlot + i);
if (validatorIdx >= NUM_VALIDATORS) break;

Copy link

Choose a reason for hiding this comment

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

Bug: Validator Index Calculation Fails for Uneven Divisions

The validator index calculation in testAggregationSlotBatchedLoad() does not account for remaining validators when NUM_VALIDATORS is not evenly divisible by 32. With NUM_VALIDATORS=30000 and 32 slots, validatorsPerSlot=937 with 16 remaining validators. The calculation validatorIdx = slot * validatorsPerSlot + i for slot 31 produces indices up to 29963, missing the last 37 validators (29964-30000). The test will not cover all 30000 validators as intended.

Fix in Cursor Fix in Web

for (int i = 0; i < validatorsForSlot; i++) {
final int validatorIdx = (int) (slot * validatorsPerSlot + i);
if (validatorIdx >= NUM_VALIDATORS) break;

Copy link

Choose a reason for hiding this comment

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

Bug: Validator Index Mismatch in Test

The validator index calculation in testAggregationSlotWithLimitedConcurrency() is inconsistent with the validator count for the last slot. While validatorsForSlot correctly accounts for remaining validators (line 326-327), the validatorIdx calculation at line 330 uses slot * validatorsPerSlot + i which does not account for the remaining validators. For slot 31, this produces indices 29027-29979, when it should produce 29027-29999. This causes 20 validators to be omitted from testing.

Fix in Cursor Fix in Web

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant