Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(bridge-exec): skip generation when mosaic setup is unavailable#629

Open
Rajil1213 wants to merge 7 commits into
mainfrom
STR-3748-check-availability-of-GC-before-generating-counterproof
Open

fix(bridge-exec): skip generation when mosaic setup is unavailable#629
Rajil1213 wants to merge 7 commits into
mainfrom
STR-3748-check-availability-of-GC-before-generating-counterproof

Conversation

@Rajil1213

@Rajil1213 Rajil1213 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added (where necessary) tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.
  • I have disclosed my use of AI in the body of this PR.

Related Issues

Closes STR-3748

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread crates/mosaic-client/src/client.rs Outdated
actual_game_index = %actual_game_index,
"mosaic setup is already consumed"
);
Ok(false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@Rajil1213 Rajil1213 Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in e614848.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.21739% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.16%. Comparing base (e04c83b) to head (e614848).

Files with missing lines Patch % Lines
crates/bridge-exec/src/graph/counterproof.rs 76.31% 9 Missing ⚠️
@@            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     
Files with missing lines Coverage Δ
bin/strata-bridge/src/main.rs 87.50% <100.00%> (-4.17%) ⬇️
crates/mosaic-client/src/client.rs 93.93% <100.00%> (-0.35%) ⬇️
crates/mosaic-client/src/lib.rs 74.09% <100.00%> (+4.81%) ⬆️
crates/bridge-exec/src/graph/counterproof.rs 88.19% <76.31%> (-2.39%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@Rajil1213

Copy link
Copy Markdown
Collaborator Author

@codex review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ 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".

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.

1 participant