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

relay-cli: Handle None case for shared base path #1135

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

cdamian
Copy link
Contributor

@cdamian cdamian commented Dec 15, 2022

Description

When running the centrifuge-chain locally, if no base-path is provided to the relay chain args then a random temp directory is used which can cause inconsistent behavior such as the chain not producing blocks due to invalid/stale data in the db.

Changes and Descriptions

The changes in this PR aim at handling the case where shared_params().base_path() is a Result(None) which results in the behavior described above.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested by running the chain locally and confirming that the base_path set in the init script is used for the relay chain.

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I rebased on the latest main branch

@cdamian cdamian force-pushed the relay-cli-handle-shared-base-path branch from 8efa8c3 to 5c54e3e Compare December 15, 2022 15:45
mustermeiszer
mustermeiszer previously approved these changes Dec 16, 2022
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

cc: @mikiquantum the reason being is that we had a silent logic change on the Substrate side, where the cli implementation now provides temp paths automatically when running in dev mode and no path is provided to the relay-chain cli.

Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

LGTM!

@cdamian cdamian enabled auto-merge (squash) December 16, 2022 10:20
@cdamian cdamian merged commit 6ee509a into main Dec 16, 2022
@cdamian cdamian deleted the relay-cli-handle-shared-base-path branch December 16, 2022 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.

2 participants