fabric icon indicating copy to clipboard operation
fabric copied to clipboard

Duplicated transactions with private data cannot retrieve private data from transientStore

Open wisecoach opened this issue 9 months ago • 2 comments

Description

Version: fabric: 3.1.0 fabric-ca: 1.5.15

Peer will store private data of invalidTx containing DuplicatedTx. If the private data is stored in transientStore, it will be pruned after the block containing the first of duplicatedTxs is handled by StoreBlock[gossip/privdata/coordinator.go:234]. Therefore, the subsequent duplicatedTxs cannot retrieve private data from transientStore anymore, resulting in the error of StoreBlock[gossip/privdatacoordinator.go:216]. Then peer cannot handle the subsequent blocks.

In my opinion, during retrieving the private data[gossip/privdata/pvtdataprovider.go:181], the eligibilityComputer should skip the DuplicatedTx even if storePvtdataOfInvalidTx[gossip/privdata/pvtdataprovider.go:101].

Steps to reproduce

No response

wisecoach avatar Mar 25 '25 07:03 wisecoach

Can you clarify the use case and reproduction steps? Duplicate transactions are not allowed. Why would you need private data for a duplicate transaction?

denyeart avatar Apr 04 '25 14:04 denyeart

I'm sorry that I didn't know that there has been a prohibition on duplicate transactions defined in the Application Capabilities, and the issue won't occur. I just think that since TxValidationCode_DUPLICATE_TXID has been defined, it should be handled correctly.

Use case: I used a simple consensus algorithm implementation to replace BFT-SMaRT, which allows for duplicate transactions. Subsequently, I used fabric-samples/test-network to test the new orderer node, and the issue occurred during the approveForMyorg phase of deploying the chaincode

wisecoach avatar Apr 07 '25 09:04 wisecoach