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

Debug failures #23

Merged
merged 9 commits into from
Dec 12, 2023
Merged

Debug failures #23

merged 9 commits into from
Dec 12, 2023

Conversation

jeremy-then
Copy link
Contributor

@jeremy-then jeremy-then commented Dec 9, 2023

The changes on this PR fix the issues we have had recently with executions failing more than normal.

It turns out that sometimes when we send a transaction to the rsk or bitcoin network, the transaction can take a bit longer to reach those blockchain's mempool. Before, we were simply mining a block right after sending the transaction, thinking that it was immediately ready to be mined, but some times it is not and we didn't mine it, hence, some assertions fail.

Now, the new logic on this pr simply waits for new transactions or a specific transaction to get to the bitcoin and rsk mempool before mining.

The idea is that after sending any transaction to the bitcoin and rsk networks, before proceeding to mine and continue, we should allow enough time for the tx to get to the mempool first. This doesn't happen all the time, and usually depends on the resources that the computer running these tests have, since there are many services running independently at once while running the tests.

The waitAndUpdateBridge function was moved from the 2wp.utils.js file to the rsk-utils.js file to avoid circular dependency since it is now required in the rsk-utils.js file and the 2wp.utils.js is already importing the rsk-utils.js module.

The retryWithCheck function was refactored to return an option with the result and the current attempts where it found (or not) the result. This can be useful for debugging.

This pr includes the changes of the pr #20. So, once this is merged, we can close the other.

@jeremy-then jeremy-then requested a review from a team as a code owner December 9, 2023 04:04
@jeremy-then
Copy link
Contributor Author

pipeline:run

8 similar comments
@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipelinee:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

@jeremy-then
Copy link
Contributor Author

pipeline:run

lib/rsk-utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
lib/utils.js Outdated Show resolved Hide resolved
lib/rsk-utils.js Outdated Show resolved Hide resolved
lib/rsk-utils.js Outdated Show resolved Hide resolved
@jeremy-then jeremy-then self-assigned this Dec 12, 2023
marcos-iov
marcos-iov previously approved these changes Dec 12, 2023
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@nathanieliov nathanieliov left a comment

Choose a reason for hiding this comment

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

LGTM

@marcos-iov marcos-iov merged commit 5f6fadc into main Dec 12, 2023
4 checks passed
@marcos-iov marcos-iov deleted the debug-failures branch December 12, 2023 19:08
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.

3 participants