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

Helium Lib attempt: 2 #930

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

Helium Lib attempt: 2 #930

wants to merge 61 commits into from

Conversation

michaeldjeffrey
Copy link
Contributor

This is a doozy!

The initial swing at using helium-lib in Oracles was intended only for the constructing of transactions.
It then moved into also using helium-lib for sending and finalizing transactions, as there were issues with trusting when Solana said a transaction was finalized.

Much of the work in this PR was a result of that attempt. It wasn't quite what was considered useful for helium-lib, but it did provide a baseline for shoring up burn transaction in Oracles.

Use helium-lib for constructing transaction

  • hexboosting::start_boost in boost_manager
  • dc::burn_delegated in iot_packet_verifier and mobile_packet_verifier

iot_packet_verifier updates

  • Convert tests to use sqlx instead of mocks
  • Use impl TxnStore for tracking transactions
  • Use solana workspace provided TestSolanaClientMap for Solana mock instead of local mock

mobile_packet_verifier updates

  • Add tests
  • Add pending_txns.sql migration for tracking pending txns in a similar style to iot_packet_verifier
  • confirm_pending_txns on startup
  • Use impl TxnStore for tracking transactions
  • Use solana workspace provided TestSolanaClientMap for Solana mock instead of local mock

solana updates

  • SolanaRpc takes it's SubDao as an argument
  • Provide burn::test_client::TestSolanaClientMap for testing
  • Add sender module for breaking out how to track burn transactions
  • Add Transaction wrapper for (SolanaTransaction, BlockHeight)
  • move send_with_retry! macro into start_boost until it also uses a TxnStore for retrying.

Thoughts for upcoming PRs

  • PendingTxn could be consolidated between iot_packet_verifier and mobile_packet_verifier into solana, but they are currently not similar enough to feel comfortable doing that.
  • Sending multiple burn transactions in parallel, as is the intent for helium-lib handling send/retry/finalize logic for users.

Remove test mocks, or move them to unit tests where applicable
now we can remove the ignore from testing confirmed txns
It's the only place it's still used, and a sender is being worked on that will use the same name.
The work done is helium-lib is useful, but not quite what we were looking for.

The change still allows us to clean up quite a bit within Oracles though, so we can still use it.
we want to put the server in a place to write out verified data transfer sessions, even if it cannot burn.
fixup to always confirm before burning
This is a relatively big query, and it is nice to not have to keep multiple copies of it in sync.

first_timestamp was added to handle the case where pending data transfer sessions are being moved back to the regular data transfer sessions table.
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