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

test: bouncer script to init swaps and send sol #5579

Open
wants to merge 4 commits into
base: release/1.7
Choose a base branch
from

Conversation

Janislav
Copy link
Contributor

@Janislav Janislav commented Jan 21, 2025

Pull Request

Closes: PRO-xxx

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have written sufficient tests.
  • I have written and tested required migrations.
  • I have updated documentation where appropriate.

Summary

Please include a succinct description of the purpose and content of the PR. What problem does it solve, and how? Link issues, discussions, other PRs, and anything else that will help the reviewer.

@Janislav Janislav marked this pull request as ready for review January 21, 2025 13:26
@Janislav Janislav requested a review from kylezs January 21, 2025 13:26
Base automatically changed from feat/1.7.7-fixes to release/1.7 January 22, 2025 16:56
Copy link
Contributor

@kylezs kylezs left a comment

Choose a reason for hiding this comment

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

Also, we should probably make this a PR to main now instead of 1.7.

const depositAddresses = await requestBatchOfSwaps(batchSize);
console.log(`Sent funds to ${depositAddresses.length} deposit channels`);
for (const depositAddress of depositAddresses) {
await sendSol(depositAddress, solAmount);
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned IRL, we should add a small amount of SOL as we go so each amount is different, otherwise the RPC will dedupe them.
You can just copy what's in spam_sol.ts:

solAmount = solAmount.plus(new BigNumber(1).div(10 ** decimals));

// Opens 1000 deposit channels
// Execute: ./commands/run_test.ts spam_solana_deposit_channels.ts
async function main() {
const batches = 200;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is too many batches for a bouncer run, will take a long time to complete. We can drop this to around 10 and get most of the benefit, in particular because it'll be running alongside all the other tests.
For manual testing, we can always increase this value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, definitely. I think it doesn't really make senses to run this automatic at all in my opinion, since it is pretty hard to verify the expected result. The idea was to have this more as a tool to debug a network.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we even want to have this permanently in our code base though :/

Copy link
Contributor

@kylezs kylezs Jan 29, 2025

Choose a reason for hiding this comment

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

Yeah, we can probably just leave it as a manual script, or delete it, I don't mind either way. Deleting is probably better for maintainability

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