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

v0 state

Back to all declarations

gasWantedReap

int64

gasWantedReap is the gas ceiling a reaping transaction is assumed to ask for, used only to price the advertised bounty. It is the measured cost of a ten-note reap rounded up; a caller reaping more notes should re-price with storagecost.EvaluateAtFloor directly rather than trust this.

Value

5000000

maxBody

untyped bigint

maxBody caps a note so one poster cannot lock an unbounded deposit in a single call, which would also make the gas cost of reaping it unpredictable.

Value

(4096 <untyped> bigint)

Note

type

Note is one posting. Body is what costs storage; the rest is bookkeeping that makes the incentive visible in Render.

Value

v0.Note

notes

*v1.List

notes is append-addressed: an index is stable for the life of the realm, which is what lets Compact reclaim dead nodes without renumbering.

Open
OID
01e99c…e47a:4
notes details

Inspect pointer

Post

func(body string, ttl int64) int

Post adds a note that becomes reapable ttl blocks from now, and locks the storage deposit for it against the caller. A ttl of zero is allowed and makes the note reapable immediately, which is the cheapest way to demonstrate the mechanism.

Open
OID
01e99c…e47a:6
Post details

Inspect func

Reap

func(limit int) int

Reap deletes up to limit expired notes and returns how many it deleted. Permissionless by design. The storage deposit freed goes to whoever signed this transaction, so a stranger keeping the board tidy is paid for it out of the deposits the posters locked. A note that has not expired is skipped, not refused, so a reaper never has to guess which indices are ripe. It walks from the highest index down, which is not cosmetic. In the backing list the oldest indices are the ancestors of the newest, so a node can only be freed once everything below it is dead. Reaping oldest-first with a binding limit therefore never creates a dead tail and leaves Compactable at zero, stranding the tree structure, which measures at roughly two thirds of what an entry costs. Reaping newest-first makes each batch immediately compactable. Every candidate is expired either way, so the order changes only who gets paid how much, and it is measured: see the ulist package doc.

Open
OID
01e99c…e47a:8
Reap details

Inspect func

Compact

func() int

Compact frees the tree nodes that reaping left behind and returns how many. Also permissionless, and also paid the same way. It is a separate call because it is a separate economic decision, and a surprisingly large one: on chain, compacting a drained board returned about three times what deleting the notes themselves did, because a list node costs more than the note it carries. But it returns nothing at all while any live note sits below the dead ones, so the two calls are worth batching in that order: reap, then compact. Compactable says how much is actually there, for free.

Open
OID
01e99c…e47a:9
Compact details

Inspect func

Reapable

func() int

Reapable counts the notes that have expired and not yet been reaped.

Open
OID
01e99c…e47a:10
Reapable details

Inspect func

Compactable

func() int

Compactable reports how many dead tree nodes a Compact would free.

Open
OID
01e99c…e47a:11
Compactable details

Inspect func

Live

func() int

Live counts the notes still holding storage.

Open
OID
01e99c…e47a:12
Live details

Inspect func

Bounty

func() v0.Quote

Bounty prices what is currently on the table for a reaper, at the default storage price and the floor gas price. The byte figure is an estimate from payload length, never the chain's own accounting. Treat it as an advertisement, not a settlement.

Open
OID
01e99c…e47a:13
Bounty details

Inspect func

noteAt

func(i int) (*v0.Note, bool)

noteAt reads index i, reporting whether a live note is there. A reaped or compacted index reads as absent.

Open
OID
01e99c…e47a:14
noteAt details

Inspect func

verdictWord

func(q v0.Quote) string
Open
OID
01e99c…e47a:16
verdictWord details

Inspect func

summarize

func(body string) string

summarize keeps the board readable when a note is long.

Open
OID
01e99c…e47a:17
summarize details

Inspect func
gasWantedReap : int64 =5000000
maxBody : untyped bigint =(4096 <untyped> bigint)
Note : type =v0.Note
notes : *v1.List Inspect
Post : func(body string, ttl int64) int Inspect
Reap : func(limit int) int Inspect
Compact : func() int Inspect
Reapable : func() int Inspect
Compactable : func() int Inspect
Live : func() int Inspect
Bounty : func() v0.Quote Inspect
noteAt : func(i int) (*v0.Note, bool) Inspect
Render : func(path string) string Inspect
verdictWord : func(q v0.Quote) string Inspect
summarize : func(body string) string Inspect