Skip to content

Commit

Permalink
Swap magic bytes for something more descriptive
Browse files Browse the repository at this point in the history
This also has the benefit of not causing problems on old versions of MySQL, which broke with the emoji version.
  • Loading branch information
mhutchinson committed Dec 5, 2023
1 parent 6af1cb4 commit 02e48ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/createtree/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func newRequest() (*trillian.CreateTreeRequest, error) {
TreeState: trillian.TreeState(ts),
TreeType: trillian.TreeType(tt),
DisplayName: *displayName,
Description: "🙃norevs🙃 " + *description,
Description: "[NO_SUBTREE_REVISIONS] " + *description,
MaxRootDuration: durationpb.New(*maxRootDuration),
}}
klog.Infof("Creating tree %+v", ctr.Tree)
Expand Down
2 changes: 1 addition & 1 deletion storage/mysql/tree_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (m *mySQLTreeStorage) beginTreeTx(ctx context.Context, tree *trillian.Tree,
}
// If the tree description starts with magic constant then we will only write a single
// revision for each subtree tile, which simplifies the reading query.
subtreeRevs := !strings.HasPrefix(tree.Description, "🙃norevs🙃")
subtreeRevs := !strings.HasPrefix(tree.Description, "[NO_SUBTREE_REVISIONS]")
return treeTX{
tx: t,
mu: &sync.Mutex{},
Expand Down
2 changes: 1 addition & 1 deletion storage/testonly/admin_storage_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
TreeState: trillian.TreeState_ACTIVE,
TreeType: trillian.TreeType_LOG,
DisplayName: "Llamas Log",
Description: "🙃norevs🙃 Registry of publicly-owned llamas",
Description: "[NO_SUBTREE_REVISIONS] Registry of publicly-owned llamas",
MaxRootDuration: durationpb.New(0 * time.Millisecond),
}

Expand Down

0 comments on commit 02e48ff

Please sign in to comment.