8000 refactor(config/node)!: Remove genesisHash from config by jmalicevic · Pull Request #3595 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor(config/node)!: Remove genesisHash from config #3595

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

Merged
merged 9 commits into from
Jul 31, 2024

Conversation

jmalicevic
Copy link
Contributor
@jmalicevic jmalicevic commented Jul 30, 2024

Closes #3547 .

This PR removes the GenesisHash from the config file because this field is not meant to be updated by the operator. It was only introduced to avoid breaking an API and used to pass the genesis hash provided via cli to the node constructor.

As this feature is going into an unreleased version, we decided to break the API of DefaultNewNode. We maintain the signature of NewNode as this is probably used by the community more and introduce NewNodeWithCliParams.

NewNodeWithCliParams allows for passing different parameters from the cli to the node.

The PR also introduces a new type CliParams. At the moment this struct contains just the GenesisHash but it was done this way so that we can in the future extend it with new parameters without breaking APIs.

< 10000 /p>

@jmalicevic jmalicevic added config breaking A breaking change backport-to-v1.x Tell Mergify to backport the PR to v1.x labels Jul 30, 2024
@jmalicevic jmalicevic added this to the 2024-Q3 milestone Jul 30, 2024
@jmalicevic jmalicevic self-assigned this Jul 30, 2024
@jmalicevic jmalicevic linked an issue Jul 30, 2024 that may be closed by this pull request
@jmalicevic jmalicevic marked this pull request as ready for review July 30, 2024 12:53
@jmalicevic jmalicevic requested review from a team as code owners July 30, 2024 12:53
@jmalicevic jmalicevic marked this pull request as draft July 30, 2024 12:55
@jmalicevic jmalicevic marked this pull request as ready for review July 30, 2024 13:06
Copy link
Contributor
@melekes melekes left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor
@cason cason left a comment

Choose a reason for hiding this comment

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

This PR has two purposes:

  1. Receive arbitrary CLI parameters when creating a new node
  2. Remove the genesis_hash field from the config file, replacing it by a CLI parameter

I am almost inclined for having two PRs, but this is probably an overkill.

Co-authored-by: Daniel <daniel.cason@informal.systems>
@jmalicevic
Copy link
Contributor Author

This PR has two purposes:

  1. Receive arbitrary CLI parameters when creating a new node
  2. Remove the genesis_hash field from the config file, replacing it by a CLI parameter

I am almost inclined for having two PRs, but this is probably an overkill.

This is a good point and you are right. But it is probably overkill to do it for this change. We could however introduce a changelog entry under features so that it is clear this is there?

@jmalicevic
Copy link
Contributor Author

This PR has two purposes:

  1. Receive arbitrary CLI parameters when creating a new node
  2. Remove the genesis_hash field from the config file, replacing it by a CLI parameter

I am almost inclined for having two PRs, but this is probably an overkill.

This is a good point and you are right. But it is probably overkill to do it for this change. We could however introduce a changelog entry under features so that it is clear this is there?

Actually no, this is not a feature visible to the users, it is internal for us as developers or people who fork the repo perhaps so I not sure it falls under the classic feature category.

@jmalice
8000
vic jmalicevic requested review from melekes and cason July 31, 2024 10:08
Copy link
Contributor
@cason cason left a comment

Choose a reason for hiding this comment

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

Thank you for that.

Lets see how our users will react to this change. Actually, I am not really convinced that we need to provide some many versions of NewNode...

@jmalicevic jmalicevic added this pull request to the merge queue Jul 31, 2024
Merged via the queue into main with commit 11c5b25 Jul 31, 2024
39 checks passed
@jmalicevic jmalicevic deleted the jasmina/3547-config-remove-genesis-hash branch July 31, 2024 14:32
mergify bot pushed a commit that referenced this pull request Jul 31, 2024
Closes #3547 .

This PR removes the `GenesisHash` from the config file because this
field is not meant to be updated by the operator. It was only introduced
to avoid breaking an API and used to pass the genesis hash provided via
cli to the node constructor.

As this feature is going into an unreleased version, we decided to break
the API of `DefaultNewNode`. We maintain the signature of `NewNode` as
this is probably used by the community more and introduce
`NewNodeWithCliParams`.

`NewNodeWithCliParams` allows for passing different parameters from the
cli to the node.

The PR also introduces a new type `CliParams`. At the moment this struct
contains just the `GenesisHash` but it was done this way so that we can
in the future extend it with new parameters without breaking APIs.

---------

Co-authored-by: Daniel <daniel.cason@informal.systems>
(cherry picked from commit 11c5b25)

# Conflicts:
#	node/node.go
#	node/node_test.go
melekes added a commit that referenced this pull request Aug 1, 2024
… (#3600)

Closes #3547 .

This PR removes the `GenesisHash` from the config file because this
field is not meant to be updated by the operator. It was only introduced
to avoid breaking an API and used to pass the genesis hash provided via
cli to the node constructor.


As this feature is going into an unreleased version, we decided to break
the API of `DefaultNewNode`. We maintain the signature of `NewNode` as
this is probably used by the community more and introduce
`NewNodeWithCliParams`.

`NewNodeWithCliParams` allows for passing different parameters from the
cli to the node.

The PR also introduces a new type `CliParams`. At the moment this struct
contains just the `GenesisHash` but it was done this way so that we can
in the future extend it with new parameters without breaking APIs.

<hr>This is an automatic backport of pull request #3595 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v1.x Tell Mergify to backport the PR to v1.x breaking A breaking change config
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

refactor(config): Remove genesis hash from config
3 participants
0