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

refactor: distribution payouts #37

Merged
merged 2 commits into from
Jan 16, 2025
Merged

refactor: distribution payouts #37

merged 2 commits into from
Jan 16, 2025

Conversation

gluax
Copy link
Contributor

@gluax gluax commented Jan 15, 2025

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 become DistribtutionMessage and no longer has the type 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.
  • The sudo request now takes a map of 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.

@gluax gluax self-assigned this Jan 15, 2025
pub kind: DistributionKind,
#[serde(rename = "type")]
pub type_: DistributionType,
Remainder,
Copy link
Member

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.

Copy link
Member

@Thomasvdam Thomasvdam Jan 15, 2025

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have been removed.

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed :)

@gluax gluax force-pushed the refactor/distrubtion-payouts branch from 55ccaea to 1925355 Compare January 16, 2025 15:34
@gluax gluax merged commit 1925355 into main Jan 16, 2025
2 checks passed
@gluax gluax deleted the refactor/distrubtion-payouts branch January 16, 2025 16:49
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.

3 participants