Skip to content

fix(x/dynamicfee): enforce params.Window == len(state.Window) in genesis validation - #113

Open
giunatale wants to merge 3 commits into
mainfrom
fix/dynamicfee-genesis-window-validation
Open

fix(x/dynamicfee): enforce params.Window == len(state.Window) in genesis validation#113
giunatale wants to merge 3 commits into
mainfrom
fix/dynamicfee-genesis-window-validation

Conversation

@giunatale

Copy link
Copy Markdown
Collaborator

The params.Window == len(state.Window) invariant was enforced only as a panic in keeper.InitGenesis, never in ValidateBasic. So a mismatched genesis (e.g. window: "4" with the default 8-slot state.window) passes atomoned genesis validate and then panics every node in InitChain before block 1.

Enforce the invariants where genesis validate sees them:

  • State.ValidateBasic: reject empty Window (len == 0, not just nil) and Index >= len(Window).
  • GenesisState.ValidateBasic: reject params.Window != len(state.Window).
  • InitGenesis: drop the now-redundant window panic (gs.ValidateBasic() covers it).

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.

1 participant