Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename createprice to pricefeed #313

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

leonz789
Copy link
Contributor

@leonz789 leonz789 commented Feb 21, 2025

Description

This PR supersede #294
Temporary comment out integrated price-feeder to get avoid of the dependency conflict


Closes #XXX

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Oracle price operations have been rebranded to use "price-feed" terminology, which updates how transactions are submitted and processed.
    • CLI commands, error notifications, and event messages now reference "price-feed" for enhanced clarity.
  • Documentation
    • API documentation, JSON schema descriptions, and help texts have been revised to reflect the new "price-feed" naming convention.
  • Bug Fixes
    • Updated error messages and event types to align with the new "price-feed" terminology, improving clarity in error handling and event logging.

Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

Walkthrough

This pull request renames all references to the oracle "create-price" transaction to "price-feed" across the codebase. Changes include updating conditional checks, function and method names, error messages, event types, CLI commands, message constructors, and associated tests. The core logic and control flow remain unchanged, with only the naming and documentation updated to reflect the new terminology.

Changes

File(s) Change Summary
app/ante/cosmos/context.go, app/ante/cosmos/fees.go, app/ante/cosmos/min_price.go, app/ante/cosmos/sigverify.go, app/ante/cosmos/txsize_gas.go, app/ante/evm/fee_market.go Renamed transaction type check from OracleCreatePriceTx to OraclePriceFeedTx; updated comments and error messages accordingly.
app/ante/utils/oracle.go Renamed function IsOracleCreatePriceTx to IsOraclePriceFeedTx and updated its documentation.
app/app.go Updated in-code comments to reflect the new "oracle price-feed" terminology.
client/docs/swagger-ui/swagger.json Modified JSON schema titles from "createPrice" to "priceFeed" to match new terminology.
proto/exocore/oracle/v1/tx.proto, proto/exocore/oracle/v1/recent_msg.proto Renamed RPC method, message types, and comments from CreatePrice to PriceFeed.
tests/e2e/oracle/create_price.go, tests/e2e/oracle/recovery.go, testutil/network/tx.go Renamed test functions and transaction builder functions from CreatePrice to PriceFeed.
x/oracle/client/cli/tx.go, x/oracle/client/cli/tx_create_price.go Updated CLI command name from CmdCreatePrice to CmdPriceFeed and adjusted message construction accordingly.
x/oracle/keeper/feedermanagement/feedermanager.go, x/oracle/keeper/msg_server_create_price.go, x/oracle/keeper/msg_server_test.go, x/oracle/keeper/native_token.go, x/oracle/keeper/nonce.go, x/oracle/keeper/validate_timestamp.go Updated keeper function signatures, event types, and error messages from CreatePrice to PriceFeed in message processing and validation.
x/oracle/types/codec.go, x/oracle/types/errors.go, x/oracle/types/events.go, x/oracle/types/message_create_price.go, x/oracle/types/message_create_price_test.go Refactored message type registrations, constants, error messages, and test cases replacing CreatePrice references with PriceFeed.

Possibly related PRs

  • feat: events for Callisto #276: The changes in the main PR, which involve renaming transaction types and updating related logic in the AnteHandle methods, are directly related to the changes in the retrieved PR, where similar updates to transaction type checks are made across various methods. Both PRs focus on the transition from OracleCreatePriceTx to OraclePriceFeedTx in their respective handling of transactions.

Suggested labels

Type: Build, Type: CI

Suggested reviewers

  • TimmyExogenous
  • bwhour
  • cloud8little
  • adu-web3
  • trestinlsd

Poem

I'm a little rabbit with coding flair,
Hopping through changes with nary a care.
Renamed the price, from create to feed,
In every file, precision is decreed.
With ASCII hops and a joyful beat,
CodeRabbit cheers for clean code so sweet!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 3

🔭 Outside diff range comments (1)
x/oracle/keeper/msg_server_create_price.go (1)

1-92: 🛠️ Refactor suggestion

Rename the file to match the new function name.

The file is still named msg_server_create_price.go but contains the PriceFeed function. Consider renaming it to msg_server_price_feed.go for consistency.

🧹 Nitpick comments (5)
x/oracle/types/errors.go (1)

25-25: Inconsistent formatting: Standardize separator in error message.

The error message uses a hyphen (price-feed) while other occurrences use an underscore (price_feed). This inconsistency in formatting should be standardized across the codebase.

-	ErrInvalidMsg                        = sdkerrors.Register(ModuleName, invalidMsg, "invalid input price-feed")
+	ErrInvalidMsg                        = sdkerrors.Register(ModuleName, invalidMsg, "invalid input price_feed")
x/oracle/client/cli/tx_create_price.go (1)

1-93: Consider renaming the file to match the new terminology.

The file name tx_create_price.go still uses the old terminology. Consider renaming it to tx_price_feed.go for consistency.

testutil/network/tx.go (1)

25-27: LGTM! Function name and comments updated consistently.

The function name change and comment updates align with the PR objective.

Fix typo in the comment.

The word "senario" should be "scenario".

-// SendTxOraclePriceFeed consturct and sign that tx with input msgs, it's different from SendTx, since when we use ed25519 for oracle senario, we allowed that signer is an unexists account, this implementation skip the 'accoutn exists' related checks
+// SendTxOraclePriceFeed construct and sign that tx with input msgs, it's different from SendTx, since when we use ed25519 for oracle scenario, we allowed that signer is an unexists account, this implementation skip the 'account exists' related checks
app/ante/cosmos/txsize_gas.go (1)

40-44: Fix grammatical error in the error message.

The error message contains a grammatical error: "has exceeds" should be "has exceeded".

-			return ctx, sdkerrors.ErrTxTooLarge.Wrapf("oracle price-feed tx has exceeds size limit, limit:%d, got:%d", anteutils.TxSizeLimit, len(ctx.TxBytes()))
+			return ctx, sdkerrors.ErrTxTooLarge.Wrapf("oracle price-feed tx has exceeded size limit, limit:%d, got:%d", anteutils.TxSizeLimit, len(ctx.TxBytes()))
x/oracle/keeper/msg_server_test.go (1)

29-126: Update test file name to match new functionality.

Since the tests now focus on PriceFeed functionality instead of CreatePrice, consider renaming this test file from msg_server_test.go to something more specific like msg_server_price_feed_test.go.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 770a676 and 267a07f.

⛔ Files ignored due to path filters (2)
  • x/oracle/types/recent_msg.pb.go is excluded by !**/*.pb.go
  • x/oracle/types/tx.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (27)
  • app/ante/cosmos/context.go (1 hunks)
  • app/ante/cosmos/fees.go (1 hunks)
  • app/ante/cosmos/min_price.go (1 hunks)
  • app/ante/cosmos/sigverify.go (4 hunks)
  • app/ante/cosmos/txsize_gas.go (1 hunks)
  • app/ante/evm/fee_market.go (1 hunks)
  • app/ante/utils/oracle.go (1 hunks)
  • app/app.go (1 hunks)
  • client/docs/swagger-ui/swagger.json (6 hunks)
  • proto/exocore/oracle/v1/recent_msg.proto (1 hunks)
  • proto/exocore/oracle/v1/tx.proto (2 hunks)
  • tests/e2e/oracle/create_price.go (13 hunks)
  • tests/e2e/oracle/recovery.go (15 hunks)
  • testutil/network/tx.go (1 hunks)
  • x/oracle/client/cli/tx.go (1 hunks)
  • x/oracle/client/cli/tx_create_price.go (2 hunks)
  • x/oracle/keeper/feedermanagement/feedermanager.go (4 hunks)
  • x/oracle/keeper/msg_server_create_price.go (4 hunks)
  • x/oracle/keeper/msg_server_test.go (4 hunks)
  • x/oracle/keeper/native_token.go (2 hunks)
  • x/oracle/keeper/nonce.go (1 hunks)
  • x/oracle/keeper/validate_timestamp.go (1 hunks)
  • x/oracle/types/codec.go (1 hunks)
  • x/oracle/types/errors.go (1 hunks)
  • x/oracle/types/events.go (1 hunks)
  • x/oracle/types/message_create_price.go (2 hunks)
  • x/oracle/types/message_create_price_test.go (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • x/oracle/keeper/native_token.go
  • x/oracle/keeper/nonce.go
  • app/app.go
  • proto/exocore/oracle/v1/recent_msg.proto
  • client/docs/swagger-ui/swagger.json
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: test-unit-e2e
  • GitHub Check: ante-benchmark-test
  • GitHub Check: Analyze (go)
  • GitHub Check: goreleaser
🔇 Additional comments (25)
app/ante/utils/oracle.go (2)

8-8: LGTM! Documentation updated to reflect new terminology.

The comment has been correctly updated to use "price-feed" instead of "create-price".


11-22: LGTM! Function renamed and message type check updated.

The function has been correctly renamed from IsOracleCreatePriceTx to IsOraclePriceFeedTx and the message type check has been updated to use MsgPriceFeed. The changes are consistent with the PR objective.

x/oracle/types/codec.go (2)

11-11: LGTM! Message type registration updated.

The concrete type registration has been correctly updated to use MsgPriceFeed and "oracle/PriceFeed".


17-19: LGTM! Interface registration updated.

The interface registration has been correctly updated to use MsgPriceFeed.

x/oracle/types/message_create_price_test.go (1)

13-42: LGTM! Test function and message types updated.

The test function has been correctly renamed and all message types have been updated to use MsgPriceFeed. The test logic remains unchanged.

x/oracle/keeper/validate_timestamp.go (1)

12-31: LGTM! Function parameter type updated.

The function parameter type has been correctly updated from MsgCreatePrice to MsgPriceFeed. The function logic remains unchanged.

x/oracle/client/cli/tx.go (1)

31-31: Breaking Change: CLI command renamed.

The command registration has been updated from CmdCreatePrice() to CmdPriceFeed(). This is a breaking change that will affect CLI users who have scripts or documentation referencing the old command.

Please ensure:

  1. Documentation is updated to reflect the new command name
  2. Release notes mention this breaking change
  3. Migration guide is provided for users
x/oracle/types/message_create_price.go (1)

11-21: LGTM: Message type renamed consistently.

The message type and all its associated methods have been consistently renamed from MsgCreatePrice to MsgPriceFeed. The implementation remains unchanged, maintaining the existing functionality.

Also applies to: 23-50

app/ante/evm/fee_market.go (1)

33-33: LGTM! Function name updated consistently.

The renaming from IsOracleCreatePriceTx to IsOraclePriceFeedTx aligns with the PR objective.

x/oracle/client/cli/tx_create_price.go (2)

16-21: LGTM! Command name and description updated consistently.

The function name and command description changes align with the PR objective.


74-74: LGTM! Message constructor updated consistently.

The message constructor name change aligns with the PR objective.

app/ante/cosmos/min_price.go (1)

35-35: LGTM! Function name updated consistently.

The renaming from IsOracleCreatePriceTx to IsOraclePriceFeedTx aligns with the PR objective.

app/ante/cosmos/context.go (1)

42-44: LGTM! Consistent renaming of oracle transaction type.

The renaming from OracleCreatePriceTx to OraclePriceFeedTx is consistent with the PR objectives, and the comment has been appropriately updated to reflect the new terminology.

x/oracle/keeper/msg_server_create_price.go (2)

22-23: LGTM! Function and message type renaming is consistent.

The renaming from CreatePrice to PriceFeed and the corresponding message type changes are consistent with the PR objectives.


56-57: Address the TODO comment about event type.

The TODO comment suggests using another event type, but it's not clear what type should be used instead.

Could you clarify what event type would be more appropriate here?

app/ante/cosmos/fees.go (1)

62-62: LGTM!

The function name change from IsOracleCreatePriceTx to IsOraclePriceFeedTx is consistent with the PR objectives and maintains the same functionality.

tests/e2e/oracle/recovery.go (1)

26-27: LGTM!

The changes consistently rename all instances of CreatePrice to PriceFeed while maintaining the same test coverage and functionality. The test scenarios and assertions remain unchanged.

Also applies to: 76-77, 81-82, 105-106, 110-111

tests/e2e/oracle/create_price.go (1)

31-34: LGTM!

The changes consistently rename test functions and update comments to use "price-feed" terminology while maintaining the same test coverage and functionality.

Also applies to: 37-37, 57-58, 60-60, 64-64, 75-77, 80-82, 104-106, 109-111

app/ante/cosmos/sigverify.go (1)

61-62: LGTM!

The changes consistently rename transaction type checks and update comments to use "price-feed" terminology while maintaining the same transaction handling logic.

Also applies to: 176-176, 261-261, 388-389, 391-391

x/oracle/keeper/feedermanagement/feedermanager.go (3)

305-305: LGTM!

The event type has been correctly renamed from EventTypeCreatePrice to EventTypePriceFeed to align with the new terminology.


603-603: LGTM!

The function signature has been correctly updated to use the new MsgPriceFeed type while maintaining the same validation logic.


663-663: LGTM!

The function signature has been correctly updated to use the new MsgPriceFeed type while maintaining the same processing logic.

proto/exocore/oracle/v1/tx.proto (3)

16-17: LGTM!

The RPC method has been correctly renamed from CreatePrice to PriceFeed with an appropriate comment update.


22-23: LGTM!

The message type has been correctly renamed from MsgCreatePrice to MsgPriceFeed with an appropriate comment update.


37-38: LGTM!

The response message type has been correctly renamed from MsgCreatePriceResponse to MsgPriceFeedResponse.

Copy link
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: 0

🧹 Nitpick comments (1)
cmd/exocored/root.go (1)

144-167: Consider creating a tracking issue for re-enabling the price feeder.

The TODO comments clearly explain that this is a temporary measure to fix dependency conflicts. However, to ensure this technical debt is properly tracked:

  1. Create a dedicated issue to track the re-enabling of the price feeder
  2. Include the specific version requirements:
    • Update price feeder to use EVMOS v16
    • Update Exocore dependency to include this fix

Would you like me to help create a tracking issue for this technical debt?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 267a07f and 478e85e.

📒 Files selected for processing (3)
  • cmd/exocored/root.go (2 hunks)
  • x/oracle/types/events.go (1 hunks)
  • x/oracle/types/message_create_price.go (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: test-unit-e2e
  • GitHub Check: test-unit-cover
  • GitHub Check: Analyze (go)
  • GitHub Check: ante-benchmark-test
  • GitHub Check: goreleaser
🔇 Additional comments (3)
x/oracle/types/message_create_price.go (1)

9-50: LGTM! Consistent renaming of message type.

The renaming from CreatePrice to PriceFeed has been applied consistently across the message type definition, constructor, and all interface methods.

x/oracle/types/events.go (1)

4-4: LGTM! Event type renamed consistently.

The event type has been correctly renamed from "create_price" to "price_feed", maintaining consistency with the message type changes.

cmd/exocored/root.go (1)

53-54: LGTM! Imports correctly commented out.

The price feeder imports have been properly commented out, maintaining code cleanliness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant