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.
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:83costs/src/storage_cost/removal.rs:102costs/src/storage_cost/removal.rs:148Suggested fix
Reinsert the updated default epoch map before returning or assigning the combined
SectionedStorageRemoval.Suggested tests
Assert
Basic + Sectioned(default),Sectioned(default) + Basic, andAddAssignall preserve both removal amounts.