Documentation
¶
Index ¶
- Constants
- Variables
- func AddCommands(app *cli.App) *cli.App
- func Bug(cmd *CmdCtx, id string) bool
- func IsSupportedBug(id string) bool
- func NewApp() *cli.App
- func NewDiagCmd() *cli.Command
- func NewEventDiagCmd() *cli.Command
- func NewLogTailCmd() *cli.Command
- func NewLogWatcherCmd() *cli.Command
- func NewMassifsCmd() *cli.Command
- func NewNodeCmd() *cli.Command
- func NewNodeScanCmd() *cli.Command
- func NewProveCmd() *cli.Command
- func NewTimestamp(id uint64, epoch uint8) (*timestamppb.Timestamp, error)
- func NewWatchConfig(cCtx *cli.Context, cmd *CmdCtx) (watcher.WatchConfig, error)
- func PeakStack(massifHeight uint8, mmrSize uint64) []uint64
- func SetTimestamp(id uint64, ts *timestamppb.Timestamp, epoch uint8) error
- type CmdCtx
- type LeafType
- type LogTailActivity
- type MassifTail
- type SealTail
- type TailConfig
Constants ¶
const ( AzureBlobURLFmt = "https://%s.blob.core.windows.net" AzuriteStorageAccount = "devstoreaccount1" DefaultContainer = "merklelogs" )
Variables ¶
var ( // recovers timestamp_committed from merklelog_entry.commit.idtimestamp prior to hashing Bug9308 = "9308" Bugs = []string{ Bug9308, } )
Functions ¶
func IsSupportedBug ¶
func NewDiagCmd ¶
NewDiagCmd prints diagnostic information about the massif blob containg a specific mmrIndex
func NewEventDiagCmd ¶
NewEventDiagCmd provides diagnostic support for event verification
func NewLogTailCmd ¶
func NewLogWatcherCmd ¶
NewLogWatcherCmd watches for changes on any log
func NewMassifsCmd ¶
NewMassifsCmd prints out pre-calculated tables for navigating massif blobs with maximum convenience
func NewNodeScanCmd ¶
NewNodeScan implements a sub command which linearly scans for a node in a blob This is a debugging tool
func NewProveCmd ¶
NewProveCmd (will) generate a proof and node path for the argument node
func NewTimestamp ¶
func NewTimestamp(id uint64, epoch uint8) (*timestamppb.Timestamp, error)
func NewWatchConfig ¶
NewWatchConfig derives a configuration from the options set on the command line context
func PeakStack ¶
PeakStack returns the stack of mmrIndices corresponding to the stack of ancestor nodes required for mmrSize. Note that the trick here is to realise that passing a massifIndex+1 in place of mmrSize, treating each massif as a leaf node in a much smaller tree, gets the (much shorter) peak stack of nodes required from earlier massifs. And this is stack of nodes carried forward in each massif blob to make them self contained. (The mmrblobs package has a slightly different variant of this that returns a map)
func SetTimestamp ¶
func SetTimestamp(id uint64, ts *timestamppb.Timestamp, epoch uint8) error
Types ¶
type CmdCtx ¶
type CmdCtx struct {
// contains filtered or unexported fields
}
CmdCtx holds shared config and config derived state for all commands
type LeafType ¶
type LeafType uint8
LeafType provides domain separation for the different kinds of tree leaves we require.
const ( // LeafTypePlain is used for committing to plain values. LeafTypePlain LeafType = iota // LeafTypePeriodSentinel is entered into the MMR once per period. By // forcing a heartbeat entry, we guarantee a liveness indicator - their will // be a definable lower bound on how often the MMR root changes LeafTypePeriodSentinel // LeafTypeEpochTombstone is always the last leave in an epoch MMR. This is // used to provide crash fault tolerance on the epoch as whole LeafTypeEpochTombStone )
type LogTailActivity ¶
type LogTailActivity struct {
watcher.LogTail
LogSize uint64
LastIDEpoch uint8
LastIDTimestamp uint64
LogActivity time.Time
TagActivity time.Time
}
LogTailActivity can represent either the seal or the massif that has most recently been updated for the log.
type MassifTail ¶
type MassifTail struct {
LogTailActivity
FirstIndex uint64
}
MassifTail contains the massif specific tail information
func TailMassif ¶
func TailMassif( ctx context.Context, massifReader massifs.MassifReader, tenantIdentity string, ) (MassifTail, error)
TailMassif returns the active massif for the tenant
func (MassifTail) String ¶
func (lt MassifTail) String() string
String returns a printable. loggable pretty rendering of the tail
type SealTail ¶
type SealTail struct {
LogTailActivity
Count uint64
Signed cose.CoseSign1Message
State massifs.MMRState
}
SealTail contains the seal specific tail information
type TailConfig ¶
type TailConfig struct {
// Interval defines the wait period between repeated tail checks if many
// checks have been asked for.
Interval time.Duration
// TenantIdentity identifies the log of interest
TenantIdentity string
}
func NewTailConfig ¶
func NewTailConfig(cCtx *cli.Context, cmd *CmdCtx) (TailConfig, error)
NewTailConfig derives a configuration from the supplied comand line options context