fix: custom preset cached on target's preset.yml#270
Conversation
|
How does it behave when the custom preset contains private keys ? |
33d3c05 to
8b02b2d
Compare
Private keys are not stored in the ./target/preset.yml file, this files contains the catched custom preset. You can create your custom preset in your local offline machine, generate the configuration, zip the target folder, and send it to your node without the node having the keys at all. With this PR, you don't need to send the custom preset either. |
segfaultxavi
left a comment
There was a problem hiding this comment.
I understand the purpose of this PR and I like it very much. But I do not understand that sentence in the README.
| oldPresetData?.preset || | ||
| Preset.bootstrap; | ||
|
|
||
| const preset = params.preset || params.customPresetObject?.preset || customPresetFileObject?.preset || oldPresetData?.preset; |
There was a problem hiding this comment.
Whats the order of precedence for the presets? Should customPresetFileObject comes before customPresetObject?
There was a problem hiding this comment.
if the user is providing both, a file and a custom preset object, the custom preset object is priority. This is the case when you use bootstrap as a library.
I would probably need to revisit this, especially in private networks when the network.yml is provided instead of built-in bootstrap.
I have added further unit testing around this.
67327f7 to
c527a1d
Compare
|
Superseded by #277 |
c527a1d to
6fa9fc8
Compare
3400a62 to
90b972b
Compare
|
Hi @Wayonb I'm keen to merge this one. Is it ok for you? |
|
Kudos, SonarCloud Quality Gate passed!
|
2fff27b to
1f59411
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
1f02207 to
7758bd8
Compare
7758bd8 to
63becc5
Compare
fix: --preset bootstrap is not the default anymore.
63becc5 to
be04ccb
Compare
| OPTIONS | ||
| -a, --assembly=assembly The assembly, example "dual" for testnet. If not provided, the value is | ||
| resolved from the target/preset.yml file. | ||
| -a, --assembly=assembly The assembly that define the node(s) layout. It can be provided via custom |
There was a problem hiding this comment.
all three docs files.
as there is a lot of similarity, i was wondering: are you generating these manually or automatically?
There was a problem hiding this comment.
Fixed. They are automatically generated
There was a problem hiding this comment.
if you don't already, consider adding a build section to the readme (if you don't already) about how to generate these files and the expected test reporting files too. can be separate PR.
# Conflicts: # CHANGELOG.md # src/commands/config.ts # src/commands/pack.ts # src/commands/start.ts # src/commands/updateVotingKeys.ts # src/commands/wizard.ts # src/service/ConfigLoader.ts # test/service/ConfigService.test.ts
|
Kudos, SonarCloud Quality Gate passed!
|








This is a small improvement. The original custom preset (without any private key) is cached in the preset.yml of the target folder. If the user upgrading doesn't provide the --customPreset, that cache is used. Currently, if the user is not providing a custom preset when --upgrading, a custom value (for example maxUnlockedAccounts: 20) could be reset to its bootstrap's default (10).
--preset and --assembly are already derived from the target folder when not provided.
How to upgrade a node before:
How to upgrade a node after:
The custom preset is loaded from the cache inside the target folder, the same applies to the preset and assembly values.
The user can still provide a custom preset if he wants to change a property for example.
Note: User needs to run the full --upgrade command one more time so the custom preset cache is populated.
Another fix: The --preset bootstrap is not the default anymore. Most people are creating nodes for testnet and mainnet, not for local testing networks like it was originally intended. The preset must be explicitly defined when starting a new node.