From bd7ed805b49e30c64cc59d96fa37fa90c2f8a878 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 7 Oct 2024 18:23:44 +0300 Subject: [PATCH] chore(drive): log invalid state on deserialisation (#2220) --- .../storage/fetch_platform_state/v0/mod.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/storage/fetch_platform_state/v0/mod.rs b/packages/rs-drive-abci/src/execution/storage/fetch_platform_state/v0/mod.rs index 25960bf5b3..a815e0266a 100644 --- a/packages/rs-drive-abci/src/execution/storage/fetch_platform_state/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/storage/fetch_platform_state/v0/mod.rs @@ -16,8 +16,18 @@ impl Platform { .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() }