Skip to content

Conversation

@Vikingzzu
Copy link

When a parameter key does not exist in store (e.g., newly added CheckpointPollInterval parameter on existing nodes), the Get method would panic with 'UnmarshalJSON cannot decode empty bytes'.

This fix returns early when bz is nil, allowing the ptr to keep its zero value. Callers can check if value > 0 to determine if it was set in the database, and fall back to config file defaults if needed.

When a parameter key does not exist in store (e.g., newly added
CheckpointPollInterval parameter on existing nodes), the Get method
would panic with 'UnmarshalJSON cannot decode empty bytes'.

This fix returns early when bz is nil, allowing the ptr to keep its
zero value. Callers can check if value > 0 to determine if it was set
in the database, and fall back to config file defaults if needed.
- Update TestQueryParams to expect zero values instead of panic
- Align test with the fix in params/subspace that returns early on nil
- Update TestQueryParams to expect zero values instead of panic
- Align test with the fix in params/subspace that returns early on nil
@sgz13140 sgz13140 merged commit e55f27a into develop_v1.1.0 Dec 16, 2025
3 checks passed
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