Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

registry state

Back to all declarations

Engine

type

Engine is the contract a registered engine satisfies. Methods take and return plain values only, so the engine never receives a reference into registry state (tasarim-v6 §5.4 defence (a)).

Value

registry.Engine

SampleSeed

untyped string

SampleSeed is rendered once at registration; its hash is the fingerprint.

Value

"spike-sample"

record

type

Value

registry.record

Board

type

Board is registry-owned state that a foreign engine can get a pointer to.

Value

registry.Board

engines

v0.Tree

// engine pkgpath -> \*record

Open
OID
003ad7…37e5:4
engines details

Inspect ref

bumps

int

Value

1

Register

func(e registry.Engine) string

Register stores the caller realm's engine. The id is the caller's pkgpath, so a realm can only ever register itself.

Open
OID
003ad7…37e5:9
Register details

Inspect func

RenderWith

func(id string, seed string) string

RenderWith runs a registered engine. Read-only: reached through qeval.

Open
OID
003ad7…37e5:11
RenderWith details

Inspect func

RenderInTx

func(id string, seed string) string

RenderInTx runs an engine inside a transaction. UNSAFE PROBE: a qeval discards writes, so this is how the spike observes on chain what engine code can do from a write path — the thing core never does (I-12).

Open
OID
003ad7…37e5:12
RenderInTx details

Inspect func

VerifyFingerprint

func(id string) bool

VerifyFingerprint re-renders the sample and compares it with the hash stored at registration; false means the engine's output changed.

Open
OID
003ad7…37e5:13
VerifyFingerprint details

Inspect func

Fingerprint

func(id string) string
Open
OID
003ad7…37e5:14
Fingerprint details

Inspect func

IsRegistered

func(id string) bool
Open
OID
003ad7…37e5:15
IsRegistered details

Inspect func

SharedBoard

func() *registry.Board

SharedBoard returns a pointer into registry state. UNSAFE PROBE: the spike checks that a foreign engine writing through it is refused by the VM (interrealm v2 §3.2 readonly check).

Open
OID
003ad7…37e5:16
SharedBoard details

Inspect func

BoardCount

func() int

BoardCount reads the probe target.

Open
OID
003ad7…37e5:17
BoardCount details

Inspect func

UnsafeBump

func()

UnsafeBump is a non-crossing exported function that mutates registry state. UNSAFE PROBE: interrealm v2 §4.1 says a non-crossing call into /r/registry borrows /r/registry's storage, so a foreign engine calling it SHOULD succeed. That is exactly why production core exports no state-changing non-crossing function (invariant I-12).

Open
OID
003ad7…37e5:18
UnsafeBump details

Inspect func

Bumps

func() int

Bumps reads the UnsafeBump counter.

Open
OID
003ad7…37e5:19
Bumps details

Inspect func

mustRecord

func(id string) *registry.record
Open
OID
003ad7…37e5:21
mustRecord details

Inspect func

sha256Hex

func(s string) string
Open
OID
003ad7…37e5:22
sha256Hex details

Inspect func
Engine : type =registry.Engine
SampleSeed : untyped string ="spike-sample"
record : type =registry.record
Board : type =registry.Board
engines : v0.Tree Inspect
board : *registry.Board Inspect
bumps : int =1
Register : func(e registry.Engine) string Inspect
RenderWith : func(id string, seed string) string Inspect
RenderInTx : func(id string, seed string) string Inspect
VerifyFingerprint : func(id string) bool Inspect
Fingerprint : func(id string) string Inspect
IsRegistered : func(id string) bool Inspect
SharedBoard : func() *registry.Board Inspect
BoardCount : func() int Inspect
UnsafeBump : func() Inspect
Bumps : func() int Inspect
Render : func(path string) string Inspect
mustRecord : func(id string) *registry.record Inspect
sha256Hex : func(s string) string Inspect