-
Notifications
You must be signed in to change notification settings - Fork 370
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
Fix support for validator key rotation, add end-to-end test #1643
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nits!
) { | ||
const msg = new Buffer('dummy_msg_data') | ||
const data = '0x' + msg.toString('hex') | ||
// Note: Eth.sign typing displays incorrect parameter order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note probably should be elsewhere now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, utils/address seems like a better place
// Note: Eth.sign typing displays incorrect parameter order | ||
const sig = await signFn(data, signer) | ||
|
||
const rawsig = ethjsutil.fromRpcSig(sig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional Nit: Didn't know about fromRpcSig
!! Could we streamline either that or our implementation (from below =parseSignature
) here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments
export const privateKeyToPublicKey = (privateKey: string) => { | ||
return '0x' + privateToPublic(Buffer.from(privateKey.slice(2), 'hex')).toString('hex') | ||
export const publicKeyToAddress = (publicKey: string) => { | ||
return toChecksumAddress( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signatureUtils
has this functionality, suggest he use that.
) { | ||
const msg = new Buffer('dummy_msg_data') | ||
const data = '0x' + msg.toString('hex') | ||
// Note: Eth.sign typing displays incorrect parameter order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, utils/address seems like a better place
packages/utils/src/signatureUtils.ts
Outdated
return '0x' + pubKey.toString('hex') | ||
} | ||
|
||
export function eqAddress(a: Address, b: Address) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must have been a merge conflict? This was supposed to move to address.ts
Description
This PR fixes support for validator key rotation, and tests it in the end-to-end governance tests.
Tested
Other changes
publicKeysData
logic to split out the various components, not store the proof-of-possession.account:authorize
CLI command so that we don't assume account and signing keys are managed by the same node, addaccount:proof-of-possession
commandaccount:register
Accounts.sol
Accounts.sol
protocol
intoutils
Related issues
Backwards compatibility
Not backwards compatible