-
Notifications
You must be signed in to change notification settings - Fork 21
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 109 boost by device type #798
base: main
Are you sure you want to change the base?
Commits on Sep 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9abbab8 - Browse repository at this point
Copy the full SHA 9abbab8View commit details -
Refactor to use BoostedHexes methods
Making the internal member hexes private will make it easier to change the implementation when device type is introduced.
Configuration menu - View commit details
-
Copy full SHA for 3836e93 - Browse repository at this point
Copy the full SHA 3836e93View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed652e2 - Browse repository at this point
Copy the full SHA ed652e2View commit details -
Add boosted hexes ability to accumulate multipliers
A cell can be boosted more than once. Old boosts will retain device_type of ::All. Any boost matching the device_type accumulates into the multiplier. ex: 3 boost with a multiplier of 10, will multiply by 30.
1Configuration menu - View commit details
-
Copy full SHA for 303aab1 - Browse repository at this point
Copy the full SHA 303aab1View commit details -
Add device_type to BoostedHexInfo from db
The device_type column is assumed to be a jsonb, because the device_type column for the `mobile_hotspot_infos` table is an enum, and a jsonb field. It's nullable, which will represent boosting a hex for ALL device types. Otherwise, a camelcase value mapping to the DeviceTypeV0 in helium-program-library. https://github.com/helium/helium-program-library/blob/master/programs/hexboosting/src/state.rs This is different from the snake_case values used with protobufs.
Configuration menu - View commit details
-
Copy full SHA for fef2d67 - Browse repository at this point
Copy the full SHA fef2d67View commit details -
Rename to clarify try_into target type
With type hints enabled, `hex` shows up as a `BoostedHex` going into a function that expects `BoostedHex`. Renaming to `hex_proto` will hopefully clear up the need for the type casting.
Configuration menu - View commit details
-
Copy full SHA for 4107d20 - Browse repository at this point
Copy the full SHA 4107d20View commit details -
Configuration menu - View commit details
-
Copy full SHA for c9b07d8 - Browse repository at this point
Copy the full SHA c9b07d8View commit details -
Add test for accumulating hex boosts
This test uses a single type of radio to reduce adding noise to rewards by factors other than hex boosting. The first pass of the test calculates rewards for 2 radios with no boosted hexes to prove they are in equal standing. The second pass boosts only the hex for single radio, but with multiple BoostedHexDeviceType's to ensure they accumulate.
Configuration menu - View commit details
-
Copy full SHA for 87fd3ca - Browse repository at this point
Copy the full SHA 87fd3caView commit details -
use BoostedHexDeviceType proto enum
There was not enough custom functionality to warrant owning a BoostedHexDeviceType enum of our own.
Configuration menu - View commit details
-
Copy full SHA for e926d43 - Browse repository at this point
Copy the full SHA e926d43View commit details -
Mobile Config filter Boosted Hexes (#801)
* Refactor to use BoostedHexes methods Making the internal member hexes private will make it easier to change the implementation when device type is introduced. * Add device type to boosted hex info * refactor metadata_db tests to make test clearer also makes it easier to add new tests * remove expired boosted hexes when streaming from db * ensure no tests are written with expired boosted hexes * optimize by computing end_ts in db query Thanks for the query help Brian! By precomputing the end timestamp of a boosted hex, we can not have to stream all the hexes out of the db just to throw them away. * fixup after rebase - remove unused imports - remove old refactor return types * make boosted hex test function more explicit If the expired check had been made a global check, the ability to use BoostedHexes for modified hexes would have broken at runtime. The attempt here is to make very explicit during testing how to meet the same contract as the database queries for boosted hexes. I think there are still some cracks, but we can narrow in on those as we find them. For now, I think naming test constructor functions is a good start.
Configuration menu - View commit details
-
Copy full SHA for 8dea91e - Browse repository at this point
Copy the full SHA 8dea91eView commit details -
add test to ensure boosts only apply to single device types
There is another test for same device types across hexes. This test is for different types in the same hex. The 2nd unboosted hex serves the purpose of giving us a relative baseline so we don't need to hardcode values into the test.
Configuration menu - View commit details
-
Copy full SHA for bbb1209 - Browse repository at this point
Copy the full SHA bbb1209View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19898b7 - Browse repository at this point
Copy the full SHA 19898b7View commit details -
update hex boosting tests for radio_reward_v2
It becomes more difficult to compare ratios with radio_reward_v2 because boosted rewards are scaled. In many of the test we were hoping to have nice ratios (1:10) of poc_rewards. However, this was mostly because a radio would have received 0 boosted_rewards. Checking that ratio is impossible. We can however check the coverage_points (now that they mean points, and not rewards) for the expected ratio, and rely on other tests to ensure we're calculating poc_reward amount correctly.
Configuration menu - View commit details
-
Copy full SHA for 7f448a7 - Browse repository at this point
Copy the full SHA 7f448a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 33f0f88 - Browse repository at this point
Copy the full SHA 33f0f88View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9229e4 - Browse repository at this point
Copy the full SHA a9229e4View commit details