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

Replace deprecated version of staking.CreateValidator #2467

Open
Zodomo opened this issue Nov 12, 2024 · 2 comments
Open

Replace deprecated version of staking.CreateValidator #2467

Zodomo opened this issue Nov 12, 2024 · 2 comments

Comments

@Zodomo
Copy link
Contributor

Zodomo commented Nov 12, 2024

Problem to Solve

Staking.sol's createValidator(bytes calldata pubkey) function has been replaced with createValidator(bytes32 x, bytes32 y, bytes calldata signature). The old function is still in place to prevent tests from breaking, but the old function needs to be removed entirely. Every reference to staking.CreateValidator in the Go codebase needs to be corrected. Once this is finished, we can update the Staking contract.

Proposed Solution

Completely remove the deprecated function in Staking.sol, and then update every instance of staking.CreateValidator to use the updated interface. Instead of providing a compressed public key, the X and Y coordinates are necessary, as well as an EIP-712 signature of the coordinate pair. The new getValidatorPubkeyDigest(bytes32 x, bytes32 y) function can be used to retrieve the hash to sign. Running make fix-golden in the root directory of the Omni repo after removing the old Solidity function is one way to see each instance of the broken staking.CreateValidator call.

@Zodomo
Copy link
Contributor Author

Zodomo commented Nov 12, 2024

Some files that need updating:

  • e2e/app/valupdates.go
  • cli/cmd/staking.go

@corverroos
Copy link
Collaborator

Add support for new CreateValidator in e2e and cli.

Deprecating old createValiudator can be postponed.

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

No branches or pull requests

3 participants