Skip to content

[audit][medium] Storage removal addition drops default-section removals #683

@QuantumExplorer

Description

@QuantumExplorer

Created from a Codex audit of grovedb. No code changes were made as part of the audit.

Summary

Combining basic and sectioned storage removals removes/updates the default identifier entry but does not reinsert it.

Impact / failure scenario

Removal bytes from the default identifier can be lost, undercounting storage removals and any costs derived from them.

References

  • costs/src/storage_cost/removal.rs:83
  • costs/src/storage_cost/removal.rs:102
  • costs/src/storage_cost/removal.rs:148

Suggested fix

Reinsert the updated default epoch map before returning or assigning the combined SectionedStorageRemoval.

Suggested tests

Assert Basic + Sectioned(default), Sectioned(default) + Basic, and AddAssign all preserve both removal amounts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions