-
Notifications
You must be signed in to change notification settings - Fork 299
feat(core-api): hasTransactionFinality(): boolean on connector API #354
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
Comments
I would like to work on this, but seems that issue #355 is closed? |
@jscode017 Yeah, #355 was a dependency of this so that being closed is good news not the other way around (e.g. meaning that this can now be worked on). TLDR: Feel free to work on this and drop by the pair programming session on weekday mornings PST if you have any questions about build setup/code/etc. |
I would first try to go with the proposed algorithm. If I have something else come to mind, maybe I would discuss on the chat? |
@jscode017 Sure thing, that works and thank you for taking this up! |
@petermetz
in the cactus-core-api/src/main/json/openapi.json
But I'm thinking this may not be a good approach, |
@jscode017 Thanks for teaching me about Back on-topic: Yeah you might not need to declare an array at all, because of the way you structured your enum you could just check later in code if an algorithm name is part of that enum, the same way they are advising at Check if value exists in enum in TypeScript That array thing would only be needed if you had one enum containing both the algos with and without tx finality IMO (that was my initial idea, but I like yours better). |
…-cacti#354 Primary change(s): ------------------ 1. Add a feature of asking the connector at runtime whether its ledger has transaction finality guaranteed or not Fixes: hyperledger-cacti#354 Signed-off-by: jscode017 <[email protected]>
Primary change(s): ------------------ 1. Add a feature of asking the connector at runtime whether its ledger has transaction finality guaranteed or not Fixes: #354 Signed-off-by: jscode017 <[email protected]>
Data Sharing Protocol Bug Fixes and RFC Specification Improvements
Is your feature request related to a problem? Please describe.
Need a way to ask the connector at runtime whether its ledger has transaction finality guaranteed or not.
Describe the solution you'd like
Depends on #355
A method on the connector that returns a boolean, something like:
For ledgers that only support one consensus algorithm (public permissionless ledgers mostly I guess?)
In cases where the ledger has configurable consensus the function's return value would depend on which one is configured for the current ledger instance.
To avoid the problem of a ledger introducing a new consensus algorithm that does support TX finality and then us returning incorrect results based on that, we must check the
currentAlgo
for presence in both lists and throw if it isn't present in either one of them. This guarantees that we fail fast instead of non-deterministic behavior.Describe alternatives you've considered
Another way of going about this would be to have the consensus algorithms defined in the consortium definition which would provide us with the means to have the consensus algorithm locked down. Not sure if we should do this because the problem is regarding enforcement: Big mistakes can still happen if a consortium member accidentally changes the consensus algorithm of their own ledger without seeking an update in the consensus definition first.
cc: @sfuji822 @takeutak @jonathan-m-hamilton
The text was updated successfully, but these errors were encountered: