Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate current assumption of ledger behavior #503

Open
g2flyer opened this issue Dec 18, 2020 · 1 comment
Open

Validate current assumption of ledger behavior #503

g2flyer opened this issue Dec 18, 2020 · 1 comment
Milestone

Comments

@g2flyer
Copy link
Contributor

g2flyer commented Dec 18, 2020

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 g2flyer added this to the FPC 1.1 milestone Dec 18, 2020
@bvavala
Copy link
Contributor

bvavala commented Dec 19, 2020

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

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

No branches or pull requests

2 participants