Repository: informalsystems/tendermint-rs (language: rust)

Issue:
The null `value` field of `EventAttribute` should be allowed
An indexer ran into null `value` field of `EventAttribute`, preventing a service from indexing events and resulting in downtime. The exact error was `serde invalid type: null`.

_Originally posted by @daniel-savu in https://github.com/informalsystems/tendermint-rs/issues/1216#issuecomment-1802436901_
            


Discussion / hints:
The OpenAPI of the RPC interface does not allow for null-valued `value` fields, by omission of `nullable` on the appropriate schema. But this may be more about what event data the application is allowed to produce in practice. I don't see any checks forbidding null values in the code of CometBFT node. So I think the tendermint-rs implementation for CometBFT RPC 0.37+ should tolerate nulls as well.
Thank you for the quick follow up @mzabaluev! 

To answer your question about the Tendermint version, I believe the chain is using 0.34+. 

I'm not a Go developer but this is what I gather from the `go.mod` file: https://github.com/neutron-org/neutron/blob/51ecb6b0466077abd4bd16b3e5746aec150608c8/go.mod#L29

Fix patch:
diff --git a/.changelog/unreleased/breaking-changes/1375-allow-null-in-event-attributes.md b/.changelog/unreleased/breaking-changes/1375-allow-null-in-event-attributes.md
new file mode 100644
index 000000000..089e4c6c7
--- /dev/null
+++ b/.changelog/unreleased/breaking-changes/1375-allow-null-in-event-attributes.md
@@ -0,0 +1,4 @@
+- `[tendermint]` Allow null values in `key` and `value` fields of
+  `EventAttribute` when deserializing. The serialization schema for the fields
+  is changed to `Option<String>`
+  ([\#1375](https://github.com/informalsystems/tendermint-rs/issues/1375)).
diff --git a/tendermint/src/abci/event.rs b/tendermint/src/abci/event.rs
index 988145ad8..06e886421 100644
--- a/tendermint/src/abci/event.rs
+++ b/tendermint/src/abci/event.rs
@@ -1,6 +1,7 @@
 use serde::{Deserialize, Serialize};
 
 use crate::prelude::*;
+use crate::serializers;
 
 /// An event that occurred while processing a request.
 ///
@@ -119,8 +120,10 @@ where
 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize, Hash)]
 pub struct EventAttribute {
     /// The event key.
+    #[serde(with = "serializers::allow_null")]
     pub key: String,
     /// The event value.
+    #[serde(with = "serializers::allow_null")]
     pub value: String,
     /// Whether Tendermint's indexer should index this event.
     ///


Test patch: