Skip to content

Commit 29f00bd

Browse files
authored
chore: drop local stdlib implementations (#78)
* fix: drop all stdlib implementations * fix * update gno version
1 parent afb35aa commit 29f00bd

44 files changed

Lines changed: 37 additions & 3826 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
name: Setup gno
22
description: Install the CI shell, cache gno tooling, and prepare the pinned gno toolchain.
33

4-
inputs:
5-
pre-install-command:
6-
description: Optional command to run after the CI shell is ready and before installing gno.
7-
required: false
8-
default: ''
9-
104
runs:
115
using: composite
126
steps:
@@ -22,11 +16,6 @@ runs:
2216
nix print-dev-env .#ci > "$RUNNER_TEMP/ci-env.sh"
2317
echo "BASH_ENV=$RUNNER_TEMP/ci-env.sh" >> "$GITHUB_ENV"
2418
25-
- name: Run pre-install command
26-
if: ${{ inputs.pre-install-command != '' }}
27-
shell: bash
28-
run: ${{ inputs.pre-install-command }}
29-
3019
- name: Cache gno binary
3120
id: gno-cache
3221
uses: actions/cache@v4
@@ -36,7 +25,7 @@ runs:
3625
~/go/bin/gnodev
3726
~/go/bin/gnokey
3827
~/.cache/gno-ibc/gno
39-
key: gno-${{ runner.os }}-${{ hashFiles('.gno-version', 'stdlibs/**/*.go', 'stdlibs/**/gnomod.toml', 'stdlibs/go.mod', 'stdlibs/go.sum', 'tools/setup-stdlibs.py') }}
28+
key: gno-${{ runner.os }}-${{ hashFiles('.gno-version') }}
4029
restore-keys: |
4130
gno-${{ runner.os }}-
4231
@@ -46,16 +35,11 @@ runs:
4635
path: |
4736
~/.cache/go-build
4837
~/go/pkg/mod
49-
key: gobuild-${{ runner.os }}-${{ hashFiles('.gno-version', 'stdlibs/go.sum', 'flake.lock') }}
38+
key: gobuild-${{ runner.os }}-${{ hashFiles('.gno-version', 'flake.lock') }}
5039
restore-keys: |
5140
gobuild-${{ runner.os }}-
5241
5342
- name: Install pinned gno toolchain
5443
if: ${{ steps.gno-cache.outputs.cache-hit != 'true' }}
5544
shell: bash
5645
run: make install-gno
57-
58-
- name: Refresh stdlib symlinks
59-
if: ${{ steps.gno-cache.outputs.cache-hit == 'true' }}
60-
shell: bash
61-
run: make link-stdlibs

.github/labeler.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ A-zkgm:
2424
- 'gno.land/p/core/ibc/zkgm/**'
2525
- 'tools/zkgm-fixtures/**'
2626

27-
A-crypto:
28-
- changed-files:
29-
- any-glob-to-any-file:
30-
- 'stdlibs/crypto/**'
31-
3227
A-encoding:
3328
- changed-files:
3429
- any-glob-to-any-file:
@@ -44,10 +39,6 @@ A-tooling:
4439
- 'Dockerfile'
4540
- 'flake.nix'
4641
- 'flake.lock'
47-
- 'tools/setup-stdlibs.py'
48-
- 'tools/test_setup_stdlibs.py'
49-
- 'stdlibs/go.mod'
50-
- 'stdlibs/go.sum'
5142
- 'Cargo.toml'
5243
- 'Cargo.lock'
5344
- 'gnowork.toml'

.github/workflows/gno-coverage.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ concurrency:
5454

5555
env:
5656
# `inputs.*` are only set on workflow_dispatch; fall back to the same
57-
# defaults so pull_request and push events use a fixed repo + SHA.
58-
# setup-stdlibs.py reads both from the environment (Makefile exports
59-
# them via `export GNO_COMMIT GNO_REPO`).
57+
# defaults so pull_request and push events use a fixed repo + SHA. The
58+
# Makefile exports GNO_COMMIT and GNO_REPO so `make install-gno` picks
59+
# them up.
6060
GNO_REPO: ${{ inputs.gno_repo || 'https://github.com/notJoon/gno-core.git' }}
6161
GNO_COMMIT: ${{ inputs.gno_commit || '8981c2b6ca8b197e1ec191573986c68bd4c037a5' }}
6262

@@ -89,7 +89,7 @@ jobs:
8989
path: |
9090
~/go/bin/gno
9191
~/.cache/gno-ibc/gno
92-
key: gno-cover-${{ runner.os }}-${{ env.GNO_COMMIT }}-${{ hashFiles('stdlibs/**/*.go', 'stdlibs/**/gnomod.toml', 'stdlibs/go.mod', 'stdlibs/go.sum', 'tools/setup-stdlibs.py') }}
92+
key: gno-cover-${{ runner.os }}-${{ env.GNO_COMMIT }}
9393
restore-keys: |
9494
gno-cover-${{ runner.os }}-${{ env.GNO_COMMIT }}-
9595
@@ -109,10 +109,6 @@ jobs:
109109
if: steps.gno-cache.outputs.cache-hit != 'true'
110110
run: make install-gno GNO_COMMIT=${{ env.GNO_COMMIT }}
111111

112-
- name: Refresh stdlib symlinks
113-
if: steps.gno-cache.outputs.cache-hit == 'true'
114-
run: make link-stdlibs GNO_COMMIT=${{ env.GNO_COMMIT }}
115-
116112
- name: Verify gno binary
117113
run: make verify-gno GNO_COMMIT=${{ env.GNO_COMMIT }}
118114

.github/workflows/gnokey-smoke.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ on:
99
- '.gno-version'
1010
- 'gnowork.toml'
1111
- 'Makefile'
12-
- 'stdlibs/**'
13-
- 'tools/setup-stdlibs.py'
1412
- 'tools/gnokey-query-smoke.sh'
1513
- 'tools/gnokey-smoke/**'
1614
- 'flake.nix'

.github/workflows/test.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
- '.gno-version'
1010
- 'gnowork.toml'
1111
- 'Makefile'
12-
- 'stdlibs/**'
13-
- 'tools/setup-stdlibs.py'
14-
- 'tools/test_setup_stdlibs.py'
1512
- 'flake.nix'
1613
- 'flake.lock'
1714
- '.github/actions/setup-gno/**'
@@ -32,14 +29,9 @@ jobs:
3229

3330
- name: Setup gno
3431
uses: ./.github/actions/setup-gno
35-
with:
36-
pre-install-command: python3 -m pytest tools/test_setup_stdlibs.py -v
3732

3833
- name: Verify gno binary
3934
run: make verify-gno
4035

4136
- name: Run tests
4237
run: make test
43-
44-
- name: Run vendored stdlib tests
45-
run: make test-stdlibs

.gno-version

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
# Pinned gno toolchain.
22
#
3-
# `make install-gno` clones gnolang/gno at the commit below, then symlinks
4-
# every package under stdlibs/ into <cache>/gnovm/stdlibs/<module>/, runs
5-
# `go generate` to regenerate the native-binding dispatch table, and
6-
# `go install`s the resulting binary. See tools/setup-stdlibs.py.
7-
#
8-
# Bump the commit to roll the upstream toolchain. Stdlib sources live in
9-
# this repo under stdlibs/.
3+
# `make install-gno` clones the repo at the commit below and `go install`s
4+
# the gno, gnoland, gnodev, and gnokey binaries from it.
105

116
GNO_REPO=https://github.com/gnolang/gno.git
12-
GNO_COMMIT=8ac234874523713913b4d8160612e655129f7cf3
7+
GNO_COMMIT=72aff5a95ec550be32de7bbaf7d34b212108725d

Makefile

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# gno-ibc Makefile.
22
#
3-
# `make install-gno` runs tools/setup-stdlibs.py, which clones the pinned gno
4-
# repo into a per-user cache, symlinks every package under stdlibs/ into
5-
# <cache>/gnovm/stdlibs/<module>/, regenerates the native-binding dispatch
6-
# table (`go generate`), and installs the resulting `gno`, `gnodev`, and `gnokey` binaries.
3+
# `make install-gno` clones the pinned gno toolchain into a per-user cache
4+
# and installs `gno`, `gnoland`, `gnodev`, and `gnokey` from it. The IBC
5+
# crypto stdlibs (bn254, cometbls, cometblszk, keccak256, merkle, modexp)
6+
# ship in the upstream pin, so this repo no longer vendors them locally.
77
#
88
# Bump GNO_COMMIT in .gno-version to roll the upstream toolchain.
99

@@ -14,8 +14,8 @@ include .gno-version
1414
SHELL := /bin/bash
1515
.SHELLFLAGS := -o pipefail -c
1616

17-
# Exported so `make install-gno GNO_COMMIT=...` propagates the override into
18-
# tools/setup-stdlibs.py, which otherwise reads .gno-version directly.
17+
# Exported so `make install-gno GNO_COMMIT=...` overrides the pin from the
18+
# command line without editing .gno-version.
1919
export GNO_COMMIT GNO_REPO
2020

2121
GNO_CACHE := $(HOME)/.cache/gno-ibc/gno
@@ -87,30 +87,24 @@ vendor-flags = $(if $(filter undefined,$(origin FLAGS_$(subst /,_,$(1)))),$(STD_
8787
# rsync only auto-creates the leaf dest dir, so mkdir -p covers intermediates.
8888
vendor-cmd = mkdir -p $(dir gno.land/$(2)) && rsync $(RSYNC_BASE) $(call vendor-flags,$(2)) $(1)/$(2)/ gno.land/$(2)/
8989

90-
.PHONY: help install-gno link-stdlibs verify-gno vendor fmt test test-cover test-stdlibs test-smoke test-gnokey-query-smoke test-gnokey-qeval-smoke test-zkgm-native-refund-smoke clean-gno-cache refresh-abi-vectors refresh-zkgm-scenarios derive-sender-salt-vectors generate generate-check
90+
.PHONY: help install-gno verify-gno vendor fmt test test-cover test-smoke test-gnokey-query-smoke test-gnokey-qeval-smoke test-zkgm-native-refund-smoke clean-gno-cache refresh-abi-vectors refresh-zkgm-scenarios derive-sender-salt-vectors generate generate-check
9191

9292
PROTOGEN_PKGS := gno.land/p/core/ibc/lightclients/cometbls
9393

9494
COVERAGE_DIR := coverage
9595

96-
# Vendored stdlib import paths, derived from stdlibs/<path>/gnomod.toml presence.
97-
STDLIB_PKGS := $(patsubst stdlibs/%/gnomod.toml,%,$(wildcard stdlibs/*/*/gnomod.toml))
98-
# Subset that ships a Go-side native binding (vs pure-gno). Detected via .go presence.
99-
STDLIB_NATIVE := $(foreach p,$(STDLIB_PKGS),$(if $(wildcard stdlibs/$(p)/*.go),$(p)))
10096
# First-party gno packages. Third-party mirrors under gno.land/p/{aib,gnoswap,nt,onbloc}
10197
# and gno.land/r/aib are dependency inputs only, so local and CI tests skip them.
10298
USER_GNO_PKGS := $(patsubst %/gnomod.toml,./%/,$(shell find gno.land/p/core gno.land/r/core -name gnomod.toml | sort))
10399

104100
help:
105101
@echo "Targets:"
106-
@echo " install-gno — vendor stdlibs/, regenerate, build+install gno + gnodev + gnokey"
107-
@echo " link-stdlibs — refresh stdlib symlinks only (no rebuild)"
102+
@echo " install-gno — clone pinned gno and install gno + gnoland + gnodev + gnokey"
108103
@echo " verify-gno — assert the gno binary is on PATH"
109104
@echo " vendor — mirror sparse third_party package sub-paths into gno.land/"
110105
@echo " fmt — gofumpt -w on uncommitted .go/.gno files (modified, staged, untracked)"
111106
@echo " test — verify-gno + vendor, then run first-party gno tests"
112107
@echo " test-cover — same as test, plus -cover (needs gno PR #4241; override GNO_COMMIT)"
113-
@echo " test-stdlibs — run the vendored stdlib's own .gno and .go tests"
114108
@echo " test-smoke — run only the env-prep smoke tests"
115109
@echo " test-gnokey-query-smoke — run the full gnokey smoke suite"
116110
@echo " test-gnokey-qeval-smoke — run only the gnokey maketx/qeval core smoke suite"
@@ -124,15 +118,23 @@ help:
124118
@echo
125119
@echo "Pinned: $(GNO_REPO)@$(GNO_SHORT) (.gno-version)"
126120

121+
# Clean the cached checkout before switching pins because older setup flows
122+
# left local stdlib symlink files under paths now tracked by upstream gno.
127123
install-gno:
128-
@python3 tools/setup-stdlibs.py
129-
130-
# Refresh stdlib symlinks under the cached gno checkout without rebuilding
131-
# the binary. Used in CI when the binary cache hits but .gno files in
132-
# stdlibs/ may have been added/removed (edits to existing files are picked
133-
# up automatically since symlinks resolve to the working-tree path).
134-
link-stdlibs:
135-
@python3 tools/setup-stdlibs.py --link-only
124+
@if [ ! -d $(GNO_CACHE)/.git ]; then \
125+
mkdir -p $(dir $(GNO_CACHE)); \
126+
echo ">> cloning $(GNO_REPO) into $(GNO_CACHE)"; \
127+
git clone --quiet --filter=blob:none $(GNO_REPO) $(GNO_CACHE); \
128+
fi
129+
@cd $(GNO_CACHE) && \
130+
git cat-file -e $(GNO_COMMIT)^{commit} 2>/dev/null || git fetch --quiet origin; \
131+
git reset --quiet --hard; \
132+
git clean --quiet -ffdx; \
133+
git checkout --quiet $(GNO_COMMIT)
134+
@echo ">> installing gno @ $(GNO_SHORT)"
135+
@$(MAKE) -C $(GNO_CACHE)/gnovm install
136+
@$(MAKE) -C $(GNO_CACHE)/gno.land install.gnoland install.gnokey
137+
@$(MAKE) -C $(GNO_CACHE) install.gnodev
136138

137139
# Initialise/update the third_party submodules, ensure sparse-checkout is set,
138140
# and rsync the relevant subdirectories into the gno.land workspace paths.
@@ -156,7 +158,7 @@ verify-gno:
156158
@gno version 2>&1 | grep -q $(GNO_SHORT) || { \
157159
gno version; \
158160
echo "ERROR: 'gno' on PATH does not match pinned commit $(GNO_SHORT)."; \
159-
echo " Run 'make install-gno' to rebuild against the current pin + stdlibs/."; \
161+
echo " Run 'make install-gno' to rebuild against the current pin."; \
160162
exit 1; }
161163
@echo "ok: gno binary matches pinned commit $(GNO_SHORT)"
162164

@@ -188,17 +190,6 @@ test-cover: verify-gno vendor
188190
@gno test -cover -coverprofile=$(COVERAGE_DIR)/profile.txt -v $(USER_GNO_PKGS) 2>&1 \
189191
| tee $(COVERAGE_DIR)/output.log
190192

191-
# Stdlib sources live under stdlibs/ but their gnomod.toml declares stdlib
192-
# paths, so `gno test ./stdlibs/...` would reject them as user mempackages.
193-
# Test them by import path (gno) and via the cache (go).
194-
test-stdlibs: verify-gno
195-
@for pkg in $(STDLIB_PKGS); do \
196-
echo ">> gno test $$pkg"; \
197-
gno test -v $$pkg || exit 1; \
198-
done
199-
@echo ">> go test (native bindings)"
200-
@cd $(GNO_CACHE)/gnovm && go test $(addprefix ./stdlibs/,$(STDLIB_NATIVE))
201-
202193
test-smoke: verify-gno
203194
@gno test ./gno.land/p/core/_smoke/ -v
204195

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ Gno ↔ Union integration. CometBLS light client and UCS03 ZKGM contract ported
55
## Development
66

77
```bash
8-
nix develop # optional: pinned toolchain (Go, Python+pytest, gofumpt, ...)
9-
make install-gno # required: build gno + gnodev with this repo's native stdlibs
8+
nix develop # optional: pinned toolchain (Go, gofumpt, ...)
9+
make install-gno # required: build gno + gnoland + gnodev + gnokey from the pinned upstream
1010
```
1111

12-
The flake supplies the supporting toolchain only — the gno and gnodev binaries' keccak256 / bn254 / cometbls native bindings come from `make install-gno`.
12+
The IBC crypto stdlibs (bn254, cometbls, cometblszk, keccak256, merkle, modexp) ship in the upstream gno toolchain (merged via gnolang/gno#5725) and are not vendored locally.
1313

1414
## Testing
1515

1616
```bash
1717
make test # first-party gno tests
18-
make test-stdlibs # vendored stdlib tests
1918
```
2019

2120
## Documentation

stdlibs/crypto/bn254/bn254.gno

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)