Bug affecting use of #[contractevent(data_format="vec")] in soroban-sdk >= 23.0.0, <= 23.4.0
#1848
leighmcculloch
announced in
Announcements
Replies: 1 comment
-
|
A fix has been released in 23.4.1. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
A bug has been found in the
contracteventattribute macro when thedata_formatis specified as"vec"affectingsoroban-sdkversions in the range>= 23.0.0, <= 23.4.0, where the order of data fields1 are published into the contract event data field’sVecin lexicographical order2 rather than in the order defined in the event.The bug only occurs:
contracteventis used withdata_format = "vec"Published events are not observable by contracts and so this bug is not observable by contracts and only by off-chain systems.
A fix is underway and will be announced in this discussion topic once released.
Software:
soroban-sdkAffected Versions:
23.4.0,23.3.0,23.2.1,23.1.1,23.1.0,23.0.3,23.0.2,23.0.1,23.0.0Affected Unstable Versions:
25.0.0-rc.1Fixed Version: 23.4.1, 25.0.0-rc.2
Issue: stellar/rs-soroban-sdk#1679
1 A data field is a field without a
#[topic]attribute.2 Lexicographical order is also known as dictionary order, or alphabetical order.
Example
For example, the following contract event definition is affected.
The event defines its data fields to be formatted in a
vecand should be published in the order they are defined:data = [data_b, data_a]The event will be published with:
data = [data_a, data_b].Testing Event Publishing
Event publishing can be tested in contracts, and subsequently the bug can be verified, by implementing a test similar to the below:
Affected Contracts on mainnet
There are five affected contracts on mainnet at the time of this post known by inspecting the available contract specs visible in a recent archive checkpoint:
https://github.com/leighmcculloch/contract-wasms/blob/main/analysis/find_event_1679_results.csv
Beta Was this translation helpful? Give feedback.
All reactions