Skip to content

Commit

Permalink
chore(drive): log invalid state on deserialisation (#2220)
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov authored Oct 7, 2024
1 parent 1e39669 commit bd7ed80
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@ impl<C> Platform<C> {
.fetch_platform_state_bytes(transaction, platform_version)
.map_err(Error::Drive)?
.map(|bytes| {
PlatformState::versioned_deserialize(&bytes, platform_version)
.map_err(Error::Protocol)
let result = PlatformState::versioned_deserialize(&bytes, platform_version)
.map_err(Error::Protocol);

if result.is_err() {
tracing::error!(
bytes = hex::encode(&bytes),
"Unable deserialize platform state for version {}",
platform_version.protocol_version
);
}

result
})
.transpose()
}
Expand Down

0 comments on commit bd7ed80

Please sign in to comment.