Skip to content

fix: apply whitelist denoms on feeabstration genesis#304

Merged
Thaleszh merged 4 commits into
mainfrom
fix/oracle-whitelist
Apr 1, 2026
Merged

fix: apply whitelist denoms on feeabstration genesis#304
Thaleszh merged 4 commits into
mainfrom
fix/oracle-whitelist

Conversation

@Thaleszh

@Thaleszh Thaleszh commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes:

  • Apply whitelist denoms on feeabstration genesis

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added tests for each case

PR Checklist:

Make sure each step was done:

  • Updated changelog with PR's intent
  • Lint with make lint-fix

@Thaleszh Thaleszh requested a review from jhelison as a code owner March 31, 2026 16:06
@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ecdffd76-1b0b-4e37-8a15-a6c38120e871

📥 Commits

Reviewing files that changed from the base of the PR and between 6862eaa and 0f06129.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • x/oracle/genesis.go
  • x/oracle/genesis_test.go
✅ Files skipped from review due to trivial changes (2)
  • CHANGELOG.md
  • x/oracle/genesis_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • x/oracle/genesis.go

Walkthrough

The oracle module's genesis initialization was modified to apply whitelist bank denoms immediately upon initialization rather than deferring this to end-of-block behavior. The InitGenesis function in x/oracle/genesis.go now invokes keeper.ApplyWhitelist after setting module parameters, which populates the vote target state during genesis. This enables validators to submit votes starting from block 0. A regression test was added to verify that InitGenesis correctly populates vote target entries for all whitelisted denoms. The changelog was updated to document this fix.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: applying whitelist denoms during oracle genesis initialization.
Description check ✅ Passed The description is related to the changeset, documenting the bug fix of applying whitelist denoms on genesis with appropriate testing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/oracle-whitelist

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Thaleszh Thaleszh changed the base branch from main to fix/oracle-denom March 31, 2026 16:13

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@x/feeabstraction/keeper/msg_server.go`:
- Around line 110-120: The code zeroes out FeeTokenMetadata.Price in the
UpdateFeeTokens path causing convertERC20ForFees to see zero prices until
BeginBlocker repopulates them; instead, in the block that builds resetItems (the
loop over msg.FeeTokens.Items that currently sets token.Price =
math.LegacyZeroDec()), populate token.Price with the current TWAP or retain the
last positive stored price for that token (read from ms.FeeTokens or the same
FeeToken metadata collection) so BeginBlocker refresh is not required for the
current block; then call ms.FeeTokens.Set with that collection (avoid writing
zero prices), ensuring convertERC20ForFees will see a usable Price and not
return ErrInsufficientFunds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ed3340c-a753-40b1-85c4-1e9f5f9078e0

📥 Commits

Reviewing files that changed from the base of the PR and between 2c96c69 and 6862eaa.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • x/feeabstraction/keeper/msg_server.go
  • x/feeabstraction/keeper/msg_server_test.go
  • x/feeabstraction/keeper/oracle.go
  • x/feeabstraction/keeper/oracle_test.go
  • x/feeabstraction/types/expected_keepers.go
  • x/feeabstraction/types/params.go
  • x/feeabstraction/types/params_test.go
  • x/oracle/genesis.go
  • x/oracle/genesis_test.go
  • x/oracle/keeper/vote_target.go

Comment thread x/feeabstraction/keeper/msg_server.go Outdated
@codecov

codecov Bot commented Mar 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
x/oracle/genesis.go 33.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Comment thread x/feeabstraction/keeper/msg_server.go Outdated
@Thaleszh Thaleszh force-pushed the fix/oracle-whitelist branch from 411f9d5 to ae58b1b Compare April 1, 2026 14:12
@Thaleszh Thaleszh changed the title fix: apply whitelist denoms on feeabstration genesis & ensure UpdateFeeToken uses pricing from TWAP fix: apply whitelist denoms on feeabstration genesis Apr 1, 2026
@Thaleszh Thaleszh changed the base branch from fix/oracle-denom to main April 1, 2026 14:15
@Thaleszh Thaleszh changed the base branch from main to fix/oracle-denom April 1, 2026 14:16
Base automatically changed from fix/oracle-denom to main April 1, 2026 15:44
@Thaleszh Thaleszh merged commit 5c894a6 into main Apr 1, 2026
9 of 10 checks passed
@Thaleszh Thaleszh deleted the fix/oracle-whitelist branch April 1, 2026 20: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.

2 participants