-
Notifications
You must be signed in to change notification settings - Fork 573
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 migration 031 to use proper multisig encoder #4978
Conversation
031 is not using the correct multisig encoder that matches AccountValue. This leads to errors when you try to use the new migration for 31 in any future migration such as 32.
84934d2
to
c410d1f
Compare
if (value.multisigKeys) { | ||
bw.writeVarBytes(Buffer.from(value.multisigKeys.secret, 'hex')) | ||
bw.writeVarBytes(Buffer.from(value.multisigKeys.keyPackage, 'hex')) | ||
const encoding = new MultisigKeysEncoding() | ||
bw.writeU64(encoding.getSize(value.multisigKeys)) | ||
bw.writeBytes(encoding.serialize(value.multisigKeys)) | ||
} |
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.
Does this break the current multisig accounts because of the size also being written?
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.
Maybe this change doesn't matter because there were no multisig accounts before 31?
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.
Yes that's correct. If this ran for anyone in the first place, their accounts would not be de-codable. It would crash when they try to start the node.
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.
Looks good, thanks Jason for fixing this. Good learning for me
Summary
031 is not using the correct multisig encoder that matches AccountValue. This leads to errors when you try to use the new migration for 31 in any future migration such as 32.
Testing Plan
Run the migration on an old database.
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and label it with
breaking-change-rpc
orbreaking-change-sdk
.