-
Notifications
You must be signed in to change notification settings - Fork 296
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
primitives: Add inclusion proof funcs. #2827
Merged
Merged
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
19 tasks
davecgh
commented
Nov 23, 2021
dnldd
approved these changes
Nov 24, 2021
JoeGruffins
approved these changes
Nov 26, 2021
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.
benchmarks
goos: linux
goarch: amd64
pkg: github.com/decred/dcrd/internal/staging/primitives
cpu: AMD Ryzen 9 3900XT 12-Core Processor
BenchmarkGenerateInclusionProof/64_leaves-24 39133 35708 ns/op 2240 B/op 2 allocs/op
BenchmarkGenerateInclusionProof/128_leaves-24 16256 70110 ns/op 4320 B/op 2 allocs/op
BenchmarkGenerateInclusionProof/256_leaves-24 8134 159816 ns/op 8448 B/op 2 allocs/op
BenchmarkGenerateInclusionProof/2048_leaves-24 996 1097113 ns/op 65888 B/op 2 allocs/op
BenchmarkVerifyInclusionProof/64_leaves-24 467757 2467 ns/op 0 B/op 0 allocs/op
BenchmarkVerifyInclusionProof/128_leaves-24 404984 2843 ns/op 0 B/op 0 allocs/op
BenchmarkVerifyInclusionProof/256_leaves-24 360238 3282 ns/op 0 B/op 0 allocs/op
BenchmarkVerifyInclusionProof/2048_leaves-24 250671 4594 ns/op 0 B/op 0 allocs/op
davecgh
force-pushed
the
primitives_inclusion_proofs
branch
from
November 26, 2021 05:17
ae90358
to
2fba2e1
Compare
rstaudt2
reviewed
Dec 4, 2021
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, I just had a couple of minor comments related to the tests.
davecgh
force-pushed
the
primitives_inclusion_proofs
branch
2 times, most recently
from
December 4, 2021 19:13
bcf5fca
to
69a0a59
Compare
rstaudt2
approved these changes
Dec 4, 2021
This adds new functions for generating and verifying inclusion proofs along with associated tests. The functions are direct ports of the functions of the same names from blockchain/standalone. It also updates the documentation.
BenchmarkGenerateInclusionProof ------------------------------- 64_leaves 31101 38577 ns/op 2240 B/op 2 allocs/op 128_leaves 15512 77140 ns/op 4320 B/op 2 allocs/op 256_leaves 7999 155127 ns/op 8448 B/op 2 allocs/op 2048_leaves 975 1237867 ns/op 65888 B/op 2 allocs/op BenchmarkVerifyInclusionProof ----------------------------- 64_leaves 333319 3999 ns/op 0 B/op 0 allocs/op 128_leaves 287670 4187 ns/op 0 B/op 0 allocs/op 256_leaves 249007 4841 ns/op 0 B/op 0 allocs/op 2048_leaves 181994 6683 ns/op 0 B/op 0 allocs/op
davecgh
force-pushed
the
primitives_inclusion_proofs
branch
from
December 4, 2021 23:57
69a0a59
to
17ded21
Compare
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.
This requires #2826.This adds new functions for generating and verifying inclusion proofs along with associated tests. The functions are direct ports of the functions of the same names from
blockchain/standalone
.Specifically, the following functions are updated and added along with their associated tests and benchmarks:
GenerateInclusionProof
(equiv tostandalone.GenerateInclusionProof
)VerifyInclusionProof
(equiv tostandalone.VerifyInclusionProof
)It also updates the documentation.
This is work towards #2786.