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

HIP-134 unique connections #904

Merged
merged 29 commits into from
Dec 11, 2024
Merged

HIP-134 unique connections #904

merged 29 commits into from
Dec 11, 2024

Conversation

michaeldjeffrey
Copy link
Contributor

@michaeldjeffrey michaeldjeffrey commented Nov 26, 2024

Summary

If a wifi hotspot has >25 unique connections of a 7 day rolling period, it automatically gets a 1x Oracle Boosting multiplier.

It is are exempt from Service Provider Banning.

Update Coverage Point Calculator

  • Added OracleBoostingStatus::Qualified variant.

This variant is constructed when a wifi radios has >25 unique connections over a 7 day rolling period as submitted by the CDR processing service to the ingestor.

New Ingestor

  • Added UniqueConnectionsIngestor.

Verifies a unique_connections_ingest_report_v1 carrier_key, writes out verified_unique_connections_ingest_report_v1 and saves unique counts to mobile-verifiers db for next rewards epoch.

New db table

  • Added unique_connections table

Stores unique connection reports received from the CDR processing service. Counts represent unique connections for a wifi hotspots over a 7 day rolling period.

The rewarder clears this table after rewarding keeping a days extra worth of data for reprocessing.

@michaeldjeffrey michaeldjeffrey force-pushed the mj/hip-134-unique-connections branch from 1e31079 to c44c915 Compare December 2, 2024 23:07
Copy link
Contributor

@andymck andymck left a comment

Choose a reason for hiding this comment

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

generally looks good but need another pass to fully digest

file_store/src/file_info.rs Show resolved Hide resolved
mobile_verifier/src/unique_connections/db.rs Outdated Show resolved Hide resolved
@macpie
Copy link
Member

macpie commented Dec 3, 2024

Got a clippy issue

@michaeldjeffrey michaeldjeffrey force-pushed the mj/hip-134-unique-connections branch from c44c915 to f3227e0 Compare December 4, 2024 22:31
@michaeldjeffrey michaeldjeffrey force-pushed the mj/hip-134-unique-connections branch from f3227e0 to 18649e7 Compare December 5, 2024 19:22
while it currently comes from the radio-threshold service, and it feelslike a threshold for a radio to pas for rewarding; current radio thresholds is about service provider boosting, and unique connections is about oracle boosting.
this makes sure we're idempotent when reprocessing reports within the same day.
…se for a record

If we get sent a new report in the same day, we always want to use the latest supplied number.
If we get sent a new report in the same day, we always want to use the latest supplied number.
The old distinct on was returning all rows for a pubkey in reverse
order, so the latest value was always inserted into the hashmap last.

Now, we are correctly getting a single value for a pubkey that is the
latest by timestamp.

Thank you Brian.
If we use inclusive on the end date, we may use a previous days record
for the current day when we do not mean to.
batch inserting is more performant from the IO perspective.
send oracle boosting status in reward_v2. sp boosted status has been
renamed to reduce confusion. orable boost status has been added
@michaeldjeffrey michaeldjeffrey force-pushed the mj/hip-134-unique-connections branch from cf6fb1e to e54db09 Compare December 11, 2024 17:46
@macpie macpie merged commit c25d18b into main Dec 11, 2024
3 checks passed
@macpie macpie deleted the mj/hip-134-unique-connections branch December 11, 2024 17:47
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.

4 participants