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

chore: rename UMEE token to UX token part1 #2328

Merged
merged 27 commits into from
Feb 8, 2024
Merged

Conversation

robert-zaremba
Copy link
Member

@robert-zaremba robert-zaremba commented Nov 16, 2023

Description

Changes:

  • changed umee denom Name and DisplaytoUX`
  • but does NOT change
    • the stake denom itself, it's still uumee (this will cause problems with IBC and transfers)
    • Symbol, it's still UMEE (this will cause errors with Oracle)
  • added aliases to the stake denom: ux and uux.

This won't allow to query nor send tokens by alias, but will allow to show it in the metadata.

Changing base name creates many problems, which I will document in Notion.

Summary by CodeRabbit

  • New Features
    • Introduced a centralized logic for token metadata creation.
    • Added support for UX and uux denom aliases for UMEE.
    • Implemented migration for UMEE to UX token metadata.
    • Added a new Cosmos SDK parameter for governance proposals.
    • Registered a new upgrade handler for version "v6.4" with specific migration logic.
  • Bug Fixes
    • Corrected the interest rate algorithm and token parameter validation rules.
  • Documentation
    • Updated comments and documentation related to token denominations and gas limits.
    • Added a note on IBC implications for BondDenom.
  • Refactor
    • Simplified function signatures by removing unused chainID parameters in various modules.
    • Extracted umeeTokenMetadata function for improved code organization.
  • Tests
    • Added a test function TestDenoms to validate several denominations.
  • Chores
    • Updated CHANGELOG.md with recent changes.
    • Adjusted test helpers to use updated parameters.

Copy link
Contributor

coderabbitai bot commented Nov 17, 2023

Walkthrough

The recent changes streamline and enhance the handling of token metadata and denominations within the application. By centralizing the creation of UmeeTokenMetadata, updating denomination standards, and preparing for a significant upgrade to version "v6.4", these updates aim to improve consistency, facilitate migrations, and support new functionalities. The modifications touch upon various aspects of the app, from parameters and settings to upgrade mechanisms and simulation operations, reflecting a comprehensive effort to refine and evolve the platform's capabilities.

Changes

Files Change Summaries
app/modules.go, app/.../app_settings.go Centralized UmeeTokenMetadata creation, updated denominations, and introduced new constants and parameters.
app/upgrades.go Added upgrade logic for version "v6.4", including migrations and parameter initialization.
CHANGELOG.md Documented changes related to UX denomination, interest rate algorithm, and token parameters.
app/params/..., app/test_helpers.go Added tests for denominations, updated test helpers with new parameters.
x/leverage/..., x/oracle/... Simplified function signatures by removing unused parameters.
.revive.toml, app/wasm/query/whitelist.go Minor tweaks to configuration and code cleanup.

Poem

🐇 "In the realm of code, where tokens flow,
A rabbit hopped, making changes glow.
'Twas not just a tweak, but a leap so bold,
In the ledger's tale, a new chapter told." 🌟

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@robert-zaremba robert-zaremba marked this pull request as ready for review November 17, 2023 21:11
@robert-zaremba robert-zaremba requested a review from a team as a code owner November 17, 2023 21:11
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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 698d078 and ecdf28b.
Files selected for processing (3)
  • app/modules.go (2 hunks)
  • app/params/app_settings.go (1 hunks)
  • app/upgrades.go (2 hunks)
Additional comments: 5
app/modules.go (3)
  • 31-40: The renaming of the token from UMEE to UX is reflected here. Ensure that the appparams.DisplayDenom is correctly set to "UX" in the app/params/app_settings.go file. Also, verify that the Base field, which must not change, is still correctly set to the base denomination (e.g., "uumee" or "uux" if that has been changed as well).

  • 43-51: The update includes handling for both the new and legacy denominations. Ensure that the appparams.BaseExtraDenom is set to the new base denomination (e.g., "uux") and that appparams.LegacyDisplayDenom is set to "UMEE" for backward compatibility. This is important for a smooth transition and to avoid breaking changes for existing users and integrations.

  • 57-62: The DefaultGenesis function has been updated to include the new token metadata in the genesis state. This is a critical part of the renaming operation, as it ensures that the new token metadata is included from the start of the blockchain. Ensure that the umeeTokenMetadata function is called correctly and that the DenomMetadata is properly appended to the genState.

app/upgrades.go (2)
  • 115-125: The migration logic for the UMEE to UX token metadata is critical and should be carefully reviewed to ensure that it correctly updates the metadata for the new UX token. It's important to verify that the umeeTokenMetadata() function generates the correct banktypes.Metadata structure for the UX token. Additionally, the new parameter MinInitialDepositRatio is being set for the governance module, which should be checked for correctness and compatibility with the Cosmos SDK 0.47 governance parameters.

  • 131-135: The migration logic for the uibc module includes a call to MigrateTotalOutflowSum() and SetParams(uibc.DefaultParams()). It's important to ensure that these methods are correctly implemented and that they handle the migration of any state or parameters necessary for the uibc module to function correctly with the new UX token. Additionally, error handling is present, but it's crucial to verify that all potential errors are being handled appropriately and that the migration will not leave the system in an inconsistent state if an error occurs.

app/params/app_settings.go Outdated Show resolved Hide resolved
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ecdf28b and e3ec745.
Files selected for processing (1)
  • app/params/app_settings.go (1 hunks)
Additional comments: 1
app/params/app_settings.go (1)
  • 11-26: The changes reflect the renaming of the UMEE token to UX token. The addition of BaseExtraDenom and LegacyDisplayDenom constants, as well as the update to DisplayDenom, are consistent with the pull request's goal to update the token's metadata while maintaining the base stake denomination (uumee). These changes should be cross-verified with other parts of the codebase to ensure that the new constants are used correctly and that the renaming does not affect the functionality of the blockchain, especially in areas where the denomination is used for calculations or transactions.

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.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e3ec745 and 942bb8e.
Files selected for processing (3)
  • app/params/app_settings.go (2 hunks)
  • app/params/app_settings_test.go (1 hunks)
  • app/params/prefix.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/params/prefix.go
Additional comments: 1
app/params/app_settings.go (1)
  • 11-26: The introduction of BaseExtraDenom, DisplayDenom, and LegacyDisplayDenom constants is a clear way to manage the transition from "UMEE" to "UX". It's important to ensure that all parts of the application that use these constants are updated accordingly to reflect the new naming convention. The comment on line 14 is especially important as it highlights the need to maintain BondDenom for IBC compatibility, which is a good practice to avoid breaking changes in inter-blockchain communication.

app/params/app_settings_test.go Show resolved Hide resolved
app/params/app_settings.go Outdated Show resolved Hide resolved
app/modules.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@gsk967 gsk967 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 942bb8e and 169f1c5.
Files selected for processing (1)
  • app/modules.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/modules.go

@robert-zaremba robert-zaremba changed the title DNM chore: rename UMEE token to UX token chore: rename UMEE token to UX token Nov 20, 2023
@robert-zaremba robert-zaremba changed the title chore: rename UMEE token to UX token chore: rename UMEE token to UX token part1 Nov 20, 2023
Copy link

stale bot commented Dec 20, 2023

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the S:Stale label Dec 20, 2023
@stale stale bot closed this Dec 28, 2023
@robert-zaremba robert-zaremba reopened this Jan 3, 2024
@stale stale bot removed the S:Stale label Jan 3, 2024
@robert-zaremba robert-zaremba requested a review from a team as a code owner February 8, 2024 21:59
@stale stale bot removed S:Stale labels Feb 8, 2024
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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2c67224 and 1621e95.
Files selected for processing (10)
  • app/modules.go (1 hunks)
  • app/params/app_settings.go (2 hunks)
  • app/test_helpers.go (3 hunks)
  • app/upgrades.go (3 hunks)
  • tests/cli/suite.go (1 hunks)
  • tests/e2e/setup/setup.go (1 hunks)
  • x/leverage/client/tests/tests.go (3 hunks)
  • x/leverage/types/token.go (1 hunks)
  • x/oracle/abci_test.go (1 hunks)
  • x/oracle/client/tests/suite.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/upgrades.go
Additional comments: 15
app/params/app_settings.go (4)
  • 15-17: The comment on BondDenom correctly emphasizes its importance for IBC operations, ensuring awareness of the implications of changing this value.
  • 20-22: Renaming DisplayDenom to "UX" and introducing LegacyDisplayDenom as "UMEE" aligns with the rebranding effort. Ensure all references to these denominations across the codebase are updated accordingly.
  • 45-48: Modifying the regex in sdk.SetCoinDenomRegex to allow 2-character denominations is a necessary change given the new "UX" denomination. This adjustment maintains the flexibility of denomination naming while adhering to the new requirements.
  • 51-72: The UmeeTokenMetadata function correctly sets up bank metadata for the UX token, ensuring consistency with the new denomination and symbol. The use of constants for Base, Name, Display, and Symbol fields ensures maintainability and clarity.
tests/cli/suite.go (1)
  • 66-67: Switching to assert.DeepEqual for comparing ExpectedResponse and Response is appropriate for ensuring a more thorough comparison in tests. The added logging statement enhances test diagnostics by providing context for the test name.
app/modules.go (1)
  • 36-36: Using appparams.UmeeTokenMetadata() to initialize umeeMetadata in the DefaultGenesis method centralizes token metadata definition, improving maintainability and consistency across the application.
x/oracle/client/tests/suite.go (1)
  • 180-180: Updating the Denom field comparison to appparams.LegacyDisplayDenom in the TestQueryExchangeRates function aligns with the rebranding changes and ensures the test reflects the current state of the application.
x/leverage/types/token.go (1)
  • 162-165: Retrieving token metadata from appparams.UmeeTokenMetadata() to set BaseDenom and SymbolDenom in the defaultUmeeToken function ensures consistency with the application's token configuration and centralizes metadata definition.
x/oracle/abci_test.go (1)
  • 27-27: Updating the displayDenom constant to appparams.LegacyDisplayDenom in the test file aligns with the rebranding changes and ensures the test reflects the current state of the application.
app/test_helpers.go (2)
  • 253-255: The usage of appparams.UmeeTokenMetadata() is correct and aligns with the PR objectives to update token metadata as part of the rebranding effort.
  • 274-279: Correct use of params.LegacyDisplayDenom in setting mock exchange rates and historic medians for oracle operations. This change is consistent with the PR's goal to update token denominations without affecting IBC and Oracle operations.
x/leverage/client/tests/tests.go (3)
  • 94-94: Correct update from DisplayDenom to LegacyDisplayDenom in test setup, aligning with the PR's rebranding objectives.
  • 116-116: The update to use LegacyDisplayDenom for registered token info in tests is appropriate and consistent with the rebranding effort.
  • 129-134: Adjustment of SymbolDenom to LegacyDisplayDenom and update of Supply_APY value in market summary query test are correctly implemented, reflecting the rebranding changes.
tests/e2e/setup/setup.go (1)
  • 217-219: Correct implementation of using appparams.UmeeTokenMetadata() to set token metadata for a token fixture in e2e test setup. This change aligns with the PR's rebranding objectives.

app/test_helpers.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: 194 lines in your changes are missing coverage. Please review.

Comparison is base (7f05ad4) 75.38% compared to head (8458588) 69.15%.
Report is 375 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2328      +/-   ##
==========================================
- Coverage   75.38%   69.15%   -6.24%     
==========================================
  Files         100      184      +84     
  Lines        8025    10776    +2751     
==========================================
+ Hits         6050     7452    +1402     
- Misses       1589     2714    +1125     
- Partials      386      610     +224     
Files Coverage Δ
ante/ante.go 74.19% <100.00%> (+25.97%) ⬆️
ante/fee.go 80.82% <100.00%> (+2.47%) ⬆️
ante/spam_prevention.go 81.39% <ø> (+5.46%) ⬆️
app/inflation/inflation.go 100.00% <100.00%> (ø)
app/params/prefix.go 100.00% <ø> (ø)
app/upgradev3/migrations.go 86.66% <ø> (+8.40%) ⬆️
sdkclient/tx/sign.go 0.00% <ø> (ø)
util/coin/utoken.go 100.00% <100.00%> (ø)
util/genmap/genmap.go 100.00% <100.00%> (ø)
util/ibc/ibc.go 64.28% <ø> (+5.46%) ⬆️
... and 46 more

... and 139 files with indirect coverage changes

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1621e95 and 044a0da.
Files selected for processing (7)
  • .revive.toml (1 hunks)
  • app/test_helpers.go (2 hunks)
  • app/upgrades.go (5 hunks)
  • app/wasm/query/whitelist.go (1 hunks)
  • x/leverage/simulation/operations.go (7 hunks)
  • x/oracle/keeper/keeper_test.go (1 hunks)
  • x/oracle/simulations/operations.go (3 hunks)
Files skipped from review due to trivial changes (1)
  • .revive.toml
Files skipped from review as they are similar to previous changes (2)
  • app/test_helpers.go
  • app/upgrades.go
Additional comments: 13
x/oracle/simulations/operations.go (3)
  • 114-114: Ensure all calls to SimulateMsgAggregateExchangeRatePrevote have been updated to match the new function signature without chainID.
  • 158-158: Ensure all calls to SimulateMsgAggregateExchangeRateVote have been updated to match the new function signature without chainID.
  • 200-200: Ensure all calls to SimulateMsgDelegateFeedConsent have been updated to match the new function signature without chainID.
app/wasm/query/whitelist.go (1)
  • 171-171: Ensure the removal of the value variable in the Range function call does not impact the intended functionality of collecting whitelisted query paths.
x/oracle/keeper/keeper_test.go (2)
  • 31-31: Ensure the update to displayDenom using appparams.LegacyDisplayDenom is consistent with the intended test scenarios and does not affect the validity of the tests.
  • 33-33: Verify that the direct assignment of initialPower to int64(10000000000) is appropriate for the test scenarios and does not introduce any unintended side effects.
x/leverage/simulation/operations.go (7)
  • 126-126: Ensure all calls to SimulateMsgSupply have been updated to match the new function signature without chainID.
  • 144-144: Ensure all calls to SimulateMsgWithdraw have been updated to match the new function signature without chainID.
  • 162-162: Ensure all calls to SimulateMsgBorrow have been updated to match the new function signature without chainID.
  • 183-183: Ensure all calls to SimulateMsgCollateralize have been updated to match the new function signature without chainID.
  • 205-205: Ensure all calls to SimulateMsgDecollateralize have been updated to match the new function signature without chainID.
  • 223-223: Ensure all calls to SimulateMsgRepay have been updated to match the new function signature without chainID.
  • 241-241: Ensure all calls to SimulateMsgLiquidate have been updated to match the new function signature without chainID.

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 1621e95 and 8458588.
Files selected for processing (11)
  • .golangci.yml (1 hunks)
  • .revive.toml (1 hunks)
  • app/test_helpers.go (2 hunks)
  • app/upgrades.go (5 hunks)
  • app/wasm/query/whitelist.go (1 hunks)
  • x/leverage/simulation/operations.go (7 hunks)
  • x/oracle/keeper/grpc_query_test.go (1 hunks)
  • x/oracle/keeper/hooks_test.go (1 hunks)
  • x/oracle/keeper/keeper_test.go (1 hunks)
  • x/oracle/simulations/operations.go (3 hunks)
  • x/uibc/quota/intest/suite_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (7)
  • .revive.toml
  • app/test_helpers.go
  • app/upgrades.go
  • app/wasm/query/whitelist.go
  • x/leverage/simulation/operations.go
  • x/oracle/keeper/keeper_test.go
  • x/oracle/simulations/operations.go
Additional comments: 3
x/oracle/keeper/hooks_test.go (1)
  • 15-15: Change from appparams.DisplayDenom to appparams.LegacyDisplayDenom aligns with the renaming objective and maintains backward compatibility in tests.
x/uibc/quota/intest/suite_test.go (1)
  • 28-33: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

Verify that the removal of displayDenom constant doesn't break tests or references within this file or related test files.

Verification successful

The search for references to displayDenom within the x/uibc/quota/intest/ directory did not find any occurrences. This suggests that within this specific directory, the removal of the displayDenom constant does not directly impact any tests or references. However, this verification is limited to the x/uibc/quota/intest/ directory, and it's recommended to review other parts of the codebase for potential impacts of this change.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for references to `displayDenom` in test files to ensure they are updated or removed.
rg --type go 'displayDenom' x/uibc/quota/intest/

Length of output: 48

x/oracle/keeper/grpc_query_test.go (1)
  • 121-121: Change from appparams.DisplayDenom to appparams.LegacyDisplayDenom is consistent with the renaming initiative and maintains backward compatibility in tests.

.golangci.yml Show resolved Hide resolved
@robert-zaremba robert-zaremba added this pull request to the merge queue Feb 8, 2024
Merged via the queue into main with commit 68ed1d3 Feb 8, 2024
26 of 28 checks passed
@robert-zaremba robert-zaremba deleted the robert/ux-token branch February 8, 2024 23:57
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