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: delete default snapshot url for bitcoind docker-compose #3442

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

julianrubino
Copy link
Member

@julianrubino julianrubino commented Jan 30, 2025

Description

  • Delete default snapshot URL for bitcoind docker-compose

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • Configuration Update
    • Removed snapshot URL configuration for Bitcoin service
    • Minor formatting adjustment in Docker Compose file

- Delete default snapshot URL for bitcoind docker-compose
Copy link
Contributor

coderabbitai bot commented Jan 30, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The pull request involves a modification to the docker-compose.yml file for the Bitcoin service configuration. Specifically, the SNAPSHOT_URL environment variable has been removed from the configuration. This change suggests a potential shift in how snapshot URLs are managed or retrieved for the Bitcoin RPC service. The modification appears to be a targeted adjustment to the environment variable setup, with minimal impact on the overall service configuration.

Changes

File Change Summary
contrib/rpc/bitcoind-mainnet/docker-compose.yml - Removed SNAPSHOT_URL environment variable
- Added a newline after bitcoin_data volume declaration

Possibly related PRs

Suggested Reviewers

  • lumtis
  • fbac
  • skosito
  • kingpinXD
  • ws4charlie
  • brewmaster012
  • gartnera
  • swift1337

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

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.

@julianrubino julianrubino changed the title Delete default snapshot url for bitcoind docker-compose chore: delete default snapshot url for bitcoind docker-compose Jan 30, 2025
@julianrubino julianrubino added the no-changelog Skip changelog CI check label Jan 30, 2025
@julianrubino julianrubino marked this pull request as ready for review January 30, 2025 17:44
@julianrubino julianrubino requested a review from a team as a code owner January 30, 2025 17:44
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

🔭 Outside diff range comments (1)
contrib/rpc/bitcoind-mainnet/docker-compose.yml (1)

Line range hint 7-8: Consider using environment variables for sensitive credentials.

The Bitcoin RPC credentials are currently hardcoded. While these might be test credentials, it's a security best practice to externalize them.

    environment:
-      - bitcoin_username=test
-      - bitcoin_password=test
+      - bitcoin_username=${BITCOIN_RPC_USER:-test}
+      - bitcoin_password=${BITCOIN_RPC_PASS:-test}
🧹 Nitpick comments (2)
contrib/rpc/bitcoind-mainnet/docker-compose.yml (2)

Line range hint 10-11: Consider parameterizing the network height URL.

The blockstream.info API endpoint is hardcoded. Consider making it configurable to support different providers or environments.

-      - NETWORK_HEIGHT_URL=https://blockstream.info/api/blocks/tip/height
+      - NETWORK_HEIGHT_URL=${BITCOIN_HEIGHT_API:-https://blockstream.info/api/blocks/tip/height}

Line range hint 12-13: Consider externalizing wallet configuration.

The wallet name and address are hardcoded. Consider making them configurable through environment variables for different environments.

-      - WALLET_NAME=tssMainnet
-      - WALLET_ADDRESS=bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y
+      - WALLET_NAME=${BITCOIN_WALLET_NAME:-tssMainnet}
+      - WALLET_ADDRESS=${BITCOIN_WALLET_ADDRESS:-bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 084100a and 51c5994.

📒 Files selected for processing (1)
  • contrib/rpc/bitcoind-mainnet/docker-compose.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: start-e2e-test / e2e
  • GitHub Check: build-and-test
  • GitHub Check: gosec
  • GitHub Check: Analyze (go)
🔇 Additional comments (2)
contrib/rpc/bitcoind-mainnet/docker-compose.yml (2)

22-22: LGTM!

The newline addition after the volume declaration improves readability.


Line range hint 9-14: Verify snapshot configuration consistency.

The removal of SNAPSHOT_URL while retaining other snapshot-related flags (SNAPSHOT_RESTORE=true, CLEAN_SNAPSHOT=true, DOWNLOAD_SNAPSHOT=true) raises concerns about the snapshot functionality.

✅ Verification successful

Snapshot configuration is consistent with documented architecture

The removal of SNAPSHOT_URL is intentional as the system uses the centralized SNAPSHOT_API configuration (https://snapshots.rpc.zetachain.com) as documented in docs/development/DEPLOY_NODES.md. The remaining flags (SNAPSHOT_RESTORE, CLEAN_SNAPSHOT, DOWNLOAD_SNAPSHOT) are correctly maintained to control the snapshot functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any alternative snapshot URL configuration or documentation
rg -l "SNAPSHOT_URL|snapshot.*url" --type yaml --type md

# Check if there are any recent changes to snapshot-related configuration
git log -p --since="1 month ago" -- "**/docker-compose*.yml" | grep -i "snapshot"

Length of output: 58


Script:

#!/bin/bash
# Check git history for the specific file
git log -p contrib/rpc/bitcoind-mainnet/docker-compose.yml | grep -A 5 -B 5 "SNAPSHOT"

# Search for snapshot-related configurations more broadly
rg -i "snapshot" --type yaml -A 3 -B 3

# Look for documentation files about configuration
fd -e md -e txt | xargs rg -i "snapshot.*configuration|bitcoin.*snapshot" -A 3 -B 3

# Search for environment variable definitions
rg -i "export.*snapshot|snapshot.*=|snapshot_url" --type sh --type yaml

Length of output: 1559


Script:

#!/bin/bash
# Search for environment files and bitcoin snapshot configurations
fd -e env -e conf | xargs rg -i "snapshot.*url|bitcoin.*snapshot"

# Check for any bitcoin-specific configuration files
fd -g "*bitcoin*.{yml,yaml,conf,env}" | xargs cat

# Search for any URL patterns in the bitcoin directory
rg -i "https.*snapshot|snapshot.*https" contrib/rpc/bitcoind-mainnet/

Length of output: 316

Copy link
Member

@gartnera gartnera left a comment

Choose a reason for hiding this comment

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

I'd just delete the whole thing

@julianrubino
Copy link
Member Author

I'd just delete the whole thing

the whole docker compose file? @gartnera

@gartnera
Copy link
Member

I'd just delete the whole thing

the whole docker compose file? @gartnera

The compose file, the shell scripts, the makefile targets. Everything.

@julianrubino julianrubino requested a review from gartnera January 30, 2025 18:08
@julianrubino julianrubino added this pull request to the merge queue Jan 30, 2025
Merged via the queue into develop with commit 1ac6f71 Jan 30, 2025
44 checks passed
@julianrubino julianrubino deleted the fix/delete-default-btc-rpc-snapshot branch January 30, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants