-
Notifications
You must be signed in to change notification settings - Fork 311
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
distributions: add distributions events #5044
Conversation
I think we should go ahead and add an event type for this, since we'll be writing an app view for the events here at some point. For emission, c.f.
|
.get_cummulative_lqt_reward_issuance(current_epoch.index - 1) | ||
.await | ||
.ok_or_else(|| { | ||
tonic::Status::not_found(format!( |
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.
This is not an RPC, so we shouldn't return an RPC error. In fact, we shouldn't return an error at all. We do not want to interrupt component logic. Just default to zero.
)); | ||
|
||
self.set_lqt_reward_issuance_for_epoch(current_epoch.index, new_issuance); | ||
self.set_cumulative_lqt_reward_issuance(current_epoch.index, cumulative_issuance); |
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.
This method only gets called at the end of every epoch, so something is wrong here right?
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.
well in the way I interpreted the event definition and it's associated fields (event emission every epoch), the logic is correct. I'll modify it to instead emit an event every block 👍
let cumulative_issuance = previous_issuance + new_issuance; | ||
|
||
// Emit an event for LQT pool size increase. | ||
self.record_proto(event::event_lqt_pool_size_increase( |
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.
We should emit an event every block, but we don't need to do anything else, the goal for this event is to be a convenient tick for observability, that's all we need imo.
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 think there are a few bugs, we should just emit an event every block and populate it using the reward rule for the budget. No need for extra state keys or tracking
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.
LGTM!
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.
Great
## Describe your changes add LQT pool size increase event to the distributions component, emitted at the end of each block. ## Issue ticket number and link references #5041 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > LQT branch
## Describe your changes add LQT pool size increase event to the distributions component, emitted at the end of each block. ## Issue ticket number and link references #5041 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > LQT branch
## Describe your changes add LQT pool size increase event to the distributions component, emitted at the end of each block. ## Issue ticket number and link references #5041 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > LQT branch
Describe your changes
add LQT pool size increase event to the distributions component, emitted at the end of each block.
Issue ticket number and link
references #5041
Checklist before requesting a review
I have added guiding text to explain how a reviewer should test these changes.
If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: