dev

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

package: adapter/sequencer/dev / testkit job: the dev Sequencer's contribution — steps 2–5 (filling, completing, verifying, persisting) behind the ranke.Contribution contract type: adapter limits: one contribution at a time, filled from one goroutine; merging is step 6 and belongs to the Sequencer (-> dev.go)

package: adapter/sequencer/dev / testkit type: adapter job: a blocking reference Sequencer for tests and development — the sole writer that advances a Ranke-Archive by driving the paper's seven steps one contribution at a time limits: a merge holds the lock end to end, so callers queue; manages named branches without propagating between them (paper 2's cross-branch merge); mints from the injected Clock. NOT for production (-> adapter/sequencer/concurrent).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Tick() time.Time
}

Clock is the deterministic time source for the claims the Sequencer mints, local to this adapter so it depends only on ranke. Tick returns now, then advances; one Clock shared with the caller keeps a whole run monotonic.

type Sequencer

type Sequencer struct {
	// contains filtered or unexported fields
}

Sequencer is the reference Ranke-Archive write path (RankeDB §Sequencer): the single writer advancing the head k → k′ by merging a contribution, running the seven steps serially in one blocking AddClaims call. Safe for concurrent use, bought by queueing — a merge runs alone (-> adapter/sequencer/concurrent for parallel).

func NewSequencer

func NewSequencer(ctx context.Context, u ranke.Universe, loc ranke.BookmarkLocator, self ranke.Contributor, clock Clock) (*Sequencer, error)

NewSequencer opens the list loc names and takes its state from it, writing nothing: an archive comes into being through Found alone. A reproducible run passes a seed of its own, keeping "same (seed, spec) → identical ids" true of the bookmark slots too.

func (*Sequencer) BookmarkId added in v0.27.0

func (s *Sequencer) BookmarkId() ranke.Id

BookmarkId returns the id of the bookmark written at bootstrap.

func (*Sequencer) Found added in v0.29.0

func (s *Sequencer) Found(ctx context.Context, pubkey []byte, branch string) (ranke.Claim, error)

Found creates the archive: k₀ empty as `V-ARCHIVEHEIGHT` fixes, then k₁ binding branch to the first contributor. Only k₁ is bookmarked, so a crash retries clean.

func (*Sequencer) GetArchive

func (s *Sequencer) GetArchive(ctx context.Context) (ranke.Archive, error)

GetArchive returns the immutable snapshot RA_k at the current head, read under the lock and built outside it, so a reader neither tears nor waits on a merge's I/O. Pre-genesis it refuses: there is no head, and an empty archive would be a fiction a caller could read from and contribute to.

func (*Sequencer) GetContributor

func (s *Sequencer) GetContributor() ranke.Contributor

GetContributor returns the contributor the Sequencer signs branch advances with.

func (*Sequencer) InGenesis added in v0.29.0

func (s *Sequencer) InGenesis() bool

InGenesis reports that no archive exists here yet, so Found is the one operation available (`ranke.ErrSequencerGenesis`).

func (*Sequencer) Merge

Merge is steps 6–7: it folds each named branch's head in, mints one branch table restating them all, bookmarks it, and publishes the new archive head. The lock covers both steps, since it derives the next head from the one it read.

func (*Sequencer) NewContribution

func (s *Sequencer) NewContribution(_ context.Context, opts ...ranke.ContributionOption) (ranke.Contribution, error)

NewContribution is step 1: it captures the base (k, t) and returns a contribution to fill, whose claims name the branches they join. Head and time come together, so the base is a pair that held at one instant.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL