-
Notifications
You must be signed in to change notification settings - Fork 172
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
scraper, project: Implement automated greylisting (tracking PR for WIP) #2778
base: development
Are you sure you want to change the base?
scraper, project: Implement automated greylisting (tracking PR for WIP) #2778
Conversation
715dba6
to
11cbd3b
Compare
Makes sense for automatic greylisted projects for de-greylisting, but why are statistics collected for manually greylisted projects? The greylister can then operate on projects with either ACTIVE or AUTO_GREYLISTED status. Also considering the WAS & ZCD calculation is done per day, I am not sure if bothering with caching is worth it. Might be worthwhile to make some dumb implementation and do a benchmark. Could adding a separate |
Excellent question. Depending on the reasons for the manual greylist, statistics may still be available for a project. If so they should continue to be collected, because the ZCD and WAS rules would then apply if the manual greylist status was removed. What are you thinking in terms of functionality for the -projectnotify parameter? |
Good point.
Manual greylisting should instantly take effect, but should ungreylisting do so too? It should be simpler to make manual ungreylisting put the project in an auto greylist state. It'll take until the next superblock for the project to become active but that's ok imo. I'm imagining a FSM like this:
Similar to other notify commands. It should be triggered on project status changes(added to whitelist, removed, greylisted etc.), should call a script with the contract hash(or superblock hash in case of an automatic greylist). |
11cbd3b
to
de00a19
Compare
That is a good simplification actually. |
6dbd145
to
23e6b12
Compare
Also implement corresponding -projectnotify startup parameter that provides the ability to run a cmd based on a change to the whitelist.
This adds a boolean argument to the listprojects RPC function. This boolean defaults to false, which only lists active projects. When true, it will list projects of every status.
23e6b12
to
c254f43
Compare
This PR is for tracking the progress of implementing automated greylisting.
Please see the following set of notes for design considerations that need to be discussed.
block → MAN_GREYLISTED
superblock → AUTO_GREYLISTED → status still MAN_GREYLISTED
superblock → removed from AUTO_GREYLISTED → status still MAN_GREYLISTED
block → removal from MAN_GREYLISTED → ACTIVE
block → MAN_GREYLISTED
superblock → AUTO_GREYLISTED → status still MAN_GREYLISTED
block → removed from MAN_GREYLISTED → AUTO_GREYLISTED
superblock → removed from AUTO_GREYLISTED → ACTIVE
- Have status in cache of something like AUTO_GREYLIST_QUAL which means project has met the conditions for AUTO_GREYLIST by the rules, but was already MAN_GREYLISTED
- This would be checked for each contract injection to change MAN_GREYLIST status, to decide whether new status is either AUTO_GREYLIST or ACTIVE
- The AUTO_GREYLIST_QUAL is a flag on the project at the current (head) state
- Maybe this really belongs in the in memory superblock structure? This does not need to be in the on-disk (chain) superblock structure at the cost of some computations.
- There is an existing superblock cache (SuperblockIndex g_superblock_index) that currently stores the last three superblocks and could be expanded to 40 superblocks as an easy way to do the cache. This means more computation on top of the cache but much faster because it operates on in memory structures rather than reading from the superblock registry (disk I/O). It also means more memory usage.
- Maybe best to modify the cache to be a hybrid and store more limited information for superblocks 4 – 40. But this makes the cache updating more complicated.
- The memory usage of the additional superblocks is minimal compared to the current size of other data structures with the current active beacon count and chain length; however, when the benefactor contracts are implemented, this will no longer be true.