-
Notifications
You must be signed in to change notification settings - Fork 85
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
test: add darkside support for GetSubtreeRoots gRPC #469
test: add darkside support for GetSubtreeRoots gRPC #469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good to me!
ACK! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question about the change to the "errors" dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK modulo the answer to the "errors" question.
One new darksidewallet gRPC added, SetSubtreeRoots()
64231e7
to
bfd4e0a
Compare
Force pushed to resolve review comment from @nuttycom (thanks). There are still some references to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK bfd4e0a
@LarryRuane do you know why the CI run here doesn't seem to be responding? I don't see an error, but I also don't see the option to admin-merge functionality. |
No, sorry, I don't know how CI works at all. As I mentioned, Marshall tried to get CI to work on this repo but wasn't able to. I don't know what problem he was running into. |
Closes #464
One new darksidewallet gRPC added, SetSubtreeRoots()
Example usage and output, after starting lightwalletd in darksidewallet mode:
Each call to
SetSubtreeRoots
completely replaces all of the roots. A call toReset
clears all the roots. It's not necessary to create or stage blocks or transactions; this is its own independent "cache".Design discussion:
The original plan was to allow subtree roots to be added and deleted individually, but that was more complex to implement and was semantically confusing. For example, what if you had created subtree roots at index 2, then 3, then 4. Now you can request starting index 2 and length 3, and get all 3 of these back. But what if you now remove index 3 and make the same request (or never created an entry at index 3 in the first place)? What should it return for the middle entry (index 3)? Should that be an error? Such an error would never occur in production (it would only be a test error).
It really only makes sense to have a contiguous range of entries. I can't imagine a test wanting to surgically update specific entries.
In return for this lack of flexibility, the code and the mental model are much simpler to understand. It's very important for test code to be as trivial as possible to understand, or else you start to doubt if the production code is actually being tested.