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

contracts: only require BLS key to remove staker #2420

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

sveitser
Copy link
Collaborator

@sveitser sveitser commented Dec 19, 2024

When removing a staker from the permissioned stake table the staker is identified by the BLS pub key. It's therefore not necessary to pass any other information to the contract to remove a staker. This PR removes the redundant information that was previously required to remove stakers.

Base automatically changed from ma/stake-table-update-script to ab/st December 20, 2024 12:26
@sveitser sveitser force-pushed the ma/remove-staker-with-bls-key-only branch from 043cc65 to 01e77fe Compare December 20, 2024 13:01
Base automatically changed from ab/st to tb/pos/fetch-stake-table2 January 8, 2025 18:21
Base automatically changed from tb/pos/fetch-stake-table2 to main January 13, 2025 19:43
@sveitser sveitser force-pushed the ma/remove-staker-with-bls-key-only branch from 01e77fe to ec726f7 Compare January 15, 2025 13:32
@sveitser sveitser marked this pull request as ready for review January 15, 2025 14:55
Ensure that the implementations of these functions to load initial stake
table and stake table update are actually exercised in tests.
Copy link
Contributor

@alysiahuggins alysiahuggins left a comment

Choose a reason for hiding this comment

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

LGTM but left a question

@@ -221,6 +207,36 @@ impl From<PeerConfigKeys<BLSPubKey>> for NodeInfoJf {
}
}

pub fn bls_jf_to_sol(bls_vk: BLSPubKey) -> permissioned_stake_table::G2Point {
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this mean? bls_jf_to_sol

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Converting the jellyfish type of BLSPubKey to the solidity type.

Copy link
Collaborator Author

@sveitser sveitser Jan 17, 2025

Choose a reason for hiding this comment

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

Since neither of these types are owned by this crate we can't implement the From due to the orphan rule. I think it gets somewhat confusing if we create too many type wrappers so just opted for a function here.

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.

Don't require entire NodeInfo struct when removing stakers from permissioned stake table contract
2 participants