Skip to content

fix backslash issue with example go test and add install info - #1

Merged
jaekwon merged 1 commit into
gnolang:masterfrom
nylira:peng/add-install-info
Feb 14, 2021
Merged

jaekwon merged 1 commit into
gnolang:masterfrom
nylira:peng/add-install-info

Conversation

@nylira

@nylira nylira commented Jan 30, 2021

Copy link
Copy Markdown
Contributor

When I tried to run go test tests/\*.go -v -run="Test/realm.go", I kept getting this error:

malformed import path "tests/*.go": invalid char '*'

Removing an extra backslash seems to have fixed it.

I've also added a couple more install commands to help new people try the AST more easily.

@jaekwon
jaekwon merged commit 47a80e7 into gnolang:master Feb 14, 2021
@jaekwon

jaekwon commented Feb 14, 2021

Copy link
Copy Markdown
Contributor

Thank you!

jaekwon added a commit that referenced this pull request Aug 5, 2021
fix backslash issue with example `go test` and add install info
@moul moul added this to the 🏗1️⃣ test1.gno.land milestone Oct 20, 2022
thehowl added a commit that referenced this pull request Jan 15, 2024
Before:

```
gno test -verbose .
=== RUN   TestFtoa
panic: cannot convert BigintKind to Uint64Kind

goroutine 1 [running]:
github.com/gnolang/gno/gnovm/pkg/gnolang.ConvertTo(0x0, {0xecc8b8, 0xc00026c3f0}, 0xc00011e190, {0xebe6d8, 0xeb0d78})
        /home/howl/oc/gno/gnovm/pkg/gnolang/values_conversions.go:868 +0x6479
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).doOpConvert(0xc0000f4a20)
        /home/howl/oc/gno/gnovm/pkg/gnolang/op_expressions.go:699 +0x71
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).Run(0xc0000f4a20)
        /home/howl/oc/gno/gnovm/pkg/gnolang/machine.go:1227 +0xfce
[... more stacktrace ...]
```

After:

```
=== RUN   TestFtoa
.: test pkg: panic: cannot convert BigintKind to Uint32Kind
gno machine: Machine:
    CheckTypes: false
	Op: [OpHalt OpBody OpRangeIter OpPopBlock OpBody OpReturn OpBody OpPopResults OpExec OpBody OpPopResults OpExec OpBody OpForLoop OpPopBlock OpBody OpDefine OpBody OpReturn OpPrecall OpBody OpPopBlock OpBody OpPopBlock OpBody OpPopBlock OpBody OpPopResults OpExec OpBody OpDefine]
	Values: (len: 9)
          #8 (ryuFtoaFixed32 func(d *gno.land/r/fG5GBXmX.decimalSlice,mant uint32,exp int,prec int)())
          #7 (genericFtoa func(dst []uint8,val float64,fmt uint8,prec int,bitSize int)( []uint8))
          #6 (typeval{string} type{})
          #5 (FormatFloat func(f float64,fmt uint8,prec int,bitSize int)( string))
          #4 (TestFtoa func(t *testing.T)())
          #3 (tRunner func(t *testing.T,fn testing.testingFunc,logSteps bool)())
          #2 (RunTest func(runFlag string,verbose bool,test testing.InternalTest)(ret string))
          #1 (slice[(struct{("TestFtoa" string),(TestFtoa func(t *testing.T)())} testing.InternalTest),(struct{("TestFormatFloatInvalidBitSize" string),(TestFormatFloatInvalidBitSize func(t *testing.T)())} testing.InternalTest)] []testing.InternalTest)
          #0 (runtest func(name string)(report string))
	Exprs:
          #0 (const-type string)(genericFtoa<VPBlock(3,12)>((const (make func(t type{},z ...interface{})( []uint8)))([](const-type uint8), (const (0 int)), max<VPBlock(3,21)>(prec<VPBlock(1,2)> + (const (4 int)), (const (24 int)))), f<VPBlock(1,0)>, fmt<VPBlock(1,1)>, prec<VPBlock(1,2)>, bitSize<VPBlock(1,3)>))
	Stmts:
          #16 bodyStmt[0/0/12]=di<VPBlock(1,7)>, dfrac<VPBlock(1,12)> := di<VPBlock(1,7)> >> extra<VPBlock(1,10)>, di<VPBlock(1,7)> & extraMask<VPBlock(1,11)>*
          #15 return
          #14 bodyStmt[0/0/2]=ok<VPBlock(4,12)> = (const (true bool))
          #13 bodyStmt[0/0/4]=(end)
          #12 bodyStmt[0/0/1]=(end)
          #11 bodyStmt[0/0/14]=if !ok<VPBlock(2,12)> { return bigFtoa<VPBlock(4,13)>(dst<VPBlock(2,0)>, prec<VPBlock(2,3)>, fmt<VPBlock(2,2)>, (const-type bool)(neg<VPBlock(2,8)>), mant<VPBlock(2,10)>, exp<VPBlock(2,9)>, flt<VPBlock(2,7)>) }
          #10 bodyStmt[0/0/1]=(end)
          #9 bodyStmt[0/0/1]=if (const-type bool)(s<VPBlock(2,0)> != test<VPBlock(3,1)>.s) { t<VPBlock(4,0)>.Error((const ("testN=32" string)), test<VPBlock(3,1)>.f, (const-type string)(test<VPBlock(3,1)>.fmt), test<VPBlock(3,1)>.prec, (const ("want" string)), test<VPBlock(3,1)>.s, (const ("got" string)), s<VPBlock(2,0)>) }*
          #8 bodyStmt[0/0/6]=(end)
          #7 bodyStmt[0/0/1]=(end)
          #6 return
          #5 bodyStmt[0/0/4]=t<VPBlock(1,0)>.finished = (const (true bool))
          #4 return
          #3 bodyStmt[0/0/3]=report<VPBlock(1,5)> := t<VPBlock(1,4)>.report()
          #2 bodyStmt[0/0/1]=(end)
          #1 bodyStmt[2/0/1]=(end)
          #0 bodyStmt[0/0/1]=panic((const ("no such test: " string)) + name<VPBlock(1,0)>)*
	Blocks:
          @(1) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2d2c0,Source:func ryuFtoaFixed32(d *(decimalS...,Parent:0xc000bf43c0)
            d: (&0xc004331cb8.(*gno.land/r/fG5GBXmX.decimalSlice) *gno.land/r/fG5GBXmX.decimalSlice)
            mant: (16777216 uint32)
            exp: (-23 int)
            prec: (6 int)
            e2: (-24 int)
            q: (5 int)
            exact: (true bool)
            di: (1638400000 uint32)
            dexp2: (-14 int)
            d0: (true bool)
            extra: (14 uint)
            extraMask: (undefined)
            dfrac: (undefined)
            roundUp: (undefined)
 (s vals) @(1) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00036bc20,Source:func ryuFtoaFixed32(d *(decimalS...,Parent:0xc00052f620)
            d: (nil *gno.land/r/fG5GBXmX.decimalSlice)
            mant: (0 uint32)
            exp: (0 int)
            prec: (0 int)
            e2: (0 int)
            q: (0 int)
            exact: (false <untyped> bool)
            di: (0 uint32)
            dexp2: (0 int)
            d0: (false bool)
            extra: (0 uint)
            extraMask: (0 uint32)
            dfrac: (0 uint32)
            roundUp: (false bool)
 (s typs) @(1) [*gno.land/r/fG5GBXmX.decimalSlice uint32 int int int int <untyped> bool uint32 int bool uint uint32 uint32 bool]
          @(2) Block(ID:89285d5563b8e2373ce3416c367151d9c4102930:5,Addr:0xc000bf43c0,Source:file{ package strconv; import bi...,Parent:0xc0003325a0)
            bits: (package(bits math/bits) package{})
 (s vals) @(2) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00052f620,Source:file{ package strconv; import bi...,Parent:0xc00037ede0)
            bits: (package(bits math/bits) package{})
 (s typs) @(2) [package{}]
          @(3) gno.land/r/fG5GBXmX
	Blocks (other):
          #13 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2d0e0,Source:if (const-type bool)(bitSize<VPB...,Parent:0xc004f2cd20)
 (static) #13 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00016b020,Source:if (const-type bool)(bitSize<VPB...,Parent:0xc00016bac8)
          #12 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2cd20,Source:if (const-type bool)(fmt<VPBlock...,Parent:0xc004f2cb40)
 (static) #12 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00016b820,Source:if (const-type bool)(fmt<VPBlock...,Parent:0xc000170568)
          #11 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2cb40,Source:if (const-type bool)(shortest<VP...,Parent:0xc004f2be00)
 (static) #11 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc000170020,Source:if (const-type bool)(shortest<VP...,Parent:0xc000701420)
          #10 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2be00,Source:func genericFtoa(dst [](const-ty...,Parent:0xc0017a0000)
            dst: (slice[0x] []uint8)
            val: (1 float64)
            fmt: (101 uint8)
            prec: (5 int)
            bitSize: (32 int)
            .res_0: (nil []uint8)
            bits: (1065353216 uint64)
            flt: (&0xc005fd7668.(*gno.land/r/fG5GBXmX.floatInfo) *gno.land/r/fG5GBXmX.floatInfo)
            neg: (false bool)
            exp: (0 int)
            mant: (8388608 uint64)
            digs: (struct{(slice[0x000000000000000000000000000000000000000000000000] []uint8),(0 int),(0 int)} gno.land/r/fG5GBXmX.decimalSlice)
            ok: (false bool)
            shortest: (false bool)
 (static) #10 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc000701420,Source:func genericFtoa(dst [](const-ty...,Parent:0xc00023c2e0)
            dst: (nil []uint8)
            val: (0 float64)
            fmt: (0 uint8)
            prec: (0 int)
            bitSize: (0 int)
            .res_0: (nil []uint8)
            bits: (undefined)
            flt: (undefined)
            neg: (false <untyped> bool)
            exp: (0 int)
            mant: (0 uint64)
            digs: (undefined)
            ok: (false bool)
            shortest: (false <untyped> bool)
          #9 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2b680,Source:func FormatFloat(f (const-type f...,Parent:0xc0017a0000)
            f: (1 float64)
            fmt: (101 uint8)
            prec: (5 int)
            bitSize: (32 int)
            .res_0: ( string)
 (static) #9 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc000700c20,Source:func FormatFloat(f (const-type f...,Parent:0xc00023c2e0)
            f: (0 float64)
            fmt: (0 uint8)
            prec: (0 int)
            bitSize: (0 int)
            .res_0: ( string)
          #8 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004f2b4a0,Source:if (const-type bool)((const-type...,Parent:0xc004d60780)
 (static) #8 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc0004e4020,Source:if (const-type bool)((const-type...,Parent:0xc0003fac20)
          #7 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004d60780,Source:for i<VPBlock(1,0)> := (const (0...,Parent:0xc004d605a0)
            i: (0 int)
            test: (&0xc0080f1300.(*gno.land/r/fG5GBXmX.ftoaTest) *gno.land/r/fG5GBXmX.ftoaTest)
            s: ("1.00000e+00" string)
            x: (slice[0x616263312E3030303030652B3030] []uint8)
 (static) #7 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc0003fac20,Source:for i<VPBlock(1,0)> := (const (0...,Parent:0xc000101420)
            i: (0 int)
            test: (nil *gno.land/r/fG5GBXmX.ftoaTest)
            s: ( string)
            x: (nil []uint8)
          #6 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004d605a0,Source:func TestFtoa(t *(testing<VPBloc...,Parent:0xc008cd8000)
            t: (&0xc0049c01e0.(*testing.T) *testing.T)
 (static) #6 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc000101420,Source:func TestFtoa(t *(testing<VPBloc...,Parent:0xc0004ee020)
            t: (nil *testing.T)
          #5 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004c39c20,Source:func tRunner(t *(T<VPBlock(2,3)>...,Parent:0xc0083aa780)
            t: (&0xc0049c01e0.(*testing.T) *testing.T)
            fn: (TestFtoa func(t *testing.T)())
            logSteps: (false bool)
 (static) #5 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc001ff8020,Source:func tRunner(t *(T<VPBlock(2,3)>...,Parent:0xc0008ed620)
            t: (nil *testing.T)
            fn: (nil testing.testingFunc)
            logSteps: (false bool)
          #4 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004c39860,Source:func RunTest(runFlag (const-type...,Parent:0xc0083aa780)
            runFlag: ("" string)
            verbose: (true bool)
            test: (struct{("TestFtoa" string),(TestFtoa func(t *testing.T)())} testing.InternalTest)
            ret: ( string)
            t: (&0xc0049c01e0.(*testing.T) *testing.T)
            report: (undefined)
            out: (undefined)
 (static) #4 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc001fefc20,Source:func RunTest(runFlag (const-type...,Parent:0xc0008ed620)
            runFlag: ( string)
            verbose: (false bool)
            test: (nil testing.InternalTest)
            ret: ( string)
            t: (nil *testing.T)
            report: (nil testing.Report)
            out: (nil gonative{[]uint8})
          #3 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004c39680,Source:if (const-type bool)(test<VPBloc...,Parent:0xc004c394a0)
 (static) #3 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc0083f1020,Source:if (const-type bool)(test<VPBloc...,Parent:0xc00bfc6f20)
          #2 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004c394a0,Source:for _<VPBlock(0,0)>, test<VPBloc...,Parent:0xc004c392c0)
            test: (struct{("TestFtoa" string),(TestFtoa func(t *testing.T)())} testing.InternalTest)
 (static) #2 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00bfc6f20,Source:for _<VPBlock(0,0)>, test<VPBloc...,Parent:0xc009e5e420)
            test: (nil testing.InternalTest)
          #1 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc004c392c0,Source:func runtest(name (const-type st...,Parent:0xc004c38f00)
            name: ("TestFtoa" string)
            report: ( string)
 (static) #1 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc009e5e420,Source:func runtest(name (const-type st...,Parent:0xc0082d1ba0)
            name: ( string)
            report: ( string)
	Frames:
          #8 [FRAME FUNC:ryuFtoaFixed32 RECV:(undefined) (4 args) 28/8/1/15/14 LASTPKG:gno.land/r/fG5GBXmX LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
          #7 [FRAME FUNC:genericFtoa RECV:(undefined) (5 args) 20/7/1/11/10 LASTPKG:gno.land/r/fG5GBXmX LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
          #6 [FRAME FUNC:FormatFloat RECV:(undefined) (4 args) 17/5/0/10/9 LASTPKG:gno.land/r/fG5GBXmX LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
          #5 [FRAME LABEL:  13/5/0/8/7]
          #4 [FRAME FUNC:TestFtoa RECV:(undefined) (1 args) 11/4/0/6/6 LASTPKG:testing LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
          #3 [FRAME FUNC:tRunner RECV:(undefined) (3 args) 8/3/0/4/5 LASTPKG:testing LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
          #2 [FRAME FUNC:RunTest RECV:(undefined) (3 args) 6/2/0/3/4 LASTPKG:gno.land/r/fG5GBXmX LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
          #1 [FRAME LABEL:  2/1/0/1/2]
          #0 [FRAME FUNC:runtest RECV:(undefined) (1 args) 1/0/0/0/1 LASTPKG:gno.land/r/fG5GBXmX LASTRLM:Realm{Path:"gno.land/r/fG5GBXmX",Time:881}#89285D5563B8E2373CE3416C367151D9C4102930]
	Realm:
	  gno.land/r/fG5GBXmX
	Exceptions:
	  []
	  
stracktrace:
test.go:446               main.runTestFiles.func1
panic.go:914              runtime.gopanic
values_conversions.go:868 gnolang.ConvertTo
op_expressions.go:699     gnolang.(*Machine).doOpConvert
machine.go:1227           gnolang.(*Machine).Run
machine.go:636            gnolang.(*Machine).Eval
test.go:478               main.runTestFiles
test.go:346               main.gnoTestPkg
test.go:257               main.execTest
test.go:99                main.newTestCmd.func1
command.go:233            commands.(*Command).Run
command.go:237            commands.(*Command).Run
command.go:118            commands.(*Command).ParseAndRun
main.go:14                main.main
proc.go:267               runtime.main
asm_amd64.s:1650          runtime.goexit
; panic: gno.land/r/fG5GBXmX_test/decimal_test.gno:5: dot imports not allowed in Gno
gno machine: Machine:
    CheckTypes: false
	Op: []
	Values: (len: 0)

	Exprs:

	Stmts:

	Blocks:
          @(1) gno.land/r/fG5GBXmX_test
	Blocks (other):

	Frames:

	Realm:
	  gno.land/r/fG5GBXmX_test
	Exceptions:
	  []
	  
stracktrace:
stracktrace:
…no/gnovm/cmd/gno/test.go:446  main.runTestFiles.func1
…/go/src/runtime/panic.go:914  runtime.gopanic
…kg/gnolang/preprocess.go:173  gnolang.Preprocess.func2.1
…/go/src/runtime/panic.go:920  runtime.gopanic
…o/src/math/big/natdiv.go:520  big.nat.div
…b/go/src/math/big/int.go:268  big.(*Int).Quo
…pkg/gnolang/op_binary.go:870  gnolang.quoAssign
…pkg/gnolang/op_binary.go:256  gnolang.(*Machine).doOpQuo
…m/pkg/gnolang/machine.go:1154 gnolang.(*Machine).Run
…m/pkg/gnolang/machine.go:662  gnolang.(*Machine).EvalStatic
…kg/gnolang/preprocess.go:2150 gnolang.evalConst
…kg/gnolang/preprocess.go:784  gnolang.Preprocess.func2
…kg/gnolang/transcribe.go:728  gnolang.transcribe
…kg/gnolang/transcribe.go:371  gnolang.transcribe
…kg/gnolang/transcribe.go:670  gnolang.transcribe
…kg/gnolang/transcribe.go:708  gnolang.transcribe
…kg/gnolang/transcribe.go:133  gnolang.Transcribe
…kg/gnolang/preprocess.go:149  gnolang.Preprocess
…m/pkg/gnolang/machine.go:443  gnolang.(*Machine).runFiles
…m/pkg/gnolang/machine.go:398  gnolang.(*Machine).RunFiles
…no/gnovm/cmd/gno/test.go:466  main.runTestFiles
…no/gnovm/cmd/gno/test.go:346  main.gnoTestPkg
…no/gnovm/cmd/gno/test.go:257  main.execTest
…no/gnovm/cmd/gno/test.go:99   main.newTestCmd.func1
…/pkg/commands/command.go:233  commands.(*Command).Run
…/pkg/commands/command.go:237  commands.(*Command).Run
…/pkg/commands/command.go:118  commands.(*Command).ParseAndRun
…no/gnovm/cmd/gno/main.go:14   main.main
…b/go/src/runtime/proc.go:267  runtime.main
…/src/runtime/asm_amd64.s:1650 runtime.goexit

FAIL
FAIL    . 	2.19s
FAIL
FAIL
FAIL: 0 build errors, 1 test errors
```
@thehowl thehowl mentioned this pull request Jan 29, 2024
6 of 7 tasks
tbruyelle referenced this pull request in tbruyelle/gno Feb 16, 2024
Turn back AssertOriginCall to original implementation.
Unfortunately, this still requires to override it for tests (wip).
zivkovicmilos added a commit that referenced this pull request Jun 24, 2024
* Setup repo

* Create LICENSE

* Bump golangci/golangci-lint-action from 3 to 4 (#1)

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v3...v4)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Initial foundation pseudocode

* Bump go version

* Add message proto definitions

* Add initial collector logic

* Add temporary fetch messages to the collector

* Significantly simplify the message storage

* Add unit tests for the collector

* Remove dupl lint

* Split up the subscribe unit test

* Simplify remove case

* Drop old message queue

* Change AddMessage sig

* Tidy go mod

* Remove leftover pb.go

* Tidy go mod

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
clockworkgr added a commit that referenced this pull request Apr 17, 2026
Every issue below was a latent bug that could corrupt persisted state or
silently drop data. All fixes ship together because several interact
(#15 ↔ #40, #1 ↔ #9 ↔ #30).

Findings closed
===============

#1  Iterator does not register a version reader
    An open iterator at version V did not increment versionReaders[V], so a
    concurrent PruneVersionsTo(V) could delete nodes the iterator still
    needed to traverse via getChild. Iterators now register on construction
    and decrement exactly once on (idempotent) Close. See iterator.go and
    TestIterator_BlocksPruneUntilClose.

#2  Empty-tree branch mishandled orphan value records
    When a version committed with an empty root, its orphan value records
    were left in the DB forever. Pruning logic now handles the empty-root
    case correctly; verified by TestMarkSweepPrune_EmptyOldVersion.

#3  Positional-descent prune algorithm mis-identified subtrees
    The previous prune walked the new version's tree by position and could
    mistakenly delete nodes that were still reachable from retained
    versions, triggering cascading "failed to load child node" panics
    under sustained random-insert + prune workloads. Replaced with a
    mark-and-sweep implementation that is content-addressed via NodeKey
    and therefore immune to positional-routing fragility. Regression
    coverage: TestMarkSweepPrune_SustainedInsertPrune (seeded long-run),
    FuzzPruneConsistency, FuzzPruneDeepTree, plus the height-3 stress
    tests in prune_test.go.

#6  ValueKey nonce starting at 0 collided with the all-zero sentinel
    Fresh stores used nonce = 0 on the first value write, which collides
    with the legacy empty/zero-value sentinel used elsewhere in the
    store layer. Nonces now start at 1; a migration test in
    valuekey_nonce_test.go confirms pre-existing stores continue to load.

#8  Iterate dropped resolver errors on both trees
    Value-resolution errors during iteration were swallowed, yielding
    silent empty values to the caller. Errors now propagate through
    Iterate on both the ImmutableTree and MutableTree paths; see
    iterate_error_test.go.

#15 PruneVersionsTo had a check-vs-delete TOCTOU against reader registration
    beginPruning now holds pruneMu across the reader-count check AND the
    actual DB deletions. incrVersionReaders takes the same lock, so a
    reader registration is either serialised before the check (rejecting
    prune with ErrActiveReaders) or after the deletes have completed
    (observing a consistent post-prune DB). Lock ordering: pruneMu BEFORE
    mtx on every path. Regression tests:
    TestPrune_BeginPruningBlocksReaderRegistration,
    TestPrune_TOCTOU_ReaderRaceIsClosed,
    TestPrune_BlocksConcurrentReaderRegistration.

#26 SaveVersion idempotent-save false mismatch vs legacy empty-tree blob
    SaveVersion compared the new empty-tree root record against the legacy
    on-disk representation byte-for-byte, which produced a spurious
    mismatch and rejected the idempotent save. Comparison now accepts
    both the legacy zero-length and hash-only empty-root encodings;
    coverage in idempotent_save_test.go.

#30 GetImmutable / immutableForProof did not register version readers
    A caller holding an ImmutableTree or generating a proof was not
    reflected in versionReaders[V], so a concurrent PruneVersionsTo(V)
    could tear the snapshot out from under the caller. Both paths now
    register and the ImmutableTree.Close() releases (idempotently).
    Tests: TestGetImmutable_BlocksPruneUntilClose,
    TestGetImmutable_EmptyVersionRegistersReader,
    TestImmutableTree_CloseIsIdempotent,
    TestProof_ReleasesReaderAfterReturn.

#40 GetImmutable / immutableForProof registered the reader AFTER loading
    Registration happened at the end of GetImmutable, so a prune that had
    already passed beginPruning could delete the root record between our
    GetRoot call and our incrVersionReaders call; the subsequent
    loadNode would then hit a partially-pruned DB. Fix: register FIRST,
    then read the root, with decrVersionReaders on every error path.
    Same reordering applied to immutableForProof. Regression tests:
    TestGetImmutable_BlocksOnInFlightPrune,
    TestGetImmutable_ReleasesReaderOnMissingVersion.

Architecture changes
====================

- prune.go: positional-descent implementation removed; mark-and-sweep is
  now the sole pruning strategy. Leaf-skip optimisation at inner.height == 1
  avoids loading children when marking/deleting them by NodeKey bytes.
- nodedb.go: pruneMu introduced. Lock order invariant documented
  (pruneMu BEFORE mtx on every path that touches both).
- immutable_tree.go: Close() is idempotent; subsequent calls are no-ops
  rather than double-decrementing versionReaders.
- mutable_tree.go, proof.go, iterator.go: reader registration reordered
  to precede any DB reads on versioned snapshots.

Tests added
===========

- version_readers_test.go     — reader-registration invariants for
                                GetImmutable, iterators, proofs, and
                                the Finding #40 TOCTOU regressions.
- prune_toctou_test.go        — Finding #15 blocking invariants and
                                reader/prune race closures.
- prune_marksweep_test.go     — basic, reload-after-prune, sustained
                                insert+prune, node-count-decreases,
                                shared-subtree preservation,
                                empty-old-version scenarios.
- idempotent_save_test.go     — Finding #26 legacy-encoding acceptance.
- iterate_error_test.go       — Finding #8 resolver-error propagation.
- valuekey_nonce_test.go      — Finding #6 nonce-from-1 + migration.
- prune_test.go               — expanded height-3 churn / cascading
                                multi-version prune / height oscillation.
- fuzz_prune_test.go          — native FuzzPruneConsistency +
                                FuzzPruneDeepTree + TestPrune_FuzzLongRun.

Verification
============

  go test -short -count=1 ./tm2/pkg/bptree/... ./tm2/pkg/store/bptree/...   PASS
  go test -race -short -run 'TestGetImmutable|TestImmutableTree_|
      TestIterator_|TestProof_|TestPrune_BeginPruningBlocksReaderRegistration|
      TestPrune_TOCTOU_ReaderRaceIsClosed|
      TestPrune_BlocksConcurrentReaderRegistration|TestMarkSweepPrune_'      PASS
thehowl added a commit that referenced this pull request Apr 21, 2026
PR Body
                                                                  
  ## Summary

Stops redundant `/t/<TypeID>` backend writes and shrinks block bytes
  when a realm persists a `TypeValue`. Every `DeclaredType` now gets
exactly one canonical persisted definition at `/t/<TypeID>` (written
by the owning package's deploy), and references to it — whether at a
field position or a `TypeValue` position — serialize as a compact
`RefType{ID}` rather than an inlined copy.
### The four edits
1. `machine.go` `saveNewPackageValuesAndTypes`: only `SetType` types
whose `PkgPath == pv.PkgPath`. Cross-pkg and uverse aliases skipped.
2. `store.go` `SetType`: invert cache check so a cache hit
early-returns (matches the existing "return if tid already known"
comment). Resolves the `TODO classify them and optimize`.
3. `realm.go` `copyTypeWithRefs` `*DeclaredType` case: remove the
uverse guard. It becomes unreachable under #1 + #2.
4. `realm.go` `copyValueWithRefs` `TypeValue` case: use
`refOrCopyType(cv.Type)` instead of `copyTypeWithRefs(cv.Type)`.
Block bytes reference the type instead of inlining its definition.
See [`gnovm/adr/prxxxx_typevalue_ref_persistence.md`][adr] for the
full design rationale, alternatives considered, and consequences.
[adr]: ./gnovm/adr/prxxxx_typevalue_ref_persistence.md
  ## New filetest infrastructure                                  
- `// Types:` directive (`gnovm/pkg/test/filetest.go`): prints each
    package-declared type as `<Name>[<TypeID>]=<persisted JSON>`.
Consistent in style with `// Realm:`.
- Exported helper `gno.PersistedTypeFormForTypeValue(typ Type) Type`
so filetests can render the on-the-wire shape (not the in-memory
post-`fillType` canonical form).
- Three new realm filetests anchor the behavior for each alias case:
- `alias_uverse_realm.gno` — `type MyErr = error`
- `alias_selfpkg_realm.gno` — self-package `type MyAlias = T`
- `alias_crosspkg_realm.gno` — cross-pkg `type TestingT =
uassert.TestingT`
  ## Test plan                                                    
- [x] `go test ./gnovm/pkg/gnolang/` (full filetest suite passes)
  - [x] `go test ./gno.land/...` (full tree passes after golden updates)
- [x] Alias filetests show the compact `RefType{ID}` form
- [x] Integration goldens updated: `issue_4983`, `restart_gas`,
`storage_deposit`, `storage_deposit_bank_send`,
`storage_deposit_collector`. Every delta traces to the same
        single cause: smaller persisted byte counts.              
  ## Branch base / target                                         
Based on `upstream/master` (`dc30ea6f6`). PR against `master`.
   
---
                                                                  
  Assisted-By: Claude Opus 4.7 (1M context)

---------

Co-authored-by: ltzMaxwell <[email protected]>
Co-authored-by: Morgan Bazalgette <[email protected]>
clockworkgr added a commit that referenced this pull request Apr 22, 2026
A line-by-line critical pass over the PR (six parallel reviewers,
results cross-verified) surfaced five actual bugs in the work
landed on this branch. All five are closed here without changing
tree semantics or the PR's headline correctness/perf story.

BUG-1 (HIGH) — Store.GetImmutable leaked version readers
  Files: tm2/pkg/store/bptree/{store.go,tree.go,store_test.go,
         coverage_test.go}

  The store wrapper's Store.GetImmutable returned a *Store with no
  Close path. Each call permanently incremented versionReaders[v]
  with no decrement. Since the store wrapper is the production
  interface (tm2/pkg/store/rootmulti and the IAVL-compat layer),
  this defeated the very contract Findings #1/#15/#30/#40 added to
  PruneVersionsTo — pruning would block on stranded reader counts
  as soon as any consumer used GetImmutable.

  Fix: added CloseSnapshot() error to the Tree interface (no-op on
  the mutable adapter; calls bp.ImmutableTree.Close on the
  immutable adapter) and Store.Close() that propagates. Updated
  the four GetImmutable test sites that previously leaked.

BUG-2 (MEDIUM) — SaveVersion idempotent path leaked session state
  File: tm2/pkg/bptree/mutable_tree.go

  When SaveVersion(N) found N already persisted with the matching
  hash, the early return skipped clearing sessionValues,
  versionOrphans, and resetting nextValueNonce. A subsequent
  Rollback would DeleteValueDirect VKs that t.lastSaved still
  references; the next SaveVersion would carry stale orphans and
  non-zero nonces forward into the wrong namespace.

  Fix: clear all three before the idempotent return so the
  post-condition matches a normal successful save.

BUG-3 (MEDIUM) — LoadVersion partial failure poisoned nextValueNonce
  File: tm2/pkg/bptree/mutable_tree.go

  In LoadVersion, if maxValueNonceForVersion succeeded but loadNode
  then failed, t.nextValueNonce was set for the *failed-load*'s
  working-version namespace. The tree's t.version was unchanged
  (still the prior version). The next Set against the OLD t.version
  would allocate VKs in the wrong namespace, re-introducing the
  value-overwrite hazard maxValueNonceForVersion was added in this
  PR to prevent.

  Fix: snapshot the prior nonce; restore on loadNode failure.

BUG-4 (LOW) — Panic in nodeKeyBytesToArr bypassed batch discard
  File: tm2/pkg/bptree/prune.go

  nodeKeyBytesToArr panicked on short slices (a corruption
  diagnostic per Finding #47). The panic propagated out of
  markReachable / sweepOld past the explicit discardBatch calls in
  PruneVersionsTo's loop, leaving ndb.batch with partial deletes
  that the next Commit would flush — corrupting the prune
  bookkeeping further (firstVersion not advanced, but partial node
  deletes flushed on the next save).

  Fix: returned a typed ErrShortNodeKeyRef; updated both call sites
  in markReachable and sweepOld to propagate the error so
  PruneVersionsTo's discardBatch path runs cleanly.

BUG-5 (LOW) — merge skipped copyKey for absorbed right-keys
  File: tm2/pkg/bptree/remove.go

  The leaf and inner cases in merge appended right's keys into left
  without copyKey(), breaking Finding #20's "all separator
  boundaries use copyKey" uniform discipline. Safe today under the
  immutable-key-bytes invariant, but inconsistent — a future
  in-place key mutation elsewhere in the codebase would silently
  corrupt prior snapshots that share these slice headers via the
  merged-left.

  Fix: added copyKey() at both sites with comments referencing
  Finding #20.

Verification:

  go test -count=1 ./tm2/pkg/bptree/... ./tm2/pkg/store/bptree/...
    PASS (full suite)

  go test -race -count=1 -run='TestPrune|TestSaveVersion|
    TestLoadVersion|TestStore|TestImmutable|TestGetImmutable|
    TestIdempotent' ./tm2/pkg/bptree/ ./tm2/pkg/store/bptree/
    PASS

Six remaining concerns from the same review (not blocking) are
documented in the PR description as C-1 through C-6.
clockworkgr added a commit that referenced this pull request Apr 22, 2026
Closes the nine confirmed findings from the PR #5571 review pass on
the v2/v3 leaf-format work (commits 2133015, d56a693, 44a223c).
None of the fixes change tree semantics (structure, hashing,
versioning, proof format are untouched); they close cache-coherence
bugs, silent-corruption passthroughs, and doc/contract drift.

Findings #1 and #2 had deterministic reproducers in the review thread
that produced wrong root hashes. Finding #6 surfaced a chain-divergence
class where a corrupt value-store record made the tree return an empty
value with err == nil. The remaining fixes are smaller correctness or
documentation closures.

Findings closed
===============

#1 (HIGH) — leaf-shift loops did not shift slotsDirty in parallel
   Files: insert.go, remove.go

   The five leaf-mutation paths (leafInsert / leafRemove /
   redistributeRight / redistributeLeft / merge LeafNode case) shifted
   keys, valueHashes, valueKeys, inlineValues, and slotHashes in
   parallel — but left the slotsDirty bitmap at the pre-shift indices.
   rebuildMiniMerkleIncremental then trusted slotHashes[i] for the
   shifted-in slot whose dirty bit had been left at the old index,
   emitting a corrupt root hash.

   Reproducer (in slotsdirty_regression_test.go): empty tree →
   Set(K20), Set(K30), Set(K10) without intervening Hash() →
   WorkingHash() disagreed with the same three keys committed in
   sorted order.

   Fix: added shiftSlotsDirtyUp / shiftSlotsDirtyDown helpers that
   mirror the existing shiftInlineMaskUp / shiftInlineMaskDown bit
   shifts. Wired them into all five mutation sites. For the borrow /
   absorb cases (redistributeRight at lastIdx → 0, redistributeLeft at
   0 → dst, merge at i → lBase+i), the moved slot's dirty bit is
   mirrored into the destination so the destination's slotHashes
   validity tracks the source's pre-move state.

#2 (HIGH) — InnerNode.Clone() omitted miniTreeDirty
   File: node.go

   The explicit struct literal in InnerNode.Clone (added in commit
   2133015 alongside the new miniTreeDirty field) did not copy the
   field. Clones got the Go zero value (false), so a clone of a dirty
   inner answered Hash() from the pre-mutation mini-merkle heap
   without rebuilding. Reachable via Snapshot() on a dirty root, common
   after a deeper-level split.

   Reproducer (in slotsdirty_regression_test.go): build a 64-key
   tree, mutate to dirty the root inner, clone, assert clone.Hash()
   matches root.Hash().

   Fix: added miniTreeDirty: n.miniTreeDirty to the field list.

#3 (LOW) — slotsDirty doc named the wrong rebuild function
   File: node.go

   The slotsDirty field doc said "RebuildMiniMerkle skips slots whose
   key/value did not change". That function actually rebuilds every
   occupied slot unconditionally; the function honoring slotsDirty is
   rebuildMiniMerkleIncremental. Doc rewritten to name the right
   function and to clarify both rebuild paths.

#4 / #9 (HIGH / LOW) — InlineValueThreshold doc/resolver contradiction
   Files: options.go, mutable_tree.go

   options.go:25-26 documented "Zero selects DefaultInlineValueThreshold"
   while resolveInlineThreshold mapped opt == 0 to -1 (disabled).
   DefaultOptions() returns Options{}, so callers following the
   documented API silently got inline values disabled.

   Resolved per the implementing commit (d56a693) intent: the
   default IS disabled; callers opt into inline storage explicitly.
   Updated all three doc sites (Options.InlineValueThreshold,
   InlineValueThresholdOption, resolveInlineThreshold) to match the
   resolver behaviour and removed the temporal "as in pre-v2
   behaviour" wording per CLAUDE.md "no temporal docs" rule.

#5 (MEDIUM) — Get-hit hydration aliased leaf.inlineValues[i]
   File: mutable_tree.go

   The Get path on a tree-walk hit called fastNodes.Add(string(key),
   val) with val from leaf.valueAt — which returns leaf.inlineValues[i]
   for inline slots, a slice aliased to the leaf's own storage. The
   Set path copied via cacheValueForKey; the Get path didn't. A
   caller-side mutation of the returned bytes would corrupt both leaf
   and cache. Fix: defensive copy before Add, mirroring
   cacheValueForKey.

#6 (HIGH) — silent corruption passthrough on missing value record
   Files: errors.go, nodedb.go, prune_test.go

   nodeDB.GetValue returned (nil, nil) for an absent DB record under a
   "callers should check val == nil explicitly" convention. No caller
   actually did, so a corrupt value store (record deleted out-of-band)
   surfaced as an empty value with err == nil — indistinguishable from
   a legitimate Get miss. App-layer hashes garbage, chain diverges,
   no log, no error.

   Fix: added ErrValueMissing to the typed-error set; nodeDB.GetValue
   now returns it instead of (nil, nil). The resolver chain
   (resolveValue, valueResolverFn, leaf.valueAt) bubbles it up
   naturally to every read path that already checked err. Updated
   TestPrune_EmptyVersionOrphansCleaned to assert the new contract
   (was relying on the old (nil, nil) for missing).

#7 (MEDIUM) — Remove swallowed resolveValue error
   File: mutable_tree.go

   MutableTree.Remove did `val, _ = t.resolveValue(oldPayload.valueKey)`
   so the caller could not distinguish "old value was nil" from
   "couldn't read old value". Combined with #6, a corrupt store made
   Remove return (nil, true, nil) on a key that did exist.

   Fix: capture the error, log it via t.logger. The slot has already
   been shifted out of the leaf at this point so returning early would
   leave the tree in a partially-mutated state with no coherent retry
   path; logging preserves the diagnostic trail without breaking the
   Remove contract. A future change could surface a wrapped error
   distinguishing resolution failure from a healthy no-old-value case.

#8 (LOW) — saveBufPool comment described the wrong policy
   File: nodedb.go

   The comment said "Buffers return to the pool with a minimum
   capacity to avoid re-growing on the next large node". The actual
   policy is the opposite: a MAXIMUM cap (saveBufCapCap = 8 KiB) that
   discards oversize buffers on Put so a single pathological node
   doesn't inflate every pooled buffer. Comment rewritten to describe
   the actual mechanism.

#10 (LOW) — ADVANCED_PLAN.md was temporal scaffolding
   File: ADVANCED_PLAN.md (deleted)

   The ~400-line file was development scaffolding: phase status table
   ("✅ landed", "⬜ open"), baseline commit SHAs, benchmark rules
   addressed to the author. Per CLAUDE.md "NEVER write comments with
   temporal words... describing what changed", the entire document is
   temporal. Removed; phase planning belongs in a PR body or an
   internal wiki, not in the package.

Note: finding #11 (benchmarks missing pebbledb) was already addressed
by the merge from feat/alex/bp32tree-second-pass (commit dd30b0a).

Regression coverage
===================

slotsdirty_regression_test.go pins both reproducers from the review
thread:

  - TestRegression_SlotsDirtyShiftedOnInsert — Set(K20),Set(K30),
    Set(K10) hash matches the same keys committed in sorted order.
  - TestRegression_InnerCloneCopiesMiniTreeDirty — clone Hash()
    matches original Hash() after dirtying the root inner.

Future changes to leaf-shift discipline or InnerNode.Clone field
membership must keep these passing.

Verification
============

  go test -count=1 -timeout=10m ./tm2/pkg/bptree/...
    ./tm2/pkg/store/bptree/...
    PASS (full suite, ~27 s)

  go test -race -count=1 -timeout=10m -run='TestRegression|TestPrune|
    TestSet|TestRemove|TestSaveVersion|TestLoadVersion|TestStore|
    TestImmutable|TestGetImmutable|TestIdempotent'
    ./tm2/pkg/bptree/ ./tm2/pkg/store/bptree/
    PASS (~189 s)
jaekwon added a commit that referenced this pull request Apr 24, 2026
The amino codec changes in this branch shift the encoded size of
consensus-adjacent types (Block, Tx, Commit with AminoMarshaler zero-
repr fields) by a small handful of bytes. That propagates through the
gas model into the gas-used figures pinned by four txtar fixtures:

  gc.txtar                    151378628 → 151379058
  restart_gas.txtar            2820655 → 2821085     (addpkg #1)
                               2822984 → 2823414     (addpkg #2)
                               2822998 → 2823428     (addpkg #3 post-restart)
  gnokey_gasfee.txtar          2814462 → 2814892     (addpkg simulate)
                               1269324 → 1269754     (call simulate)
                               plus gas-wanted headroom bumps on the
                               two subsequent broadcast txs that feed
                               the simulate numbers.
  stdlib_restart_compare.txtar 1974482 → 1974912     (EXACT_GAS env var)

The gas-fee and fee_delta values in gnokey_gasfee's INFO line stay at
2955ugnot and 206900 — those round the same way despite the ~430-gas
delta. The restart_gas test's "pre-restart vs post-restart gas delta"
stays constant (14 gas), preserving the test's actual regression
signal that restarts don't leak state-dependent cost.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request Apr 24, 2026
…#12,#8,#9)

Five generator fixes where the genproto2-emitted UnmarshalBinary2 diverged
from the reflect codec's wire-format semantics. All identified via a
systematic 349-item audit (BINARY_AUDIT.md) cross-referencing every
conditional in BINARY_CONDITIONS.md against the generator.

#1  Monotonic fnum check: `fnum < lastFieldNum` → `<=`. Generator was
    accepting duplicate field numbers in sequence; reflect rejects.

#2  writeReprUnmarshal primitive branch now delegates to
    writePrimitiveDecodeFrom. Honors BinFixed64/32 dispatch (latent; no
    reachable type today) and slides bz correctly.

#3+#12 Top-level trailing-bytes rejection for non-struct types:
    - packed-slice repr branch now captures DecodeByteSlice's n and slides bz
    - both non-struct-or-unpacked branches now emit `if len(bz) != 0 { error }`
      mirroring amino.go:1054. Also renames reflect error text to
      "trailing bytes after top-level unmarshal" for consistency.

#8  ertIsStruct check in list-element encoding now keyed off einfo.Type
    (Go kind) not einfo.ReprType.Type (wire kind). nil_elements is a
    Go-side semantic guard — a nil `*Struct` in a list is the footgun
    whether the repr is struct or string. Reflect (binary_encode.go:399)
    agrees. Fixed in gen_marshal.go:487 and gen_size.go:396;
    gen_unmarshal.go:586 isStructLike left alone (decode-strategy, not
    nil_elements enforcement).

#9  writePrimitiveDecodeFrom Array+Uint8 branch now emits exact-length
    check before `copy(accessor[:], v)`. Previously short payloads
    zero-padded; long payloads silently truncated. Mirrors
    binary_decode.go:551-555.

Tests:
- wire_validation_test.go: 7 new negative tests covering duplicate/
  interleaved fnums, trailing bytes at three top-level shapes, nil
  struct-ptr in lists with non-struct repr, and byte-array element
  length mismatches (short+long).
- genproto2_test.go: structural test for writeReprUnmarshal's primitive
  branch bz-slide.
- reflect_test.go: fuzz hook for []*StructWithStringRepr (respects the
  no-nil-elements contract).

New registered test types: StructWithStringRepr, StructPtrSliceWithStringRepr,
ByteArraySliceStruct. All pb3_gen.go regenerated.

Audit artifacts: BINARY_CONDITIONS.md (1050-line reflect-codec conditional
reference), BINARY_FIXES.md (30-item fix plan), BINARY_AUDIT.md (349-row
checklist used to drive the systematic walk).

Verification: full tm2/pkg/amino/..., bft/types, crypto, std, bitarray,
gnovm, gno.land/pkg/sdk/vm Gas, gnovm/pkg/gnolang Files -test.short, and
gno.land/pkg/integration TestTestdata suites all pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request Apr 25, 2026
…s-tool deprecation scope

genproto1 (the tm2/pkg/amino/genproto library + the misc/genproto wrapper
that drives it) is deprecated for the gno.land project. genproto2 is now
the source-of-truth generator with a tested parity contract.

The library is kept in-tree because it emits standard protobuf3
(genproto2 emits amino's native wire format, not protobuf3). Future
projects that need protobuf3-compatible generated code may revive it.

If genproto1 IS revived, it must be hardened against the same wire-format
divergence class genproto2 was hardened against. Add HARDENING.md
documenting the systematic audit + per-item-loop + subagent-review
procedure that was used (commits on branch fix/jae/pr-5569 are the
canonical worked example).

Procedure summary:
  1. Audit every conditional in binary_{encode,decode}.go and amino.go
     Any helpers; classify CRITICAL / LATENT / BRITTLE / DOC.
  2. Per-item: write a failing test (parity fixture preferred, one-off
     inspection acceptable for pure structural fixes), apply the fix
     mirroring reflect's line-numbered ground truth, regenerate, run
     full amino test suite, dispatch a subagent reviewer, commit.
  3. Cross-check signals: LATENT items often turn out reachable; fixes
     surface deeper bugs; defensive branches become dead code (convert
     to explicit panic); fix all sibling sites together.
  4. Items #1-#26 from the genproto2 audit are listed as priorities
     for the genproto1 revival — same divergence class.

Expand misc/genproto deprecation banner (Makefile + binary stderr +
LongHelp) to point to HARDENING.md and clarify that the library
remains available for future protobuf3 needs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request May 3, 2026
Running the Phase 7 integration test against a real tmkms 0.15.0
binary uncovered two wire-format requirements the earlier round of
fixes had backwards.

1. Timestamp must always be emitted. tmkms's tendermint-rs decoder
   raises `MissingTimestamp` if the field is nil. The Phase 6
   `tsOrNil` helper omitted Timestamp when it was the zero time —
   exactly the wrong direction. Reverted to always emit; zero time
   becomes the protobuf year-0001 timestamp, which both sides
   canonicalize identically.

2. PartSetHeader must always be present (Some(empty), not None).
   tendermint-rs's `BlockId::TryFrom` rejects `part_set_header is
   None`. We were sending nil for the empty case after my last
   change — that's the same error class as #1. Reverted; empty
   PartSetHeader is now Some(default) on the wire.

The translator_pb_test.go zero-time tests are flipped accordingly
to assert presence + the year-0001 seconds value.

The integration test now passes end-to-end against tmkms 0.15.0:

  --- PASS: TestTmkmsIntegration_FullSigningFlow (0.02s)
    [signed Precommit:AAAAAAAAAA at h/r/s 1/0/2]
    [signed Precommit:BBBBBBBBBB at h/r/s 2/0/2]
    [signed Proposal:CCCCCCCCCC at h/r/s 3/0/0]

The test uses populated PartSetHeader values because tm2's
amino-based Vote.SignBytes still omits a default-valued embedded
message while upstream proto encodes it as `tag len=0`. That gap
is harmless in real consensus traffic — every block has parts —
but documented in tmkms.md alongside the wire requirements above.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request May 3, 2026
Running the Phase 7 integration test against a real tmkms 0.15.0
binary uncovered two wire-format requirements the earlier round of
fixes had backwards.

1. Timestamp must always be emitted. tmkms's tendermint-rs decoder
   raises `MissingTimestamp` if the field is nil. The Phase 6
   `tsOrNil` helper omitted Timestamp when it was the zero time —
   exactly the wrong direction. Reverted to always emit; zero time
   becomes the protobuf year-0001 timestamp, which both sides
   canonicalize identically.

2. PartSetHeader must always be present (Some(empty), not None).
   tendermint-rs's `BlockId::TryFrom` rejects `part_set_header is
   None`. We were sending nil for the empty case after my last
   change — that's the same error class as #1. Reverted; empty
   PartSetHeader is now Some(default) on the wire.

The translator_pb_test.go zero-time tests are flipped accordingly
to assert presence + the year-0001 seconds value.

The integration test now passes end-to-end against tmkms 0.15.0:

  --- PASS: TestTmkmsIntegration_FullSigningFlow (0.02s)
    [signed Precommit:AAAAAAAAAA at h/r/s 1/0/2]
    [signed Precommit:BBBBBBBBBB at h/r/s 2/0/2]
    [signed Proposal:CCCCCCCCCC at h/r/s 3/0/0]

The test uses populated PartSetHeader values because tm2's
amino-based Vote.SignBytes still omits a default-valued embedded
message while upstream proto encodes it as `tag len=0`. That gap
is harmless in real consensus traffic — every block has parts —
but documented in tmkms.md alongside the wire requirements above.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request May 4, 2026
Bug #4 (analogous to bug #1 in a different code path): SignVote /
SendRequest after Stop blocked for the full timeoutAccept (default
3s, measured 3.001s) before returning ErrConnectionTimeout.

The previous fix added stopCh to WaitForConnection but bypassed
signerEndpoint.WaitConnection by inlining the select. ensureConnection
(called from SendRequestLocked → sendRequestLocked) still used base
WaitConnection without a stopCh select arm, so it pinned the caller
plus instanceMtx for the full maxWait when the endpoint was stopping.

Cascade impact: RetrySignerClient retries up to 5 times with 1s
sleep between attempts, so on a stopped endpoint a single SignVote
through the retry layer would stall ~20s before the caller saw an
error.

Fix: thread stopCh through signerEndpoint.WaitConnection (option b
from the report). Both WaitForConnection and ensureConnection now
select on it. The base method's signature changes — small surface
area, only one struct embeds signerEndpoint today.

Verified: TestBugFix_SignVoteAfterStopReturnsPromptly asserts
SignVote-after-Stop returns in <500ms (measured 33.5µs in the
manual probe). All other privval tests pass under -race; lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request May 22, 2026
Rewrite the PushFrameCall borrow-rule comment block to use the
"borrow rule #1/#2/#3" naming and tighten the rule descriptions:

- #1 explicitly covers function/method/closure (closures lexically
  declared in /r/ get fv.PkgPath = /r/ and fire #1, not #3).
- #2 says "real, foreign-stamped object" and notes that constructing
  realm = storage realm under the type-driven stamping model.
- #3 narrowed to "(FuncLit) declared in a /p/ package" — the only
  case where #3 actually fires, since /r/-lexical closures are
  caught by #1.
- "Three borrow rules apply (the first applicable one fires)"
  replaces the misleading "Layered borrow" framing.

Also renames stale "Rule N" and "Layer N" references in surrounding
comments at machine.go:2335 and machine.go:2655 to match the new
naming convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request May 22, 2026
…ts/comments

Mechanical rename of all interrealm "Layer 1/2/3" and "Rule 1/2/3"
references to "borrow rule #1/#2/#3" across docs, ADRs, integration
tests, filetests, and example /r/ and /p/ packages. "Layer" was the
wrong word — these are mutually-exclusive rules (first applicable
fires), not stacked transformations.

Skipped (unrelated meaning):
- gnovm/pkg/gnolang/realm.go, values_export*.go — preprocess
  Layer 1/2 (DeclaredType→RefType collapse), unrelated to borrow
  rules.
- gnovm/adr/pr5544_typevalue_ref_persistence.md — same.
- docs/builders/getting-started.md — "Layer 1 blockchain".
- gno.land/adr/gas_refactor.md — "cache layer 1/2".

Also drops the awkward "borrow rule #N borrow" doublings that the
mechanical rewrite introduced (the original "Layer N borrow" form
used "borrow" as a noun modifier; "borrow rule #N borrow" is
redundant). Hyphenated compound forms ("Rule-1-borrows",
"Rule-2-borrowed", "pre-Layer-1-borrow") rewritten in-place.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
clockworkgr pushed a commit that referenced this pull request May 25, 2026
Bug #4 (analogous to bug #1 in a different code path): SignVote /
SendRequest after Stop blocked for the full timeoutAccept (default
3s, measured 3.001s) before returning ErrConnectionTimeout.

The previous fix added stopCh to WaitForConnection but bypassed
signerEndpoint.WaitConnection by inlining the select. ensureConnection
(called from SendRequestLocked → sendRequestLocked) still used base
WaitConnection without a stopCh select arm, so it pinned the caller
plus instanceMtx for the full maxWait when the endpoint was stopping.

Cascade impact: RetrySignerClient retries up to 5 times with 1s
sleep between attempts, so on a stopped endpoint a single SignVote
through the retry layer would stall ~20s before the caller saw an
error.

Fix: thread stopCh through signerEndpoint.WaitConnection (option b
from the report). Both WaitForConnection and ensureConnection now
select on it. The base method's signature changes — small surface
area, only one struct embeds signerEndpoint today.

Verified: TestBugFix_SignVoteAfterStopReturnsPromptly asserts
SignVote-after-Stop returns in <500ms (measured 33.5µs in the
manual probe). All other privval tests pass under -race; lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
clockworkgr pushed a commit that referenced this pull request May 25, 2026
Running the Phase 7 integration test against a real tmkms 0.15.0
binary uncovered two wire-format requirements the earlier round of
fixes had backwards.

1. Timestamp must always be emitted. tmkms's tendermint-rs decoder
   raises `MissingTimestamp` if the field is nil. The Phase 6
   `tsOrNil` helper omitted Timestamp when it was the zero time —
   exactly the wrong direction. Reverted to always emit; zero time
   becomes the protobuf year-0001 timestamp, which both sides
   canonicalize identically.

2. PartSetHeader must always be present (Some(empty), not None).
   tendermint-rs's `BlockId::TryFrom` rejects `part_set_header is
   None`. We were sending nil for the empty case after my last
   change — that's the same error class as #1. Reverted; empty
   PartSetHeader is now Some(default) on the wire.

The translator_pb_test.go zero-time tests are flipped accordingly
to assert presence + the year-0001 seconds value.

The integration test now passes end-to-end against tmkms 0.15.0:

  --- PASS: TestTmkmsIntegration_FullSigningFlow (0.02s)
    [signed Precommit:AAAAAAAAAA at h/r/s 1/0/2]
    [signed Precommit:BBBBBBBBBB at h/r/s 2/0/2]
    [signed Proposal:CCCCCCCCCC at h/r/s 3/0/0]

The test uses populated PartSetHeader values because tm2's
amino-based Vote.SignBytes still omits a default-valued embedded
message while upstream proto encodes it as `tag len=0`. That gap
is harmless in real consensus traffic — every block has parts —
but documented in tmkms.md alongside the wire requirements above.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
clockworkgr pushed a commit that referenced this pull request May 25, 2026
Running the Phase 7 integration test against a real tmkms 0.15.0
binary uncovered two wire-format requirements the earlier round of
fixes had backwards.

1. Timestamp must always be emitted. tmkms's tendermint-rs decoder
   raises `MissingTimestamp` if the field is nil. The Phase 6
   `tsOrNil` helper omitted Timestamp when it was the zero time —
   exactly the wrong direction. Reverted to always emit; zero time
   becomes the protobuf year-0001 timestamp, which both sides
   canonicalize identically.

2. PartSetHeader must always be present (Some(empty), not None).
   tendermint-rs's `BlockId::TryFrom` rejects `part_set_header is
   None`. We were sending nil for the empty case after my last
   change — that's the same error class as #1. Reverted; empty
   PartSetHeader is now Some(default) on the wire.

The translator_pb_test.go zero-time tests are flipped accordingly
to assert presence + the year-0001 seconds value.

The integration test now passes end-to-end against tmkms 0.15.0:

  --- PASS: TestTmkmsIntegration_FullSigningFlow (0.02s)
    [signed Precommit:AAAAAAAAAA at h/r/s 1/0/2]
    [signed Precommit:BBBBBBBBBB at h/r/s 2/0/2]
    [signed Proposal:CCCCCCCCCC at h/r/s 3/0/0]

The test uses populated PartSetHeader values because tm2's
amino-based Vote.SignBytes still omits a default-valued embedded
message while upstream proto encodes it as `tag len=0`. That gap
is harmless in real consensus traffic — every block has parts —
but documented in tmkms.md alongside the wire requirements above.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
clockworkgr pushed a commit that referenced this pull request May 25, 2026
Running the Phase 7 integration test against a real tmkms 0.15.0
binary uncovered two wire-format requirements the earlier round of
fixes had backwards.

1. Timestamp must always be emitted. tmkms's tendermint-rs decoder
   raises `MissingTimestamp` if the field is nil. The Phase 6
   `tsOrNil` helper omitted Timestamp when it was the zero time —
   exactly the wrong direction. Reverted to always emit; zero time
   becomes the protobuf year-0001 timestamp, which both sides
   canonicalize identically.

2. PartSetHeader must always be present (Some(empty), not None).
   tendermint-rs's `BlockId::TryFrom` rejects `part_set_header is
   None`. We were sending nil for the empty case after my last
   change — that's the same error class as #1. Reverted; empty
   PartSetHeader is now Some(default) on the wire.

The translator_pb_test.go zero-time tests are flipped accordingly
to assert presence + the year-0001 seconds value.

The integration test now passes end-to-end against tmkms 0.15.0:

  --- PASS: TestTmkmsIntegration_FullSigningFlow (0.02s)
    [signed Precommit:AAAAAAAAAA at h/r/s 1/0/2]
    [signed Precommit:BBBBBBBBBB at h/r/s 2/0/2]
    [signed Proposal:CCCCCCCCCC at h/r/s 3/0/0]

The test uses populated PartSetHeader values because tm2's
amino-based Vote.SignBytes still omits a default-valued embedded
message while upstream proto encodes it as `tag len=0`. That gap
is harmless in real consensus traffic — every block has parts —
but documented in tmkms.md alongside the wire requirements above.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request Jun 3, 2026
READONLY_RoundTripFails asserted the readonly taint blocking a caller
from round-tripping owned.GlobalSlice through owned.MutateSlice. With the
taint removed, borrow rule #1 puts m.Realm at /r/owned for MutateSlice and
the write to owned's own slice commits under owned's authority — the
round-trip now succeeds. Flip the assertion to success, rename to
READONLY_RoundTripSucceeds, and refresh the stale taint comments (header
overview + scenario).

The other taint-message assertions in this and sibling txtars
(allowancesender_*, interrealm_final_omarsy) are genuine cross-realm
foreign writes still blocked by the ownership gate (same panic message),
so they are unchanged and still pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request Jun 8, 2026
0de551f fixed the bptree 100M populate OOM (getChild memoized every loaded
child and saveNode never cleared it, so the working tree pinned every node
touched since the last reload — unbounded; now bounded by the node LRU, verified
by WorkingTreeBoundedAfterSave + ConcurrentReadWrite_NoRace under -race).

Update BENCHMARKS.md: mark the 100M populate ready (not OOM-blocked), reframe
TODO #1 (the prune dual-walk is now a performance issue, not a memory one), and
caveat that the 33M read numbers predate the fix's read-path tradeoff (~+44%
worst-case) and should be re-measured; writes are structural and unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jaekwon added a commit that referenced this pull request Jul 29, 2026
…wording

Cleanup from a three-subagent review of the ownership + parent/ancestor
authority model (unanimous verdict: the model makes sense — authority
collapses to exactly two axes, a DAO's own Council and its ancestor chain,
with no residual owner axis).

- Remove CommonDAO.TopParent(): a jump-to-root resolver that was the
  mechanism behind the removed root-owner authority (rescope fault #1). No
  authority path jumps to the root — control resolves only via one-level
  Parent() and proper-ancestor walks. Zero production callers; the package
  is new in this PR, so no compatibility concern. The unit test now asserts
  the parent link via Parent().
- Tighten the DefaultMaxActiveProposals docstring: it is a package library
  seam; the reference realm keeps the default (never tunes it).
- Reword 6 filetest comments that said "gives ownership to `test`" — New
  seeds the caller as a council member; there is no ownership.
- ADR: record the TopParent removal and the review outcome.
jaekwon added a commit that referenced this pull request Aug 25, 2026
The guide describes borrow rules #1 to #3 accurately and omits two facts about
when they apply. Both are stated in PushFrameCall and both change the
conclusions a reader draws.

They govern ordinary calls, not boundary crossings. A cross(...) call sets
m.Realm to the callee's realm and returns before any of them; a non-crossing
call of a crossing function returns too, after checking the target is not an
external realm. The three rules decide what a call that is neither borrows.

And they are a priority chain, not three separate tests -- the code says "the
first applicable one fires". So "rule #2 protects this receiver" holds only
where rule #1 does not already apply. Calling all four defenses "independent"
was wrong about the first three; readonly taint really is independent.

Verified this pass, no drift found: both VM error messages the guide quotes
appear verbatim in the source (errPersistRealm in uverse.go, the allocate format
in alloc.go), sanitize.InlineText and InlineCode exist at the cited path, and
the three rules are where the guide says they are.
gfanton added a commit that referenced this pull request Aug 31, 2026
… write fails (#6085)

## Summary

A node killed between the application's commit of height H and
`SaveState(H)` loses the stored ABCIResponses for H. Every subsequent
start then fails the ABCI handshake with:

```
error during handshake: error on replay: Could not find results for height #H
```

The node never recovers on its own. The record exists precisely to cover
this crash window, but it was written without a flush, so it died in the
same crash it was supposed to protect against. This bricked the same
production node twice in two days.

The fix is two small changes in `SaveABCIResponses`:

1. `db.Set` becomes `db.SetSync`, so the record is on disk before the
application commits.
2. Its write error (previously discarded) is returned, so `ApplyBlock`
stops the block *before* the application commit instead of committing a
height whose recovery record was never stored.

Fixes [#6055](#6055).

<details>
<summary>Mapping to #6055's items (two are deliberately scoped
out)</summary>

The missing flush and the dropped `SaveABCIResponses` error are fixed
here, with regression tests. Scoped out:

- `SaveState`'s own dropped error: past the application commit a save
failure has no in-place remedy (the app is already at H), so returning
it buys no recovery. Reasonable follow-up.
- A handshake-level test against an *already*-skewed directory: a skewed
store cannot be repaired at handshake time; that scenario belongs to
recovery tooling (see "Recovery for already-skewed stores").

</details>

## Root cause

`BlockExecutor.ApplyBlock` persists a block in this order
(`tm2/pkg/bft/state/execution.go`):

1. `SaveABCIResponses(db, H, …)`, a plain `db.Set`
2. the tx result index, also plain `db.Set`
3. `proxyApp.CommitSync()`: the application store commit, atomic and
fsynced
4. `SaveState(db, state)`, which ends in `db.SetSync`

On the WAL-based backends `Set` is unsynced (pebbledb, the production
default, passes `pebble.NoSync`), so steps 1 and 2 become durable only
when step 4 flushes the log. A death between 3 and 4 loses the responses
**and** the state while the block store and the application keep H:

```
block store = H, application = H, state = H-1, abciResponses(H) = missing
```

`Handshaker.ReplayBlocks` handles this shape by replaying H against a
mock application that serves the stored responses (the real application
must not re-execute a height it already committed). `LoadABCIResponses`
is its only source and there is no fallback: startup fails
deterministically, forever.

This is a regression, not a design choice: the forked code wrote this
key with `SetSync`, and
[#1546](#1546) removed the flush in
the same PR that added the RPC endpoint making the key undiscardable.
CometBFT v1.x uses the same design as this fix.

<details>
<summary>Full upstream history (how the regression happened, with
references)</summary>

- Every upstream release from v0.33 through v0.34.20 wrote this key with
`SetSync`.
- [tendermint#9159](tendermint/tendermint#9159)
+ [#9253](tendermint/tendermint#9253) (v0.34.21,
2022) downgraded it to `Set`, but *simultaneously* moved crash recovery
to a `SetSync`-written `lastABCIResponseKey` ("We always save the last
ABCI response for crash recovery"). Motivation was state.db bloat
([#8946](tendermint/tendermint#8946)), not
durability.
- tm2 took the downgrade **without** the compensating synced key, in
[#1546](#1546), commit
[c627995](c627995),
in response to a [review concern about per-tx fsync
cost](#1546 (comment)).
The reply ("we do a CommitSave just shortly after") is inverted for this
record: its only purpose, per its own doc comment, is the crash *before*
that save. The same PR added the RPC tx-results endpoint (`Tx()`
resolves a hash to a height, then reads `LoadABCIResponses` at that
height), which makes the per-height key load-bearing and undiscardable.
A survey of ~36 active tendermint descendants found no other fork with
neither mechanism.
- CometBFT v1.x restored the per-height `SetSync` and deprecated
`lastABCIResponseKey`
([#1976](cometbft/cometbft#1976),
[#2017](cometbft/cometbft#2017), backport
[#2412](cometbft/cometbft#2412)): the same
design as this PR. (Merged as a write-amplification fix; it stayed off
the v0.38 line over a compaction concern that does not apply to a plain
`Set` to `SetSync` change.)
- Upstream's split-key design only makes sense with their "discard ABCI
responses" config flag, which tm2 cannot have while the RPC endpoint
depends on the per-height key. The singleton is not bulletproof either:
it failed in production on CometBFT v0.38.17
([celestia-app#5070](celestiaorg/celestia-app#5070)).

</details>

## Production evidence

Two occurrences in two days on the same gno testnet node
(non-validator), both while it was fast-syncing after a restart and a
routine graceful stop landed inside `ApplyBlock`:

```
2026-08-20: block store = 288055, app = 288055, state = 288054, abciResponses(288055) ABSENT
2026-08-21: block store = 313891, app = 313891, state = 313890, abciResponses(313891) ABSENT
```

Offline analysis with tm2's own load functions confirmed all three
stores individually intact: no bit-rot, just the skew above. Both losses
happened on a clean process exit, no host crash, so the window is not
host-failure-only (tm2 never closes its databases on shutdown).

Note: this is the handshake replay path (`consensus/replay.go`), not the
RPC path. The same error string is widely reported by relayers as a
pruned-height symptom;
[tendermint#7039](tendermint/tendermint#7039)
is the canonical prior report of this exact height-triple, closed by
stalebot without a fix.

## The fix

With `SetSync`, the responses for H are on disk before the application
commits H, so every crash position maps onto a handshake case that
recovers:

| Crash position | Resulting heights | Handshake path |
|---|---|---|
| before the responses flush | app = state = H-1, store = H | replay H
against the real application |
| after it, before the app commit | app = state = H-1, store = H |
replay H against the real application |
| after the app commit, before the state save | app = store = H, state =
H-1 | replay H against the mock, responses guaranteed present |

The error propagation closes the second door into the same window: a
write that *fails* outright (disk full, I/O error) has nothing to flush,
and the old code proceeded to the application commit anyway. Now
`ApplyBlock` aborts while `app = state = H-1, store = H` still holds,
the healthy replay case, so the node self-recovers once the fault
clears. The handshake's InitChain-time save propagates it the same way.

This is a behavior change worth naming: a state-db write error now stops
the node loudly, where the old code carried on and deferred the failure
to an unrecoverable position. Every production caller already has an
exercised error path for it:

- consensus kills the process (matching how it already treats a failed
WAL fsync as fatal)
- fast sync panics
- the handshake fails the start with a clear error

The caller-by-caller analysis is in the ADR (`tm2/adr/`). The tx result
index write stays fire-and-forget deliberately: it is a lookup index,
rewritten on replay, not a recovery record.

**Cost:** five fsyncs per block become six (block store ×2, consensus
WAL, application store, `SaveState`, plus this one), against a 5 s
default commit interval. Fast sync pays it per block, which is precisely
the path that failed in production.

## Tests

- `TestSaveABCIResponsesIsDurable` (`state/store_test.go`): the
crash-recovery contract of the exported function.
- `TestApplyBlockFlushesABCIResponsesBeforeAppCommit`
(`state/execution_test.go`): the ordering through `ApplyBlock`;
snapshots what a restarting process would find at the instant the
application commits.
- `TestSaveABCIResponsesReturnsWriteError`: a failed write surfaces to
the caller.
- `TestApplyBlockAbortsBeforeAppCommitOnResponsesWriteError`: with a
store refusing the responses key, `ApplyBlock` returns the error and the
application's `Commit` is never invoked.

The durability pair fails with the `SetSync` reverted, with the
production error (`Could not find results for height #1`); the error
pair fails with the propagation reverted (returns nil and commits). The
doubles (`unsyncedWriteDB`, `failingWriteDB` in `state/helpers_test.go`)
model the WAL backends' behavior and the tests assert on observable
store contents after a simulated death, not on which method was called.
`go test ./tm2/pkg/bft/...` passes; `-race` on the state package is
clean.

For context, CometBFT maintainers describe this recovery mechanism as
not "well specified" and hard to test
([cometbft#3290](cometbft/cometbft#3290),
[#493](cometbft/cometbft#493)); upstream has
no equivalent coverage.

## Recovery for already-skewed stores

This PR prevents new occurrences; it does not repair a data directory
already in the skewed state. `contribs/gnobr`
([#5410](#5410), currently on
`chain/gnoland1`) can already dig such a node out, at the cost of a full
local replay (it wipes `gnolang.db` and replays from height 0). A
lighter path would be an app-store rollback of one version, like
tendermint/CometBFT's `rollback` command
([tendermint#7033](tendermint/tendermint#7033)),
which makes the handshake take the real-application replay path. A
replay-side fallback inside the handshake was considered and rejected as
unsound: rebuilding state for H needs `EndBlock`'s validator/param
updates, which are not derivable from the block, and guessing risks a
silent fork (reasoning in the ADR).

One more follow-up, out of scope here: shutdown does not drain an
in-flight `ApplyBlock` during fast sync, which is why a routine stop hit
this window. Draining narrows the window but cannot make any single
crash position recoverable, so it is complementary, not an alternative.

## AI assistance

AI-assisted; see the ADR's "AI assistance" section for what was
machine-derived and how it was reviewed. The human author reviewed and
owns the change.

## Note for operators

Until recovery tooling lands on master, recovering a skewed store means
restoring from a snapshot. Meanwhile, do not stop a catching-up node:
gate stops on `sync_info.catching_up == false`. That gate is deployed
and validated in production on the affected network's snapshot pipeline.
alexiscolin pushed a commit that referenced this pull request Sep 29, 2026
…2 updates (#6117)

Bumps the npm_and_yarn group with 2 updates in the
/gno.land/pkg/gnoweb/frontend directory:
[postcss](https://github.com/postcss/postcss) and
[svgo](https://github.com/svg/svgo).

Updates `postcss` from 8.5.10 to 8.5.26
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/releases">postcss's
releases</a>.</em></p>
<blockquote>
<h2>8.5.26</h2>
<ul>
<li>Fixed <code>list.split()</code> regression (by <a
href="https://github.com/lazerg"><code>@​lazerg</code></a>).</li>
<li>Track symlinks in path protection in source map loading (by <a
href="https://github.com/drengir1"><code>@​drengir1</code></a>).</li>
</ul>
<h2>8.5.25</h2>
<ul>
<li>Fixed 8.5.17 visitor regression.</li>
<li>Fixed <code>list.split()</code> for non-string values (by <a
href="https://github.com/amir-rezaei"><code>@​amir-rezaei</code></a>).</li>
</ul>
<h2>8.5.24</h2>
<ul>
<li>Preserve the BOM after the processing (by <a
href="https://github.com/hdimer"><code>@​hdimer</code></a>).</li>
</ul>
<h2>8.5.23</h2>
<ul>
<li>Do not load source map without <code>opts.from</code> for security
reasons.</li>
</ul>
<h2>8.5.22</h2>
<ul>
<li>Fixed custom property losing semicolon before a comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<h2>8.5.21</h2>
<ul>
<li>Fixed childless at-rule losing semicolon before comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed docs (by <a
href="https://github.com/isker"><code>@​isker</code></a>).</li>
</ul>
<h2>8.5.20</h2>
<ul>
<li>Fixed missing space if <code>AtRule#params</code> is set after (by
<a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed mixing AST error on warnings (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.19</h2>
<ul>
<li>Fixed cleaning <code>before</code> for new nodes inserted to
<code>Root</code> (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.18</h2>
<ul>
<li>Restricted loading previous source maps file to the
<code>opts.from</code> folder for security reasons (use <code>unsafeMap:
true</code> to disable the check).</li>
</ul>
<h2>8.5.17</h2>
<ul>
<li>Fixed <code>Maximum call stack size exceeded</code> error.</li>
<li>Fixed Prototype hijacking for <code>postcss.fromJSON()</code>.</li>
<li>Fixed <code>Input#origin()</code> for unmapped end position (by <a
href="https://github.com/chatman-media"><code>@​chatman-media</code></a>).</li>
</ul>
<h2>8.5.16</h2>
<ul>
<li>Fixed <code>Input#origin()</code> position (by <a
href="https://github.com/mizdra"><code>@​mizdra</code></a>).</li>
<li>Fixed <code>raws</code> after rehydrating a JSON AST (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed putting parent-less node in <code>nodes</code> of new node (by
<a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
<li>Fixed computing <code>offset</code> in <code>positionBy()</code> (by
<a
href="https://github.com/greymoth-jp"><code>@​greymoth-jp</code></a>).</li>
<li>Fixed <code>rangeBy()</code> on <code>index: 0</code> (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<h2>8.5.15</h2>
<ul>
<li>Fixed declaration parsing performance (by <a
href="https://github.com/homanp"><code>@​homanp</code></a>).</li>
</ul>
<h2>8.5.14</h2>
<ul>
<li>Fixed custom syntax regression (by <a
href="https://github.com/43081j"><code>@​43081j</code></a>).</li>
</ul>
<h2>8.5.13</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's
changelog</a>.</em></p>
<blockquote>
<h2>8.5.26</h2>
<ul>
<li>Fixed <code>list.split()</code> regression (by <a
href="https://github.com/lazerg"><code>@​lazerg</code></a>).</li>
<li>Track symlinks in path protection in source map loading (by <a
href="https://github.com/drengir1"><code>@​drengir1</code></a>).</li>
</ul>
<h2>8.5.25</h2>
<ul>
<li>Fixed 8.5.17 visitor regression.</li>
<li>Fixed <code>list.split()</code> for non-string values (by <a
href="https://github.com/amir-rezaei"><code>@​amir-rezaei</code></a>).</li>
</ul>
<h2>8.5.24</h2>
<ul>
<li>Preserve the BOM after the processing (by <a
href="https://github.com/hdimer"><code>@​hdimer</code></a>).</li>
</ul>
<h2>8.5.23</h2>
<ul>
<li>Do not load source map without <code>opts.from</code> for security
reasons.</li>
</ul>
<h2>8.5.22</h2>
<ul>
<li>Fixed custom property losing semicolon before a comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<h2>8.5.21</h2>
<ul>
<li>Fixed childless at-rule losing semicolon before comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed docs (by <a
href="https://github.com/isker"><code>@​isker</code></a>).</li>
</ul>
<h2>8.5.20</h2>
<ul>
<li>Fixed missing space if <code>AtRule#params</code> is set after (by
<a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed mixing AST error on warnings (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.19</h2>
<ul>
<li>Fixed cleaning <code>before</code> for new nodes inserted to
<code>Root</code> (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.18</h2>
<ul>
<li>Restricted loading previous source maps file to the
<code>opts.from</code> folder for security reasons (use <code>unsafeMap:
true</code> to disable the check).</li>
</ul>
<h2>8.5.17</h2>
<ul>
<li>Fixed <code>Maximum call stack size exceeded</code> error.</li>
<li>Fixed Prototype hijacking for <code>postcss.fromJSON()</code>.</li>
<li>Fixed <code>Input#origin()</code> for unmapped end position (by <a
href="https://github.com/chatman-media"><code>@​chatman-media</code></a>).</li>
</ul>
<h2>8.5.16</h2>
<ul>
<li>Fixed <code>Input#origin()</code> position (by <a
href="https://github.com/mizdra"><code>@​mizdra</code></a>).</li>
<li>Fixed <code>raws</code> after rehydrating a JSON AST (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/postcss/postcss/commit/07b25773f38f77919f2af02ae3e8896b0deb5988"><code>07b2577</code></a>
Release 8.5.26 version</li>
<li><a
href="https://github.com/postcss/postcss/commit/47de6b9d7c55674cb326c5de7a734a740916defc"><code>47de6b9</code></a>
Update CI</li>
<li><a
href="https://github.com/postcss/postcss/commit/1493a83db7830912316512f55ab6064e7b7dd68e"><code>1493a83</code></a>
Fix Rule#selectors losing the empty selector (<a
href="https://redirect.github.com/postcss/postcss/issues/2129">#2129</a>)</li>
<li><a
href="https://github.com/postcss/postcss/commit/180db166e250d20e6761b224ae8d8134c9ba3e40"><code>180db16</code></a>
Typo</li>
<li><a
href="https://github.com/postcss/postcss/commit/29e9e00f132c96e46e1de295b816fe88a05354e7"><code>29e9e00</code></a>
Resolve symlinks before the previous-source-map containment check (<a
href="https://redirect.github.com/postcss/postcss/issues/2125">#2125</a>)</li>
<li><a
href="https://github.com/postcss/postcss/commit/3ba8f84703a884329b58abea579c3615684e0b7e"><code>3ba8f84</code></a>
Update dependencies</li>
<li><a
href="https://github.com/postcss/postcss/commit/87e72f671fd0d401c52822b5226c656632d92ec0"><code>87e72f6</code></a>
Update lock file</li>
<li><a
href="https://github.com/postcss/postcss/commit/caaeeb907e4a816c44a23b00b151882bd02325a1"><code>caaeeb9</code></a>
Upgrade nanoid to fix infinite loop on zero size (<a
href="https://redirect.github.com/postcss/postcss/issues/2124">#2124</a>)</li>
<li><a
href="https://github.com/postcss/postcss/commit/3609b6f4296952d0b5b9ddae42c8d73ee460c041"><code>3609b6f</code></a>
Explain how to type plugin options</li>
<li><a
href="https://github.com/postcss/postcss/commit/fbad419cbd01cd7a9a1a46413447f2cd9b3fce4a"><code>fbad419</code></a>
docs: show ESM and TypeScript plugin declaration (<a
href="https://redirect.github.com/postcss/postcss/issues/2118">#2118</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/postcss/postcss/compare/8.5.10...8.5.26">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new
releaser for postcss since your current version.</p>
</details>
<br />

Updates `svgo` from 4.0.1 to 4.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/svg/svgo/releases">svgo's
releases</a>.</em></p>
<blockquote>
<h2>v4.1.0</h2>
<p>This minor release upgrades the SAX parser and introduces stricter
XML validation. It also includes important security hardening for
<code>removeScripts</code>, dependency updates, and improvements to the
test and regression infrastructure.</p>
<h3>Support SVGO</h3>
<p>If SVGO is valuable to you or your organization, please consider <a
href="https://opencollective.com/svgo">supporting the project on
OpenCollective</a>. Your sponsorship helps fund ongoing maintenance and
security work.</p>
<h3>Stricter XML validation</h3>
<p>SVGO now uses <a
href="https://www.npmjs.com/package/sax"><code>sax</code> 1.6.1</a>,
upgraded from 1.5.0 (<a
href="https://redirect.github.com/svg/svgo/pull/2257">#2257</a>).</p>
<p>The new parser version validates numeric character references against
the ranges permitted by XML. Invalid references are now rejected in both
text and attributes, including:</p>
<ul>
<li>disallowed control characters such as
<code>&amp;[#1](https://github.com/svg/svgo/issues/1);</code>,
<code>&amp;#xB;</code>, and <code>&amp;#x1F;</code>;</li>
<li>UTF-16 surrogate code points such as <code>&amp;#xD800;</code>;</li>
<li>invalid XML code points such as <code>&amp;#xFFFF;</code>.</li>
</ul>
<p>Valid boundary values—including <code>U+0020</code>,
<code>U+D7FF</code>, <code>U+E000</code>, <code>U+FFFD</code>, and
characters through <code>U+10FFFF</code>—remain supported.</p>
<p>Parser failures are consistently exposed as
<code>SvgoParserError</code> errors with an <code>Invalid character
entity</code> reason.</p>
<p>This is an intentional behavior change: malformed SVGs that were
previously accepted may now produce a parser error, while valid XML
documents are unaffected.</p>
<h3>Security</h3>
<p>The <a
href="https://svgo.dev/docs/plugins/removeScripts/"><code>removeScripts</code></a>
plugin has been hardened against several script-execution bypasses:</p>
<ul>
<li>Filters executable <code>data:</code> URLs containing HTML, XHTML,
or SVG documents while preserving inert data such as PNG images, and
filters legacy <code>vbscript:</code> URLs (<a
href="https://redirect.github.com/svg/svgo/pull/2263">#2263</a>).</li>
<li>Sanitizes content inside SVG <code>&lt;foreignObject&gt;</code>
elements by removing HTML event-handler attributes, <code>srcdoc</code>,
and executable URLs from <code>action</code>, <code>data</code>,
<code>formaction</code>, <code>href</code>, and <code>src</code>, while
preserving non-executable HTML and visual content (<a
href="https://redirect.github.com/svg/svgo/pull/2264">#2264</a>).</li>
<li>Recognizes namespace-prefixed SVG <code>&lt;a&gt;</code> elements
and removes ASCII tabs and newlines before checking URL schemes,
preventing values such as
<code>java&amp;[#9](https://github.com/svg/svgo/issues/9);script:</code>
from bypassing detection while preserving elements in unrelated custom
namespaces (<a
href="https://redirect.github.com/svg/svgo/pull/2268">#2268</a>).</li>
</ul>
<p>These changes address:</p>
<ul>
<li><a
href="https://github.com/svg/svgo/security/advisories/GHSA-4vpr-x523-8j87">GHSA-4vpr-x523-8j87</a></li>
<li><a
href="https://github.com/svg/svgo/security/advisories/GHSA-w27v-7q3p-w38r">GHSA-w27v-7q3p-w38r</a></li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>Upgraded <code>css-select</code> to v6 and <code>css-what</code> to
v7, and updated SVGO's custom selector adapter for
<code>css-select</code> v6 (<a
href="https://redirect.github.com/svg/svgo/pull/2244">#2244</a>).</li>
</ul>
<h3>Project maintenance</h3>
<p><a href="https://github.com/TrySound"><code>@​TrySound</code></a> is
back as an active SVGO maintainer.</p>
<p>Many thanks to <a
href="https://github.com/KTibow"><code>@​KTibow</code></a>, <a
href="https://github.com/SethFalco"><code>@​SethFalco</code></a>, and <a
href="https://github.com/XhmikosR"><code>@​XhmikosR</code></a> for
maintaining and improving SVGO over the past several years.</p>
<p><strong>Full Changelog:</strong> <a
href="https://github.com/svg/svgo/compare/v4.0.2...v4.1.0">https://github.com/svg/svgo/compare/v4.0.2...v4.1.0</a></p>
<h2>v4.0.2</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/svg/svgo/commit/5765cbe4e0a930dca648c6b81d335b1522cd7375"><code>5765cbe</code></a>
chore: prepare v4.1.0 release (<a
href="https://redirect.github.com/svg/svgo/issues/2275">#2275</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/3db3ef33e409a0bc0fdaf255e46c908b00e93bc2"><code>3db3ef3</code></a>
fix(removeScripts): handle anchor URL bypasses (<a
href="https://redirect.github.com/svg/svgo/issues/2268">#2268</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/4e9b9aed2a4607cf28025871151421d5bfe86484"><code>4e9b9ae</code></a>
chore: cache regression screenshots (<a
href="https://redirect.github.com/svg/svgo/issues/2267">#2267</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/d55270ce17b99ebfe16e4fad028bd162187205a1"><code>d55270c</code></a>
chore(regression): migrate comparison workers to Tinypool (<a
href="https://redirect.github.com/svg/svgo/issues/2266">#2266</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/fd51e474a300417d9361d9302d596b1763146327"><code>fd51e47</code></a>
fix(removeScripts): sanitize foreignObject content (<a
href="https://redirect.github.com/svg/svgo/issues/2264">#2264</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/dcaf957c6eb34832844de11ef2792e3e0e8db5dd"><code>dcaf957</code></a>
chore: optimize fixtures in a bounded worker pool (<a
href="https://redirect.github.com/svg/svgo/issues/2265">#2265</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/a3542937d9c85debab04b1ff75207768caf8a058"><code>a354293</code></a>
fix(removeScripts): filter executable data URLs (<a
href="https://redirect.github.com/svg/svgo/issues/2263">#2263</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/4e0d2ac5e7abd5f12d650d3e4b4d2500d4944cc5"><code>4e0d2ac</code></a>
ci(typecheck): return typechecking on CI</li>
<li><a
href="https://github.com/svg/svgo/commit/0b97fedd00a3001f1da616f61578c2c12e6cde1f"><code>0b97fed</code></a>
test(typescript): drop tsd for vitest type testing API</li>
<li><a
href="https://github.com/svg/svgo/commit/f6e8ae1afb012c2b47675622728d76b9bfd734f5"><code>f6e8ae1</code></a>
chore(pnpm): drop package.json#pnpm.onlyBuiltDependencies</li>
<li>Additional commits viewable in <a
href="https://github.com/svg/svgo/compare/v4.0.1...v4.1.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new
releaser for svgo since your current version.</p>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/gnolang/gno/network/alerts).

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
aeddi pushed a commit that referenced this pull request Oct 16, 2026
…2 updates (#6117)

Bumps the npm_and_yarn group with 2 updates in the
/gno.land/pkg/gnoweb/frontend directory:
[postcss](https://github.com/postcss/postcss) and
[svgo](https://github.com/svg/svgo).

Updates `postcss` from 8.5.10 to 8.5.26
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/releases">postcss's
releases</a>.</em></p>
<blockquote>
<h2>8.5.26</h2>
<ul>
<li>Fixed <code>list.split()</code> regression (by <a
href="https://github.com/lazerg"><code>@​lazerg</code></a>).</li>
<li>Track symlinks in path protection in source map loading (by <a
href="https://github.com/drengir1"><code>@​drengir1</code></a>).</li>
</ul>
<h2>8.5.25</h2>
<ul>
<li>Fixed 8.5.17 visitor regression.</li>
<li>Fixed <code>list.split()</code> for non-string values (by <a
href="https://github.com/amir-rezaei"><code>@​amir-rezaei</code></a>).</li>
</ul>
<h2>8.5.24</h2>
<ul>
<li>Preserve the BOM after the processing (by <a
href="https://github.com/hdimer"><code>@​hdimer</code></a>).</li>
</ul>
<h2>8.5.23</h2>
<ul>
<li>Do not load source map without <code>opts.from</code> for security
reasons.</li>
</ul>
<h2>8.5.22</h2>
<ul>
<li>Fixed custom property losing semicolon before a comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<h2>8.5.21</h2>
<ul>
<li>Fixed childless at-rule losing semicolon before comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed docs (by <a
href="https://github.com/isker"><code>@​isker</code></a>).</li>
</ul>
<h2>8.5.20</h2>
<ul>
<li>Fixed missing space if <code>AtRule#params</code> is set after (by
<a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed mixing AST error on warnings (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.19</h2>
<ul>
<li>Fixed cleaning <code>before</code> for new nodes inserted to
<code>Root</code> (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.18</h2>
<ul>
<li>Restricted loading previous source maps file to the
<code>opts.from</code> folder for security reasons (use <code>unsafeMap:
true</code> to disable the check).</li>
</ul>
<h2>8.5.17</h2>
<ul>
<li>Fixed <code>Maximum call stack size exceeded</code> error.</li>
<li>Fixed Prototype hijacking for <code>postcss.fromJSON()</code>.</li>
<li>Fixed <code>Input#origin()</code> for unmapped end position (by <a
href="https://github.com/chatman-media"><code>@​chatman-media</code></a>).</li>
</ul>
<h2>8.5.16</h2>
<ul>
<li>Fixed <code>Input#origin()</code> position (by <a
href="https://github.com/mizdra"><code>@​mizdra</code></a>).</li>
<li>Fixed <code>raws</code> after rehydrating a JSON AST (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed putting parent-less node in <code>nodes</code> of new node (by
<a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
<li>Fixed computing <code>offset</code> in <code>positionBy()</code> (by
<a
href="https://github.com/greymoth-jp"><code>@​greymoth-jp</code></a>).</li>
<li>Fixed <code>rangeBy()</code> on <code>index: 0</code> (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<h2>8.5.15</h2>
<ul>
<li>Fixed declaration parsing performance (by <a
href="https://github.com/homanp"><code>@​homanp</code></a>).</li>
</ul>
<h2>8.5.14</h2>
<ul>
<li>Fixed custom syntax regression (by <a
href="https://github.com/43081j"><code>@​43081j</code></a>).</li>
</ul>
<h2>8.5.13</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's
changelog</a>.</em></p>
<blockquote>
<h2>8.5.26</h2>
<ul>
<li>Fixed <code>list.split()</code> regression (by <a
href="https://github.com/lazerg"><code>@​lazerg</code></a>).</li>
<li>Track symlinks in path protection in source map loading (by <a
href="https://github.com/drengir1"><code>@​drengir1</code></a>).</li>
</ul>
<h2>8.5.25</h2>
<ul>
<li>Fixed 8.5.17 visitor regression.</li>
<li>Fixed <code>list.split()</code> for non-string values (by <a
href="https://github.com/amir-rezaei"><code>@​amir-rezaei</code></a>).</li>
</ul>
<h2>8.5.24</h2>
<ul>
<li>Preserve the BOM after the processing (by <a
href="https://github.com/hdimer"><code>@​hdimer</code></a>).</li>
</ul>
<h2>8.5.23</h2>
<ul>
<li>Do not load source map without <code>opts.from</code> for security
reasons.</li>
</ul>
<h2>8.5.22</h2>
<ul>
<li>Fixed custom property losing semicolon before a comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<h2>8.5.21</h2>
<ul>
<li>Fixed childless at-rule losing semicolon before comment (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed docs (by <a
href="https://github.com/isker"><code>@​isker</code></a>).</li>
</ul>
<h2>8.5.20</h2>
<ul>
<li>Fixed missing space if <code>AtRule#params</code> is set after (by
<a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
<li>Fixed mixing AST error on warnings (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.19</h2>
<ul>
<li>Fixed cleaning <code>before</code> for new nodes inserted to
<code>Root</code> (by <a
href="https://github.com/MahinAnowar"><code>@​MahinAnowar</code></a>).</li>
</ul>
<h2>8.5.18</h2>
<ul>
<li>Restricted loading previous source maps file to the
<code>opts.from</code> folder for security reasons (use <code>unsafeMap:
true</code> to disable the check).</li>
</ul>
<h2>8.5.17</h2>
<ul>
<li>Fixed <code>Maximum call stack size exceeded</code> error.</li>
<li>Fixed Prototype hijacking for <code>postcss.fromJSON()</code>.</li>
<li>Fixed <code>Input#origin()</code> for unmapped end position (by <a
href="https://github.com/chatman-media"><code>@​chatman-media</code></a>).</li>
</ul>
<h2>8.5.16</h2>
<ul>
<li>Fixed <code>Input#origin()</code> position (by <a
href="https://github.com/mizdra"><code>@​mizdra</code></a>).</li>
<li>Fixed <code>raws</code> after rehydrating a JSON AST (by <a
href="https://github.com/sarathfrancis90"><code>@​sarathfrancis90</code></a>).</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/postcss/postcss/commit/07b25773f38f77919f2af02ae3e8896b0deb5988"><code>07b2577</code></a>
Release 8.5.26 version</li>
<li><a
href="https://github.com/postcss/postcss/commit/47de6b9d7c55674cb326c5de7a734a740916defc"><code>47de6b9</code></a>
Update CI</li>
<li><a
href="https://github.com/postcss/postcss/commit/1493a83db7830912316512f55ab6064e7b7dd68e"><code>1493a83</code></a>
Fix Rule#selectors losing the empty selector (<a
href="https://redirect.github.com/postcss/postcss/issues/2129">#2129</a>)</li>
<li><a
href="https://github.com/postcss/postcss/commit/180db166e250d20e6761b224ae8d8134c9ba3e40"><code>180db16</code></a>
Typo</li>
<li><a
href="https://github.com/postcss/postcss/commit/29e9e00f132c96e46e1de295b816fe88a05354e7"><code>29e9e00</code></a>
Resolve symlinks before the previous-source-map containment check (<a
href="https://redirect.github.com/postcss/postcss/issues/2125">#2125</a>)</li>
<li><a
href="https://github.com/postcss/postcss/commit/3ba8f84703a884329b58abea579c3615684e0b7e"><code>3ba8f84</code></a>
Update dependencies</li>
<li><a
href="https://github.com/postcss/postcss/commit/87e72f671fd0d401c52822b5226c656632d92ec0"><code>87e72f6</code></a>
Update lock file</li>
<li><a
href="https://github.com/postcss/postcss/commit/caaeeb907e4a816c44a23b00b151882bd02325a1"><code>caaeeb9</code></a>
Upgrade nanoid to fix infinite loop on zero size (<a
href="https://redirect.github.com/postcss/postcss/issues/2124">#2124</a>)</li>
<li><a
href="https://github.com/postcss/postcss/commit/3609b6f4296952d0b5b9ddae42c8d73ee460c041"><code>3609b6f</code></a>
Explain how to type plugin options</li>
<li><a
href="https://github.com/postcss/postcss/commit/fbad419cbd01cd7a9a1a46413447f2cd9b3fce4a"><code>fbad419</code></a>
docs: show ESM and TypeScript plugin declaration (<a
href="https://redirect.github.com/postcss/postcss/issues/2118">#2118</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/postcss/postcss/compare/8.5.10...8.5.26">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new
releaser for postcss since your current version.</p>
</details>
<br />

Updates `svgo` from 4.0.1 to 4.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/svg/svgo/releases">svgo's
releases</a>.</em></p>
<blockquote>
<h2>v4.1.0</h2>
<p>This minor release upgrades the SAX parser and introduces stricter
XML validation. It also includes important security hardening for
<code>removeScripts</code>, dependency updates, and improvements to the
test and regression infrastructure.</p>
<h3>Support SVGO</h3>
<p>If SVGO is valuable to you or your organization, please consider <a
href="https://opencollective.com/svgo">supporting the project on
OpenCollective</a>. Your sponsorship helps fund ongoing maintenance and
security work.</p>
<h3>Stricter XML validation</h3>
<p>SVGO now uses <a
href="https://www.npmjs.com/package/sax"><code>sax</code> 1.6.1</a>,
upgraded from 1.5.0 (<a
href="https://redirect.github.com/svg/svgo/pull/2257">#2257</a>).</p>
<p>The new parser version validates numeric character references against
the ranges permitted by XML. Invalid references are now rejected in both
text and attributes, including:</p>
<ul>
<li>disallowed control characters such as
<code>&amp;[#1](https://github.com/svg/svgo/issues/1);</code>,
<code>&amp;#xB;</code>, and <code>&amp;#x1F;</code>;</li>
<li>UTF-16 surrogate code points such as <code>&amp;#xD800;</code>;</li>
<li>invalid XML code points such as <code>&amp;#xFFFF;</code>.</li>
</ul>
<p>Valid boundary values—including <code>U+0020</code>,
<code>U+D7FF</code>, <code>U+E000</code>, <code>U+FFFD</code>, and
characters through <code>U+10FFFF</code>—remain supported.</p>
<p>Parser failures are consistently exposed as
<code>SvgoParserError</code> errors with an <code>Invalid character
entity</code> reason.</p>
<p>This is an intentional behavior change: malformed SVGs that were
previously accepted may now produce a parser error, while valid XML
documents are unaffected.</p>
<h3>Security</h3>
<p>The <a
href="https://svgo.dev/docs/plugins/removeScripts/"><code>removeScripts</code></a>
plugin has been hardened against several script-execution bypasses:</p>
<ul>
<li>Filters executable <code>data:</code> URLs containing HTML, XHTML,
or SVG documents while preserving inert data such as PNG images, and
filters legacy <code>vbscript:</code> URLs (<a
href="https://redirect.github.com/svg/svgo/pull/2263">#2263</a>).</li>
<li>Sanitizes content inside SVG <code>&lt;foreignObject&gt;</code>
elements by removing HTML event-handler attributes, <code>srcdoc</code>,
and executable URLs from <code>action</code>, <code>data</code>,
<code>formaction</code>, <code>href</code>, and <code>src</code>, while
preserving non-executable HTML and visual content (<a
href="https://redirect.github.com/svg/svgo/pull/2264">#2264</a>).</li>
<li>Recognizes namespace-prefixed SVG <code>&lt;a&gt;</code> elements
and removes ASCII tabs and newlines before checking URL schemes,
preventing values such as
<code>java&amp;[#9](https://github.com/svg/svgo/issues/9);script:</code>
from bypassing detection while preserving elements in unrelated custom
namespaces (<a
href="https://redirect.github.com/svg/svgo/pull/2268">#2268</a>).</li>
</ul>
<p>These changes address:</p>
<ul>
<li><a
href="https://github.com/svg/svgo/security/advisories/GHSA-4vpr-x523-8j87">GHSA-4vpr-x523-8j87</a></li>
<li><a
href="https://github.com/svg/svgo/security/advisories/GHSA-w27v-7q3p-w38r">GHSA-w27v-7q3p-w38r</a></li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>Upgraded <code>css-select</code> to v6 and <code>css-what</code> to
v7, and updated SVGO's custom selector adapter for
<code>css-select</code> v6 (<a
href="https://redirect.github.com/svg/svgo/pull/2244">#2244</a>).</li>
</ul>
<h3>Project maintenance</h3>
<p><a href="https://github.com/TrySound"><code>@​TrySound</code></a> is
back as an active SVGO maintainer.</p>
<p>Many thanks to <a
href="https://github.com/KTibow"><code>@​KTibow</code></a>, <a
href="https://github.com/SethFalco"><code>@​SethFalco</code></a>, and <a
href="https://github.com/XhmikosR"><code>@​XhmikosR</code></a> for
maintaining and improving SVGO over the past several years.</p>
<p><strong>Full Changelog:</strong> <a
href="https://github.com/svg/svgo/compare/v4.0.2...v4.1.0">https://github.com/svg/svgo/compare/v4.0.2...v4.1.0</a></p>
<h2>v4.0.2</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/svg/svgo/commit/5765cbe4e0a930dca648c6b81d335b1522cd7375"><code>5765cbe</code></a>
chore: prepare v4.1.0 release (<a
href="https://redirect.github.com/svg/svgo/issues/2275">#2275</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/3db3ef33e409a0bc0fdaf255e46c908b00e93bc2"><code>3db3ef3</code></a>
fix(removeScripts): handle anchor URL bypasses (<a
href="https://redirect.github.com/svg/svgo/issues/2268">#2268</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/4e9b9aed2a4607cf28025871151421d5bfe86484"><code>4e9b9ae</code></a>
chore: cache regression screenshots (<a
href="https://redirect.github.com/svg/svgo/issues/2267">#2267</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/d55270ce17b99ebfe16e4fad028bd162187205a1"><code>d55270c</code></a>
chore(regression): migrate comparison workers to Tinypool (<a
href="https://redirect.github.com/svg/svgo/issues/2266">#2266</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/fd51e474a300417d9361d9302d596b1763146327"><code>fd51e47</code></a>
fix(removeScripts): sanitize foreignObject content (<a
href="https://redirect.github.com/svg/svgo/issues/2264">#2264</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/dcaf957c6eb34832844de11ef2792e3e0e8db5dd"><code>dcaf957</code></a>
chore: optimize fixtures in a bounded worker pool (<a
href="https://redirect.github.com/svg/svgo/issues/2265">#2265</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/a3542937d9c85debab04b1ff75207768caf8a058"><code>a354293</code></a>
fix(removeScripts): filter executable data URLs (<a
href="https://redirect.github.com/svg/svgo/issues/2263">#2263</a>)</li>
<li><a
href="https://github.com/svg/svgo/commit/4e0d2ac5e7abd5f12d650d3e4b4d2500d4944cc5"><code>4e0d2ac</code></a>
ci(typecheck): return typechecking on CI</li>
<li><a
href="https://github.com/svg/svgo/commit/0b97fedd00a3001f1da616f61578c2c12e6cde1f"><code>0b97fed</code></a>
test(typescript): drop tsd for vitest type testing API</li>
<li><a
href="https://github.com/svg/svgo/commit/f6e8ae1afb012c2b47675622728d76b9bfd734f5"><code>f6e8ae1</code></a>
chore(pnpm): drop package.json#pnpm.onlyBuiltDependencies</li>
<li>Additional commits viewable in <a
href="https://github.com/svg/svgo/compare/v4.0.1...v4.1.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new
releaser for svgo since your current version.</p>
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/gnolang/gno/network/alerts).

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 5e1f88a)
moul added a commit that referenced this pull request Nov 5, 2026
## What

Every pull request that changes a realm, a package a realm imports, or
gnoweb itself gets a
**static gnoweb snapshot** published to a per-PR URL, and a sticky
comment linking to exactly
what changed.

- **realm / package change** → the comment lists the changed realms,
plus the realms that
transitively import a changed package, each with `source` and `help`
shortcuts
- **gnoweb change** → the comment links the preview homepage and embeds
**screenshots** of the
  four views that carry most of gnoweb's chrome
- **anything else** → no artifact, no comment, no job; silently skipped

---

## 👀 See it running

This is deployed and working in a scratch repo —
**[moul/gno-preview-lab](https://github.com/moul/gno-preview-lab)**,
a single-commit snapshot of this branch with every workflow but these
four removed — with one
pull request per code path:

| Lab PR | Change | The comment it produced | The preview it published |
|---|---|---|---|
| [#1](moul/gno-preview-lab#1) | gnoweb CSS |
[comment](moul/gno-preview-lab#1 (comment))
— homepage + 4 screenshots + realm sample |
[pr-1/](https://moul.github.io/gno-preview-lab/pr-1/) |
| [#2](moul/gno-preview-lab#2) |
`r/gnoland/home` |
[comment](moul/gno-preview-lab#2 (comment))
— changed realm, no screenshots |
[pr-2/r/gnoland/home/](https://moul.github.io/gno-preview-lab/pr-2/r/gnoland/home/)
|
| [#3](moul/gno-preview-lab#3) |
`p/nt/ownable/v0` |
[comment](moul/gno-preview-lab#3 (comment))
— 7 realms found by the reverse import walk |
[pr-3/r/gnops/valopers/](https://moul.github.io/gno-preview-lab/pr-3/r/gnops/valopers/)
|

The godoc site is unharmed at the root of the same Pages site:
<https://moul.github.io/gno-preview-lab/>

Lab PR #1 changes gnoweb's CSS to something deliberately loud, so the
screenshot proves the
preview rendered **that branch** rather than the published site:

<table><tr>
<td width="50%"><a
href="https://moul.github.io/gno-preview-lab/pr-1/r/gnoland/home/"><img
src="https://moul.github.io/gno-preview-lab/pr-1/_shots/home.png"
width="100%" alt="Home, rendered markdown"></a><br><sub>Home — rendered
markdown</sub></td>
<td width="50%"><a
href="https://moul.github.io/gno-preview-lab/pr-1/r/gnoland/boards2/v0/_t/help/"><img
src="https://moul.github.io/gno-preview-lab/pr-1/_shots/help.png"
width="100%" alt="Help and actions forms"></a><br><sub>Help / actions
forms</sub></td>
</tr></table>

> The lab is a temporary scratch deployment for this review and will be
deleted once the PR
> settles, so these links are not permanent.

---

## How

`misc/gnopreview` boots `gnodev` on just the selected packages
(dependencies resolve lazily out
of `examples/`), crawls the resulting gnoweb, and writes a
self-contained static tree.

Three workflows, split on the trust boundary so previews work for pull
requests opened from forks:

| Workflow | Trigger | Token | Runs PR code |
|---|---|---|---|
| `pr-preview.yml` | `pull_request` | read-only, no secrets | yes —
builds gnodev, renders |
| `pr-preview-publish.yml` | `workflow_run` | write, through an
environment | **no**: downloads the artifact, pushes, comments |
| `pr-preview-cleanup.yml` | `pull_request_target: closed` | write,
through an environment | **no**: deletes `pr-<N>/` |

Publishing is gated on who is asking. A job holding no secret checks
that both the PR author
and the run's triggering actor have write access here; if so the
snapshot publishes through the
`gno-previews` environment, otherwise (forks from outside contributors)
through
`gno-previews-review`, which has required reviewers. The deploy key
lives only in those two
environments. Rendering always runs on `gnolang/gno`; elsewhere it is
opt-in through the
`GNOWEB_PREVIEW_BASE_URL` repository variable, which the lab sets:

```sh
gh variable set GNOWEB_PREVIEW_BASE_URL -R gnolang/gno -b https://gnolang.github.io/gno-previews
```

### Why previews live in their own repository

Previews publish to
**[gnolang/gno-previews](https://github.com/gnolang/gno-previews)**, a
separate Pages site in branch mode. `deploy-pages.yml` is **not touched
by this PR** — the godoc
site keeps deploying exactly as it does today.

The two workloads want opposite things. The docs are regenerated from
scratch on every deploy
(measured: 2 m 57 s) and nobody needs them within five minutes of a
merge. A preview's whole value
is being there when a reviewer clicks the link. A Pages site built by an
Actions workflow has **no
incremental deploy** — the entire site ships every time — so sharing one
would mean every preview
push rebuilds and re-uploads the docs, putting the link 3–6 minutes
behind the comment. Publishing
from a branch, as the previews repo does, pushes only the bytes that
changed.

Keeping them apart also bounds the blast radius: a broken preview job
cannot delay or break the
documentation, and the two do not share a 1 GB site budget or a git
history.

The previews repo runs its own scheduled `evict.yml` — drop previews
whose PR closed, drop previews
whose PR has been quiet for 21 days, then enforce a 700 MiB budget
oldest-first. Without it the site
would reach the 1 GB cap at roughly 78 concurrent previews.

### Setup

**Changed in round 2, not yet applied:** the deploy key moves from a
repository secret into the
environments `gno-previews` (no reviewers) and `gno-previews-review`
(required reviewers). Until
those exist the review path refuses to publish rather than creating an
unprotected environment.

- `PREVIEWS_DEPLOY_KEY`: the private half of a **write-enabled deploy
key** on
`gnolang/gno-previews`, as a secret of those two environments only. A
deploy key rather
than a fine-grained PAT because it cannot reach any other repository, it
does not expire, and it carries no personal identity — preview commits
are
not attributed to whoever minted the credential, and nothing breaks when
that person rotates a
  token or leaves.
- `GNOWEB_PREVIEW_BASE_URL` = `https://gnolang.github.io/gno-previews`
(already set), which is
also the publishing switch: unset means nothing is published or cleaned
up. On a fork's own
  repository it is also what turns rendering on.

## Measured on the lab

| | |
|---|---|
| Preview render (gnodev boot → crawl → 50 pages + 4 screenshots) | ~20
s, 6.2 MB |
| Worst case, 25 realms (a change to `p/nt/avl/v0`) | **8.8 MB / 110
pages** (was 22.2 MB / 243 before rendering only changed files' sources)
|
| A one-file realm change | 936 KB |
| Push to `gno-previews` → serving | **33 s** (measured on the live
repo) |
| The same content through a shared Actions-built Pages site | 3–6 min
(godoc rebuild + whole-site upload) |

The comment does not wait on the deploy: the publishing job posts it as
soon as the snapshot is
pushed, and the link is serving about half a minute later.

## Scope and bounds

Deliberately **not** previewed: `*_test.gno`, `*_filetest.gno`,
`filetests/`,
`examples/quarantined/**`, and `ignore = true` packages. Realms under
`gno.land/r/tests/` are
previewed when changed directly, never pulled in as dependents.

The crawl skips URL shapes that enumerate rather than describe —
`$state&oid=` / `&tid=` (walks
the object graph, and trips gnoweb's own rate limiter), `$state` (~1.3
MB per realm of a chain
that only ran `init()`), `$help&func=X` (`$help` already lists them
all), `$download`. At most 25
realms and 400 pages, and the comment says how many realms were dropped.

`misc/gnopreview/README.md` documents the output layout, the URL-to-path
slugging (no `$`, `:` or
`&` ever reaches a file path), and the known limits.

## Notes for review

- Running the three lab PRs **concurrently** found two bugs a local run
could not, both fixed here:
1. **A single global concurrency group silently drops a publish.**
GitHub queues at most *one*
pending run per group, so with three PRs publishing at once the middle
one was cancelled: its
snapshot rendered, its comment never appeared. The group is now keyed on
the source head
repository and branch, so different PRs publish in parallel — the shared
branch is already
     serialized by the replay loop.
2. **`cancel-in-progress: true` on the `pages` group starves the
deploy.** With a dispatch per
preview publish, consecutive `deploy / pages` runs cancelled one another
and the site stopped
updating for the length of the burst. Left at `false`, its original
value: every run publishes
the complete site, so GitHub's one-running-plus-one-pending behaviour
already coalesces a
burst, and the pending run picks up everything when it starts. Moot now
that previews no
longer share the docs pipeline, but the reasoning is why
`deploy-pages.yml` ends up unchanged.
- **Changed realms are shown before and after.** A second gnodev renders
the same realms from a
merge-base checkout, using the *head's* gnodev binary and the head's
assets in both passes, so
the pair isolates the realm change rather than whatever else moved on
master. A realm the PR
*adds* says so instead of faking a before; a run with no base checkout
makes no claim at all.
gnodev defaults both its RPC listener and its keybase to fixed
locations, so the two passes are
  given distinct ones — otherwise they fight over `127.0.0.1:26657`.
- **Previews are `noindex`, and were not.** gnoweb's layout emits
  `<meta name="robots" content="index, follow">` on every page
(`components/layouts/head.html:38`), so a published snapshot — a
near-duplicate of a real
gno.land page — was actively inviting the crawler. The renderer now
*replaces* that tag with
`noindex, nofollow` rather than adding a second one; two conflicting
robots directives leave
the outcome to each crawler's precedence rules. Not a `robots.txt`
`Disallow`: a disallowed
path can still be indexed from an external link, and being disallowed is
exactly what stops a
  crawler from reading the `noindex`.
- `misc/gnopreview` is registered in `ci-dir-misc.yml`'s matrix — that
file's own comment warns an
  unlisted program is never built.
- `public/js/index.js` builds its dynamic `import()` specifiers from a
hardcoded
`/public/js/controller-` prefix. The snapshot rewrites it relative to
the asset's own URL;
without that, every interactive control 404s from any mount point but
the site root. The renderer
  warns loudly if that string ever disappears.
- The comment is **not** the untrusted job's: the publishing job builds
it with the default
branch's `gnopreview comment` from the artifact's `preview.json`,
refusing any package path
that is not a plain path and deriving every link, image path and caption
again. It is
byte-identical to what the render job writes for an honest snapshot
(checked on a realm render
with a before/after pair and on a gnoweb render with four screenshots).
- `actionlint`, `zizmor --persona=regular`, `golangci-lint` with
`.github/golangci.yml`, `go fix`,
  `go vet` and `go test` all clean.

ADR: `gno.land/adr/pr6194_gnoweb_pr_previews.md`.

---

## Review round 1

Every one of @alexiscolin's findings reproduced; all are fixed in
`fix(ci): address review …`. The three security ones:

- **The pull request number came from the artifact**, which the fork's
own render job writes —
a cross-PR primitive: name another number and you replace that preview
and PATCH its comment.
Now resolved from the `workflow_run` payload, with a head-SHA check that
stands down when a
newer run has superseded this one, and `state=open` so a render
finishing after close publishes
  nothing.
- **A `.git` in the artifact** makes `git add -A` record `pr-<N>` as
mode `160000` (reproduced),
which GitHub Pages reports as a build error — freezing publication for
every preview. Stripped
  before the copy, plus a size cap on the snapshot.
- **The privileged job executed `bin/reindex.sh` from
`gno-previews@main`** while holding
`pull-requests: write` here. Nothing in this repository runs code from
that one any more; the
  index is regenerated by a workflow over there with its own token.

And the rest: slugs no longer traverse (`:..` folded onto the realm's
own render page) or collide
(`:p/a-b`, `:p/a/b`, `:p/a&b` shared one file) — non-trivial slugs now
carry a digest and are length
capped; the trailing slash is preserved, since `/r/x/y/` is a different
page from `/r/x/y` (48,642
vs 62,174 bytes) and `/r` is no longer seeded because gnoweb answers it
with 400; gnodev is watched,
so a node that dies fails in seconds with the reason instead of timing
out on "not ready", and the
log is printed on failure; the sticky comment matches the bot's
authorship, not just the marker;
the per-file budget is charged at capture rather than at link discovery;
"New in this PR" is
asserted from the merge-base tree rather than inferred from a missing
capture.

**Screenshots were showing the no-JS state.** Chrome will not load ES
modules over `file://` —
0 controllers initialise versus 3 over HTTP, matching the numbers in the
review. The renderer now
serves the snapshot on a loopback port while photographing it. A
one-line gnoweb fix using
`import.meta.url` in `index.ts` would also remove the
`/public/js/controller-` rewrite this depends
on; happy to take that PR.

---

## Review round 2

All of @alexiscolin's second-round points are addressed in `f09f12f` and
`0420507`; each
fix that has a test was seen red before green.

- **Fork trust.** Publishing needs the author *and* the triggering actor
to have write access,
or a maintainer's approval through `gno-previews-review` (both, because
a maintainer's
"Update branch" makes the maintainer the actor). The deploy key is
environment-only. The run
must come from `.github/workflows/pr-preview.yml` (`workflow_run.path`),
so a same-named
look-alike is ignored. Freshness is re-checked after approval, since an
approval can come
  days after the render.
- **Fork PRs never rendered.** The render gate is `github.repository ==
'gnolang/gno' ||
vars.GNOWEB_PREVIEW_BASE_URL != ''`, which holds whether or not a fork
run sees variables.
- **Comment body**: rebuilt by trusted code, as above.
- **Site budget**: 20 MiB and 1,000 files per preview (apparent size),
and publishing refuses to
  take the whole site past 900 MiB between two evictions.
- **Timeouts**: every job has one, and Chrome runs under a 60 s deadline
that kills its whole
process group (killing only the parent leaves its helpers holding the
pipe open).
- **Readiness** probes gnoweb's `/ready` and requires its
`{"status":"ready"}` body. A bare 200
was not enough: a local run crawled another server already on the port.
The ports are
  checked free before gnodev starts.
- **Queue fill**: scope is re-checked at fetch time with the seed
exemption, as suggested. The
2,000-link case goes from 2,004 fetches to 7, and a separate test covers
the before-pass.
- Changed realms cut by the realm cap are named without a link;
`--no-renames`; slug examples
carry their digest (and are pinned by a test); `Draft` and the Makefile
are gone; the ADR
  names the variable, the secret, the environments and every cap.

---------

Signed-off-by: moul <[email protected]>
Co-authored-by: Alexis Colin <[email protected]>
Co-authored-by: Antoine Eddi <[email protected]>
aeddi pushed a commit that referenced this pull request Nov 17, 2026
)

* test(gnovm): cover predefine declaration resolver

* fix(gnovm): bound predefine declaration lookup

* docs(gnovm): record predefine lookup decision

* test(gnovm): add predefine lookup benchmarks

* test(gnovm): cover predefine splitting with overrides

* docs(gnovm): add alternative comparision

Assisted by: Opus 4.8 (1M context)

* refactor(gnovm): clarify predefine declaration index

* refactor(gnovm): bind predefine index to file set

* update ADR

* guard against quadratic allocation growth

* fix(gnovm): assert predefine index invariants

* docs(gnovm): explain the index nil branch in predefineRecursively2

Co-authored-by: ltzmaxwell <[email protected]>

* Update gnovm/tests/files/predefine_split_stale.gno

Co-authored-by: ltzmaxwell <[email protected]>

* fix

---------

Co-authored-by: ltzmaxwell <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>
aeddi added a commit that referenced this pull request Nov 17, 2026
* fix(gnovm): drop clause-local names on switch fallthrough (#6056)

`fallthrough` from a clause that declares more names than the clause it
falls into panics the VM:

```go
switch 1 {
case 1:
	x := 1
	_ = x
	fallthrough
case 2:
	println("two")
}
```

```
unexpected panic: unexpected block size shrinkage: 1 vs 0
```

## Cause

All clauses of a switch share a single runtime `Block` (allocated in
`doOpExec`'s `*SwitchStmt` case). During preprocessing,
`copyFromFauxBlock` copies the switch's own names — those from its init
statement — into every clause's static block, so a clause's static block
is *switch names + that clause's own names*. When a clause matches,
`Block.ExpandWith` grows the shared block's `Values` to that clause's
name count.

`fallthrough` re-used the already-expanded block and called `ExpandWith`
again with the next clause. When the falling-through clause declared
more names than the next one, `len(b.Values)` exceeded the next clause's
`NumNames` and `ExpandWith` tripped its no-shrinkage guard
(`values.go:2951`).

## Fix

Truncate the block back to the switch's own name count before expanding
with the next clause, so it gets fresh slots of its own.

This also fixes a latent equal-size case that never panicked: two
clauses declaring the same number of names hit `ExpandWith`'s `numNames
== len(b.Values)` early return and silently reused the stale slots,
including the previous clause's `*HeapItemValue`.

Truncating is safe because the block never escapes — `doOpFuncLit`
copies `*HeapItemValue`s into `FuncValue.Captures` rather than
referencing the block — and `ExpandWith` mints fresh heap items for the
new slots, so a closure created in the previous clause keeps its own.

## Tests

Five filetests, each verified to produce identical output under real `go
run`:

| File | Covers |
|---|---|
| `switch47.gno` | the reported repro (1 name → 0 names) |
| `switch48.gno` | 3 names → 1 name, plus equal-size clauses with
differing types |
| `switch49.gno` | switch-init names surviving chained fallthroughs into
`default` |
| `switch50.gno` | fallthrough chain inside a loop (slots reused across
iterations) |
| `switch51.gno` | heap-captured clause vars on both sides of the
fallthrough |

## Related, not fixed here

Shadowing a switch-init variable inside a clause fails at preprocess
time, with or without `fallthrough`:

```go
switch v := 1; v {
case 1:
	v := "shadow" // panic: StaticBlock.Define2(v) cannot change .T; was int, new string
	println(v)
}
```

Same root design (`copyFromFauxBlock` puts the init names into the
clause's static block, so a redeclaration collides instead of
shadowing). Real Go prints `shadow`. Left for a separate change.

---

AI-assisted: the fix and tests were written with Claude Code and
reviewed before submission.

* feat: add audit pattern harness and security patterns example (#5835)

## Summary

Moves the audit pattern harness into this repo and keeps the public
builder-facing updates alongside it.

This adds:

- `misc/audit-pattern-harness`: a small audit pattern harness with YAML
expected records, sanitized fixtures, `gno test` execution, and
Markdown/JSON reports via `cmd/auditpattern`
- eight initial pattern slices:
  - `cur.Previous()` before `cur.IsCurrent()`
  - raw `Render(path)` markdown output
  - `Render` output that depends on map iteration order
  - `OriginSend()` without an `IsUserCall()` guard
  - `OriginCaller()` used as authorization identity
  - caller-supplied callbacks accepted by realm APIs
  - interfaces that expose `cur realm`
  - exported pointers or pointer getters for mutable state
- `gno.land/r/docs/security_patterns`: a compact example realm showing
authenticated mutators and safe Render output
- security-guide updates for caller-identity selection, Render output,
official markdown sanitizing guidance, and OriginCaller authorization
- Effective Gno storage guidance kept concise, with fuller tree/seqid
examples moved to `gno-data-structures.md`
- `community-packages.md`: a disclaimer-backed place for non-official
helper packages such as `moul/md`, `ulist`, `addrset`, and `fifo`
- a docs index link

The additional patterns were calibrated from local `examples/` plus
checked-out Gno contract repos including GnoSwap, Akkadia, gno-ibc, and
gno-mcp fixtures, then reduced into sanitized fixtures rather than
copying source.

## Validation

- `go test ./...` in `misc/audit-pattern-harness`
- `make run
GO=/home/russel/go/pkg/mod/golang.org/[email protected]/bin/go
AUDIT_PATTERN_FLAGS='-gno-bin /tmp/gno-audit-harness-gno'` in
`misc/audit-pattern-harness` with
`GNOROOT=/home/russel/p/gh/gnoland/gno`
- `gno test .` in `examples/gno.land/r/docs/security_patterns` with
`GNOROOT=/home/russel/p/gh/gnoland/gno`
- `gno test .` in `examples/gno.land/r/docs/home` with
`GNOROOT=/home/russel/p/gh/gnoland/gno`
- `git diff --check`

Assisted-By: OpenAI Codex

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Miguel Victoria Villaquiran <[email protected]>

* fix(gnovm): allow type-switch with sole `case nil:` (preprocess single-case branch must tag-type-only when ct is nil) (#5766)

- Before: a type-switch whose sole case was `case nil:` (e.g. `switch xx
:= x.(type) { case nil: ... }`) panicked at preprocess with `name xx not
declared` because the single-case shortcut registered the switch var
with `anyValue(ct)` where `ct == nil`; after: the sole-`nil` form is
accepted and `xx` is bound to the tag's static type, matching Go.
- `preprocess1`'s `*TypeSwitchStmt` branch in
`gnovm/pkg/gnolang/preprocess.go` now gates the `len(n.Cases) == 1`
define-with-case-type shortcut on `ct != nil`, so a nil `ct` falls
through to the same tag-type define used for multi-case switches.
- New filetest `gnovm/tests/files/typeswitch1.gno` mirrors gocorpus's
typeswitch1 (sole `case nil:` alongside mixed multi-type cases) and
exercises both the `xx := x.(type)` and bare `xx.(type)` shapes.

---------

Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>

* fix(boards2): Fix the doc for GetComments (#6090)

The doc for `GetComments` says it returns "all thread comments and
replies". Maybe this was true in an earlier version, but now it uses
[`Post.Replies`](https://github.com/gnolang/gno/blob/add66f24b895e201280e717f07e4e8cf88334593/examples/gno.land/p/gnoland/boards/post.gno#L41)
which is only direct replies. No need to filter the result. (Note that
the public API doesn't give access to `AllReplies`.)

Signed-off-by: Jeff Thompson <[email protected]>

* feat(gno.land): finish the inert-package flow, allowlist MsgRun, delegate params (#6088)

Builds on #5888 and contains it, so this supersedes that PR — please
review this
one instead. Base is master, which #5888 predates by about a month.

Under the inert policy a package is parked when submitted and only runs
once an
approver enables it. Storage gets written at both points, and this fixes
who
pays and when:

- The deposit ceiling is recorded at submit time and honored at enable,
so a
later change to the chain default cannot change what a submitter already
  agreed to.
- The namespace and CLA checks moved before the type-check. They ran
after the
  object cache was cleared, so the creator was charged nothing.
- Deleting the old package moved below the inert branch. The two
orderings
  disagreed on stored state, which is a fork.
- Re-submitting a parked package is now limited to its original creator.
  Overwrites are silent, so anyone could clobber a pending submission.
- Parking is skipped at genesis, where there is no approver and the
chain
  would fail to boot.

Other changes:

- **MsgRun allowlist.** New `run_submitters` param. Empty means today's
  behavior: anyone may send it.
- **Policy enforcement.** The check that decides whether a transaction
carries
code missed `MsgEnablePackage` and `MsgDisablePackage`. It is now an
explicit
  list that fails closed for message types added later.
- **Default deposit 600M → 100M ugnot.** This is a ceiling, not a
charge. The
largest real deploy among all 321 genesis packages is 276,098 bytes, so
the
  new ceiling clears the worst case by about 3.6x.
- **Simulation now verifies signatures on code-bearing transactions.**
It did
not, so a forged signature naming any address bought a full type-check
and
  `init()` run off one unauthenticated request.
- **Parameter delegation.** GovDAO can hand one parameter to one other
realm
and take it back at any time. The delegate may only remove entries it
added
itself. `r/nt/commondao` leaves quarantine, since it is the intended
delegate.
- **gpao fails closed.** It ignored whether the transaction it read
actually
  succeeded, so a rejected submission could still be approved.

Merging master also surfaced a determinism bug: `EnablePackage`
type-checked
with a test-file getter, which reads a test-stdlib overlay off the
node's local
disk. #6025 removed exactly that from `AddPackage` for the same reason.
Fixed
here.

Consensus-breaking: new and changed vm params, and the storage-charging
order.
The pinned multistore hash was re-derived by running the test.

ADRs are included for the inert charging work and the delegation design.
AI-assisted, reviewed by me before pushing.

---------

Co-authored-by: moul <[email protected]>
Co-authored-by: Thomas <[email protected]>

* fix(gno.land): post-merge fixes for inert packages (#6093)

3 fixes/commits :

- `MsgRejectPackage`: don't check inert approvers for genesis txs
e09e68c069a7efb1150c2e0ccb32bbff104e0ae7
- Deny new `MsgRejectPackage` to session keys (just like
`MsgAddPackage`, `MsgEnablePackage` and `MsgDisablePackage`)
ce7f217a783477dfafb4239b1e2b3b9081639fe0
- Add missing out-of-gas panic recover from new `QueryInertPaths`

---------

Co-authored-by: moul <[email protected]>

* perf(gnovm,tm2,gno.land): size-aware encode, decode and render paths

Rework a set of hot paths so that work and allocation scale with the actual
input rather than with a declared or worst-case size: stream the nested
interface JSON encoder, size Gno->Go slice conversions by length instead of
capacity, render BitArray from its backing data, make uniqueDecls O(n), bound
the recursive predefine declaration lookup, price the flat-fee natives on
their real operand size, and vendor a bounded toml decoder for gnomod.toml.

Also tightens a few input validators (multisig key structure, ParseCoins,
gnokms authkeys, gnoweb URL schemes and path length, markdown reader
lifetime), bounds the per-connection p2p receive buffer and the WAL backwards
search, gives the remote signer a dial timeout, errors on unverifiable Merkle
proofs, reworks the grc20 teller surface so the frame-relative teller stays
within the token's own realm, and fixes params baseline handling on a
net-zero storage diff.

Co-authored-by: Morgan Bazalgette <[email protected]>
Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: moul <[email protected]>
Co-authored-by: davd-gzl <[email protected]>

* test(grc20): assert cross-realm event provenance (#6092)

## Summary

Adds `event_provenance_filetest.gno`, the cross-realm counterpart to the
existing `newtoken_event_filetest.gno`. Test-only; no production code
changes.

Related: #6026, #6042.

## Motivation

`newtoken_event_filetest.gno` (#6042) covers the *within-realm* case: a
realm that reuses a `seqid` announces the same `Token.ID()` twice, so an
indexer can flag it.

The *cross-realm* case has never been pinned by a test, which left the
harder question open: given a `Transfer` event, how does a consumer
decide which realm issued the token? Two fields are involved and neither
is sufficient alone:

- **`pkg_path`** is stamped by the VM from the package whose code calls
`chain.Emit` (`gnovm/stdlibs/chain/emit_event.go`). Every genuine grc20
event therefore carries `gno.land/p/demo/tokens/grc20` — a constant
across the ecosystem, so it identifies the library but never the token.
- **the `token` attribute** carries `Token.ID()`, whose leading
component is `rlm.PkgPath()` captured under `IsCurrent()` in `NewToken`.

Chained, they are sufficient: `pkg_path` proves the event came from
grc20's code, and grc20's code only ever writes an `IsCurrent`-verified
realm prefix into `token`. So for any event bearing grc20's `pkg_path`,
the realm prefix inside `token` is unforgeable.

That property is what the indexer rule rests on, and until now nothing
in the tree would have caught a regression in it.

## What the filetest pins

An impostor realm tries both routes available to it against a canonical
registered token (`foo20`), and fails at each:

1. **Ask grc20 for it.** `NewToken("Foo", "FOO", 4, 0, cur)` — same
name, symbol, decimals and id as foo20 — yields
`gno.land/r/demo/grc20provenance.FOO.0000000`. The id prefix comes from
the live crossing frame, so no argument can make it name another realm.
2. **Bypass grc20.** A hand-emitted `Transfer` carrying foo20's exact id
is stamped `"pkg_path": "gno.land/r/demo/grc20provenance"`. An indexer
accepting `Transfer` only from grc20's `pkg_path` drops it.

The asserted `// Events:` block contains all three events, so the two
`pkg_path` values and both id prefixes are part of the expectation
rather than prose.

## The resulting indexer rule

1. Accept grc20 token events only when `pkg_path ==
"gno.land/p/demo/tokens/grc20"`.
2. Read the issuing realm from the leading component of the `token`
attribute.
3. Flag any realm that announces the same `Token.ID()` in more than one
`NewToken` event.

Steps 1–2 settle provenance across realms; step 3 is the within-realm
signal from #6042. Together they cover the ambiguity described in #6026
without a change to the standard.

## Testing

```
gno test -C examples ./gno.land/p/demo/tokens/... ./gno.land/r/demo/defi/...
gno fmt -diff -C examples ./gno.land/p/demo/tokens/grc20/...
gno lint -C examples ./gno.land/p/demo/tokens/grc20/...
```

No ADR: test-only, and it documents existing behaviour rather than
deciding anything (AGENTS.md exempts simple tests).

* feat(gnovm): add chain params reader API" (#6094)

Continues #5698 by @notJoon, which went stale in May. Their commits are
preserved with authorship; I merged master (resolving conflicts in
native_gas.go and the crossrealm38 hash pin) and added documentation
plus a test for wrong-type reads.

Superseding #5698 rather than pushing to their fork so their branch is
left alone. Happy to close this if @notJoon would rather carry it
themselves.

Outstanding: the six chain/params Get* gas rows are copied from the
matching Set* rather than fitted — native_bench_output.txt has no
samples for them. The benchmarks are in this PR; they need a run on the
reference machine.

---------

Co-authored-by: Lee ByeongJun <[email protected]>

* feat(grc721): rewrite core on the Token/PrivateLedger/Teller axis (1/4) (#6072)

## Summary

Rewrites `p/demo/tokens/grc721` around a `Token` / `PrivateLedger` /
`Teller` axis, replacing the old `BasicNFT` monolith, and migrates every
in-tree consumer in the same change.

This is the first of five PRs split out of #6029, which was too large to
review in one piece.
Each PR builds, lints and tests green on its own.

## Motivation

Three properties of the old API made it hard to use safely under the
current interrealm spec:

- **Caller identity was an argument.** Every writer took `caller
address`, so the calling realm asserted who it was. Nothing tied that
address to the frame actually crossing in, and each consumer
re-implemented the check.
- **Reads and writes shared one handle.** `*BasicNFT` carries exported
mutators, so handing it to another realm is a write-authority grant
under borrow rule 2 — the type could not be exposed, only wrapped.
- **Extensions were in-package.** Metadata and royalty lived inside the
core package, so every collection paid their storage and gas cost
whether or not it used them.

GRC20 had already converged on a Token/Ledger/Teller shape; GRC721
diverging from it forced consumers to learn two mental models for the
same problem.

## What changes

- **Core rewrite** — `token.gno`, `tellers.gno` and `types.gno` replace
`basic_nft.gno`, `igrc721*.gno`, `util.gno` and the in-package
metadata/royalty files. `Token` is the read surface, `PrivateLedger` is
the unshared write authority the issuer keeps, and `Teller` is a
capability that writes *as some account*: it takes a secondary `rlm
realm` and rejects it with `ErrSpoofedRealm` unless `rlm.IsCurrent()`
holds. Five grades cover the realistic cases — `CallerTeller`,
`ReadonlyTeller`, `RealmTeller`, `RealmSubTeller`, and the issuer-only
`ImpersonateTeller`.
- **`NewToken` event** on token creation, with a filetest covering the
emitted attributes.
- **Extension hooks** — `RegisterExtension` attaches an issuer-supplied
`Extension` whose `OnMint` / `OnTransfer` / `OnBurn` fire on every
movement. `ExtensionKind` is the identity: one extension per kind, and a
second registration of an attached kind panics. Hooks run after the
ledger write but before the movement event is emitted, so a hook that
panics vetoes the announcement as well as the transaction.
- **EIP-721 conformance fixes** — `Approve(zero)` now revokes a
per-token approval instead of being rejected; `GetApproved` reports
`ErrInvalidTokenId` for a token that is not a valid NFT, rather than
collapsing it into "not approved"; `SetApprovalForAll(op, false)`
releases the operator entry instead of storing `false`.
- **Docs** — `IsCanonicalTeller` is documented as an authenticity check
on the implementation, not an authorization guard on the acting account;
the issuer-hook trust property is stated explicitly.
- **Consumer migration** — `btree_dao`, `eventix`, `tokenhub` and
`foo721` move to the new API in this same PR, so `examples/` never
breaks. `foo721` stays core-only here and grows into the full showcase
in the last PR of the series.
- **Integration test** — `grc721_emit.txtar` is rewritten against the
new core events.

## Teller confinement

`CallerTeller` resolves the acting account from the calling frame, so it
acts as whoever crossed into the realm holding it. That is meaningful
inside the token's own realm, where the wrappers act for a caller who
knowingly invoked the collection. Anywhere else it is a confused deputy,
and `*Token` is a published pointer — exported vars, the collection
facade, `grc721reg.GetToken` — so any realm could otherwise mint one and
take the NFTs of whoever called it. `TransferFrom` is the sharp case: it
resolves the *spender* from the frame, so a realm reached from an honest
hub spends that hub's approvals against any owner who granted one.

Two layers, matching the Token/Ledger split this PR introduces:

- **Construction privacy** — `CallerTeller` hangs off `*PrivateLedger`,
not `*Token`. The token pointer travels; the ledger does not, since
`NewToken` hands it to the creating realm and nowhere else.
- **A write-time home check** — privacy alone is insufficient, because a
realm may legally build a teller and then export the *value*.
`guardHome` compares the invoking realm against `Token.origRealm` on
every write, leaving a leaked teller inert everywhere but home.

`origRealm` is captured in `NewToken` from `rlm.PkgPath()` under the
existing `IsCurrent` assertion, with any `":subpath"` from `realm.Sub`
stripped on both the stored and the invoking side, so a token created
from a sub frame is not locked out of its own host and a host's
sub-realms are not falsely rejected. `Token.ID()` keeps the raw path, so
identities and the `NewToken` event are unchanged.

The guard keys on the invoking realm alone, deliberately not on whether
the resolved actor is an end user: keying on the actor blocks only the
case where the debited party is the signing user, and leaves a realm
chargeable by a realm it calls.

The supported route for a realm that must move someone else's tokens is
unchanged: the owner `Approve`s it, and it spends as itself through
`RealmTeller`, which is eagerly bound to its own address and
approval-gated.

This matches the teller surface `grc20` carries on master as of acd01fa.

## Breaking change

The old surface is removed wholesale:

- **Core** — `BasicNFT`, `NewBasicNFT`, the `IGRC721Reader` interface,
the `NFTGetter` indirection and the `TokenURI` type.
- **Metadata / royalty** — `NewNFTWithMetadata`, `NewNFTWithRoyalty`,
`IGRC721Metadata`, `IGRC721MetadataOnchain`,
`IGRC721CollectionMetadata`, `IGRC2981`, `Metadata`, `Trait` and
`RoyaltyInfo`. These return as opt-in extensions in #6073.
- **Dropped with no replacement** — `SafeMint` and `SafeTransferFrom`
(EIP-721's receiver check needs a registry, and aliasing it under the
same name would imply a safety this package cannot provide), plus
`TokenURI` / `SetTokenURI` and `Getter()`.

Renamed on the read surface: `Name()` → `GetName()`, `Symbol()` →
`GetSymbol()`, `TokenCount()` → `TotalSupply()`.

Kept identical, so migrating readers is mechanical: `BalanceOf(address)
(int64, error)`, `OwnerOf`, `GetApproved`, `IsApprovedForAll`, `Mint`,
`Burn`, `RenderHome`.

Writers change shape by design: the `caller address` argument is gone,
and the acting account is derived from the crossing frame by a `Teller`
— see Motivation.

Per AGENTS.md, breaking `gno.land/p/demo/` backwards-compat needs
discussion, so flagging it explicitly: the package is not part of the
current testnet genesis set, and every in-tree consumer lives under
`examples/quarantined/`, so the blast radius is limited to this
repository.

Publishing the new API under a parallel `/v2` path was considered and
rejected — it would mean a permanent double surface for a package with
no external consumers on chain.

## Testing

- `gno fmt -diff -C examples ./...`
- `gno lint -C examples ./...`
- `gno test -C examples ./gno.land/p/demo/tokens/grc721/...
./quarantined/...`
- `go test ./gno.land/pkg/integration/ -run 'TestTestdata/grc721'`

`grc721_callerteller_home.txtar` covers both foreign-realm paths — a
frame-resolved `TransferFrom` and a `SetApprovalForAll` land-grab — and
asserts the teller **still works at home**, so the guard is scoped
rather than a blanket disable.

Negative control: returning early from `guardHome` makes the
`TransferFrom` attack succeed and the txtar fail on both the
expected-failure and the error-message assertions.

## The rest of the series

Split out of #6029. All five target `master`; the later four are drafts
and should merge in this order, since each builds on the previous one:

1. core(**this PR**) — core rewrite + consumer migration
2. extensions(#6073) — metadata / royalty / enumerable
3. collection(#6074) — read-only `Collection` + `NFT` handle
4. grc721reg(#6075) — collection registry

---------

Co-authored-by: moul <[email protected]>

* feat(grc721): add stackable metadata, royalty, and enumerable extensions (2/4) (#6073)

## Summary

Adds three independent, stackable extensions on top of the new GRC721
core.
Each lives in its own package, wraps a core token's ledger, and can be
composed freely — a collection may use none, one, or all three.

Second of five PRs split out of #6029.

## What changes

- **`grc721/metadata`** — EIP-721 Metadata plus the OpenSea attribute
convention. Emits `TokenURIUpdate` / `MetadataUpdate`.
- **`grc721/royalty`** — EIP-2981 royalty info, with per-token overrides
on top of a collection default and a configurable bps cap.
- **`grc721/enumerable`** — EIP-721Enumerable, backed by AVL trees so
iteration order is deterministic.

Each package ships its own `gnomod.toml` and a full unit-test suite.

## Design notes

Extensions wrap rather than embed.
Each constructor takes the core `*PrivateLedger` and returns a read view
plus its own ledger, registering an `Extension` hook (`OnMint` /
`OnTransfer` / `OnBurn`) on the core.
Hooks take no `realm` parameter, so they cannot capture a `cur`, and
only the issuer can attach one.

The flip side — an attached hook runs issuer code on every movement and
can veto a transfer by panicking, and gas scales linearly with the
extension count — is documented as an explicit trust grant rather than
left implicit.

## Reviewing this PR

Draft until the core rewrite (first PR of the series, #6072) merges.
Both target `master`, so the diff below still contains the core commits
until then.

---------

Co-authored-by: moul <[email protected]>

* feat: pearl testnet release candidate (#6091)

Co-authored-by: gfanton <[email protected]>
Co-authored-by: moul <[email protected]>

* fix(tm2): /genesis output not amino-decodable (#6098)

This doesn't affect standard nodes: only gnodev, in-memory nodes,
pkg/integration and the gnogenesis contribs are affected.

Essentially when the genesis app state type doesn't implement
`StreamableResult` (has no `StreamJSON()` method), /genesis misses the
amino `@type` field for the `app_state` field, which makes the output
not aminoJSON decodable.

* refactor(tm2)!: make vesting a field on BaseAccount, not an account type (#6095)

Vesting was three account types, and the bank decided whether to apply a
lock by
type-asserting a stored account to `std.VestingAccount`. That assertion
was the
entire enforcement contract, and it was silent whenever it missed.

It missed. gno.land builds accounts as `*GnoAccount`, while genesis
built
`*ContinuousVestingAccount` from a plain `std.BaseAccount` — so a
vesting account
was not a gno.land account. Three consequences, each verified before
changing
anything:

1. It does not implement `std.AccountUnrestricter`, so while ugnot is a
restricted
denom `canSendCoins` finds no whitelist bit and refuses **every**
transfer. The
   vesting lock is never even consulted.
2. `applyUnrestrictedAddrs` does an unchecked `acc.(*GnoAccount)`, so
listing a
vesting address in `UnrestrictedAddrs` **panics the chain during
InitChain**:
`interface conversion: std.Account is *std.BaseAccount, not
*gnoland.GnoAccount`.
3. `gnoclient.QueryAccount` unmarshals every account into a concrete
`gnoland.GnoAccount`, and a vesting account's JSON carried a
`VestingSchedule`
   field that type had no place for. Querying one failed outright with
`unknown JSON field "VestingSchedule"` — **no client could read a
vesting
   account at all**.

`docs/CONSTITUTION.md` requires the configuration that panicked:
*"Whitelisted
funds remain subject to the vesting schedule."* Vesting accounts were
effectively
non-functional on gno.land.

## The change

One account type. `BaseAccount` gains a `VestingSchedule` field, the
schedule
gains the vesting maths, and `std.Account` gains `GetVesting`,
`SetVesting` and
`LockedCoins`. Enforcement reads the field, so which concrete type is
stored
decides nothing.

Deleted: the `VestingAccount` interface, all three account types, both
constructors, `SpendableCoins`, `upgradeVestingAccount`, the `upgraded`
flag
threaded through `subtract`, and `vestingScheduleOf`.

Adding interface methods costs nothing here: `SetAddress` is implemented
exactly
once in the whole tree, on `*BaseAccount`, so every account type already
inherits
by embedding and no independent implementer exists.

`VestingSchedule.Type` now selects the curve at read time instead of
selecting a
type at genesis, so it can no longer disagree with how an account
actually vests.
`upgradeVestingAccount` is gone because there is nothing left to upgrade
— an
elapsed schedule already locks nothing, so collapsing it saved nothing
and cost a
write on a path that could still fail.

### This does not move the app hash

genproto2 emits a struct field only when it marshals to non-zero length,
and a
zero `VestingSchedule` marshals to nothing, so an account without
vesting encodes
byte-for-byte as before. `json:",omitempty"` does the same for JSON, and
the two
are independent — the binary encoding does not depend on the tag.

Measured, not argued: the integration txtar suite, whose goldens contain
account
query output, passes unchanged.

### Breaking state change

Removing the three amino-registered types means state holding one stops
decoding.
Only genesis ever created them and a fork re-parses the text balances
file, so a
fresh or re-genesised chain is unaffected. **Safe because the chain is
pre-mainnet**; a live chain would need a migration.

## Fixes found alongside

Auditing this turned up three faults in how the genesis balance format
is read and
written. **None is caused by the redesign** — master has all three — but
each
decides whether a vesting schedule survives, so they are fixed here
rather than
left beside code that now depends on them.

- **`gnogenesis balances add` silently unlocked accounts.** `LeftMerge`
only fills
in absent addresses and the input sheets merge first, so overriding an
address's
amount dropped its schedule. Silent: what remains looks like any
ordinary
balance. A tx export names every address that ever transacted, so a
vesting
  investor who made one transaction came out unlocked.
- **`gnoland start --genesis-balances-file` rejected vesting entries.**
It read the
sheet with its own split-on-`=` parser, which sees three fields in a
vesting
line. The file `gnogenesis` writes was refused at boot. Now delegates to
the same
  parser, deleting the duplicate.
- **`balances add`'s summary print dropped the suffix** that `balances
export`
  keeps.

The pattern in each: the account now has one owner of what vesting
means, but the
text format had several.

## Changes by area

**tm2/pkg/std** — `Vesting` field on `BaseAccount`;
`GetVesting`/`SetVesting`/
`LockedCoins` on `std.Account`; `vesting.go` replaces
`vesting_account.go` with
the schedule owning its own maths; three amino registrations removed;
`pb3_gen.go` and `std.proto` regenerated by genproto2 (`vesting = 6`,
appended,
fields 1–5 untouched).

**tm2/pkg/sdk/bank** — `SubtractCoins` reads the field instead of
asserting;
`upgradeVestingAccount` and the `upgraded` flag deleted; `subtract` now
reads the
account when the caller passes nil, so nil means "I do not have it" in
both halves
of that function; the account-tier invariant validates the field.

**gno.land/pkg/gnoland** — `applyBalance` builds one account type and
sets the
schedule, with the `Validate`/`IsAllGTE` guards that lived in the
constructors;
`LoadGenesisBalancesFile` delegates to the canonical sheet parser.

**contribs/gnogenesis** — the two `balances` fixes above, plus a
`verify` warning
when a schedule ends at or before genesis or more than a century after
it
(warns rather than rejects, since fork replay legitimately carries
past-dated
schedules).

**Tests** — schedule arithmetic across boundaries, monotonicity and
conservation
over whole schedules including `MaxInt64`; the vesting-plus-whitelist
regression;
`applyBalance`'s guards; the sheet→genesis→enforcement seam; schedule
survival
across the gas path; the two behaviours mutation showed were free to
change (the
`lockedAmt == 0` shortcut and the `max(...,0)` clamp).

**ADRs** — `tm2/adr/prxxxx_vesting_as_an_account_field.md` and
`tm2/adr/prxxxx_vesting_schedule_sharp_edges.md`. *(Rename both once the
PR
numbers exist.)*

## Verification

- `go test ./tm2/pkg/std/ ./tm2/pkg/sdk/... ./gno.land/pkg/gnoland/...
-count=1` — pass
- `go test ./... -count=1` in `contribs/gnogenesis` — pass
- `go test ./gno.land/pkg/integration/ -run TestTestdata -count=1` —
pass
- `go test ./gno.land/pkg/sdk/vm/ -run Gas -count=1` — pass
- `golangci-lint run --config .github/golangci.yml ./...` — 0 issues
- `make fix` — no-op

Every behavioural change was mutation-tested: the mutation applied,
confirmed to
compile, the test run, then restored and the tree diffed. Notable ones —
giving
`BaseVestingAccount` the three methods fails the interface and hazard
tests;
reverting `applyBalance` to the old shape reproduces the genesis panic
verbatim;
dropping either `applyBalance` guard fails exactly its own two cases;
removing the
`balances add` carry-over fails only the override case.

## Known gap

Vesting has no end-to-end txtar coverage, and the harness cannot
currently express
it — `adduser` parses its amount with `std.ParseCoins`, and `gnoland
start` has no
balances-file flag. Closing that means extending the integration
harness, which
belongs in its own change.

AI-assisted: audit, implementation and tests written with Claude Code,
reviewed
before submission.

* chore(deps): bump brace-expansion from 5.0.6 to 5.0.9 in /gno.land/pkg/gnoweb/frontend (#5992)

Bumps `brace-expansion` from 5.0.6 to 5.0.9 in
`/gno.land/pkg/gnoweb/frontend`.

This PR was originally opened by Dependabot targeting 5.0.7. Two further
high-severity advisories were published after it was opened, so the
lockfile
was bumped manually to 5.0.9 — the current `latest` on npm — to close
all of
them in a single change:

| Advisory | Fixed in | Covered by 5.0.7? |
| --- | --- | --- |
| CVE-2026-13149 — exponential-time expansion of consecutive `{}` groups
| 5.0.7 | yes |
| CVE-2026-14257 — OOM crash via unbounded expansion length | 5.0.8 | no
|
| CVE-2026-69152 — DoS bypassing the CVE-2026-14257 mitigation | 5.0.9 |
no |

`brace-expansion` is a dev-only transitive dependency (`minimatch` <-
`glob`,
`nodemon`), so the shipped gnoweb bundle is unaffected; the exposure was
limited
to the frontend build tooling.

Notes:
- `[email protected]` requires `brace-expansion@^5.0.5`, so 5.0.9
resolves within
range and no other package moved. The diff is confined to the four lines
of
  the `brace-expansion` entry.
- The `integrity` hash was verified against a SHA-512 computed from the
  published tarball.
- 5.0.9 narrows `engines.node` from `18 || 20 || >=22` to `20 || >=22`;
CI runs
  `lts/Jod` (Node 22), so this is a no-op here.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexis Colin <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

* fix(tm2): fsync the ABCI responses record and stop the block when its write fails (#6085)

## Summary

A node killed between the application's commit of height H and
`SaveState(H)` loses the stored ABCIResponses for H. Every subsequent
start then fails the ABCI handshake with:

```
error during handshake: error on replay: Could not find results for height #H
```

The node never recovers on its own. The record exists precisely to cover
this crash window, but it was written without a flush, so it died in the
same crash it was supposed to protect against. This bricked the same
production node twice in two days.

The fix is two small changes in `SaveABCIResponses`:

1. `db.Set` becomes `db.SetSync`, so the record is on disk before the
application commits.
2. Its write error (previously discarded) is returned, so `ApplyBlock`
stops the block *before* the application commit instead of committing a
height whose recovery record was never stored.

Fixes [#6055](https://github.com/gnolang/gno/issues/6055).

<details>
<summary>Mapping to #6055's items (two are deliberately scoped
out)</summary>

The missing flush and the dropped `SaveABCIResponses` error are fixed
here, with regression tests. Scoped out:

- `SaveState`'s own dropped error: past the application commit a save
failure has no in-place remedy (the app is already at H), so returning
it buys no recovery. Reasonable follow-up.
- A handshake-level test against an *already*-skewed directory: a skewed
store cannot be repaired at handshake time; that scenario belongs to
recovery tooling (see "Recovery for already-skewed stores").

</details>

## Root cause

`BlockExecutor.ApplyBlock` persists a block in this order
(`tm2/pkg/bft/state/execution.go`):

1. `SaveABCIResponses(db, H, …)`, a plain `db.Set`
2. the tx result index, also plain `db.Set`
3. `proxyApp.CommitSync()`: the application store commit, atomic and
fsynced
4. `SaveState(db, state)`, which ends in `db.SetSync`

On the WAL-based backends `Set` is unsynced (pebbledb, the production
default, passes `pebble.NoSync`), so steps 1 and 2 become durable only
when step 4 flushes the log. A death between 3 and 4 loses the responses
**and** the state while the block store and the application keep H:

```
block store = H, application = H, state = H-1, abciResponses(H) = missing
```

`Handshaker.ReplayBlocks` handles this shape by replaying H against a
mock application that serves the stored responses (the real application
must not re-execute a height it already committed). `LoadABCIResponses`
is its only source and there is no fallback: startup fails
deterministically, forever.

This is a regression, not a design choice: the forked code wrote this
key with `SetSync`, and
[#1546](https://github.com/gnolang/gno/pull/1546) removed the flush in
the same PR that added the RPC endpoint making the key undiscardable.
CometBFT v1.x uses the same design as this fix.

<details>
<summary>Full upstream history (how the regression happened, with
references)</summary>

- Every upstream release from v0.33 through v0.34.20 wrote this key with
`SetSync`.
- [tendermint#9159](https://github.com/tendermint/tendermint/pull/9159)
+ [#9253](https://github.com/tendermint/tendermint/pull/9253) (v0.34.21,
2022) downgraded it to `Set`, but *simultaneously* moved crash recovery
to a `SetSync`-written `lastABCIResponseKey` ("We always save the last
ABCI response for crash recovery"). Motivation was state.db bloat
([#8946](https://github.com/tendermint/tendermint/issues/8946)), not
durability.
- tm2 took the downgrade **without** the compensating synced key, in
[#1546](https://github.com/gnolang/gno/pull/1546), commit
[c627995](https://github.com/gnolang/gno/commit/c627995589676bb95a7a2a3b6f341a25a72c02cc),
in response to a [review concern about per-tx fsync
cost](https://github.com/gnolang/gno/pull/1546#discussion_r1497945114).
The reply ("we do a CommitSave just shortly after") is inverted for this
record: its only purpose, per its own doc comment, is the crash *before*
that save. The same PR added the RPC tx-results endpoint (`Tx()`
resolves a hash to a height, then reads `LoadABCIResponses` at that
height), which makes the per-height key load-bearing and undiscardable.
A survey of ~36 active tendermint descendants found no other fork with
neither mechanism.
- CometBFT v1.x restored the per-height `SetSync` and deprecated
`lastABCIResponseKey`
([#1976](https://github.com/cometbft/cometbft/issues/1976),
[#2017](https://github.com/cometbft/cometbft/pull/2017), backport
[#2412](https://github.com/cometbft/cometbft/pull/2412)): the same
design as this PR. (Merged as a write-amplification fix; it stayed off
the v0.38 line over a compaction concern that does not apply to a plain
`Set` to `SetSync` change.)
- Upstream's split-key design only makes sense with their "discard ABCI
responses" config flag, which tm2 cannot have while the RPC endpoint
depends on the per-height key. The singleton is not bulletproof either:
it failed in production on CometBFT v0.38.17
([celestia-app#5070](https://github.com/celestiaorg/celestia-app/issues/5070)).

</details>

## Production evidence

Two occurrences in two days on the same gno testnet node
(non-validator), both while it was fast-syncing after a restart and a
routine graceful stop landed inside `ApplyBlock`:

```
2026-08-20: block store = 288055, app = 288055, state = 288054, abciResponses(288055) ABSENT
2026-08-21: block store = 313891, app = 313891, state = 313890, abciResponses(313891) ABSENT
```

Offline analysis with tm2's own load functions confirmed all three
stores individually intact: no bit-rot, just the skew above. Both losses
happened on a clean process exit, no host crash, so the window is not
host-failure-only (tm2 never closes its databases on shutdown).

Note: this is the handshake replay path (`consensus/replay.go`), not the
RPC path. The same error string is widely reported by relayers as a
pruned-height symptom;
[tendermint#7039](https://github.com/tendermint/tendermint/issues/7039)
is the canonical prior report of this exact height-triple, closed by
stalebot without a fix.

## The fix

With `SetSync`, the responses for H are on disk before the application
commits H, so every crash position maps onto a handshake case that
recovers:

| Crash position | Resulting heights | Handshake path |
|---|---|---|
| before the responses flush | app = state = H-1, store = H | replay H
against the real application |
| after it, before the app commit | app = state = H-1, store = H |
replay H against the real application |
| after the app commit, before the state save | app = store = H, state =
H-1 | replay H against the mock, responses guaranteed present |

The error propagation closes the second door into the same window: a
write that *fails* outright (disk full, I/O error) has nothing to flush,
and the old code proceeded to the application commit anyway. Now
`ApplyBlock` aborts while `app = state = H-1, store = H` still holds,
the healthy replay case, so the node self-recovers once the fault
clears. The handshake's InitChain-time save propagates it the same way.

This is a behavior change worth naming: a state-db write error now stops
the node loudly, where the old code carried on and deferred the failure
to an unrecoverable position. Every production caller already has an
exercised error path for it:

- consensus kills the process (matching how it already treats a failed
WAL fsync as fatal)
- fast sync panics
- the handshake fails the start with a clear error

The caller-by-caller analysis is in the ADR (`tm2/adr/`). The tx result
index write stays fire-and-forget deliberately: it is a lookup index,
rewritten on replay, not a recovery record.

**Cost:** five fsyncs per block become six (block store ×2, consensus
WAL, application store, `SaveState`, plus this one), against a 5 s
default commit interval. Fast sync pays it per block, which is precisely
the path that failed in production.

## Tests

- `TestSaveABCIResponsesIsDurable` (`state/store_test.go`): the
crash-recovery contract of the exported function.
- `TestApplyBlockFlushesABCIResponsesBeforeAppCommit`
(`state/execution_test.go`): the ordering through `ApplyBlock`;
snapshots what a restarting process would find at the instant the
application commits.
- `TestSaveABCIResponsesReturnsWriteError`: a failed write surfaces to
the caller.
- `TestApplyBlockAbortsBeforeAppCommitOnResponsesWriteError`: with a
store refusing the responses key, `ApplyBlock` returns the error and the
application's `Commit` is never invoked.

The durability pair fails with the `SetSync` reverted, with the
production error (`Could not find results for height #1`); the error
pair fails with the propagation reverted (returns nil and commits). The
doubles (`unsyncedWriteDB`, `failingWriteDB` in `state/helpers_test.go`)
model the WAL backends' behavior and the tests assert on observable
store contents after a simulated death, not on which method was called.
`go test ./tm2/pkg/bft/...` passes; `-race` on the state package is
clean.

For context, CometBFT maintainers describe this recovery mechanism as
not "well specified" and hard to test
([cometbft#3290](https://github.com/cometbft/cometbft/issues/3290),
[#493](https://github.com/cometbft/cometbft/issues/493)); upstream has
no equivalent coverage.

## Recovery for already-skewed stores

This PR prevents new occurrences; it does not repair a data directory
already in the skewed state. `contribs/gnobr`
([#5410](https://github.com/gnolang/gno/pull/5410), currently on
`chain/gnoland1`) can already dig such a node out, at the cost of a full
local replay (it wipes `gnolang.db` and replays from height 0). A
lighter path would be an app-store rollback of one version, like
tendermint/CometBFT's `rollback` command
([tendermint#7033](https://github.com/tendermint/tendermint/pull/7033)),
which makes the handshake take the real-application replay path. A
replay-side fallback inside the handshake was considered and rejected as
unsound: rebuilding state for H needs `EndBlock`'s validator/param
updates, which are not derivable from the block, and guessing risks a
silent fork (reasoning in the ADR).

One more follow-up, out of scope here: shutdown does not drain an
in-flight `ApplyBlock` during fast sync, which is why a routine stop hit
this window. Draining narrows the window but cannot make any single
crash position recoverable, so it is complementary, not an alternative.

## AI assistance

AI-assisted; see the ADR's "AI assistance" section for what was
machine-derived and how it was reviewed. The human author reviewed and
owns the change.

## Note for operators

Until recovery tooling lands on master, recovering a skewed store means
restoring from a snapshot. Meanwhile, do not stop a catching-up node:
gate stops on `sync_info.catching_up == false`. That gate is deployed
and validated in production on the affected network's snapshot pipeline.

* fix(docs): don't link-check chain RPC endpoints (#6100)

## Problem

`ci / codegen-verify` (the `docs` matrix leg) is red on `master`, and
has been since 2026-08-27. [Failing
run](https://github.com/gnolang/gno/actions/runs/33150009390):

```
found items that need linting
Remote links that need checking:
>>> https://rpc.gno.land:443 (found in file: docs/resources/gas-fees.md)
>>> https://rpc.gno.land:443 (found in file: docs/users/interact-with-gnokey.md)
... (11 occurrences)
exit status 1
make: *** [Makefile:2: lint] Error 1
```

The links are not actually broken. `rpc.gno.land` is serving a
certificate issued for `rpc.betanet.testnets.gno.land` that **expired on
2026-08-27 14:05 UTC**:

```
$ echo | openssl s_client -connect rpc.gno.land:443 -servername rpc.gno.land \
    | openssl x509 -noout -subject -dates
subject=CN=rpc.betanet.testnets.gno.land
notBefore=May 29 14:05:45 2026 GMT
notAfter=Aug 27 14:05:44 2026 GMT
```

The docs linter GETs every remote URL it finds, so the TLS verification
failure surfaces as eleven "broken" links and fails the job.

## Fix

The linter shouldn't be link-checking chain RPC endpoints at all. They
are JSON-RPC APIs, not documentation pages — the response to a plain GET
says nothing about whether the documented endpoint is correct, while it
does make docs CI depend on a live chain's uptime and TLS certificate.

This skips `rpc.*` hosts, which is the same reasoning already applied to
`staging.gno.land` in that file ("deployment-specific hosts whose uptime
is not a CI concern"). It also covers `rpc.pearl.testnets.gno.land`,
which would hit the identical problem at its next certificate rotation.

While here, the exclusion condition — now eight entries with interleaved
comments — moves out of the `if` into `shouldCheckURL`, and the RPC
check runs against the parsed hostname so a path segment like
`https://example.org/rpc.gno.land` is still checked.

`docs/README.md` and the other docs are untouched; the URLs stay exactly
as they are.

## Verification

```
$ cd docs && make lint
Lint complete, no issues found.

$ cd misc/docs/tools/linter && go test ./...
ok
```

`make generate` in `docs/` leaves the tree clean, so the other half of
the `codegen-verify` job is unaffected.

New tests cover the skip list and the hostname-vs-path distinction.

## Still needed (infra, not this PR)

**The `rpc.gno.land` certificate needs renewing.** This PR only stops
docs CI from failing on it; betanet's RPC endpoint is currently unusable
for anything that verifies TLS.

---

Written with AI assistance (Claude Code); reviewed before submitting.

* chore(gno.land)!: remove unused MsgDisablePackage (#6130)

MsgDisablePackage was wired through every layer -- registered in the
amino codec as m_disable_pkg, routed by vmHandler.Process, covered by
txCarriesCode and sessionAlwaysDenied, matched by gnokey's
txNeedsSimulationSignature -- but its keeper method only ever checked
the approver gate and returned "disable_package is not yet implemented".
So the whole surface existed for a message whose only possible outcome
was an error, and the tests pinned that error rather than any behaviour.

The follow-up that would have implemented it never landed, and #6088's
own review notes record why it is not small: it needs eviction of
executed objects from the base store, and the storage deposit taken at
enable would have to be released. Neither has a design.

Its purpose is also unclear. MsgRejectPackage already covers the
operationally needed case -- clearing a package parked awaiting
approval, on the creator's or an approver's request. What is left for
disable is un-deploying live code, which raises questions this series
never answered: what happens to callers that imported the package, to
its realm state, to its storage deposit, and to the addresses that paid
it. That is a design discussion, and it does not need a placeholder
message on the wire to start.

Removes the message, its keeper stub, its route, its amino registration
and the layers that enumerated it; regenerates pb3_gen.go and vm.proto
with `make -C misc/genproto2`; and drops the stub-only tests along with
the disable_package rows in the codec-parity, txCarriesCode,
session-deny and simulation-signature tables. Comments that named the
stub are updated in place.

Nothing that worked stops working, since the message had no success
path. It does unregister the m_disable_pkg amino type, so
vm/disable_package no longer decodes: a chain whose history contains
such a transaction -- it could only fail, but a failed message is still
committed into a block -- cannot replay that block on a post-removal
binary. chain/pearl registers the type, so check before upgrading a
pearl node across this change rather than restarting from a fresh
genesis. No mainnet is affected; there is none.

Closes #6125

* fix(gpao): derive a dependency's name from its production files (#6124)

Importing `gno.land/p/demo/tokens/grc20` is a terminal rejection, and
the reason names a package the submitter never wrote.

Three packages in `examples/` are unimportable this way:
`p/demo/tokens/grc20` (named `grc20subrealm`), `p/demo/tokens/grc721`
(named `grc721dupsignal`), and `p/nt/treasury/v0` (named
`canonicaltest`). Counted across all 325 package directories with the
derivation the chain itself uses.

### A filetest sorts first and names the package

[`vm/qfile` serves a package's files
sorted](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/store.go#L1199),
and [`ReadMemPackage` flattens `filetests/` into that
list](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L821-L833),
so a filetest routinely arrives ahead of the production files.
[`packageName` took the first `.gno` file that
parsed](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/contribs/gpao/getter.go#L123-L134),
and filetests carry package clauses of their own.

```
caller_teller_sub_realm_filetest.gno   # package grc20subrealm   <- taken
gnomod.toml
token.gno                              # package grc20
token_test.gno                         # package grc20_test
```

The wrong name reaches the typechecker, which emits `.gnobuiltins.gno`
under it:

```
.gnobuiltins.gno:1:1: package grc20subrealm; expected package grc20
token.gno:3:14: undefined: address
token.gno:5:14: undefined: realm
```

`handleCandidate` then records `rejected` and marks the content hash
seen, so resubmitting identical bytes changes nothing.

### The chain already has the rule


[`ReadMemPackageFromList`](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L910)
derives a package's own name by skipping filetests, whose clauses ["may
have arbitrary package
names"](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L964),
and trimming a `_test` suffix. For a package holding only filetests it
[takes the filetests' clause where they agree and the literal
`"filetests"` where they do
not](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L1008-L1014).
`packageName` now does the same.

An empty name was never a safe fallback: it leaves `.gnobuiltins.gno`
unparseable, and the verifier reports a panic rather than a diagnostic.

### Left alone

- Which files the typechecker considers is unchanged. The getter labels
the reconstructed package `MPUserProd`, which excludes tests and
filetests at typecheck.
- Which imports are fetched from the chain and which from disk is
unchanged. That is Q5 on #6113.

Other gpao defects and the design questions behind them: #6113.

🤖 Written with AI assistance (Claude); reviewed and submitted by a
human.

---------

Signed-off-by: Jeff Thompson <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Morgan <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Miguel Victoria Villaquiran <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>
Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>
Co-authored-by: Jeff Thompson <[email protected]>
Co-authored-by: Jae Kwon <[email protected]>
Co-authored-by: Thomas <[email protected]>
Co-authored-by: davd-gzl <[email protected]>
Co-authored-by: jinoosss <[email protected]>
Co-authored-by: Antoine Eddi <[email protected]>
Co-authored-by: gfanton <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexis Colin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants