fix(bridge-exec): skip generation when mosaic setup is unavailable#629
fix(bridge-exec): skip generation when mosaic setup is unavailable#629Rajil1213 wants to merge 7 commits into
Conversation
Prometheus exporter startup requires a Tokio runtime context which it did not previously have
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb97ecc94c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| actual_game_index = %actual_game_index, | ||
| "mosaic setup is already consumed" | ||
| ); | ||
| Ok(false) |
There was a problem hiding this comment.
Reuse same-game consumed setups before skipping
When a prior attempt gets through complete_adaptor_sigs but the node crashes or fails before publish_signed_transaction, Mosaic will report this same game as Consumed. The API explicitly makes complete_adaptor_sigs idempotent and able to return existing signatures, but this arm maps every Consumed state to false, so generate_and_publish_counterproof returns Ok(()) and all future retries skip publishing the counterproof, letting a contested invalid claim time out. Please distinguish actual_game_index == game_index from a consumed setup for an older game and retrieve/reuse the completed signatures for the same game.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #629 +/- ##
==========================================
- Coverage 87.21% 87.16% -0.05%
==========================================
Files 249 249
Lines 27882 27927 +45
==========================================
+ Hits 24316 24343 +27
- Misses 3566 3584 +18
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This handles a scenario where a watchtower generates the counterproof, completes the signatures but then crashes before the counterproof tx can be broadcasted. We want the watchtower to retry broadcasting the counterproof tx without failing the setup-consumed guard.
|
@codex review. |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Description
This PR adds a guard in the counterproof generation executor so that the node does not start generating the counterproof if the associated mosaic setup has already been consumed (by some other counterproof). The functional test for this relies on the prometheus metrics for number of counterproof generations. There was a bug in how the metrics harness had been setup resulting in it being outside the tokio runtime. This has also been fixed as part of this PR.
Codex was used to implement these changes.
Type of Change
Notes to Reviewers
Checklist
Related Issues
Closes STR-3748