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

Improve Issues Around Waiting for Safe Txs #719

Merged
merged 4 commits into from
Jan 3, 2025
Merged

Conversation

rauljordan
Copy link
Collaborator

@rauljordan rauljordan commented Jan 2, 2025

This PR fixes a bug in the functions waitForTxToBeSafe inside the BoLD repo. These functions used to check that a tx receipt has passed a configured, safe block number. However, in a bad merge, it was edited to just compare against latest, which was incorrect. This led to a variety of UX issues in the BoLD v2 testnet and more egregious errors around attempting to send a ton of timer update txs at the end of a challenge.

This PR also fixes the DB methods to use latest block number, as it is important our DB captures all data that is posted, even if it is reorged later. The DB does not need to be reorg safe as it is purely for informational purposes and data analysis. We also a removed a method to fetch the latest confirmed assertion via the rest API, as this can easily be retrieved via other means. The reason it was removed is because it was using several methods that were hard to configure the block number for, and it is just unnecessary in general.

@rauljordan rauljordan marked this pull request as draft January 2, 2025 19:39
@rauljordan rauljordan marked this pull request as ready for review January 2, 2025 20:13
@rauljordan rauljordan requested review from eljobe and amsanghi January 2, 2025 20:14
@@ -167,7 +168,7 @@ func (cc *challengeConfirmer) beginConfirmationJob(
}

onchainInheritedTimer, err := retry.UntilSucceeds(ctx, func() (protocol.InheritedTimer, error) {
timer, innerErr := royalRootEdge.SafeHeadInheritedTimer(ctx)
timer, innerErr := royalRootEdge.LatestInheritedTimer(ctx)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The internal call to the solidity will use the configured block number, so it will still use safe underneath the hood if the user desires

Copy link
Member

Choose a reason for hiding this comment

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

I feel like this would be a good candidate for some in-code documentation (a.k.a. a comment.)

@rauljordan rauljordan enabled auto-merge (squash) January 2, 2025 20:16
Copy link
Member

@eljobe eljobe left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -167,7 +168,7 @@ func (cc *challengeConfirmer) beginConfirmationJob(
}

onchainInheritedTimer, err := retry.UntilSucceeds(ctx, func() (protocol.InheritedTimer, error) {
timer, innerErr := royalRootEdge.SafeHeadInheritedTimer(ctx)
timer, innerErr := royalRootEdge.LatestInheritedTimer(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this would be a good candidate for some in-code documentation (a.k.a. a comment.)

@rauljordan rauljordan merged commit cb6922f into main Jan 3, 2025
4 of 5 checks passed
@rauljordan rauljordan deleted the improve-finality-issues branch January 3, 2025 12:32
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