Skip to content

chore(contract-manager) Entropy stress test script #2588

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

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

Conversation

aditya520
Copy link
Member

@aditya520 aditya520 commented Apr 16, 2025

Summary

Added a script that can send multiple requests from a single wallet to test Entropy.

npx ts-node latency_entropy_with_callback_stress_test.ts --chain berachain_bepolia --private-key $PRIVATE_KEY --nrequests 10 --delay 1

Rationale

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Copy link

vercel bot commented Apr 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2025 4:34pm
component-library ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2025 4:34pm
entropy-debugger ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2025 4:34pm
insights ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2025 4:34pm
proposals ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2025 4:34pm
staking ⬜️ Ignored (Inspect) Visit Preview Apr 17, 2025 4:34pm

Copy link
Collaborator

@m30m m30m left a comment

Choose a reason for hiding this comment

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

Let's merge this script with latency_entropy_with_callback. the shared logic is a lot and this is essentially a superset of the other script.

contract: EvmEntropyContract,
privateKey: PrivateKey,
requestId: number,
): Promise<{ EntropyRequestResponse: any; startTime: number }> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't we use something better than any?

Copy link
Member Author

@aditya520 aditya520 Apr 17, 2025

Choose a reason for hiding this comment

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

This is just the transaction turn object that we get from requestRandomness

},
"delay": {
type: "number",
desc: "delay between requests",
Copy link
Collaborator

Choose a reason for hiding this comment

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

mention that it is in seconds

Copy link
Member Author

Choose a reason for hiding this comment

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

ms

"delay": {
type: "number",
desc: "delay between requests",
default: 25,
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like a very specific number. any reason?

Copy link
Member Author

@aditya520 aditya520 Apr 17, 2025

Choose a reason for hiding this comment

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

Nope, just felt like it. 😅

@aditya520 aditya520 requested a review from m30m April 21, 2025 14:48
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.

2 participants