-
Notifications
You must be signed in to change notification settings - Fork 1
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
Change store/publish flow to allow for timestamps to be used in review records #94
Comments
Can you point me to the two places the timestamps are being generated? I am trying to understand why the publishing code regenerates the timestamps |
The flow is:
We have a Also now if I try to import the same identical unverified review twice the second time should do nothing making it idempotent. However with timestamps this breaks We should change the flow so that at step 3 we call a publishReviewRecord function and we only pass the multihash and the bitcoin transaction hash. |
Why don't we set the timestamps in 1. Wouldn't that work? |
@kulpreet yes, but 3 has to take the multihash from 1 as a parameter and not the review record contents, otherwise the timestamps created in 1 are lost But to accomplish this, 1 has to not only compute the multihash but store in IPFS. This is fine since nobody is going to request that review record since the multihash isn't available anywhere. The point is that step 3 will be able to fetch the previously created review records with all the sigs and timestamps using the multihash, from IPFS, without doing any network requests since the data is already local. Since this is a change in exposed API it's a breaking change (a small one though). |
When you say "that step 3 will be able to fetch", do you mean it is currently able to do so or will be able to do so if we make the change being discussed? |
Will be able to do so if we make the change. Step 1 does not store on IPFS ATM, but if we make this change it will |
But that will break the txid/cid solve, i.e what comes first, the review record or the txid |
In step 1 the transaction id is not passed, that's the whole point there are two steps. Step 3 can reuse the review record from step 1 because the transaction id never goes in the review record. For now it's just written to orbit-db oplog and then orbit-db index keeps it associated to the review record multihash. Maybe we should figure out how to include it in the review record, maybe using review record updates, but this is a different issue |
The problem is that the code that writes the timestamps is ran twice, once when storing and again when publishing. Since the storing code cannot mutate the review passed for a number of reasons, there is no way to fix this unless we make the store function write to IPFS the review and then only return the multihash, which will be passed to the publish function.
The text was updated successfully, but these errors were encountered: