-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π‘οΈ Insufficient information in Events #556
Comments
This comment initiates the process of determining the necessary information to return for each execute message in the Objectarium. As the event result from the Objectarium is automatically transferred when invoked from the Law stone contract, it's crucial to start with the Objectarium. Adding event information is crucial for data tracking and integrity checks. However, it's important to avoid including excessive or redundant information, as this can lead to increased data storage costs. By redundant information, we mean data that can be easily inferred from the input. For example, when storing an object with a specified compression algorithm, it's unnecessary to return the used compression algorithm as an event output, since this information is already known. So for the next purpose, in addition to the standard attributes ( πΎ
|
Many thanks @bdeneux for such wide analysis! It helps to imagine all the possibilities we have here. It's clear we can make the events carry a lot of information, we also need to avoid flooding events because this has a cost on the long term. That's why I'd tend to avoid exposing information that could be recomposed by tracking all the past events, for instance Following this I think the only message that should expose more information is the {
"action": "store_object",
"id": <object_id>,
"pinned": <pinned>,
"size": <size>,
"compressed_size": <compressed_size>
} It's worth mentioning that it's authorized to store an already stored object, and in that case we may need to expose different values for those events.. Regarding the law stone Let me know what you think :) |
@amimart I agree with the proposed changes. Let's proceed with adding the following attributes to the {
"action": "store_object",
"id": <object_id>,
"pinned": <pinned>,
"size": <size>,
"compressed_size": <compressed_size>
} However, we need to carefully consider the scenario where an object already exists in the storage. In my opinion, it would be beneficial to include the Additionally, while working on this implementation, I noticed an inconsistency when the compression algorithm of the existing object differs from the one being stored (refer to issue #583). Depending on the resolution of this issue, the data returned in the event might need to be adjusted (for example, the new compressed size). Therefore, I suggest we first decide on the approach for handling differing compression algorithms before finalizing the attributes to be returned in the event. |
Sounds like a plan. π |
I agree, we could set |
Note
Severity: Critical
target: v5.0.0 - Commit: cde785fbd2dad71608d53f8524e0ef8c8f8178af
Ref: OKP4 CosmWasm Audit Report v1.0 - 02-05-2024 - BlockApex
Description
break_stone
function in the Law Stone contract fails to emit detailed events for actions undertaken within the function. Notably, actions such as unpinning or forgetting objects lack corresponding information in event emissions, which are crucial for auditing and tracing the state changes within the contract.system.
Recommendation
The text was updated successfully, but these errors were encountered: