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

Mobile Verifier Burner Txn Error check #906

Merged
merged 7 commits into from
Dec 4, 2024
Merged

Conversation

michaeldjeffrey
Copy link
Contributor

Summary

When submitting a transaction with the Solana client, there is a chance an error is returned but the transaction still made it to the chain.

In this first pass, we're taking a verify approach. When any error is returned, we spawn a task that attempts to confirm the transaction a number of times before really considering it a failure.

A later PR will come in to implement proper transaction tracking.

Changes

  • New Settings
    • txn_confirmation_retry_attempts
    • txn_confirmation_check_interval
  • SolanaNetwork now requires implementing Clone

.write(ValidDataTransferSession::from(session), &[])
.await?;
let signature = txn.get_signature();
for check_idx in 0..retry_attempts {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the expectation if the confirmation check fails each time ( for example due to solana congestion ) and exhausts the retry attempts ? Wont we be back in the same situation again whereby we potentially reburn a previously burnt balance

Copy link
Contributor

Choose a reason for hiding this comment

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

i chatted with @bbalser on this and we both agree this is a gap that cannot be solved readily without some additional structural changes. This PR is still an improvement on what was there previously.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the next pass at this will most likely include some block height checking. That way we can be tell the difference between solana errors and the amount of time passing without our txn on being on chain.

If a submitted transaction does not come back as a defacto success, we spawn a process that checks a txn made it to the chain by signature. By default, we will retry 5 times a minute apart, before considering the txn an actual failure to be tried again later.

If during the checking we find the txn on chain, we do the same logic as if it had passed the first time.
mobile packet verifier is not handling many burn txns, we can block on confirming before attempting to process the next txn.

Txn tracking by signature and block-height will come in a later update.
// We have failed to burn data credits:
metrics::counter!(
"burned",
"payer" => payer.to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to include the payer? this is either just the one service provider or an (potentially) unbounded list of payers that balloons the metrics cost by increasing the breadth of the monitored dataset, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

we already include payer in this metric today. There could be more wallets in the future that pay for this, but we have some alerts that require payer be in this metric

@michaeldjeffrey michaeldjeffrey merged commit 2582122 into main Dec 4, 2024
17 checks passed
@michaeldjeffrey michaeldjeffrey deleted the mj/burner-error-check branch December 4, 2024 19:36
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.

5 participants