From a5217bf1354f535335a132695ca52858c2c92688 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 7 Oct 2024 18:19:01 +0300 Subject: [PATCH 1/2] chore(drive): log invalid state on deserialization --- .../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 25960bf5b39..bda06fe6b02 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::trace!( + bytes = hex::encode(&bytes), + "Unable deserialize platform state for version {}", + platform_version.protocol_version + ); + } + + result }) .transpose() } From a6a6aeb3fe803a04ef2c357f374968197043f8b0 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 7 Oct 2024 18:23:22 +0300 Subject: [PATCH 2/2] Update mod.rs --- .../src/execution/storage/fetch_platform_state/v0/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 bda06fe6b02..a815e0266a6 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 @@ -20,7 +20,7 @@ impl Platform { .map_err(Error::Protocol); if result.is_err() { - tracing::trace!( + tracing::error!( bytes = hex::encode(&bytes), "Unable deserialize platform state for version {}", platform_version.protocol_version