Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Dec 18, 2023
2 parents f009bf8 + d8a33fd commit 8e8daea
Show file tree
Hide file tree
Showing 100 changed files with 1,640 additions and 1,378 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
temp/
build/
dist/
*.md
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ coverage:
threshold: 1% # Allow coverage to drop by X%, posting a success status.
# removed_code_behavior: Takes values [off, removals_only, adjust_base]
removed_code_behavior: adjust_base
patch:
default:
target: 70%

comment: # this is a top-level key
layout: " diff, flags, files"
Expand Down
11 changes: 6 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Description
# Purpose / Abstract

What does this PR do?

# Purpose
- Closes #AAA

Why is this PR important?
<!--
Why is this PR important?
What does this PR do?
-->
48 changes: 0 additions & 48 deletions .github/workflows/e2e-wasm.yml

This file was deleted.

14 changes: 12 additions & 2 deletions .github/workflows/goreleaser-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -37,11 +37,21 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Move dist to prevent dockerignore"
run: |
echo "dist contents: $(ls dist)"
if [ ! -d "dist" ]; then
echo "❌ expected dist dir to be generated from make release-snapshot" && exit 1
else echo "dist dir exists as expected."
fi
rm -rf dist-temp
cp -r dist dist-temp
- name: Build and push versioned image
uses: docker/build-push-action@v5
with:
file: contrib/docker/goreleaser.Dockerfile
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/nibiruchain/nibiru:latest
tags: ghcr.io/nibiruchain/nibiru:latest
20 changes: 17 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Go
- name: "Set up Go"
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Build the nibid binary
run: make build
- name: "Install just"
# casey/just: https://just.systems/man/en/chapter_6.html
# taiki-e/install-action: https://github.com/taiki-e/install-action
uses: taiki-e/install-action@just

- name: "Build the nibid binary"
run: |
just install
- name: "Run scripts/chaosnet.sh (Used in Docker image)"
run: |
just test-chaosnet
- name: "Run scripts/localnet.sh"
run: |
just test-localnet
37 changes: 18 additions & 19 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ builds:
binary: nibid
hooks:
pre:
- bash contrib/scripts/release_pre_darwin.sh
- cmd: bash contrib/scripts/release_pre_darwin.sh
output: false # enable for debug
env:
- TARGET={{ .Target }}
goos:
- darwin
goarch:
- amd64
- arm64
env:
- CC=o64-clang
- CC_darwin_amd64=o64-clang
- CC_darwin_arm64=oa64-clang
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
flags:
- -mod=readonly
- -trimpath
Expand All @@ -34,28 +39,28 @@ builds:
- osusergo
- ledger
- static
- static_wasm
- rocksdb
- static_wasm
- grocksdb_no_link
overrides:
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang

- id: linux
main: ./cmd/nibid
binary: nibid
hooks:
pre:
- bash contrib/scripts/release_pre_linux.sh
- cmd: bash contrib/scripts/release_pre_linux.sh
output: false # enable for debug
env:
- TARGET={{ .Target }}
goos:
- linux
goarch:
- amd64
- arm64
env:
- CC=x86_64-linux-gnu-gcc
- CC_linux_amd64=x86_64-linux-gnu-gcc
- CC_linux_arm64=aarch64-linux-gnu-gcc
- 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}'
flags:
- -mod=readonly
- -trimpath
Expand All @@ -67,20 +72,14 @@ builds:
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/types.DBBackend=rocksdb
- -linkmode=external
- -extldflags '-static -lrocksdb -lstdc++ -lm -ldl -lpthread'
- -extldflags '-static -lm -lbz2'
tags:
- netgo
- osusergo
- ledger
- muslc
- rocksdb
- grocksdb_no_link
- static
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- rocksdb
- muslc

universal_binaries:
- id: darwin
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* [#1688](https://github.com/NibiruChain/nibiru/pull/1688) - fix(inflation)!: make default inflation allocation follow tokenomics
* [#1682](https://github.com/NibiruChain/nibiru/pull/1682) - feat!: add upgrade handler for v1.1.0
* [#1706](https://github.com/NibiruChain/nibiru/pull/1706) - fix: `v1.1.0` upgrade handler
* [#1712](https://github.com/NibiruChain/nibiru/pull/1712) - refactor(inflation): turn inflation off by default
* [#1713](https://github.com/NibiruChain/nibiru/pull/1713) - chore(build-release): use new rocksdb libraries and link required libs
* [#1715](https://github.com/NibiruChain/nibiru/pull/1715) - fix(build): revert! to working build + cherry-picks

#### Dapp modules: perp, spot, etc

Expand All @@ -60,21 +64,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#1656](https://github.com/NibiruChain/nibiru/pull/1656) - feat(perp): Make the collateral denom a stateful collections.Item
* [#1632](https://github.com/NibiruChain/nibiru/pull/1632) - feat(perp): Add settle position transaction
* [#1573](https://github.com/NibiruChain/nibiru/pull/1573) - feat(perp): Close markets and compute settlement price
* [#1705](https://github.com/NibiruChain/nibiru/pull/1705) - feat(perp): Add oracle pair to market object
* [#1718](https://github.com/NibiruChain/nibiru/pull/1718) - fix: fees does not require additional funds

### Non-breaking/Compatible Improvements

* [#1690](https://github.com/NibiruChain/nibiru/pull/1690) - docs(CHANGELOG.md): Correct the change log, providing clarity on what's released.
* [#1679](https://github.com/NibiruChain/nibiru/pull/1679) - test(perp): add more tests for perp module msg server
* [#1695](https://github.com/NibiruChain/nibiru/pull/1695) - feat(inflation): add events for inflation distribution
* [#1695](https://github.com/NibiruChain/nibiru/pull/1695) - fix(sudo): Make blank sudoers root invalid at genesis time.
* [#1710](https://github.com/NibiruChain/nibiru/pull/1710) - refactor(perp): Clean and organize module errors for x/perp
* [#1714](https://github.com/NibiruChain/nibiru/pull/1714) - ci(localnet.sh): Fix script, simplify, and test in CI.
* [#1719](https://github.com/NibiruChain/nibiru/pull/1719) - refactor(test): add is not mandatory interface to action
* [#1723](https://github.com/NibiruChain/nibiru/pull/1723) - ci(e2e-wasm.yml): rm unused workflow

### Dependencies
- Bump `google.golang.org/grpc` from 1.59.0 to 1.60.0 ([#1720](https://github.com/NibiruChain/nibiru/pull/1720))

* Bump `github.com/spf13/cast` from 1.5.1 to 1.6.0 ([#1689](https://github.com/NibiruChain/nibiru/pull/1689))
* Bump `cosmossdk.io/math` from 1.1.2 to 1.2.0 ([#1676](https://github.com/NibiruChain/nibiru/pull/1676))
* Bump `github.com/grpc-ecosystem/grpc-gateway/v2` from 2.18.0 to 2.18.1 ([#1675](https://github.com/NibiruChain/nibiru/pull/1675))
* Bump `actions/setup-go` from 4 to 5 ([#1696](https://github.com/NibiruChain/nibiru/pull/1696))
* Bump `golang` from 1.19 to 1.21 ([#1698](https://github.com/NibiruChain/nibiru/pull/1698))
* [#1678](https://github.com/NibiruChain/nibiru/pull/1678) - chore(deps): collections to v0.4.0 for math.Int value encoder


## [v1.1.0] - 2023-11-20
Expand Down Expand Up @@ -133,6 +145,7 @@ v0.47.5.
* [#1614](https://github.com/NibiruChain/nibiru/pull/1614) - refactor(proto): Use explicit namespacing on proto imports for #1608
* [#1610](https://github.com/NibiruChain/nibiru/pull/1610) - refactor(app): Simplify app.go with less redundant imports using struct embedding.
* [#1606](https://github.com/NibiruChain/nibiru/pull/1606) - fix(perp): emit `MarketUpdatedEvent` in the absence of index price
* [#1700](https://github.com/NibiruChain/nibiru/pull/1700) - fix(oracle): remove non deterministic sqrt calculation

### Dependencies

Expand Down
52 changes: 34 additions & 18 deletions CHAOSNET.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
# How to use
# Chaosnet

Before running
- [Chaosnet](#chaosnet)
- [What is Chaosnet?](#what-is-chaosnet)
- [How to run "chaosnet"](#how-to-run-chaosnet)
- [How to force pull images from the registry](#how-to-force-pull-images-from-the-registry)
- [Endpoints](#endpoints)
- [FAQ](#faq)
- [`make chaosnet` says that "Additional property name is not allowed"](#make-chaosnet-says-that-additional-property-name-is-not-allowed)
- [Does data persist between runs?](#does-data-persist-between-runs)

```sh
make chaosnet
```
## What is Chaosnet?

you need to log into our private Docker image registry in order to pull the private images. Go to <https://github.com/settings/tokens/new> and generate a new token with `read:packages` scope. Copy the access token to your clipboard.
Chaosnet is an expanded version of localnet that runs:

Next, run
- two validators (nibiru-0 and nibiru-1)
- pricefeeders for each validator
- a hermes relayer between the two validators
- a faucet
- a postgres:14 database
- a heartmonitor instance
- a liquidator instance
- a graphql server

```sh
## How to run "chaosnet"

1. Make sure you have [Docker](https://docs.docker.com/engine/install/) installed and running
2. Make sure you have `make` installed
3. Docker login to ghcr.io

```bash
docker login ghcr.io
```

and enter your GitHub username for the `username` field, and your personal access token for the password.
Enter your GitHub username for the `username` field, and your personal access token for the password.

Now you can run

```sh
make chaosnet
```
4. Run `make chaosnet`

## How to force pull images from the registry

By default, images won't re-fetch from upstream registries. To force a pull, you can run
By default, most images (heart-monitor, liquidator, etc.) are cached locally and won't re-fetch from upstream registries. To force a pull, you can run

```sh
make chaosnet-build
```

to force re-build and pull images.

## Endpoints

- `http://localhost:5555` -> GraphQL server
Expand All @@ -44,4 +56,8 @@ to force re-build and pull images.

### `make chaosnet` says that "Additional property name is not allowed"

Make sure to update your docker application to version 23.0.1
Make sure to update your docker application to version >=23.0.1

### Does data persist between runs?

No, all volumes are deleted and recreated every time you run `make chaosnet`. This is to ensure that you always start with a clean network.
Loading

0 comments on commit 8e8daea

Please sign in to comment.