fabric-private-chaincode icon indicating copy to clipboard operation
fabric-private-chaincode copied to clipboard

Validate current assumption of ledger behavior

Open g2flyer opened this issue 5 years ago • 1 comments

Description

PR #501 assumes -- as experiments with fabric seemed surprisingly to have shown .. -- that fabric always returns only the commit value, even if the chaincode in the current transaction has issued a putState. On the other hand, fpc currently allows multiple putStates (with the last one counting). As fabric behaviour seems a bit surprising and we might have missed some other subtleties which could lead to behavior which is unexpected to chaincode developer (and potentially insecure) we should cross-check with fabric maintainers ...

Link to feature or bug

Link to dependent issues

g2flyer avatar Dec 18 '20 23:12 g2flyer

Notes: at the time #501 was merged, FPC updates the read/write set in shim.cpp and behaves as follows for a given key k:

  • only the hash of the first read(k) is stored
  • the values of subsequent read(k) calls (to Fabric) are checked against the stored hash; if the hash is different, the read fails
  • only the value of the most recent write(k,v) is stored

bvavala avatar Dec 19 '20 05:12 bvavala