Skip to content

fix: avoid adding MsgOracleRealyTypeUrl before config enabled#126

Merged
traviolus merged 2 commits into
mainfrom
fix/backward-compatibility
Feb 24, 2026
Merged

fix: avoid adding MsgOracleRealyTypeUrl before config enabled#126
traviolus merged 2 commits into
mainfrom
fix/backward-compatibility

Conversation

@beer-1
Copy link
Copy Markdown
Member

@beer-1 beer-1 commented Feb 24, 2026

Summary by CodeRabbit

  • Refactor
    • Oracle relay authorization is now governed by a configuration flag: when enabled, relay-related grants are validated and created as before; when disabled, relay grant processing is skipped.
    • Status messages and the set of required message types for authorization checks have been updated to reflect the enabled/disabled relay behavior.

@beer-1 beer-1 requested a review from a team as a code owner February 24, 2026 09:57
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 041a2c4 and 5168b51.

📒 Files selected for processing (1)
  • cmd/opinitd/tx.go

Walkthrough

The change gates oracle-relay authz grant creation and the set of required message types behind cfg.OracleRelay.Enable, conditionally adding relay-related grants and message types only when the OracleRelay feature is enabled.

Changes

Cohort / File(s) Summary
Oracle Relay Gate & Required Msgs
cmd/opinitd/tx.go
Gate creation of the MsgRelayOracleTypeUrl authz grant behind cfg.OracleRelay.Enable; preserve existing check-before-add behavior when enabled. Recompute required message types to always include MsgUpdateOracleTypeUrl and MsgAuthzExecTypeUrl, and append MsgRelayOracleTypeUrl and MsgUpdateClientTypeUrl only if OracleRelay is enabled. Update log/print messages to reflect gated grant creation and skipping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I nibble on flags in the config glade,

When OracleRelay blooms, a grant is made.
If sleeping, I skip with a twitch and a hop,
Else I add the relay and never stop—
Small hops, safe gates, in code I parade.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: preventing MsgOracleRelayTypeUrl from being added before the OracleRelay config is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/backward-compatibility

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 `@cmd/opinitd/tx.go`:
- Around line 118-121: The current requiredMsgTypes initialization incorrectly
always includes types.MsgRelayOracleTypeUrl and omits
types.MsgUpdateOracleTypeUrl when cfg.OracleRelay.Enable is false; update the
logic in the requiredMsgTypes construction (the requiredMsgTypes variable) to
start from a base slice of always-required types (e.g., include
types.MsgAuthzExecTypeUrl and types.MsgUpdateOracleTypeUrl) and only append
relay-related types (types.MsgRelayOracleTypeUrl and
types.MsgUpdateClientTypeUrl) when cfg.OracleRelay.Enable is true so that relay
message types are only added when the feature flag is enabled.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 71b69dc and 041a2c4.

📒 Files selected for processing (1)
  • cmd/opinitd/tx.go

Comment thread cmd/opinitd/tx.go Outdated
Comment thread cmd/opinitd/tx.go Outdated
Copy link
Copy Markdown
Contributor

@traviolus traviolus left a comment

Choose a reason for hiding this comment

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

LGTM 🙏🏻

@traviolus traviolus merged commit b2fb290 into main Feb 24, 2026
9 checks passed
@traviolus traviolus deleted the fix/backward-compatibility branch February 24, 2026 10:16
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