sumdb/tlog: make NewTiles only generate strictly necessary tiles

Currently, NewTiles returns tiles for every partial tree size from
oldTreeSize to newTreeSize. However, if a log is only publishing
checkpoints at oldTreeSize and newTreeSize, the trees of sizes
oldTreeSize+1 to newTreeSize-1 are unverifiable, so those tiles are
unnecessary. Also, NewTiles currently returns tiles that already exists
as part of oldTreeSize, which are not new.

This has a significant performance and cost difference when uploading
tiles individually to e.g. object storage.

Change-Id: I92a5d76bc54e7022991e51997e793356ab5e7d5c
Reviewed-on: https://go-review.googlesource.com/c/mod/+/570295
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 files changed
tree: 6eba6370712f75656b2b773c55a7f27ae8275967
  1. gosumcheck/
  2. internal/
  3. modfile/
  4. module/
  5. semver/
  6. sumdb/
  7. zip/
  8. codereview.cfg
  9. go.mod
  10. go.sum
  11. LICENSE
  12. PATENTS
  13. README.md
README.md

mod

PkgGoDev

This repository holds packages for writing tools that work directly with Go module mechanics. That is, it is for direct manipulation of Go modules themselves.

It is NOT about supporting general development tools that need to do things like load packages in module mode. That use case, where modules are incidental rather than the focus, should remain in x/tools, specifically x/tools/go/packages.

The specific case of loading packages should still be done by invoking the go command, which remains the single point of truth for package loading algorithms.