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

lazy/v1 package

Overview

untrusted-render: records are seeded in init or derived from lazy/v0's own init; this realm exposes no setter, so no caller string ever reaches Render.

Package lazy is version 1 of the "lazy migration" upgrade pattern (pattern D of the exploration; see ../README.md).

v1 changes the stored shape (Score widens, Active is new) and migrates one record at a time, on first touch, paid for by whoever touched it. There is no migration transaction and no pause.

The catch on today's gno: migrating on read MUTATES, so the read path has to be a crossing function. Get therefore costs a transaction and is invisible to vm/qeval and to Render. Peek is the honest read-only half, and it reports the pre-migration answer for records that have not been touched yet.

Function

Pending

func Pending() int
Ask AI Claude ChatGPT

Pending is how many v0 records have never been touched. It is only a bound: v0 keeps every record it ever had, migrated or not.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/upgrade/lazy/v1.Pending()"

Result