Skip to content

Conversation

cyrossignol
Copy link
Member

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 the GetNextProject() 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 to resetcpids. 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.

denravonska and others added 9 commits November 5, 2018 14:49
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
Copy link
Member

@denravonska denravonska Jun 19, 2019

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 :)

Copy link
Member Author

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) {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

@cyrossignol cyrossignol Jun 19, 2019

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.)

@cyrossignol cyrossignol force-pushed the researcher branch 7 times, most recently from f65b9ce to 66f40f9 Compare June 19, 2019 23:31
@cyrossignol
Copy link
Member Author

Main and test nets finished syncing with these changes. I need to make a tweak, and then I'll move out of draft.

@jamescowens jamescowens added this to the Elizabeth milestone Jun 21, 2019
@cyrossignol cyrossignol marked this pull request as ready for review June 21, 2019 05:27
@jamescowens jamescowens merged commit 27a7fe9 into gridcoin-community:development Jun 22, 2019
jamescowens added a commit that referenced this pull request Aug 20, 2019
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)
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