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

WhaleBasedAccountManager with Retry Mechanism #278

Closed
wants to merge 6 commits into from

Conversation

nadeemb53
Copy link
Contributor

@nadeemb53 nadeemb53 commented Nov 4, 2024

This PR closes #215, which reported intermittent failures in the coordinator's integration tests due to nonce-related and gas price errors. The errors included "Replacement transaction underpriced" and "Nonce too low," originating from the WhaleBasedAccountManager

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Note: Changes are not tested

@thedarkjester
Copy link
Collaborator

It looks like the coordinator tests are failing now, please have a look and adjust accordingly.

see: https://github.com/Consensys/linea-monorepo/actions/runs/11687214785/job/32693999670?pr=278

@nadeemb53
Copy link
Contributor Author

It looks like the coordinator tests are failing now, please have a look and adjust accordingly.

see: https://github.com/Consensys/linea-monorepo/actions/runs/11687214785/job/32693999670?pr=278

I've added a fix in this commit.

Please note that I haven’t yet been able to run the coordinator tests locally. I’ve raised an issue regarding this setup difficulty here.

@jonesho
Copy link
Contributor

jonesho commented Nov 19, 2024

@nadeemb53 The coordinator test is failed again and should be easily fixed by replacing sendWithRetry() return type with EthSendTransaction, btw for running the unit tests locally, you could open the repo in your IDE (preferably IntelliJ) and then run ./gradlew -V coordinator:app:buildNeeded, just like what we did in this github workflow file. Similarily, in the same file, you could also see how we run coordinator integration tests.

result.forEach { (account, transferTx) ->

result.forEach { pair ->
val (account, transferTx) = pair
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be simplified as:

result.forEach { (account, transferTx) ->

@jonesho
Copy link
Contributor

jonesho commented Nov 19, 2024

@nadeemb53 FYI, we have a class called AsyncRetryer which could potentially be used for this case, the caveat is that it assumes the action return type is async and needs to pass in an vertx instance.

@nadeemb53 nadeemb53 closed this Dec 12, 2024
@nadeemb53 nadeemb53 reopened this Dec 12, 2024
@nadeemb53 nadeemb53 had a problem deploying to docker-build-and-e2e December 19, 2024 06:01 — with GitHub Actions Failure
Copy link

cla-assistant bot commented Jan 7, 2025

CLA assistant check
All committers have signed the CLA.

@jpnovais
Copy link
Collaborator

jpnovais commented Feb 5, 2025

Hi @nadeemb53 my apologies for the conflicts, I was not aware of this PR so in one of my PRs I fixed the issue because it was breaking the CI on my PR.

The issue was that when we ran all tests in parallel (can be even different JVM processes), some tests may randomly be assigned the same whale account: Imagine that we have 4 tests sharing the whale account, and they send 4 competing transactions with the same nonce, 3 of them will get an error. These 3 remaining tests just need to retry sending the same transaction with a new nonce until it succeeds (the least lucky one will retry 3 times). Although the proposed solution would work just fine, the current solution with a simple retry works just fine, no need for extra logic for transaction replacement with gasPrice increase.

Since the problem seems to be solved I think we can close this PR?

@nadeemb53
Copy link
Contributor Author

makes sense, i'll close this

@nadeemb53 nadeemb53 closed this Feb 5, 2025
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.

Coordinator Integration Test - Account Manager helper
4 participants