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

feat: 🔧 Add CODE_IDs to Transmuter list #4001

Conversation

EnricoBarbieri1997
Copy link
Collaborator

@EnricoBarbieri1997 EnricoBarbieri1997 commented Dec 7, 2024

What is the purpose of the change:

Add version 3.0, 3.1, 3.2 of the Transmuter contract to the transmuter code_id list

Linear Task

https://linear.app/osmosis/issue/FE-1237/issue-with-dogeint3-asset-displaying-incorrectly-in-pools-page

Brief Changelog

  • Add versions 3.0, 3.1, 3.2 of the Transmuter contract to the transmuter code_id list

Notice

This can be closed #3749

Copy link

vercel bot commented Dec 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
osmosis-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2024 1:03pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
osmosis-frontend-datadog ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2024 1:03pm
osmosis-frontend-dev ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2024 1:03pm
osmosis-frontend-edgenet ⬜️ Ignored (Inspect) Dec 8, 2024 1:03pm
osmosis-testnet ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2024 1:03pm

Copy link
Contributor

coderabbitai bot commented Dec 7, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/server/src/queries/complex/pools/env.ts

Oops! Something went wrong! :(

ESLint: 8.50.0

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/packages/server/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Walkthrough

The pull request modifies the TransmuterPoolCodeIds constant in the packages/server/src/queries/complex/pools/env.ts file. The constant's value is updated from an array containing a single code ID "148" to an array with four code IDs: ["148", "814", "867", "996"]. This change impacts the getCosmwasmPoolTypeFromCodeId function, allowing it to recognize multiple valid code IDs for the "cosmwasm-transmuter" type. Additionally, a deprecation notice for the TransmuterPoolCodeIds constant is introduced in the packages/web/config/feature-flag.ts file.

Changes

File Path Change Summary
packages/server/src/queries/complex/pools/env.ts Updated TransmuterPoolCodeIds from ["148"] to ["148", "814", "867", "996"]
packages/web/config/feature-flag.ts Added deprecation notice for TransmuterPoolCodeIds constant.

Possibly related PRs

  • filter out bad pool per request from adam and johnny #3864: The changes in this PR involve the introduction of a constant FILTERABLE_IDS in both packages/web/components/complex/pools-table.tsx and packages/server/src/queries/complex/pools/index.ts, which relates to filtering pool IDs, similar to how the TransmuterPoolCodeIds constant was modified in the main PR to expand the recognized pool IDs.

Suggested reviewers

  • DavideSegullo
  • JoseRFelix
  • mattupham

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>, 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 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.

@EnricoBarbieri1997 EnricoBarbieri1997 changed the title feat: 🔧 Add CODE_ID 996 to Transmuter pool ids feat: 🔧 Add CODE_IDs to Transmuter list Dec 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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f7aa745 and 5da7208.

📒 Files selected for processing (2)
  • packages/server/src/queries/complex/pools/env.ts (1 hunks)
  • packages/web/config/feature-flag.ts (1 hunks)
🔇 Additional comments (2)
packages/web/config/feature-flag.ts (1)

6-9: LGTM! Good practice adding the deprecation notice.

The deprecation notice properly guides developers to the canonical source of truth in the server package.

packages/server/src/queries/complex/pools/env.ts (1)

4-6: LGTM! Verify the new transmuter pool code IDs.

The addition of new code IDs aligns with the PR objective and should help resolve the Dogeint3 asset display issue.

Let's verify these are valid transmuter contract deployments:

✅ Verification successful

LGTM! The new transmuter pool code IDs are valid.

The verification confirms these are legitimate transmuter pool code IDs:

  • The code shows proper integration of transmuter pools in the codebase with 1:1 exchange ratio implementation
  • The TransmuterPool class implementation confirms these are stable-swap style pools with zero swap fees
  • The UI properly identifies and handles these pools as transmuter pools with appropriate icons and routing
  • Code IDs are properly validated through the getCosmwasmPoolTypeFromCodeId function
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the transmuter contract deployments
# Note: Using gh api to query contract info from the chain would be ideal,
# but since we're in a sandbox, we'll search for references in the codebase

# Search for references to these code IDs in the codebase
echo "Searching for references to new transmuter code IDs..."
for id in 814 867 996; do
  echo "=== References to code ID $id ==="
  rg -l "$id" --type ts --type md
done

# Look for any test files or documentation that might validate these IDs
echo -e "\nSearching for transmuter-related tests and docs..."
rg -l "transmuter" --type ts --type md

Length of output: 4236


Script:

#!/bin/bash
# Let's examine the transmuter-related code to verify these IDs are valid transmuter contracts

# Check the transmuter pool implementation and configuration
echo "=== Checking transmuter pool implementation ==="
ast-grep --pattern 'export class TransmuterPool' -A 20

# Look for any configuration or validation of code IDs
echo -e "\n=== Checking code ID validation logic ==="
rg -A 10 "TransmuterPoolCodeIds" --type ts

# Check for any test cases validating these specific code IDs
echo -e "\n=== Checking test cases for these code IDs ==="
rg -A 5 "(814|867|996).+transmuter" --type ts

Length of output: 4037


Script:

#!/bin/bash
# Let's check the transmuter pool implementation and related files

# Check transmuter pool type definition and implementation
echo "=== Checking transmuter pool implementation ==="
rg -A 10 "cosmwasm-transmuter" --type ts

# Check for any transmuter pool configuration or validation
echo -e "\n=== Checking transmuter configuration ==="
fd transmuter.ts -t f -x cat {}

# Look for any recent changes or commits related to these code IDs
echo -e "\n=== Checking recent changes to transmuter pools ==="
git log -n 5 --oneline -- "**/transmuter*" "**/pools*"

Length of output: 19314

Comment on lines +4 to +6
const TransmuterPoolCodeIds = IS_TESTNET
? ["3084"]
: ["148", "814", "867", "996"];
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Configuration mismatch detected between web and server components

The verification reveals an inconsistency in the TransmuterPoolCodeIds configuration between the web and server components:

  • Server (packages/server/src/queries/complex/pools/env.ts): ["148", "814", "867", "996"] for mainnet
  • Web (packages/web/config/feature-flag.ts): ["148"] for mainnet

This mismatch in pool code IDs between frontend and backend could lead to inconsistent pool type identification and display issues.

🔗 Analysis chain

Verify the impact on pools page rendering.

Since this change aims to fix the Dogeint3 asset display issue on the pools page, we should verify the configuration's impact.

Let's search for related pool page components and Dogeint3 references:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find related pool page components and Dogeint3 references

echo "Searching for pool page components..."
rg -l "pools.*page" --type ts --type tsx

echo -e "\nSearching for Dogeint3 asset references..."
rg -l "Dogeint3" --type ts --type tsx --type json

Length of output: 334


Script:

#!/bin/bash
# Let's try a different approach without file type restrictions
echo "Searching for pool page components..."
rg -l "pools.*page"

echo -e "\nSearching for Dogeint3 references..."
rg -l "Dogeint3"

echo -e "\nSearching for usages of TransmuterPoolCodeIds..."
rg "TransmuterPoolCodeIds" -A 3

Length of output: 1982

@EnricoBarbieri1997
Copy link
Collaborator Author

Duplicate of #3749

@EnricoBarbieri1997 EnricoBarbieri1997 marked this as a duplicate of #3749 Dec 12, 2024
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.

1 participant