Documentation
¶
Overview ¶
Package dedup limits the number of duplicate entries a personality allows in a Tessera log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateFromLog ¶
func UpdateFromLog(ctx context.Context, lds LocalBEDedupStorage, t time.Duration, fcp client.CheckpointFetcherFunc, fb client.EntryBundleFetcherFunc, pb ParseBundleFunc)
UpdateFromLog synchronises a local best effort deduplication storage with a log.
Types ¶
type BEDedupStorage ¶
type BEDedupStorage interface { Add(ctx context.Context, lidxs []LeafDedupInfo) error Get(ctx context.Context, leafID []byte) (SCTDedupInfo, bool, error) }
type LeafDedupInfo ¶
type LeafDedupInfo struct { LeafID []byte SCTDedupInfo }
LeafDedupInfo enables building deduplicated add-pre-chain/add-chain responses.
func DedupFromBundle ¶
func DedupFromBundle(bundle []byte, bundleIdx uint64) ([]LeafDedupInfo, error)
DedupFromBundle converts a bundle into an array of LeafDedupInfo.
The index of a leaf is computed from its position in the log, instead of parsing SCTs. Greatly inspired by https://github.com/FiloSottile/sunlight/blob/main/tile.go TODO(phboneff): move this somewhere else, and only leave crypto in this file
type LocalBEDedupStorage ¶
type LocalBEDedupStorage interface { Add(ctx context.Context, lidxs []LeafDedupInfo) error Get(ctx context.Context, leafID []byte) (SCTDedupInfo, bool, error) LogSize() (uint64, error) }
TODO: re-architecture to prevent creating a LocaLBEDedupStorage without calling UpdateFromLog
type ParseBundleFunc ¶
type ParseBundleFunc func([]byte, uint64) ([]LeafDedupInfo, error)
type SCTDedupInfo ¶
SCTDedupInfo contains data to build idempotent SCTs.