Skip to content

feat: port to latest gno and interrealm v2 (cross(cur)) - #64

Closed
davd-gzl wants to merge 5 commits into
samouraiworld:mainfrom
davd-gzl:feat/port-latest-gno-interrealm-v2
Closed

davd-gzl wants to merge 5 commits into
samouraiworld:mainfrom
davd-gzl:feat/port-latest-gno-interrealm-v2

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Ports all of gnodaokit to gno master (2c7f1abe324e, 2026-06-01) and the interrealm v2 specification.

Interrealm v2

  • Crossing functions take cur realm as the first param; cross-calls use cross(cur). The realm is threaded only down the Execute path (DAO.Execute(id, rlm) → Handler.Execute(action, rlm) → executor(payload, rlm)), since Propose/Vote do not cross. Realm params that are not first are named rlm (reserved-name rule).
  • Drop the crossing-DAO wrapper: remove crossing.gno, daokit.NewCrossing, the CrossFn config field, and the per-realm crossFn helpers. Demos use localDAO and a one-arg setImplem.
  • Use chain/runtime/unsafe for PreviousRealm/CurrentRealm; keep chain/runtime for the Realm type and ChainHeight.

Tests

  • Test functions that cross-call now take func TestX(cur realm, t *testing.T).
  • urequire PanicsWithMessage/NotPanics gain the new rlm realm argument.

Fixes beyond mechanical porting

  • Thread the realm through basedao.MigrateFn (func(prev, params, rlm realm)) so the documented migration-via-basedao.New pattern compiles under v2. The handler already received a realm but discarded it.

Tooling and docs

  • Bump Makefile GNOVERSION to 2c7f1abe324e8fa6fac6dc71a36635cc4e92a0be.
  • gno fix is a clean no-op (no std. usage remained).
  • Update both READMEs to the v2 API (interfaces, Config, Quick Start, custom-resource and migration examples).

Verification

Lint exits 0 with zero diagnostics and all tests pass, verified against the exact target gno version via a local monorepo overlay. Note: make test / make lint resolve gno.land/p/... deps from the live chain, which still lags master, so those targets may fail locally until the chain catches up.

🤖 Generated with Claude Code

davd-gzl added 3 commits June 3, 2026 23:27
Port all of gnodaokit to gno master (2c7f1abe324e, 2026-06-01) and the
interrealm v2 specification.

Interrealm v2:
- Crossing functions take `cur realm` as first param; cross-calls use
  `cross(cur)`. The realm is threaded only down the Execute path
  (DAO.Execute(id, rlm) -> Handler.Execute(action, rlm) -> executor),
  since Propose/Vote do not cross. Non-first realm params are named `rlm`.
- Drop the crossing-DAO wrapper: remove crossing.gno, daokit.NewCrossing,
  the CrossFn config field, and per-realm crossFn helpers. Demos use
  localDAO and a one-arg setImplem.
- Use chain/runtime/unsafe for PreviousRealm/CurrentRealm; keep
  chain/runtime for the Realm type and ChainHeight.

Tests:
- Test functions that cross-call take `func TestX(cur realm, t *testing.T)`.
- urequire PanicsWithMessage/NotPanics gain the new `rlm realm` arg.

Fixes beyond mechanical porting:
- Thread the realm through basedao.MigrateFn so the documented
  migration-via-basedao.New pattern compiles under v2.

Tooling and docs:
- Bump Makefile GNOVERSION to 2c7f1abe324e8fa6fac6dc71a36635cc4e92a0be.
- Update both READMEs to the v2 API (interfaces, Config, Quick Start,
  custom-resource and migration examples).
gno lint/test download dependencies from the gno.land chain, which lags
master. Since the interrealm-v2 port targets bleeding-edge gno, the
chain's deployed packages (uassert, onbloc/json, r/demo/profile) no
longer build under the pinned toolchain, turning CI red even though our
code is correct.

scripts/gno-overlay.sh assembles a GNOROOT overlay from the pinned gno
version's stdlibs + examples, injects this repo's packages under their
on-chain import paths, and runs lint/test against it with -root-dir so
every dependency resolves locally instead of from the chain.

Also bump GNOVERSION to the latest gno master (ba9da8eb).
go list -m -f '{{.Dir}}' returns an empty Dir until the module is
extracted, so on a fresh CI runner the overlay build ran cp on
/gnovm/stdlibs and failed. go mod download -json both extracts the
source and reports its directory, without touching go.mod/go.sum.
Guard against an empty result so a future breakage fails loudly.
@davd-gzl
davd-gzl marked this pull request as ready for review June 4, 2026 21:04
@davd-gzl
davd-gzl marked this pull request as draft June 4, 2026 21:08
@davd-gzl
davd-gzl marked this pull request as ready for review June 4, 2026 22:14
@davd-gzl
davd-gzl requested review from Villaquiranm and omarsy June 4, 2026 22:14
Revert lint/test to `gno lint/test ./gno/...` and remove
scripts/gno-overlay.sh: the overlay added too much machinery for the
payoff. These targets resolve deps from the gno.land chain, which lags
master, so they stay red until gno.land ships interrealm v2; the code
itself is verified against gno master. Keeps GNOVERSION at latest master.
@davd-gzl

davd-gzl commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

CI is expected red here, and it is not the code. make lint/make test run gno lint/test ./gno/..., which downloads deps from the gno.land chain. The chain lags gno master; this branch targets master (interrealm v2 / cross(cur)), so the chain deps fail to build under the toolchain: p/nt/uassert/v0 (use of builtin cross not in function call), p/onbloc/json, r/demo/profile.

The code is verified against gno master: lint + test pass locally for every package. CI will go green once gno.land ships interrealm v2.

619929e (AI Agent)

The quick-start examples still declared the exported DAO var that the
interrealm v2 port removed from the demos, and the membership-extension
example referenced dao.DAO across realms. Use localDAO like the demos
and gate cross-realm membership checks behind a read-only IsMember
helper exposed by the DAO realm.
@zxxma

zxxma commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Superseded — every part of this landed, nothing is left.

Its substantive commit (15dbc83, the interrealm-v2 port) was already in the stack. The residual delta was exactly 3 files:

Not merged directly because its head does not compile on topaz-1 (two-value Get at ~19 sites), and merging over the ceremony branch would have reverted the avl repoint, deleted the vendored closure, dropped the provenance guard and undone #67/#68.

Thanks — the port itself is the foundation the whole freeze stack sits on.

@zxxma zxxma closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants