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
web multibatch has constant merkel proof #120
Comments
I'm a bit confused by how this is an issue. You have 3 certificates in a batch, issuing them gives something like Then you issue them via the web api method, and receive the same tree: A certificate always resolves to the same hash, and if they are included in the same order, then it's batched the same and thus the merkle tree is the same. Am I understanding that correctly or is there a different issue? |
@AnthonyRonning thanks for the reply. The Merkle proof for each certificate is different because it only needs to include the required hash to create the proof from the leaf node up to the root. Because there wasn't already a test for how the current "file" version works I added a test for that. I then created a test to show the web api creates the same proof as the "file" version. Note I didn't change any existing functionality of the file version, only added a test to assert what it creates. Does that make sense? |
I think I'm confused as well. Are you saying the web multibatch code paths weren't actually looking at the file content? Can you give an example? |
@kimdhamilton i'm saying that when submiting a single certificate the web API works as it should, however, if submitting a batch it doesn't work properly because each certificate needs a different proof, and the code wasn't supporting that. My apologies not better describing the issue. For example, let's say there are 3 certificates:
by placing the files at the location file1 file2 file3: as you can see, the proofs are not the same, and by contrast the current web api returns only one proof which is the last proof when in fact the web api should return an array of proofs. This PR does that by building an array in memory and returning the results:
the current broken web ap implementation for 3 badges returns: |
ok, I gotcha. This makes sense |
Looks like the PR was merged, closing. Thanks for opening up the issue and fixing it! |
There's a bug that when batching certs into a single transaction, the proof that's created for each cert is the same when using the web api implementation.
The text was updated successfully, but these errors were encountered: