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

Feat/675 on chain ouis devaddrs #909

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

Conversation

bryzettler
Copy link

After helium/helium-program-library#745 is merged/deployed and a backfill is ran, creation of orgs and devaddrs will have been moved to solana instructions/structs.

payer is renamed to escrow_key and is just a string
helium_netids logic has been copied over to the cli where it will be utilized in constructing instructions
• Test migrations stubbed out with bare minimum fields. Indexer service will alter these with full struct fields
• Updated all read operations to read form new indexer tables

approved BOOLEAN NOT NULL
);

CREATE OR REPLACE FUNCTION delete_routes_on_solana_organizations_delete() RETURNS trigger AS $$
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be replaced by an ON DELETE CASCADE

Copy link
Author

Choose a reason for hiding this comment

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

At the indexer I dont have control to say oui is a unique key so I cant cascade delete on that. Need to do this trigger route

net_id TEXT NOT NULL,
authority TEXT NOT NULL,
oui BIGINT NOT NULL,
escrow_key TEXT NOT NULL,
Copy link
Member

Choose a reason for hiding this comment

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

Is this the key where the funds are coming from? aka why not keeping it payer_key?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah this is the key used to infer the escrow pda. The struct on chain has it as escrow_key and a string. payer_key to me sounds like its an actual publickey of a wallet

iot_config/src/route_service.rs Outdated Show resolved Hide resolved
// Reduce the pending burn amount and the payer's balance by the amount
// we've burned.
payer_account.burned = payer_account.burned.saturating_sub(amount);
payer_account.balance = payer_account.balance.saturating_sub(amount);

metrics::counter!("burned", "payer" => payer.to_string()).increment(amount);
metrics::counter!("burned", "payer" => escrow_key.to_string()).increment(amount);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
metrics::counter!("burned", "payer" => escrow_key.to_string()).increment(amount);
metrics::counter!("burned", "payer" => %escrow_key).increment(amount);

this should already be a string now, no?

Copy link
Author

Choose a reason for hiding this comment

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

I didn't update any of the logic in mobile_packet_verifier/burner.rs or its pending_burns.rs as I was only running an instance of iot_config. But this change will make it work with the new pda getter that expects a string. Think I should take a pass at that and also update where payer is a PublicKeyBinary?

iot_config/src/org_service.rs Show resolved Hide resolved
iot_config/src/org_service.rs Outdated Show resolved Hide resolved
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.

3 participants