hiero-ledger / hiero-ledger/hiero-consensus-node

Add test to `MerkleDbDataSource` where save is called with unexpected values

Open
#5,212 1 comment 0 reactions 0 assignees View on GitHub
Bug Good First Issue Candidate Platform Platform Data Structures Platform Virtual Map Test Development
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

We found some cases where `saveRecords(...)` is called with negative values for paths and/or empty streams. We should write tests for the different potential inputs and validate the behavior of the DB. Ideally it should be resilient to such things. We don't know how many items are in the stream at the time we try to save.

Contributor guide

Open the contributing guide

Research direction

Start at MerkleDbDataSource.saveRecords(...), then trace how negative path values and empty streams are handled before reaching the database. Add coverage for the different inputs described and validate the database behavior, including streams whose item count is not known in advance.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.