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

Update postcli for compatibility with multismeshing #270

Merged
merged 8 commits into from
Feb 27, 2024

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Feb 26, 2024

Part of spacemeshos/go-spacemesh#5089

Closes #219

This updates postcli with the changes for multi-smeshing setup.

  • postcli now stores a generated key in identity.key instead of key.bin and informs the user that they have to copy the file to the datadir of the node
  • Added multiple checks to ensure users don't accidentally corrupt or delete their PoST data files:
    • the key in identities.key is checked to be compatible with the NodeID in the postdata_metadata.json file (only if both files are present
    • a provided -id is checked against both the identities.key file and NodeID in postdata_metadata.json and user has to confirm a warning that providing a mismatched value potentially corrupts their data.
    • -numUnits has to be set if postdata_metadata.json cannot be found. If postdata_metadata.json is present the value will be read from there. If the provided value does not match the value in the postdata_metadata.json file the user has to confirm that they want to continue and is informed that providing a lower value will delete data.
    • -commitmentAtxId has to be set if postdata_metadata.json cannot be found. If postdata_metadata.json is present the value will be read from there. If the provided value does not match the value in the postdata_metadata.json file the user has to confirm that they want to continue and is informed that providing a wrong value can corrupt their data.
    • provider has to be set
    • labelsPerUnit and scryptN trigger a warning if set and do not match mainnet values. User has to confirm that this will generate data that is not compatible with mainnet.
  • All text that is printed now uses log.Print and log.Fatal instead of fmt.Println

@fasmat fasmat requested a review from poszu February 26, 2024 22:34
@fasmat fasmat self-assigned this Feb 26, 2024
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 38.46154% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 74.3%. Comparing base (3cd36cc) to head (61f0fbc).

Files Patch % Lines
initialization/metadata.go 28.5% 5 Missing ⚠️
initialization/diskstate.go 25.0% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           develop    #270   +/-   ##
=======================================
  Coverage     74.3%   74.3%           
=======================================
  Files           29      29           
  Lines         1539    1543    +4     
=======================================
+ Hits          1144    1147    +3     
- Misses         254     258    +4     
+ Partials       141     138    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cmd/postcli/main.go Outdated Show resolved Hide resolved
cmd/postcli/main.go Outdated Show resolved Hide resolved
cmd/postcli/main.go Outdated Show resolved Hide resolved
cmd/postcli/main.go Outdated Show resolved Hide resolved
@fasmat fasmat enabled auto-merge February 27, 2024 10:54
@fasmat fasmat merged commit 83f3fde into develop Feb 27, 2024
11 of 12 checks passed
@fasmat fasmat deleted the 5089-update-postcli-for-compatibility branch February 27, 2024 11:02
spacemesh-bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this pull request Mar 4, 2024
…tities (#5592)

## Motivation

This completes the implementation of multi-smeshing support.

Related: spacemeshos/post#270
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.

postcli should use postdata_metadata.json for default values
2 participants