-
Notifications
You must be signed in to change notification settings - Fork 11
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
Payout to committers in case of data request timeout #461
Conversation
8fd82ac
to
1e9f138
Compare
I had mentioned that I would add filtering support for requests with missing reveals in this PR, but I think it's better to create a separate PR for that. I'll do that tomorrow. |
// TODO | ||
distMsgs = types.DistributionMessages{ | ||
Messages: []types.DistributionMessage{}, | ||
RefundType: types.DistributionTypeNoConsensus, |
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.
Maybe we should add one for insufficient commits/reveals :x
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.
Not sure what you mean here? :) The switch statement covers those cases 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.
Your switch case does! I was thinking about the RefundType
message. It would be more specific for the end user than saying No Consensus
.
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.
Idk what do you think @Thomasvdam?
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.
Ah yes I find the current list of distribution types to be confusing.
const (
DistributionTypeTallyReward DistributionType = "tally_reward"
DistributionTypeExecutorReward DistributionType = "executor_reward"
DistributionTypeTimedOut DistributionType = "timed_out"
DistributionTypeNoConsensus DistributionType = "no_consensus"
DistributionTypeRemainderRefund DistributionType = "remainder_refund"
)
We have to add executor reward can be inferred from the distribution kind. Also, time out and no consensus are outcomes of tally, not distribution types, right? We also have to add distribution kinds for slashing and data provider payout, but I'm not sure what distribution types they would be.
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.
No consensus and time out exists, so the dr poster knows why they got a full refund. At least that's the logic I'm going by.
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.
As for data provider payout I would assume it would be a DistributionSend
message, while I thought we weren't doing any slashing to executors?
Oopa nevermind new Distribution makes sense to match Executor reward.
I believe this PR is ready to be merged? I will create an issue on the contract repo about what we discussed. Cc @Thomasvdam @gluax Created an issue here sedaprotocol/seda-chain-contracts#249 |
e70a899
to
7cc82fe
Compare
Explanation of Changes
This PR makes use of the core contract's distribution message types to report payout allocations in case of data request timeouts. When a data request times out, either due to insufficient number of commits or reveals, we pay some fixed amount to the ones that did commit. This amount is a module parameter called
GasCostCommitment
, whose default value is100_000_000
(subject to change).Testing
Integration testing simulates commit and reveal timeouts under varying replication factors and numbers of commits and reveals. The core contract used for integration testing has been updated to the one built from commit aa0a52f.
Related PRs and Issues
Closes #453