-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: distribution payouts #37
Conversation
pub kind: DistributionKind, | ||
#[serde(rename = "type")] | ||
pub type_: DistributionType, | ||
Remainder, |
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 this should be called Consensus
for consistency. From my understanding the refund type is used to broadly describe the tally outcome.
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 we don’t need to distinguish between refund types. The solver always gets refunded all the funds that weren’t consumed. No actions change the amount refunded, they only change the amounts consumed.
In addition there will never be a full refund, we’ll always consume a base fee of X gas in the tally phase (prolly 1 teragas) to prevent attacks where a malicious actor posts a lot of DRs that all time out without incurring costs beyond posting the DR on the contract.
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.
They have been removed.
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.
The refund enum can be removed entirely 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.
Yes I forgot to whoops
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.
fixed :)
55ccaea
to
1925355
Compare
Motivation
Now that the chain has started working with this data, we have a better idea of how to format this data.
Explanation of Changes
DistrbutionKind
has becomeDistribtutionMessage
and no longer has thetype
field. The Message already knows the type so this is less verbose.DistributionSend
->DistributionDataProxyReward
as this message is used to reward data proxies.DistributionType
-> has been removed.dr_id
->Vec<DistributionMessage>
Testing
JSON tests have been updated accordingly.
Related PRs and Issues
This sets up sedaprotocol/seda-chain-contracts#249 for the contract.