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

Use owners instead of public keys. #3160

Merged
merged 5 commits into from
Jan 22, 2025
Merged

Conversation

afck
Copy link
Contributor

@afck afck commented Jan 21, 2025

Motivation

For #3162 we need to stop using ChainOwnership as a lookup table for public keys.

In general, we are using PublicKey in several places where we should be using the Owner type.

Proposal

Remove public keys from ChainOwnership. Add the signer's public key directly to the BlockProposal instead.

When creating key pairs, assigning chains and changing chain ownership via CLI commands, node service mutations or system API calls, use Owner instead of PublicKey.

Test Plan

Several tests have been updated.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

@afck afck force-pushed the proposal-pub-key branch 3 times, most recently from 3d6b992 to f4c5f3f Compare January 22, 2025 11:09
@afck afck force-pushed the proposal-pub-key branch from f4c5f3f to 0d6d990 Compare January 22, 2025 11:34
@afck afck marked this pull request as ready for review January 22, 2025 11:49
@afck afck requested review from Twey, ma2bd and bart-linera January 22, 2025 11:50
Copy link
Contributor

@christos-h christos-h left a comment

Choose a reason for hiding this comment

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

Very nice!

pub fn verify_owner(&self, proposal: &BlockProposal) -> Option<PublicKey> {
if let Some(public_key) = self.ownership.get().super_owners.get(&proposal.owner) {
return Some(*public_key);
pub fn verify_owner(&self, proposal: &BlockProposal) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to update method description here?

@@ -124,6 +124,8 @@ BlockProposal:
TYPENAME: ProposalContent
- owner:
TYPENAME: Owner
- public_key:
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

@afck afck merged commit 903b975 into linera-io:main Jan 22, 2025
23 of 24 checks passed
@afck afck deleted the proposal-pub-key branch January 22, 2025 17:59
bart-linera added a commit to bart-linera/linera-protocol that referenced this pull request Jan 27, 2025
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.

Remove PublicKey from ChainOwnership.
3 participants