Skip to content
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

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Conversation

hacheigriega
Copy link
Member

@hacheigriega hacheigriega commented Jan 10, 2025

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 is 100_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

@hacheigriega hacheigriega changed the title Payout to committers in case of reveal timeout Payout to committers in case of data request timeout Jan 10, 2025
@hacheigriega hacheigriega force-pushed the hy/incentive branch 2 times, most recently from 8fd82ac to 1e9f138 Compare January 11, 2025 01:30
@hacheigriega
Copy link
Member Author

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,
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@gluax gluax Jan 14, 2025

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.

x/tally/keeper/endblock_test.go Show resolved Hide resolved
x/tally/keeper/payout.go Outdated Show resolved Hide resolved
x/tally/keeper/payout.go Outdated Show resolved Hide resolved
x/tally/types/params.go Outdated Show resolved Hide resolved
@hacheigriega
Copy link
Member Author

hacheigriega commented Jan 15, 2025

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

@hacheigriega hacheigriega merged commit 7cc82fe into main Jan 15, 2025
8 of 10 checks passed
@hacheigriega hacheigriega deleted the hy/incentive branch January 15, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Incur gas cost for data requests that time out
3 participants