-
Notifications
You must be signed in to change notification settings - Fork 780
Description
Bug Report
CometBFT 0.37 introduced a change where events in RPC responses are now encoded as string literals instead of Base64. However, the documentation has not yet been updated to reflect this code change.
Setup
RPC Event Encoding in CometBFT 0.37
In previous versions of CometBFT, events in RPC responses were Base64 encoded. For example:
{
"events": [
{
"type": "app",
"attributes": [
{
"key": "YWN0aW9u",
"value": "c2VuZA==",
"index": false
}
]
}
]
}However, in CometBFT 0.37, events are now encoded as string literals:
{
"events": [
{
"type": "app",
"attributes": [
{
"key": "action",
"value": "send",
"index": false
}
]
}
]
}How to reproduce it
To verify that CometBFT 0.37 is actually using string literals for events instead of Base64, you can:
Send a transaction to CometBFT via the RPC API
Check the events field in the response
If the value attributes end in =, they are Base64 encoded
If the value attributes are strings without = at the end, string literals are being used
Anything else we need to know
Outdated Documentation
Despite the code change in CometBFT 0.37 to use string literals for events, the documentation has not yet been updated.
The RPC docs still show events encoded in Base64 even though the code was updated in CometBFT 0.37 to use string literals for events. This is due to outdated documentation that has not been updated to reflect the code changes.
PS: Thank you hdevalence for pointing out the discrepancy.