-
Notifications
You must be signed in to change notification settings - Fork 13
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
Create a proposal for a execution emitters coins split #1706
Conversation
4b552a8
to
e530135
Compare
e530135
to
0f8ae34
Compare
var runnerShare = sdk.NewDecWithPrec(9, 1) | ||
var ( | ||
runnerShare = sdk.NewDecWithPrec(8, 1) | ||
emittersShare = sdk.NewDecWithPrec(1, 1) |
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.
just for comprehension, it would be nice to also have the serviceShare
and assert in the code if the rest of runner + emitters != serviceShare
. Like that, we will have 100%
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 and no. We need to be sure that inputs == outputs and we can only have that, if we subtract it, because division can't guarantee that.
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.
of course but we can still check that the diff matches the supposed value of the service. Anyway not blocking but it's just really confusing not to have all the repartition here, it looks like there is only 90% of the distribution and the rest maybe stays in the execution. (If we have a deep look at the code then we see it's not the case but we should not need to have a deep look at the code). Maybe just document that correctly with the details of the repartitions.
|
||
var voters []sdk.AccAddress | ||
var emitterCoins sdk.Coins | ||
if store.Has(voteKey(execHash)) { |
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 shouldn't do this test, if there is no vote on the store it means we have a serious issue before and we should either panic or at least return an error and not just ignore it I think. Or we could calculate everything and at the end assert that the result of emitters + runner + service == balance of execution.
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 related to a question if we should put a exec creator as an voter into the list. If yes, then this check shouldn't be here, otherwise it's should be :)
} | ||
|
||
// if there is no emitter get rest coins to runner | ||
if emitterCoins.IsZero() { |
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.
why should we do that? why would we have no emitters in the first place? and why giving to the runner and not the service or get back to the user etc... we never talked about that...
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.
why would we have no emitters in the first place?
See above. Also, it might happen that coins/len(emitters) == 0, so we can either pay only a few random emitters or none at all.
and why giving to the runner
Because I took the reward from runners' share.
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.
Because I took the reward from runners' share.
No, you're giving to the runner from the execution here... or I think there is a big confusion with what is the runner and all the different types of runners (emitters/executors).
The different types of runners will do a specific job and will be rewarded for that and not for the job of others.
Also, I'm seeing that in fact, this instruction is only when the coins are zero and you add zero to the existing coins. So yes we will actually not pay anyone and this whole instruction is useless isn't it?
closing this PR in favor of #1705 |
dep #1703