-
Notifications
You must be signed in to change notification settings - Fork 116
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
Updates for Oracles to transition to helium-lib #401
Conversation
There is a |
You going to fix that up? This PR got lost in an ocean of noise but I'm spending some time in helium-lib again |
fb1560c
to
0e750c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question around the io error. otherwise looks good!
The Data Credits Key is not SubDao specific.
The solana_sdk provides a `read_keypair_file` function, but it returns a Result with a Box<dyn Error>. Rather than recreate all those functions for a wrapped Keypair, I thought to start with an easy conversion from one to the other. So you can read the keypair with the solana_sdk, then very quickly turn it into a helium-lib keypair. Bring the discussion!!!
The module is named boosting so there is hopefully less confusion with the existance of `helium_anchor_lang::hexboosting` that is autogenerated.
You can directly read a helium_lib::Keypair from a file that is a solana keypair.
we can not go all the way back to 0.28 because of solana-sdk. So we go back as far as we can without causing problems for upstream things like oracles.
0e750c9
to
47edfa1
Compare
Companion Oracles PR helium/oracles#850
dc::burn_delegated()
The
iot_packet_verifier
andmobile_packet_verifier
in Oracles burn DC on behalf of OUI operators and Data Users respectively.boosting::start_boost()
The
boost_manager
starts the clock for boosted hexes when they have yielded their first rewards in an epoch.Because
helium_lib
also re-exportshelium_anchor_gen::hexboosting
, I named the moduleboosting
to hopefully be different enough to avoid confusion.Multiple hexes can have their boost periods started in a single transaction. Currently, whoever is calling
start_boost()
needs to make sure to restrict the number of boosted hexes it is providing. It would make sense to me to put that inhelium-lib
and potentially return multiple transactions for the caller to submit, but I haven't gotten there yet, and have not been able to think of a nice way to provide control over transaction sizes.ReadWrite
moved tohelium-lib
You can now Read and Write a Keypair use the
std::io
traits. A convenience methodKeypair::read_from_file
has been added.#### Added Keypair conversionIn trying to keep the separation betweensolana_sdk::signer::keypair::Keypair
andhelium_lib::keypair::Keypair
, rather than providing ahelium_lib
version ofsolana_sdk::signature::read_keypair_file
, I added aFrom
impl to go from solana to helium-lib.solana_sdk::signature::read_keypair_file
returns aBox<dyn std::error::Error>
to coverio::Error
and aserde_json::Error
. I wasn't sure of a nice way to add this error tohelium_lib::error::Error
, so I opted for the conversion.