-
Notifications
You must be signed in to change notification settings - Fork 648
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
Feature/es voting stat plugin #1983
Open
Dimfred
wants to merge
18
commits into
bitshares:develop
Choose a base branch
from
blockops-de:feature/es-voting-stat-plugin-clean
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
19cc469
added new signals to database, calling signals from maintenance
Dimfred f1329e6
added voting_statistics_object
Dimfred b690a33
added voteable statistics object
Dimfred 7c5c124
added voting_stat_plugin
Dimfred 4336e00
added vot*_objs to es_objects
Dimfred 07d0a81
added test
Dimfred 43ef521
add here?
Dimfred 47861c9
static space_type for abstract_object (optional)
Dimfred 2fe34b1
added voting stat to plugin README
Dimfred 3fa5581
moved voting stat obj to plugin dir, changed ids to match plugin space
Dimfred e00daae
db maint removed unnecessary inlude
Dimfred c0f3def
db notify removed question
Dimfred 8ff6922
moved voteable obj to plugin dir and changed ids to match plugin space
Dimfred 3736c90
chnaged the plugin space removed objs from types
Dimfred c53bf9a
es objs
Dimfred b53b254
(temp) moved test to standard bench and removed es tests
Dimfred 72587d3
changed the plugin space
Dimfred f47e5ba
maint counter object added, changed plugin accordingly
Dimfred File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,21 @@ namespace graphene { namespace chain { | |
*/ | ||
fc::signal<void(const vector<object_id_type>&, const vector<const object*>&, const flat_set<account_id_type>&)> removed_objects; | ||
|
||
/** | ||
* Emitted after the calculation of the voting_stake (occurs in the maintenance interval) | ||
*/ | ||
fc::signal<void(const account_object&, const account_object&, const uint64_t)> on_voting_stake_calculated; | ||
|
||
/** | ||
* Emitted after the beginning of the maintenance interval | ||
*/ | ||
fc::signal<void(uint32_t)> on_maintenance_begin; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, this resolves #211. |
||
|
||
/** | ||
* Emitted after the end of the maintenance interval | ||
*/ | ||
fc::signal<void()> on_maintenance_end; | ||
|
||
//////////////////// db_witness_schedule.cpp //////////////////// | ||
|
||
/** | ||
|
@@ -333,7 +348,7 @@ namespace graphene { namespace chain { | |
* to newly created VBID and return it. | ||
* | ||
* Otherwise, credit amount to ovbid. | ||
* | ||
* | ||
* @return ID of newly created VBO, but only if VBO was created. | ||
*/ | ||
optional< vesting_balance_id_type > deposit_lazy_vesting( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hm, unsure if we want to add such a specific signal. @abitmore @jmjatlanta?
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.
At a glance I don't like it. Is there any way to avoid 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.
I need all the data to properly feed the plugin, so AFAIK there is no way to avoid this. Everything is performed inside the
vote_tally_helper
and nothing is given outside.What exactly do you don't like? Is the signal signature too specific?
To make it more generic I could switch the emission signature to emit an object with the data. This would make it extensible. It would be up to the signal receiver to use the data or not.
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 I understood correctly,
void(const account_object&, const account_object&, const uint64_t)
means we need to emit the signal once per account, which IMHO is too many. I think it's easier if we add thevoting_stake
data directly intoaccount_statistics_object
as a member variable, although this would need a bit more memory.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.
Yes you are right. The signal is emitted once per account.
Inserting data in
account_statistics_object
would mean double tracking of the data. Also it would then insert always (or make a check whether the plugin is active, but this seems weird IMHO). But the plugin kinda looses its purpose then.What would be if I gathered the data first and then emit the signal with all the data? This would call the signal only once and wouldn't require more memory to be used. Though still would require a check whether the plugin is active or not.