Skip to content

Commit

Permalink
Merge branch 'master' into 1320
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-dambovaliev committed Mar 26, 2024
2 parents 2b50ee6 + 84ba9c9 commit eefe2de
Show file tree
Hide file tree
Showing 442 changed files with 11,693 additions and 6,039 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Bug Report Template
about: Create a bug report
# NOTE: keep in sync with gnovm/cmd/gno/bug.go
---

## [Subject of the issue]
Expand Down
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ updates:
golang-x:
patterns:
- "golang.org/x/*"
dbs:
patterns:
- "github.com/linxGnu/grocksdb"
- "go.etcd.io/bbolt"
- "github.com/dgraph-io/badger/v3"
everything-else:
patterns:
- "*"
exclude-patterns:
# NOTE: grocksdb should be updated manually, to match the version
# available on Ubuntu's latest LTS release; and updated in conjunction
# with the ubuntu version on .github/workflows/db-tests.yml
- "github.com/linxGnu/grocksdb"
open-pull-requests-limit: 10
pull-request-branch-name:
separator: "-"
Expand Down
29 changes: 11 additions & 18 deletions .github/workflows/db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@ concurrency:

jobs:
test:
runs-on: ubuntu-latest
# NOTE: this job uses a specific version of ubuntu as the version of grocksb
# we use is related to the version of RocksDB in ubuntu's repositories.
# If updating this to a later ubuntu release, update the grocksdb version
# accordingly:
# https://github.com/linxGnu/grocksdb/releases
# https://pkgs.org/search/?q=rocksdb-dev
runs-on: ubuntu-22.04
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
tags:
- cleveldb
- memdb
- fsdb
- boltdb
steps:
- uses: actions/checkout@v4

Expand All @@ -36,16 +37,8 @@ jobs:
with:
go-version: ${{ matrix.goversion }}

# leveldb
- name: install leveldb
if: ${{ matrix.tags=='cleveldb' }}
run: |
sudo apt-get install libsnappy1v5
mkdir -p /tmp/leveldb
cd /tmp/leveldb
wget http://ftp.us.debian.org/debian/pool/main/l/leveldb/libleveldb1d_1.22-3_amd64.deb
wget http://ftp.us.debian.org/debian/pool/main/l/leveldb/libleveldb-dev_1.22-3_amd64.deb
sudo dpkg -i *.deb
- name: install database dependencies
run: sudo apt-get install -y libleveldb-dev librocksdb-dev

- name: Set environment variables for debug mode
if: env.ACTIONS_STEP_DEBUG == 'true'
Expand All @@ -55,7 +48,7 @@ jobs:
echo "LOG_LEVEL=debug" >> $GITHUB_ENV
echo "LOG_PATH_DIR=$LOG_PATH_DIR" >> $GITHUB_ENV
# test ./pkgs/db
- name: test ./tm2/pkg/db
run: go test -tags ${{ matrix.tags }} ./tm2/pkg/db/...
run: go test -v ./tm2/pkg/db/...
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: marocchino/validate-dependabot@v2
12 changes: 6 additions & 6 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
go-version: ${{ matrix.goversion }}
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno precompile --verbose --gobuild ./examples
- run: go run ./gnovm/cmd/gno transpile -v --gobuild ./examples
test:
strategy:
fail-fast: false
Expand All @@ -57,7 +57,7 @@ jobs:
echo "LOG_LEVEL=debug" >> $GITHUB_ENV
echo "LOG_PATH_DIR=$LOG_PATH_DIR" >> $GITHUB_ENV
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno test --verbose ./examples/...
- run: go run ./gnovm/cmd/gno test -v ./examples/...
lint:
strategy:
fail-fast: false
Expand All @@ -75,10 +75,10 @@ jobs:
go-version: ${{ matrix.goversion }}
- run: go install -v ./gnovm/cmd/gno
# testing official directories, basically examples/ minus examples/.../x/.
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/p
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/r/demo
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/r/gnoland
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/r/system
- run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/p
- run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/demo
- run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/gnoland
- run: go run ./gnovm/cmd/gno lint -v ./examples/gno.land/r/system
# TODO: track coverage
mod-tidy:
strategy:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:

- name: Lint
uses: golangci/golangci-lint-action@v4
env:
# Don't attempt to compile/resolve C packages (grocksdb, cleveldb).
CGO_ENABLED: 0
with:
# sync with misc/devdeps/go.mod
version: v1.54
Expand Down Expand Up @@ -79,6 +82,6 @@ jobs:
run: |
# Ensure Make is installed
make --version
# Run the tidy target
make tidy
48 changes: 48 additions & 0 deletions .github/workflows/portal-loop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: portal-loop

on:
push:
paths:
- misc/loop
- .github/workflows/portal-loop.yml
branches:
- "master"
- "ops/portal-loop"
tags:
- "v*"

permissions:
contents: read
packages: write

jobs:
portal-loop:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker metadata portalloopd
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/portalloopd
tags: |
type=raw,value=latest
type=semver,pattern=v{{version}}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: ./misc/loop
target: portalloopd
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions .github/workflows/tm2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
- _test.pkg.amino
- _test.pkg.bft
- _test.pkg.others
# _test.pkg.db needs special dependencies -- see db-tests.
runs-on: ubuntu-latest
timeout-minutes: 21
steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ If you wish to test a `.gno` Realm or Package, you can utilize the `gno` tool.

2. Now, you can point to the directory containing the `*_test.gno` files:

gno test <path-to-dir> --verbose
gno test <path-to-dir> -v


To learn more about how `gno` can help you when developing gno code, you can look into the available
Expand Down
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,31 @@ help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z][^:]*:' | grep -v 'install_' | cut -d: -f1 | sort | sed 's/^/ /'

# command to run dependency utilities, like goimports.
rundep=go run -modfile misc/devdeps/go.mod

########################################
# Environment variables
# You can overwrite any of the following by passing a different value on the
# command line, ie. `CGO_ENABLED=1 make test`.
# NOTE: these are not very useful in this makefile, but they serve as
# documentation for sub-makefiles.

# disable cgo by default. cgo requires some additional dependencies in some
# cases, and is not strictly required by any tm2 code.
CGO_ENABLED ?= 0
export CGO_ENABLED
# flags for `make fmt`. -w will write the result to the destination files.
GOFMT_FLAGS ?= -w
# flags for `make imports`.
GOIMPORTS_FLAGS ?= $(GOFMT_FLAGS)
# test suite flags.
GOTEST_FLAGS ?= -v -p 1 -timeout=30m
# when running `make tidy`, use it to check that the go.mods are up-to-date.
VERIFY_MOD_SUMS ?= false

########################################
# Dev tools
.PHONY: install
install: install.gnokey install.gno
@if ! command -v gnodev > /dev/null; then \
Expand Down
2 changes: 1 addition & 1 deletion PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the Discord server.
### Gnolang

* Get basic Go tests working _COMPLETE_
* Implement minimal toolsuite (precompile, gnodev)
* Implement minimal toolsuite (transpile, gnodev)
* Tweak/enforce gas limitations
* Implement flat-as-struct supported
* Implement ownership/realm logic; phase 1: no cycles
Expand Down
24 changes: 21 additions & 3 deletions contribs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@ help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /'

# command to run dependency utilities, like goimports.
rundep=go run -modfile ../misc/devdeps/go.mod

########################################
# Environment variables
# You can overwrite any of the following by passing a different value on the
# command line, ie. `CGO_ENABLED=1 make test`.

# disable cgo by default. cgo requires some additional dependencies in some
# cases, and is not strictly required by any tm2 code.
CGO_ENABLED ?= 0
export CGO_ENABLED
# flags for `make fmt`. -w will write the result to the destination files.
GOFMT_FLAGS ?= -w
# flags for `make imports`.
GOIMPORTS_FLAGS ?= $(GOFMT_FLAGS)
# test suite flags.
GOTEST_FLAGS ?= -v -p 1 -timeout=30m

########################################
# Dev tools
.PHONY: install
install: install.gnomd install.gnodev

Expand All @@ -18,7 +39,6 @@ clean:
rundep=go run -modfile ../misc/devdeps/go.mod

.PHONY: fmt
GOFMT_FLAGS ?= -w
fmt:
$(rundep) mvdan.cc/gofumpt $(GOFMT_FLAGS) .

Expand All @@ -33,8 +53,6 @@ tidy:

########################################
# Test suite
GOTEST_FLAGS ?= -v -p 1 -timeout=30m

.PHONY: test
test:
@echo "nothing to do."
4 changes: 2 additions & 2 deletions contribs/gnodev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ the following combinations:
- **Ctrl+R**: Reset the current node state.
- **Ctrl+C**: Exit `gnodev`.

### Example Folder Loading
The **example** package folder is loaded automatically. If working within this folder, you don't have to specify any additional paths to `gnodev`. Use `--minimal` to prevent this.
### Loading 'examples'
The **examples** directory is loaded automatically. If working within this folder, you don't have to specify any additional paths to `gnodev`. Use `--minimal` to prevent this.

### Installation
Run `make install` to install `gnodev`.
30 changes: 8 additions & 22 deletions contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,48 @@ replace github.com/gnolang/gno => ../..
require (
github.com/fsnotify/fsnotify v1.7.0
github.com/gnolang/gno v0.0.0-00010101000000-000000000000
github.com/gorilla/websocket v1.5.1
go.uber.org/zap v1.26.0
golang.org/x/term v0.16.0
golang.org/x/term v0.18.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/dgraph-io/badger/v3 v3.2103.5 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/gnolang/goleveldb v0.0.9 // indirect
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gotuna/gotuna v0.6.0 // indirect
github.com/jaekwon/testify v1.6.1 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.12.3 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.8.11 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/peterbourgon/ff/v3 v3.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.22.5 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap/exp v0.2.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
Expand Down
Loading

0 comments on commit eefe2de

Please sign in to comment.