Skip to content

verifier_tools: Support prefetching and local caching of log entries. - #18

Merged
billy-lau merged 1 commit into
android:mainfrom
billy-lau:verifier_tools/usability
Sep 10, 2026
Merged

verifier_tools: Support prefetching and local caching of log entries.#18
billy-lau merged 1 commit into
android:mainfrom
billy-lau:verifier_tools/usability

Conversation

@billy-lau

Copy link
Copy Markdown
Member

cmd/verifier/verifier.go:

  • added --fetch_entries flag to pre-fetch and cache entries locally up to the current checkpoint without requiring a payload or running inclusion proofs.
  • added --concurrency flag to configure worker threads for Tessera tiles.
  • added --cache_dir flag to specify a custom root directory for the cache.
  • updated error handling and flag.Usage to improve usability.

internal/tiles/reader.go:

  • added log entry prefetching utilities for both legacy and Tessera logs, supporting bounded concurrency and incremental caching of immutable tiles.
  • introduced configurable cache directory management with automatic eviction of stale partial tiles.
  • modernized HTTP transport with connection pooling, timeouts, and context-aware cancellation.

internal/tiles/reader_test.go:

  • added TestFetchAllLegacyEntries testing multi-file caching and cache hits.
  • added TestFetchAllTesseraEntries testing concurrent tile downloads, skip logic, and error/cancellation handling.
  • added TestSetCacheDir verifying custom cache directory redirection.
  • hermetically isolated test caches across platforms ($HOME and $XDG_CACHE_HOME).

README.md:

  • documented Verification Mode and Pre-fetching & Offline Cache Mode.
  • added flags reference table covering new flags and aliases.

Change-Id: I411b1587280aaf0df03915ab946baf7b5076cf4a

cmd/verifier/verifier.go:
- added `--fetch_entries` flag to pre-fetch and cache entries locally up to
  the current checkpoint without requiring a payload or running inclusion proofs.
- added `--concurrency` flag to configure worker threads for Tessera tiles.
- added `--cache_dir` flag to specify a custom root directory for the cache.
- updated error handling and `flag.Usage` to improve usability.

internal/tiles/reader.go:
- added log entry prefetching utilities for both legacy and Tessera logs, supporting
  bounded concurrency and incremental caching of immutable tiles.
- introduced configurable cache directory management with automatic eviction of
  stale partial tiles.
- modernized HTTP transport with connection pooling, timeouts, and context-aware
  cancellation.

internal/tiles/reader_test.go:
- added `TestFetchAllLegacyEntries` testing multi-file caching and cache hits.
- added `TestFetchAllTesseraEntries` testing concurrent tile downloads, skip logic,
  and error/cancellation handling.
- added `TestSetCacheDir` verifying custom cache directory redirection.
- hermetically isolated test caches across platforms ($HOME and $XDG_CACHE_HOME).

README.md:
- documented Verification Mode and Pre-fetching & Offline Cache Mode.
- added flags reference table covering new flags and aliases.

Change-Id: I411b1587280aaf0df03915ab946baf7b5076cf4a
@billy-lau
billy-lau merged commit 07d699d into android:main Sep 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant