-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Objectarium] 🐛 fix: compression size decrement on forget_object
#570
Conversation
WalkthroughThe recent changes to the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant Contract
participant Storage
User->>Contract: Store Object
Contract->>Storage: Save object data with compression
Storage-->>Contract: Acknowledge save
Contract->>User: Confirm storage
User->>Contract: Remove Object
Contract->>Storage: Delete object data
Storage-->>Contract: Confirm deletion
Contract->>User: Confirm removal
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- contracts/axone-objectarium/src/contract.rs (11 hunks)
Additional comments not posted (3)
contracts/axone-objectarium/src/contract.rs (3)
232-232
: Correctly updated the decrement operation forcompressed_size
inforget_object
.This change ensures that both the total and compressed sizes are accurately updated, aligning with the security audit findings.
2204-2204
: Updated test cases to reflect new logic forcompressed_size
.The modifications in the test cases correctly reflect the changes in logic for handling
compressed_size
. Ensure that these tests cover all relevant scenarios, including edge cases where the compressed size might be zero or very large.Also applies to: 2216-2218, 2233-2235, 2245-2247, 2259-2261, 2273-2275, 2292-2294, 2311-2313, 2332-2334
2241-2247
: Added a new test case forforget_object
focusing oncompressed_size
.The new test case effectively tests the decrement operation on
compressed_size
when an object is forgotten. It's important to ensure that this test case includes assertions for both thetotal_size
andcompressed_size
to fully validate the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thx :)
This PR addresses a minor issue identified in security audit #559.
It introduces a necessary decrement operation for the
total_compressed_size
within the Bucket Stat in addition to thetotal_size
, when theforget_object
message is called. This adjustment ensures accurate tracking of the compressed size, thereby rectifying the discrepancy.Summary by CodeRabbit
New Features
Bug Fixes
Tests
expected_compressed_size
and adjusted expected values for count and total size to ensure accuracy.