fix(broadcast): survive the Credible RPC alignment window - #124
Draft
lean-apple wants to merge 4 commits into
Draft
fix(broadcast): survive the Credible RPC alignment window#124lean-apple wants to merge 4 commits into
lean-apple wants to merge 4 commits into
Conversation
A Credible RPC endpoint refuses to judge a transaction while its assertion state trails the chain head, and that refusal is raised both before the transaction is forwarded and after, so the error alone cannot say whether anything was submitted. Retrying it blindly risked a second transaction on the same nonce, so activation failed instead. Sign one envelope and resubmit those exact bytes: identical hash and nonce mean a node can only deduplicate the retry. Each attempt first asks the endpoint whether it already holds the hash, which is the only reliable answer to what the refusal leaves open. Gas estimation is gated the same way and is retried before anything is signed. When the window outlasts the retries the two outcomes stay distinct: `onchain.assertions_unavailable` guarantees nothing was submitted, while `onchain.tx_submission_unconfirmed` carries the signed hash to reconcile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Credible RPC can briefly return
assertions are unavailablewhile its assertion state catches up with the chain. This PR makes PCL wait through that window without risking a duplicate transaction.What changed
Verification
Mocked RPC tests cover failures before and after forwarding, transport failures, safe resubmission, deduplication, nonce handling, assertion rejection, receipt confirmation, and timeout boundaries.
Resolves ENG-4467