Skip to content

fix(proto): deprecate pub_key in Validator instead of removing it - #3077

Merged
melekes merged 10 commits into
mainfrom
3075-proto-pubkey-type
May 15, 2024
Merged

melekes merged 10 commits into
mainfrom
3075-proto-pubkey-type

Conversation

@melekes

@melekes melekes commented May 14, 2024 •

Copy link
Copy Markdown
Collaborator

which makes the change non-breaking (i.e., chains using v0.38 can use v1 without a hard fork)

  • revert changes to SimpleValidator because it breaks consensus (v1 valSet hash != v0.38 valSet hash).

Closes #3075


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

@melekes
melekes requested a review from a team as a code owner May 14, 2024 09:56
@melekes
melekes requested a review from a team May 14, 2024 09:56
@melekes melekes self-assigned this May 14, 2024
Comment thread proto/cometbft/types/v1/validator.proto Resolved
Comment thread types/validator.go Resolved
@sergio-mena

Copy link
Copy Markdown
Collaborator

Thanks for this @melekes ! Are there other possible structs using cometbft.crypto.v1.PublicKey that might also have been persisted?

@melekes

melekes commented May 14, 2024 •

Copy link
Copy Markdown
Collaborator Author

Thanks for this @melekes ! Are there other possible structs using cometbft.crypto.v1.PublicKey that might also have been persisted?

we are calculating validators_hash and next_validators_hash differently in #2890 due to changes to Validator. The consequence of this is the light clients won't be able to verify the old evidence (because validators hashes won't match).

@melekes melekes changed the title feat(proto): bring back pub_key in Validator feat(proto): deprecate pub_key in Validator instead of removing it May 14, 2024
@melekes

melekes commented May 14, 2024 •

Copy link
Copy Markdown
Collaborator Author
  • [ ] Add tests that check if we're breaking the header's hash

@melekes melekes changed the title feat(proto): deprecate pub_key in Validator instead of removing it fix(proto): deprecate pub_key in Validator instead of removing it May 14, 2024
@melekes

melekes commented May 15, 2024

Copy link
Copy Markdown
Collaborator Author
  • Add tests that check if we're breaking the header's hash

I'm going to add tests in a separate PR.

@melekes

melekes commented May 15, 2024

Copy link
Copy Markdown
Collaborator Author

Patch has been verified manually in cosmos/cosmos-sdk#20318 (comment)

@melekes
melekes enabled auto-merge May 15, 2024 09:19

@sergio-mena sergio-mena left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes in this PR LGTM.
I have a question: given our current understanding on how difficult it is to get rid of PublicKey from the Validator structure (if possible at all), is it really a good move to introduce pub_key_type?

@melekes
melekes added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit 5745407 May 15, 2024
@melekes
melekes deleted the 3075-proto-pubkey-type branch May 15, 2024 10:18
mergify Bot pushed a commit that referenced this pull request May 15, 2024
…#3077)

which makes the change non-breaking (i.e., chains using v0.38 can use v1
without a hard fork)

* revert changes to `SimpleValidator` because it breaks consensus (`v1
valSet hash != v0.38 valSet hash`).

Closes #3075

<!--

Please add a reference to the issue that this PR addresses and indicate
which
files are most critical to review. If it fully addresses a particular
issue,
please include "Closes #XXX" (where "XXX" is the issue number).

If this PR is non-trivial/large/complex, please ensure that you have
either
created an issue that the team's had a chance to respond to, or had some
discussion with the team prior to submitting substantial pull requests.
The team
can be reached via GitHub Discussions or the Cosmos Network Discord
server in
the #cometbft channel. GitHub Discussions is preferred over Discord as
it
allows us to keep track of conversations topically.
https://github.com/cometbft/cometbft/discussions

If the work in this PR is not aligned with the team's current
priorities, please
be advised that it may take some time before it is merged - especially
if it has
not yet been discussed with the team.

See the project board for the team's current priorities:
https://github.com/orgs/cometbft/projects/1

-->

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

(cherry picked from commit 5745407)
@melekes

melekes commented May 15, 2024

Copy link
Copy Markdown
Collaborator Author

I have a question: given our current understanding on how difficult it is to get rid of PublicKey from the Validator structure (if possible at all), is it really a good move to introduce pub_key_type?

PublicKey will stay in SimpleValidator until we decide to break Header's hash. Note it's not user-facing. Even though SimpleValidator is exposed in proto, it's not used to communicate with the ABCI app. I would say it's still worth it from the usability perspective. @tac0turtle please comment if you disagree.

melekes added a commit that referenced this pull request May 15, 2024
… (backport #3077) (#3085)

which makes the change non-breaking (i.e., chains using v0.38 can use v1
without a hard fork)

* revert changes to `SimpleValidator` because it breaks consensus (`v1
valSet hash != v0.38 valSet hash`).

Closes #3075



---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
<hr>This is an automatic backport of pull request #3077 done by
[Mergify](https://mergify.com).

Co-authored-by: Anton Kaliaev <[email protected]>
@sergio-mena

Copy link
Copy Markdown
Collaborator

@melekes So, if I want to add a new curve in the near future, will I still need to modify protobufs (the oneof) to add the new case? IIRC that was the main advantage of introducing pub_key_type and removing public_key

@melekes

melekes commented May 17, 2024

Copy link
Copy Markdown
Collaborator Author

@melekes So, if I want to add a new curve in the near future, will I still need to modify protobufs (the oneof) to add the new case? IIRC that was the main advantage of introducing pub_key_type and removing public_key

Yeah. We need to break the hash in order to remove it from SimpleValidator.

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.

proto: make #2890 non-breaking

2 participants