Skip to main content

Module cache

Module cache 

Source
Expand description

Compilation and verification cache for Trident.

Caches are keyed by content hashes from hash.rs:

  • Compilation cache: (source hash, target) → compiled TASM + cost info
  • Verification cache: source hash → verification report

Cache location: ~/.trident/cache/ (or $TRIDENT_CACHE_DIR)

Layout:

~/.trident/cache/
├── compile/
│   └── <source_hash_hex>.<target>.tasm
└── verify/
    └── <source_hash_hex>.json

Cache entries are append-only: once written, never modified. A hash uniquely identifies content, so the same hash always maps to the same result.

Structs§

CacheStats
Statistics about the cache.
CachedCompilation
A cached compilation result.
CachedVerification
A cached verification result.

Functions§

cache_dir
Resolve the cache directory.
clear
Clear the entire cache.
lookup_compilation
Look up a cached compilation result.
lookup_verification
Look up a cached verification result.
stats
Get cache statistics.
store_compilation
Store a compilation result in the cache.
store_verification
Store a verification result in the cache.
timestamp
Get the current timestamp as a string.