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

[tmpnet] Minimize duration of tx acceptance for e2e testing #3685

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maru-ava
Copy link
Contributor

Why this should be merged

Faster tests mean faster iteration

How this works

  • Enable configuration of min block delay for primary subnet with the addition of node flag --proposer-min-block-delay
  • Configure tmpnet to default the block delay to zero for all subnets
  • Reduce the wallet poll interval from 100ms to 10ms
  • Remove unnecessary sleep in virtuous test

How this was tested

CI against regression, manually verified decreased runtime

Need to be documented in RELEASES.md?

New node flag should be documented.

@maru-ava maru-ava added the testing This primarily focuses on testing label Jan 30, 2025
@maru-ava maru-ava self-assigned this Jan 30, 2025
@maru-ava maru-ava force-pushed the tmpnet-minimize-tx-acceptance-duration branch from d55ad5a to 021ba8f Compare January 30, 2025 00:14
@maru-ava maru-ava marked this pull request as draft January 30, 2025 00:51
@maru-ava maru-ava force-pushed the tmpnet-minimize-tx-acceptance-duration branch from 021ba8f to 6d51c62 Compare January 30, 2025 02:46
@maru-ava maru-ava marked this pull request as ready for review January 30, 2025 02:47
config/flags.go Outdated Show resolved Hide resolved
Copy link
Contributor

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

  1. What's the overall time saved?
  2. Reduce the wallet poll interval from 100ms to 10ms - just as a word of warning, getting close to millisecond in tests can be risky on CI running on shared/slow runners, and produce flaky tests, just because the runner is slow and things take milliseconds to execute... think Pentium 4 running CI 😄

@@ -76,3 +78,11 @@ func DefaultChainConfigs() map[string]FlagsMap {
},
}
}

// A set of subnet configuration appropriate for testing.
func DefaultSubnetConfig() FlagsMap {
Copy link
Contributor

Choose a reason for hiding this comment

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

since this is only used in this package, can we unexport it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tmpnet is used by other repos - including subnet-evm and hypersdk - and the intention is for reuse.

@maru-ava
Copy link
Contributor Author

maru-ava commented Jan 30, 2025

  1. What's the overall time saved?

I wasn't too concerned with total time saved. The goal was speeding up perceived execution speed when running interactively iterating. It is noticeably faster even without timing.

For a given transaction, a min block delay of 1s ensures that a set of sequentially executed transactions (as is commonly done in a test that uses a single wallet) take a minimum of 1s per transaction. In Stephen's example PR with a polling interval of 1ms, tx acceptance could approach that lower bound. I considered 1ms potentially problematic in the context of CI, though, so bumped the interval to 10ms. Going from a minimum of 1s to a minimum of 10ms is a pretty nice speedup!

  1. Reduce the wallet poll interval from 100ms to 10ms - just as a word of warning, getting close to millisecond in tests can be risky on CI running on shared/slow runners, and produce flaky tests, just because the runner is slow and things take milliseconds to execute... think Pentium 4 running CI 😄

Sure, that's why I didn't go all the way down to 1ms. If its flakey, we'll adjust it.

- Enable configuration of min block delay for primary subnet with
  the addition of node flag `--proposer-min-block-delay`
- Configure tmpnet to default the block delay to zero for all subnets
- Reduce the wallet poll interval from 100ms to 10ms
- Remove unnecessary sleep in virtuous test
@maru-ava maru-ava force-pushed the tmpnet-minimize-tx-acceptance-duration branch from 6d51c62 to a392bdb Compare January 30, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing This primarily focuses on testing
Projects
Status: In Review 👀
Development

Successfully merging this pull request may close these issues.

3 participants