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

revert: upgrade to Core v22 #2354

Merged
merged 10 commits into from
Nov 27, 2024
Merged

revert: upgrade to Core v22 #2354

merged 10 commits into from
Nov 27, 2024

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Nov 27, 2024

Issue being fixed or feature implemented

Core 22 release is delayed so we are going to release 1.6 ASAP since it contains important bug fixes.

What was done?

  • Reverted changes related to Core 22

How Has This Been Tested?

None

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • New Features

    • Introduced improved synchronization checks for node configurations.
    • Added user-friendly time formatting for platform activation messages.
  • Bug Fixes

    • Enhanced error handling for service status retrieval.
  • Refactor

    • Reorganized task sequences for better clarity and functionality in core configuration tasks.
    • Updated Docker image versions for better compatibility with network types.
  • Documentation

    • Updated method signatures to reflect changes in functionality.

@shumkov shumkov added this to the v1.6.0 milestone Nov 27, 2024
Copy link
Contributor

coderabbitai bot commented Nov 27, 2024

Walkthrough

The changes in this pull request primarily involve updates to Docker image versions and modifications to configuration management functions within the Dashmate project. Key alterations include downgrading the Docker image version in getBaseConfigFactory.js, updating the Docker image for migrations in getConfigFileMigrationsFactory.js, and reorganizing task sequences in configureCoreTaskFactory.js. Additionally, enhancements to user messaging and error handling are made in platform.js, ensuring that the overall functionality remains intact while improving clarity and synchronization in the task execution.

Changes

File Path Change Summary
packages/dashmate/configs/defaults/getBaseConfigFactory.js Updated Docker image version from 22.0.0-rc.1 to 21 in getBaseConfigFactory function.
packages/dashmate/configs/getConfigFileMigrationsFactory.js Updated Docker image version for migration to 22.0.0-rc.1, maintaining backward compatibility for previous versions.
packages/dashmate/src/listr/tasks/setup/local/configureCoreTaskFactory.js Reorganized task sequence, added new tasks for spork synchronization and DIP8 activation, and updated activation heights.
packages/dashmate/src/status/scopes/platform.js Enhanced activation messaging using prettyMs and refined error handling in getDriveInfo function.

Possibly related PRs

Suggested labels

dashmate

Suggested reviewers

  • QuantumExplorer

🐇 In the land of code where changes bloom,
A rabbit hops in with joy to zoom!
Docker versions shift, tasks rearranged,
With pretty messages, the platform's changed.
Synchronize the sporks, let the nodes align,
In Dashmate's garden, everything's fine! 🌼


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.

@shumkov shumkov changed the title revert: upgrade to Core 22 revert: upgrade to Core v22 Nov 27, 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: 3

🧹 Outside diff range and nitpick comments (2)
packages/dashmate/src/status/scopes/platform.js (1)

315-319: Consider moving this fix to a separate PR

This bug fix for platform activation timing calculation appears unrelated to reverting Core 22 upgrade changes. To maintain clear change history and facilitate easier rollbacks if needed, consider moving this fix to a separate PR focused on bug fixes.

packages/dashmate/src/listr/tasks/setup/local/configureCoreTaskFactory.js (1)

Line range hint 400-445: Simplify EHF activation check using optional chaining

Use optional chaining in the EHF activation check to avoid potential TypeError exceptions.

Apply the following change:

- isEhfActivated = blockchainInfo.softforks && blockchainInfo.softforks.mn_rr
-   && blockchainInfo.softforks.mn_rr.active;
+ isEhfActivated = blockchainInfo.softforks?.mn_rr?.active;
🧰 Tools
🪛 Biome (1.9.4)

[error] 424-425: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 840dcec and c31dacb.

⛔ Files ignored due to path filters (1)
  • packages/dashmate/templates/core/dash.conf.dot is excluded by !**/*.dot
📒 Files selected for processing (4)
  • packages/dashmate/configs/defaults/getBaseConfigFactory.js (1 hunks)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js (0 hunks)
  • packages/dashmate/src/listr/tasks/setup/local/configureCoreTaskFactory.js (7 hunks)
  • packages/dashmate/src/status/scopes/platform.js (2 hunks)
💤 Files with no reviewable changes (1)
  • packages/dashmate/configs/getConfigFileMigrationsFactory.js
🧰 Additional context used
🪛 Biome (1.9.4)
packages/dashmate/src/listr/tasks/setup/local/configureCoreTaskFactory.js

[error] 365-366: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 424-425: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (7)
packages/dashmate/configs/defaults/getBaseConfigFactory.js (2)

56-56: Version downgrade approved but testing is required.

The Docker image downgrade from '22.0.0-rc.1' to '21' aligns with the PR objective to revert Core 22 upgrade. However, since no testing has been performed according to the PR description, this change requires validation.

Let's verify the version consistency across related configurations:

✅ Verification successful

Version consistency verified across configurations

The version check confirms that:

  • The new Core 21 version is correctly set in the base config
  • No remaining references to Core 22 exist in the codebase
  • Other version references are only in test fixtures with older versions (19.x and 20.x)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to Core 22 or version inconsistencies

# Search for any remaining Core 22 references
echo "Checking for Core 22 references..."
rg -i "22\.0\.0|core.*22" --type js

# Search for Docker image version references
echo "Checking Docker image versions..."
rg "dashpay/dashd:[\"']?\d+" --type js

Length of output: 773


56-56: Verify compatibility with platform components.

Since this is a core version downgrade, we need to ensure compatibility with other platform components (dapi, drive) that are using dynamic versioning: dashpay/dapi:${dockerImageVersion} and dashpay/drive:${dockerImageVersion}.

Let's check the version compatibility:

✅ Verification successful

Let me gather more information about the version references and configuration.


Core version 21 is compatible with platform components

The version compatibility is maintained through dynamic versioning in the configuration. The code shows that platform components (DAPI and Drive) use dockerImageVersion which is derived from the package version's major number. When Core is set to version 21, the platform components will automatically use version 21 images through dashpay/dapi:${dockerImageVersion} and dashpay/drive:${dockerImageVersion}.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify version compatibility between core and platform components

# Check platform component version references
echo "Checking platform component versions..."
rg "dashpay/(dapi|drive):\$\{.*\}" --type js -A 5

# Check package.json for version constraints
echo "Checking package.json version constraints..."
fd "package.json" --exec cat {} \; | jq -r 'select(.dependencies != null) | .dependencies'

Length of output: 5918


Script:

#!/bin/bash
# Check for platform component version references in configuration files
echo "Checking configuration files for version references..."
rg "image.*dashpay/(dashd|drive|dapi)" --type js -A 2 -B 2

# Check for docker version variables
echo "Checking for docker version variables..."
rg "dockerImageVersion" --type js -A 2 -B 2

Length of output: 13596

packages/dashmate/src/listr/tasks/setup/local/configureCoreTaskFactory.js (5)

5-5: Import waitForNodesToHaveTheSameSporks

The addition of the import statement for waitForNodesToHaveTheSameSporks is correct and necessary for spork synchronization.


96-98: Verify DIP3 activation height

The DIP3 activation height has been updated to 1000. Please verify that this is the intended value for the network configuration.


129-148: Approved: Wallet creation task

The Create wallet task is correctly implemented with appropriate parameters for wallet initialization.


151-158: Approved: Generating masternode collateral

The calculation of the collateral amount and the invocation of generateToAddressTask are correctly implemented.


280-282: Approved: Waiting for spork synchronization

The task to wait for all nodes to have the same sporks ensures proper network synchronization.

@shumkov shumkov self-assigned this Nov 27, 2024
@shumkov shumkov merged commit 9a17062 into v1.6-dev Nov 27, 2024
25 checks passed
@shumkov shumkov deleted the revert/core-22 branch November 27, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants