-
Notifications
You must be signed in to change notification settings - Fork 39
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(drive): panic if PlatformState has serialisation error #1945
Conversation
pub fn fingerprint(&self) -> [u8; 32] { | ||
hash_double( | ||
self.serialize_to_bytes() | ||
.expect("expected to serialize state"), |
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.
The reason for the expect is that it can't actually fail. I went into the code to check this.
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.
We ran into this today on a devnet due to a bug I introduced while testing in PR #1937
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.
While I don't really mind this PR, can you explain what was introduced?
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.
We defined PlatformStateForSaving v2 and didn't handle it properly in one of try_from_platform_versioned so we got VersionMismatch error that failed serialisation.
merging this one in without CI check, as it is very simple. |
Issue being fixed or feature implemented
PlatfromState.fingerprint
panics in case of serialization error.What was done?
expect
How Has This Been Tested?
Running tests
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only