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

Add check-node-configuration command #923

Merged
merged 4 commits into from
Oct 31, 2024
Merged

Add check-node-configuration command #923

merged 4 commits into from
Oct 31, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Oct 4, 2024

Changelog

- description: |
    Add the `debug check-node-configuration --node-configuration-file node-config.json` command
    that reads `node-config.json` and checks that the hashes of genesis files are correct.
# uncomment types applicable to the change:
  type:
  - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

How to trust this PR

Try it yourself:

  • Extract the 922.zip file
  • Run the command on the zip's content: cabal run cardano-cli -- debug check-node-configuration --node-configuration-file node-config.json
  • Try to change the hashes with the node-config.json file. Rerun the command and observe that it detects the change.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/check-node-config branch 5 times, most recently from c740c1f to 9a6f631 Compare October 7, 2024 09:26
@smelc smelc force-pushed the smelc/check-node-config branch 2 times, most recently from 66c8ef2 to 9d4dba7 Compare October 8, 2024 08:52
@smelc smelc marked this pull request as ready for review October 8, 2024 09:08
@smelc smelc mentioned this pull request Oct 8, 2024
3 tasks
@smelc smelc force-pushed the smelc/check-node-config branch 2 times, most recently from 4be047d to 212c3d2 Compare October 10, 2024 08:44
Copy link
Contributor

@carbolymer carbolymer left a comment

Choose a reason for hiding this comment

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

LGTM. I think I'll leave the approval to @Jimbo4350

@smelc smelc force-pushed the smelc/check-node-config branch 4 times, most recently from d8c18e5 to 5b42105 Compare October 10, 2024 12:32
@smelc smelc marked this pull request as draft October 10, 2024 14:31
@smelc
Copy link
Contributor Author

smelc commented Oct 10, 2024

Putting back to draft while I change the code to use NodeConfig.

@smelc smelc force-pushed the smelc/check-node-config branch 2 times, most recently from f64d941 to 682dc9a Compare October 11, 2024 15:25
@smelc smelc force-pushed the smelc/check-node-config branch 4 times, most recently from 7ed8319 to 78c0fe5 Compare October 15, 2024 10:12
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

#923 (comment)

Also we need to come up with a better name than Analysis.

@smelc smelc force-pushed the smelc/check-node-config branch from 78c0fe5 to 2e88aae Compare October 16, 2024 09:17
@smelc
Copy link
Contributor Author

smelc commented Oct 16, 2024

Also we need to come up with a better name than Analysis.

Renamed to CheckGenesisAnalysis, but please note that this name is not exported, so using a short name was fine IMO 🙂

@smelc smelc force-pushed the smelc/check-node-config branch 2 times, most recently from 27126cd to 637e846 Compare October 16, 2024 11:51
@smelc smelc requested a review from Jimbo4350 October 16, 2024 11:53
@smelc smelc force-pushed the smelc/check-node-config branch from 637e846 to f6d4b34 Compare October 16, 2024 11:59
@smelc smelc force-pushed the smelc/check-node-config branch 4 times, most recently from d4a4536 to 622f434 Compare October 29, 2024 10:23
@smelc smelc force-pushed the smelc/check-node-config branch from 622f434 to 38f2ef5 Compare October 30, 2024 15:41
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

LGTM! One requested change.


-- | Semaphore protecting against locked file error, when running properties concurrently.
nodeConfigSem :: FileSem
nodeConfigSem = newFileSem "test/cardano-cli-test/files/input/check-node-configuration/node-config.json"
Copy link
Contributor

@Jimbo4350 Jimbo4350 Oct 30, 2024

Choose a reason for hiding this comment

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

Are these tests actually run concurrently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes parallelism happens even within a single file. cc @carbolymer

@smelc smelc added this pull request to the merge queue Oct 31, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 31, 2024
@smelc smelc added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit cd0d31a Oct 31, 2024
25 checks passed
@smelc smelc deleted the smelc/check-node-config branch October 31, 2024 10:50
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.

Add check-node-configuration command
3 participants