-
Notifications
You must be signed in to change notification settings - Fork 183
Refactor researcher context and CPID harvesting #1480
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
Refactor researcher context and CPID harvesting #1480
Conversation
Gridcoin doesn't mine projects--it associates research rewards with a CPID independently of a particular project. Refereshing a meaningless project in the UI adds unnecessary complexity.
Gridcoin added custom encryption functions to obfuscate internal CPIDs and email addresses. Because we don't store this data currently, we can remove these functions.
//! | ||
//! \return A hash as the sum of the two halves of the bytes in the CPID. | ||
//! | ||
size_t operator()(const NN::Cpid& cpid) const |
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.
size_t
is platform dependent (32 or 64 bit). Will that matter here?
Edit: Just saw the doc. Seems like it doesn't matter :)
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.
I don't think it matters how much it wraps...from what I understand, unordered_map
does an equality check after the hash lookup.
|
||
std::vector<std::string> projects = split(*client_state_xml, "<project>"); | ||
|
||
if (projects.size() < 2) { |
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.
What happens if you only have one project?
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.
The first element from the split is just a bunch of crap from the beginning of the file. It doesn't contain a project, so we drop it right below this.
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.
(If split()
returns one item, it's the whole file and doesn't contain any projects.)
f65b9ce
to
66f40f9
Compare
Main and test nets finished syncing with these changes. I need to make a tweak, and then I'll move out of draft. |
Added: - Add freedesktop.org desktop file and icon set #1438 (@a123b) - Add warning in help for blockchain scan for importprivkey #1469 (@jamescowens) - Consolidateunspent rpc function #1472 (@jamescowens) - Scraper 2.0 improvements #1481, #1488, #1509, and #1514 (@jamescowens, @cyrossignol) - explorer mode operation - simplified explainmagnitude output - improved convergence reporting, including scraper information in the tooltip when fDebug3 is set - improved statistics and SB contract core caching based on a bClean flag in the cache global - new SB format and packing for bv11 - new SB contract hashing (native) for bv11 - changes to accomodate new beacon approach - Implement in memory versioning for team file ETags - Implement local dynamic team requirement removal and whitelist #1502 (@cyrossignol) Changed: - Quiet logging for getmininginfo and scraper INFO logging level #1460 (@jamescowens) - Spelling corrections #1461, #1462 (@caraka) - Update crypto module #1453 (@denravonska) - Update .travis.yml for Bionic #1475 (@jamescowens) - Create CPID classes and clean up CPID code #1477 (@cyrossignol) - Refactor researcher context and CPID harvesting #1480 (@cyrossignol) - Remove boinckey export RPC method and import handler - Notify when wallet locked in advertisebeacon RPC method #1504 (@cyrossignol) - Notify when wallet locked in beaconstatus RPC method #1506 (@cyrossignol) - Change spacer minimum height hint #1511 (@jamescowens) Removed: - Remove safe mode #1434 (@denravonska) - Remove bitcoin.moc in Makefile.qt.include #1444 (@RoboticMind) - Clean up legacy Proof-of-Work functions #1497 (@cyrossignol) Fixed: - Constrain walletpassphrase to 10000000 seconds #1459 (@jamescowens) - Straighten out localization in the scraper. #1471 (@jamescowens) - Quick fix for rainbymagnitude #1473 (@jamescowens) - Correct negation error in scraper tooltip for vScrapersNotPublishing #1484 (@jamescowens) - Fix staked block rejection when active researcher #1485 (@cyrossignol) - Add back informational magnitude to generated blocks #1489 (@cyrossignol) - Add back in the in sync check in ScraperGetNeuralContract #1492 (@jamescowens) - Scraper correct team file processing. #1501 (@jamescowens) - Have importwallet file path default to datadir #1508 (@jamescowens) - Scraper add Beacon Map size check to ensure convergence #1515 (@jamescowens)
Part 2 of the changes started with #1477.
These changes move the logic behind
HarvestCPIDs()
into a new set of classes that manage the BOINC researcher context and scraps theGetNextProject()
behavior. It continues the CPID-related clean-up that I started in the previous PR. I merged @denravonska's changes from #1352--it helped to see what I was doing more clearly.I added a provision that checks
REQUIRE_TEAM_WHITELIST_MEMBERSHIP
to prepare for team requirement removal. This isn't dynamic right now--it requires a wallet restart or a call toresetcpids
. If needed, we can determine how to make the wallet handle this automatically with the contract handler changes.This also fixes the empty "status" field on the overview screen. I'm currently reloading testnet and mainnet to check compatibility.