Skip to content

Conversation

@SukanyaByteSavy
Copy link

@SukanyaByteSavy SukanyaByteSavy commented Dec 10, 2025

PR Summary: Private Data Enhancements and Performance Optimization

  1. 🧪 Extended Integration Tests (FAB-15704)
    New Test Case for Rollback and Data Revival
    Test Implemented: TestRollbackKVLedgerPvtDataRevival

Location: core/ledger/kvledger/tests/rollback_pvtdata_revival_test.go

Scenario Verified: Ensures private data is correctly accessible (revived) when the ledger is rolled back to a block height before the data's purging block.

Gap Addressed: Fills an integrity testing gap identified in rollback_test.go.

Cleanup: The stale TODO regarding FAB-15704 was removed.

  1. ⚡ Performance Optimization
    Efficient Private Data Retrieval
    Component: core/ledger/pvtdatastorage

Issue: Identified an N+1 database query inefficiency in GetPvtDataByBlockNum. retrieveLatestPurgeKeyCollMarkerHt was repeatedly called for every key in the same collection.

Fix: Introduced a local cache (purgeMarkerCache) within the retrieval loop to store and reuse purge markers.

Impact: Significantly reduces DB reads, changing the retrieval scaling from O(N) per key to O(1) per collection.

✅ Verification
Successful addition and execution of TestRollbackKVLedgerPvtDataRevival in core/ledger/kvledger/tests.

Verified compilation and logic of the pvtdatastorage optimization.

@SukanyaByteSavy SukanyaByteSavy requested a review from a team as a code owner December 10, 2025 10:08
@SukanyaByteSavy SukanyaByteSavy force-pushed the feature/fabric-optimizations branch from ad69170 to b14f952 Compare December 10, 2025 10:10
@SukanyaByteSavy
Copy link
Author

Hello, this PR is from a fork.
Could a maintainer please approve running the CI checks?
All required checks are currently stuck on “Expected”.

@SukanyaByteSavy SukanyaByteSavy force-pushed the feature/fabric-optimizations branch 3 times, most recently from c353a1a to 0986757 Compare December 10, 2025 19:59
@SukanyaByteSavy SukanyaByteSavy requested a review from a team as a code owner December 10, 2025 19:59
Optimizes GetPvtDataByBlockNum by caching purge markers (N+1 fix) and adds regression test for FAB-15704.

Signed-off-by: Sukanya Patnaik <[email protected]>
@SukanyaByteSavy SukanyaByteSavy force-pushed the feature/fabric-optimizations branch from 0986757 to d323148 Compare December 10, 2025 20:22
@bestbeforetoday
Copy link
Member

@SukanyaByteSavy Your change is failing the basic checks step of the build. It might be worth running make basic-checks locally to ensure it passes before pushing additional changes.

@SukanyaByteSavy
Copy link
Author

@SukanyaByteSavy Your change is failing the basic checks step of the build. It might be worth running make basic-checks locally to ensure it passes before pushing additional changes.

@bestbeforetoday thanks for the advice ... will do that rightaway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants