Skip to content

feat(x/provider): lock fees_per_block denom at module wiring#54

Merged
giunatale merged 7 commits into
mainfrom
giunatale/fees-denom-lock
Jun 5, 2026
Merged

feat(x/provider): lock fees_per_block denom at module wiring#54
giunatale merged 7 commits into
mainfrom
giunatale/fees-denom-lock

Conversation

@giunatale

@giunatale giunatale commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Closes #49

Follow-up to #47. Params.FeesPerBlock (a sdk.Coin) let MsgUpdateParams silently change the fee denom, which would break downtime slashing logic and force an upgrade of any per-consumer override.

This PR removes the denom from params entirely: the amount stays a param (Params.FeesPerBlockAmount, math.Int), while the denom is fixed at keeper construction (Keeper.feeDenom) and cannot change without a binary upgrade — satisfying the constitution's "ICS payments in PHOTON" requirement.

The reference app wires providertypes.DefaultFeesPerBlockDenom while AtomOne is supposed to wire photontypes.Denom. Both resolve to uphoton but the former is less formal and just for testing purposes. NewKeeper panics on an invalid denom.

BREAKING: Params proto field 5 changes from sdk.Coin fees_per_block to string fees_per_block_amount.

@giunatale

Copy link
Copy Markdown
Contributor Author

#46 would require a minor change/adaptation due to this PR (i.e. params.FeesPerBlock.Denom to k.GetFeeDenom(ctx) when checking for denom correctness upon fee pool funding). If this PR gets merged first I'll fix it in #46 after merge, otherwise I'll fix it either in this PR or in a followup

@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.

LGTM

Tiny optimization: DistributeFeesToValidators() should call k.GetFeeDenom() instead of k.GetFeesPerBlock().Denom to prevent a useless params store read.

Additional note: impact the wiring in atomone-hub/atomone#283 (cc @julienrbrt)

@giunatale

Copy link
Copy Markdown
Contributor Author

Tiny optimization: DistributeFeesToValidators() should call k.GetFeeDenom() instead of k.GetFeesPerBlock().Denom to prevent a useless params store read.

fair point!

@tbruyelle

Copy link
Copy Markdown
Contributor

Just realized as well that make provider-start for localnet should be updated just like the e2e/provider-init.sh with the add-genesis-account command.

@giunatale giunatale merged commit 9d83198 into main Jun 5, 2026
4 checks passed
@giunatale giunatale deleted the giunatale/fees-denom-lock branch June 5, 2026 15:22
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.

Lock fees_per_block denom after init; rework per-consumer overrides

2 participants