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

Fix migration 031 to use proper multisig encoder #4978

Merged
merged 1 commit into from
May 23, 2024

Conversation

NullSoldier
Copy link
Contributor

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.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

@NullSoldier NullSoldier requested a review from a team as a code owner May 22, 2024 23:32
@NullSoldier NullSoldier marked this pull request as draft May 22, 2024 23:32
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.
@NullSoldier NullSoldier force-pushed the jason/31-migration branch from 84934d2 to c410d1f Compare May 22, 2024 23:46
Comment on lines 53 to 57
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))
}
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@NullSoldier NullSoldier marked this pull request as ready for review May 23, 2024 00:06
Copy link
Contributor

@patnir patnir left a 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

@dguenther dguenther merged commit 3c7fe43 into staging May 23, 2024
10 checks passed
@dguenther dguenther deleted the jason/31-migration branch May 23, 2024 00:12
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.

3 participants