forked from hyperledger/fabric-private-chaincode
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Merge Solution Single Key Value Storage (SKVS) #3
Merged
chenchanglew
merged 7 commits into
thesis/rollback-protection-zac
from
thesis/skvs-solution
Jun 22, 2023
Merged
Merge Solution Single Key Value Storage (SKVS) #3
chenchanglew
merged 7 commits into
thesis/rollback-protection-zac
from
thesis/skvs-solution
Jun 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chenchanglew
added a commit
that referenced
this pull request
Jun 22, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples
chenchanglew
added a commit
that referenced
this pull request
Jun 22, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples
chenchanglew
added a commit
that referenced
this pull request
Aug 27, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples
chenchanglew
added a commit
that referenced
this pull request
Aug 27, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples Signed-off-by: chenchanglew <[email protected]>
chenchanglew
added a commit
that referenced
this pull request
Aug 27, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples Signed-off-by: chenchanglew <[email protected]>
chenchanglew
added a commit
that referenced
this pull request
Oct 10, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples Signed-off-by: chenchanglew <[email protected]> Signed-off-by: chenchanglew <[email protected]>
chenchanglew
added a commit
that referenced
this pull request
Oct 10, 2023
Create a solution for protecting against rollback attack. Solution: Single Key Value Storage (SKVS) Just need to apply one line of change in your chaincode main.go to use SKVS solution: ``` secretChaincode, _ := contractapi.NewChaincode(&chaincode.SecretKeeper{}) chaincode := fpc.NewSkvsChaincode(secretChaincode) ``` Skvs solution will store all the key under the main key "SKVS". before: {"Alice": "DataAlice", "Bob": "DataBob"} After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} } By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key. Special notes for your reviewer: This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection. However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block. Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while. ---- * add singleKVS wrapper * able to save into single key * change to only getState Once * change storing type and add del state * refactor part 1 - private can run * refactor part 2 - skvs run successfully * remove unnecessary logging change back samples Signed-off-by: chenchanglew <[email protected]> Signed-off-by: chenchanglew <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Create a solution for protecting against rollback attack.
Solution: Single Key Value Storage (SKVS)
Just need to apply one line of change in your chaincode main.go to use SKVS solution
Skvs solution will store all the key under the main key "SKVS".
before: {"Alice": "DataAlice", "Bob": "DataBob"}
After: {"SKVS": {"Alice": "DataAlice", "Bob": "DataBob"} }
By using this approach we are able to protect against Rollback + key mismatch problem since all the data are now just store under one single key.
Which issue(s) this PR fixes:
Solve the potential solution of rollback attack in FPC.
Special notes for your reviewer:
This approach is very user friendly because you just need to change one line of your main application to get the properties of rollback protection.
However, which this approach will reduce the performance of FPC a lot because it didn't perform well in concurrent situation because every changes will cause a conflict in their Transactions happened to be in a same block.
Thus if developer would like to use this approach will need to make sure your application doesn't required high throughput and will expected it to update once a while.