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 Packet Verifier Transaction Recovery #958

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

michaeldjeffrey
Copy link
Contributor

This PR is step 1 in getting back to using helium-lib for solana.
It does not currently use helium-lib for anything, yet.
But adds failure resilience for mobie-packet-verifier.

All the changes in iot-packet-verifier were aimed towards making the integration tests use more production code.
The only new change here, is we check if there are any in flight transactions before burning.
There should only ever be 1 for this iteration of the code.

Mobile Packet Verifier

  • Can handle a shutdown with an inflight transaction.
  • Pending Transactions are handled with 2 new db tables.
    • pending_txns and pending_data_transfer_sessions.
    • "burns" and their sessions are moved to the new tables when submitted.
      • If the transaction succeeds, the sessions are written to s3 and the pending txn is removed.
      • If it fails, the pending txn is deleted, and the sessions are moved back to the main data transfer table.
    • Burn values are derived from sessions in data_transfer_sessions.
  • We always confirm any pending transactions before burning
  • There should only ever be a single pending transaction

IoT Packet Verifier

  • Updated tests to use #[sqlx::test] to use production code.
  • Removed unused Mock structs.
  • Make sure we only have 1 in flight transaction at a time.

Solana

  • TestSolanaClientMap replaces Arc<Mutex<HashMap<PublicKeyBinary, u64>>> impls

@michaeldjeffrey michaeldjeffrey force-pushed the mj/mobile-pv-txn-recovery branch from 0cd9a58 to acf212a Compare February 26, 2025 22:42
@michaeldjeffrey michaeldjeffrey changed the title Mj/mobile pv txn recovery Mobile Packet Verifier Transaction Recovery Feb 26, 2025
@michaeldjeffrey michaeldjeffrey force-pushed the mj/mobile-pv-txn-recovery branch from acf212a to 287d583 Compare February 27, 2025 19:00
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.

2 participants