From 7e03125857c324966c0efba0ce5c5c596a2d5e89 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Fri, 22 Apr 2022 15:20:06 +0100 Subject: [PATCH 1/5] Add deprecation note to most packages under merkle --- merkle/compact/range.go | 4 ++++ merkle/doc.go | 4 ++++ merkle/hashers/tree_hasher.go | 5 +++++ merkle/logverifier/log_verifier.go | 5 +++++ merkle/rfc6962/rfc6962.go | 4 ++++ merkle/testonly/constants.go | 4 ++++ 6 files changed, 26 insertions(+) diff --git a/merkle/compact/range.go b/merkle/compact/range.go index c26030300d..c81881b6ef 100644 --- a/merkle/compact/range.go +++ b/merkle/compact/range.go @@ -13,6 +13,10 @@ // limitations under the License. // Package compact provides compact Merkle tree data structures. +// +// Deprecated: This package is superseded by the corresponding functionality in +// https://github.com/transparency-dev/merkle/compact. It will be removed in +// future releases of Trillian. package compact import ( diff --git a/merkle/doc.go b/merkle/doc.go index bb15d9360b..6bf92abef6 100644 --- a/merkle/doc.go +++ b/merkle/doc.go @@ -13,4 +13,8 @@ // limitations under the License. // Package merkle provides Merkle tree manipulation functions. +// +// Deprecated: This package is superseded by the corresponding functionality in +// https://github.com/transparency-dev/merkle. It will be removed in future +// releases of Trillian. package merkle diff --git a/merkle/hashers/tree_hasher.go b/merkle/hashers/tree_hasher.go index afecdabfab..aa73abd79f 100644 --- a/merkle/hashers/tree_hasher.go +++ b/merkle/hashers/tree_hasher.go @@ -12,6 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package hashers provides an interface for log hashers. +// +// Deprecated: This package is superseded by the corresponding functionality in +// https://github.com/transparency-dev/merkle. It will be removed in future +// releases of Trillian. package hashers // LogHasher provides the hash functions needed to compute dense merkle trees. diff --git a/merkle/logverifier/log_verifier.go b/merkle/logverifier/log_verifier.go index 3e023aa8d4..75040a8531 100644 --- a/merkle/logverifier/log_verifier.go +++ b/merkle/logverifier/log_verifier.go @@ -12,6 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package logverifier implements proof verificaion helpers for Merkle trees. +// +// Deprecated: This package is superseded by the corresponding functionality in +// https://github.com/transparency-dev/merkle. It will be removed in future +// releases of Trillian. package logverifier import ( diff --git a/merkle/rfc6962/rfc6962.go b/merkle/rfc6962/rfc6962.go index b04f952ef8..419ae284b5 100644 --- a/merkle/rfc6962/rfc6962.go +++ b/merkle/rfc6962/rfc6962.go @@ -13,6 +13,10 @@ // limitations under the License. // Package rfc6962 provides hashing functionality according to RFC6962. +// +// Deprecated: This package is superseded by the corresponding functionality in +// https://github.com/transparency-dev/merkle/rfc6962. It will be removed in +// future releases of Trillian. package rfc6962 import ( diff --git a/merkle/testonly/constants.go b/merkle/testonly/constants.go index 7a4e65bd19..1cbe386ee4 100644 --- a/merkle/testonly/constants.go +++ b/merkle/testonly/constants.go @@ -13,6 +13,10 @@ // limitations under the License. // Package testonly contains code and data for testing Merkle trees. +// +// Deprecated: This package is superseded by the corresponding functionality in +// https://github.com/transparency-dev/merkle/testonly. It will be removed in +// future releases of Trillian. package testonly import "github.com/google/trillian/testonly" From 4ad01b012be223bed5a09018ca561eb91485c005 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Fri, 22 Apr 2022 10:31:14 -0400 Subject: [PATCH 2/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41eee3c25e..19de58051b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Removals * #2711: Unused `storage/tools/hasher` removed. + * #2715: Packages under `merkle` are deprecated and to be removed. ### Misc improvements From dbd34c1bf18713768eeb8a30c20605e572ebd2cb Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Fri, 22 Apr 2022 10:52:05 -0400 Subject: [PATCH 3/5] Disable linter for self-imported deprecated packages --- merkle/compact/range_test.go | 4 ++-- merkle/log_proofs.go | 2 +- merkle/log_proofs_test.go | 4 ++-- merkle/logverifier/hash_chainer.go | 2 +- merkle/logverifier/log_verifier.go | 2 +- merkle/logverifier/log_verifier_test.go | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/merkle/compact/range_test.go b/merkle/compact/range_test.go index a1021bcf8e..e7c9747f76 100644 --- a/merkle/compact/range_test.go +++ b/merkle/compact/range_test.go @@ -26,8 +26,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/trillian/merkle/rfc6962" - "github.com/google/trillian/merkle/testonly" + "github.com/google/trillian/merkle/rfc6962" // nolint:staticcheck + "github.com/google/trillian/merkle/testonly" // nolint:staticcheck _ "github.com/golang/glog" // Required for flag handling ) diff --git a/merkle/log_proofs.go b/merkle/log_proofs.go index 84d1fd6092..10b4ae33f3 100644 --- a/merkle/log_proofs.go +++ b/merkle/log_proofs.go @@ -18,7 +18,7 @@ import ( "errors" "math/bits" - "github.com/google/trillian/merkle/compact" + "github.com/google/trillian/merkle/compact" // nolint:staticcheck "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/merkle/log_proofs_test.go b/merkle/log_proofs_test.go index d10ee8035e..872d076d87 100644 --- a/merkle/log_proofs_test.go +++ b/merkle/log_proofs_test.go @@ -20,8 +20,8 @@ import ( _ "github.com/golang/glog" // Logging flags for overarching "go test" runs. "github.com/google/go-cmp/cmp" - "github.com/google/trillian/merkle/compact" - "github.com/google/trillian/merkle/rfc6962" + "github.com/google/trillian/merkle/compact" // nolint:staticcheck + "github.com/google/trillian/merkle/rfc6962" // nolint:staticcheck ) // TestCalcInclusionProofNodeAddresses contains inclusion proof tests. For diff --git a/merkle/logverifier/hash_chainer.go b/merkle/logverifier/hash_chainer.go index be7192e35d..89ba41a626 100644 --- a/merkle/logverifier/hash_chainer.go +++ b/merkle/logverifier/hash_chainer.go @@ -14,7 +14,7 @@ package logverifier -import "github.com/google/trillian/merkle/hashers" +import "github.com/google/trillian/merkle/hashers" // nolint:staticcheck // hashChainer provides convenience methods for hashing subranges of Merkle // Tree proofs to obtain (sub-)tree hashes. Depending on how the path to a tree diff --git a/merkle/logverifier/log_verifier.go b/merkle/logverifier/log_verifier.go index 75040a8531..41eb860d13 100644 --- a/merkle/logverifier/log_verifier.go +++ b/merkle/logverifier/log_verifier.go @@ -25,7 +25,7 @@ import ( "fmt" "math/bits" - "github.com/google/trillian/merkle/hashers" + "github.com/google/trillian/merkle/hashers" // nolint:staticcheck ) // RootMismatchError occurs when an inclusion proof fails. diff --git a/merkle/logverifier/log_verifier_test.go b/merkle/logverifier/log_verifier_test.go index 57b06045f5..c31a058f40 100644 --- a/merkle/logverifier/log_verifier_test.go +++ b/merkle/logverifier/log_verifier_test.go @@ -23,7 +23,7 @@ import ( _ "github.com/golang/glog" "github.com/google/trillian/internal/merkle/inmemory" - "github.com/google/trillian/merkle/rfc6962" + "github.com/google/trillian/merkle/rfc6962" // nolint:staticcheck ) type inclusionProofTestVector struct { From 6b34ec433271dcc025bc80dc5d8840c2306616a1 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Fri, 22 Apr 2022 11:05:44 -0400 Subject: [PATCH 4/5] Deduplicate changelog --- CHANGELOG.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19de58051b..0dd5523d96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +2,12 @@ ## HEAD -* Start using `github.com/transparency-dev/merkle` as a replacement to the - `merkle` libraries in this repository. This is not a breaking change, but - we recommend clients also migrate over to this library at the earliest - convenient time; the long term plan is to remove `merkle` from this repo. * `countFromInformationSchema` function to add support for MySQL 8. ### Removals * #2711: Unused `storage/tools/hasher` removed. - * #2715: Packages under `merkle` are deprecated and to be removed. + * #2715: Packages under `merkle` are deprecated and to be removed. Use + https://github.com/transparency-dev/merkle instead. ### Misc improvements From 721e2a2bfdc0de879319a671eb987dd6b9215e6e Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Fri, 22 Apr 2022 11:10:30 -0400 Subject: [PATCH 5/5] Fix 404 URLs --- merkle/compact/range.go | 4 ++-- merkle/rfc6962/rfc6962.go | 4 ++-- merkle/testonly/constants.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/merkle/compact/range.go b/merkle/compact/range.go index c81881b6ef..316ebaa0d2 100644 --- a/merkle/compact/range.go +++ b/merkle/compact/range.go @@ -15,8 +15,8 @@ // Package compact provides compact Merkle tree data structures. // // Deprecated: This package is superseded by the corresponding functionality in -// https://github.com/transparency-dev/merkle/compact. It will be removed in -// future releases of Trillian. +// https://github.com/transparency-dev/merkle. It will be removed in future +// releases of Trillian. package compact import ( diff --git a/merkle/rfc6962/rfc6962.go b/merkle/rfc6962/rfc6962.go index 419ae284b5..f2182c5428 100644 --- a/merkle/rfc6962/rfc6962.go +++ b/merkle/rfc6962/rfc6962.go @@ -15,8 +15,8 @@ // Package rfc6962 provides hashing functionality according to RFC6962. // // Deprecated: This package is superseded by the corresponding functionality in -// https://github.com/transparency-dev/merkle/rfc6962. It will be removed in -// future releases of Trillian. +// https://github.com/transparency-dev/merkle. It will be removed in future +// releases of Trillian. package rfc6962 import ( diff --git a/merkle/testonly/constants.go b/merkle/testonly/constants.go index 1cbe386ee4..659d64a4ec 100644 --- a/merkle/testonly/constants.go +++ b/merkle/testonly/constants.go @@ -15,8 +15,8 @@ // Package testonly contains code and data for testing Merkle trees. // // Deprecated: This package is superseded by the corresponding functionality in -// https://github.com/transparency-dev/merkle/testonly. It will be removed in -// future releases of Trillian. +// https://github.com/transparency-dev/merkle. It will be removed in future +// releases of Trillian. package testonly import "github.com/google/trillian/testonly"