Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed up electra attestation tests by 5x #6563

Merged
merged 1 commit into from
Sep 19, 2024
Merged

speed up electra attestation tests by 5x #6563

merged 1 commit into from
Sep 19, 2024

Conversation

tersec
Copy link
Contributor

@tersec tersec commented Sep 19, 2024

Otherwise they take a long time simply to generate their test databases:

[2024-09-18T10:21:57.296Z] 10 longest individual test durations
[2024-09-18T10:21:57.296Z] ------------------------------------
[2024-09-18T10:21:57.296Z]  76.48s for Can add and retrieve simple electra attestations [Preset: mainnet]
[2024-09-18T10:21:57.296Z]  73.19s for Working with electra aggregates [Preset: mainnet]
[2024-09-18T10:21:57.296Z]  72.85s for Aggregated attestations with disjoint comittee bits into a single on-chain aggregate [Preset: mainnet]
[2024-09-18T10:21:57.296Z]  72.82s for Attestations with disjoint comittee bits and equal data into single on-chain aggregate [Preset: mainnet]

or

Attestation pool electra processing [Preset: mainnet] .... (294.4s)

due to the number of validators they generate.

To some extent, this is necessary, because there need to be enough validators to generate at least two committees, to have meaningful tests. But the non-electra attestation tests have some overkill in how many validators/deposits they create, which becomes several cumulative minutes per make test in the Electra attestation pool tests.

This PR brings the total time for test_attestation_pool down to about a minute, from around 5-6 minutes.

Rewards API imports removals are to address some build warnings:

nimbus-eth2/beacon_chain/rpc/rest_rewards_api.nim(15, 3) Warning: imported and not used: 'state_ttl_cache' [UnusedImport]
nimbus-eth2/beacon_chain/rpc/rest_rewards_api.nim(11, 20) Warning: imported and not used: 'sequtils' [UnusedImport]

@tersec tersec enabled auto-merge (squash) September 19, 2024 04:05
Copy link

Unit Test Results

         9 files  ±0    1 355 suites  ±0   41m 5s ⏱️ - 16m 15s
  5 147 tests ±0    4 799 ✔️ ±0  348 💤 ±0  0 ±0 
21 510 runs  ±0  21 106 ✔️ ±0  404 💤 ±0  0 ±0 

Results for commit 5b5c003. ± Comparison against base commit e3fcd8b.

@tersec tersec merged commit e94417c into unstable Sep 19, 2024
11 checks passed
@tersec tersec deleted the fCV branch September 19, 2024 05:46
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