Skip to content

refactor(x/provider): switch to epoch rewards#58

Merged
julienrbrt merged 8 commits into
mainfrom
julien/epochs
Jun 15, 2026
Merged

refactor(x/provider): switch to epoch rewards#58
julienrbrt merged 8 commits into
mainfrom
julien/epochs

Conversation

@julienrbrt

@julienrbrt julienrbrt commented Jun 11, 2026

Copy link
Copy Markdown
Member

Closes: #35

The other command in the issue has already been implemented by #55

@tbruyelle tbruyelle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change introduces an important shift in the debt system:

Before fees are distributed, the required amount is sent from the consumer fee pool to the provider module account. If this operation fails because of insufficient funds, the consumer chain becomes "in debt" and fees are not distributed.

With this PR, the required amount becomes much larger (multiplied by blocks_per_epoch), so there is more chance for a consumer chain to become "in debt" and to have the fees not distributed.

As long as blocks_per_epoch is small enough, this is probably fine, or maybe we should adjust the algorithm accordingly.

Comment thread x/vaas/provider/keeper/fees.go Outdated
Comment thread x/vaas/provider/keeper/fees.go Outdated
Comment thread x/vaas/provider/keeper/fees.go
@julienrbrt

julienrbrt commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

With this PR, the required amount becomes much larger (multiplied by blocks_per_epoch), so there is more chance for a consumer chain to become "in debt" and to have the fees not distributed.

I don't get this. The amount does not change, it just gets paid in batches instead of per block.
As your 'rent' security, payment is made upfront so you will be declared in debt at the start of the epoch if it does not cover the whole epoch, but you would have anyway been in debt mid-epoch if we keep the current per block system.

@tbruyelle

Copy link
Copy Markdown
Contributor

I don't get this. The amount does not change, it just gets paid in batches instead of per block.
As your 'rent' security, payment is made upfront so you will be declared in debt at the start of the epoch if it does not cover the whole epoch, but you would have anyway been in debt mid-epoch if we keep the current per block system.

Yes this is what I meant, a consumer chain can go "in debt" sooner than in the previous model. We can go with that, I just wanted to highlight it.

@julienrbrt julienrbrt requested a review from tbruyelle June 12, 2026 15:47
Comment thread x/vaas/provider/keeper/keeper.go Outdated
@julienrbrt julienrbrt requested a review from tbruyelle June 13, 2026 19:53
Comment thread x/vaas/provider/keeper/fees.go Outdated
Comment thread x/vaas/provider/keeper/fees.go
Comment thread x/vaas/provider/keeper/fees_test.go
Comment thread x/vaas/provider/keeper/fees.go Outdated
@julienrbrt julienrbrt merged commit 0b8a917 into main Jun 15, 2026
4 checks passed
@julienrbrt julienrbrt deleted the julien/epochs branch June 15, 2026 09:45
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.

Consider delaying fee distribution

2 participants