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

fix: don't abort broadcast if signers are unavailable #4104

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Conversation

dandanlen
Copy link
Collaborator

Pull Request

Closes: PRO-886

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

@linear
Copy link

linear bot commented Oct 11, 2023

PRO-886 Don't abort broadcast if signers unavailable.

In start_broadcast_attempt in the broadcast pallet, we assume that we can always select a single signer/broadcaster for a transaction. If we can't we effectively abort the broadcast. The assumption is that this can't happen on a live network. Mostly, this is true, however it's not logically impossible and on small networks it can happen (and did occur on Sisyphos).

We should be more defensive and instead schedule the broadcast to be retried as long as we haven't exhausted all of the singers (check FailedBroadcasters storage).

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #4104 (cd2be9c) into main (e79b88c) will increase coverage by 0%.
Report is 3 commits behind head on main.
The diff coverage is 94%.

@@          Coverage Diff          @@
##            main   #4104   +/-   ##
=====================================
  Coverage     71%     71%           
=====================================
  Files        377     377           
  Lines      59967   60035   +68     
  Branches   59967   60035   +68     
=====================================
+ Hits       42717   42769   +52     
- Misses     15008   15022   +14     
- Partials    2242    2244    +2     
Files Coverage Δ
state-chain/pallets/cf-broadcast/src/lib.rs 83% <94%> (+1%) ⬆️

... and 12 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dandanlen dandanlen requested a review from kylezs October 11, 2023 11:19
@dandanlen dandanlen changed the title Feature/pro-886 fix: don't abort broadcast if signers are unavailable Oct 11, 2023
"Failed to select a signer for broadcast {:?}. Scheduling Retry",
broadcast_attempt.broadcast_attempt_id
);
BroadcastRetryQueue::<T, I>::append(&broadcast_attempt);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also emit BroadcastRetryScheduled - can be pulled into a function since we do this inside transaction_signing_failure too

@dandanlen dandanlen merged commit 0887c9a into main Oct 12, 2023
44 checks passed
@dandanlen dandanlen deleted the feature/pro-886 branch October 12, 2023 14:50
syan095 added a commit that referenced this pull request Oct 12, 2023
* origin/main:
  Feat: Set pool fees (#4050)
  fix: don't egress empty all_batch calls (#4102)
  fix: don't abort broadcast if signers are unavailable (#4104)
  feat: add restricted balances to AccountInfoV2 (#4048)
  feat: use snake case for lp api method names (#4108)
  feat: add expiry block to liquidity channel event (#4111)

# Conflicts:
#	state-chain/custom-rpc/src/lib.rs
#	state-chain/runtime/src/lib.rs
#	state-chain/runtime/src/runtime_apis.rs
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.

None yet

2 participants