Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/web-ui/remixicon-4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat authored Dec 31, 2023
2 parents 082df53 + 8953bb0 commit d3e5d57
Show file tree
Hide file tree
Showing 59 changed files with 661 additions and 333 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# build
build
rocksdb
data
Dockerfile
scripts/tg271/data
web-ui
7 changes: 7 additions & 0 deletions .github/codeql/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
packs:
go:
- crypto-com/cosmos-sdk-codeql




11 changes: 8 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ updates:
directory: "web-ui"
schedule:
interval: daily
open-pull-requests-limit: 10
open-pull-requests-limit: 20
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
open-pull-requests-limit: 20
labels:
- automerge
- dependencies
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
open-pull-requests-limit: 20
ignore:
- dependency-name: "github.com/cosmos/cosmos-sdk"
labels:
- automerge
- dependencies
7 changes: 7 additions & 0 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ jobs:
test:
runs-on: ubuntu-latest
name: test quicksilver
strategy:
matrix:
arch: [amd64]
targetos: [linux, windows, darwin]
include:
- targetos: darwin
arch: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: "CodeQL"

on:
pull_request:
paths:
- "**.go"
branches:
- main
push:
branches:
- main
- develop
- release/**
paths:
- "**.go"



jobs:
analyze:
Expand All @@ -33,7 +33,7 @@ jobs:
with:
languages: "go, javascript, typescript"
queries: +security-and-quality,github/codeql/go/ql/src/experimental/InconsistentCode/DeferInLoop.ql@main,github/codeql/go/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql@main,github/codeql/go/ql/src/experimental/CWE-369/DivideByZero.ql@main
packs: +crypto-com/cosmos-sdk-codeql
config-file: ./.github/codeql/config.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: DevSkim

on:
push:
branches: [ "main", "develop", "feat*", "main*", "unstable*" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '37 18 * * 2'

jobs:
lint:
name: DevSkim
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run DevSkim scanner
uses: microsoft/DevSkim-Action@v1

- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: devskim-results.sarif
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
##### Chain #######

# OS
.DS_Store
*.swp
Expand Down Expand Up @@ -31,3 +33,42 @@ scripts/wallets.sh

# Coverage
coverage.txt


##### web ui #######

# dependencies
web-ui/node_modules
web-ui/.pnp
web-ui/.pnp.js

# testing
web-ui/coverage

# next.js
web-ui/.next/
web-ui//out/

# production
web-ui/build

# misc
web-ui/.DS_Store
web-ui/*.pem

# debug
web-ui/npm-debug.log*
web-ui/yarn-debug.log*
web-ui/yarn-error.log*
web-ui/.pnpm-debug.log*

# local env files
web-ui/.env*.local
web-ui/.vscode

# vercel
web-ui/.vercel

# typescript
web-ui/*.tsbuildinfo
web-ui/next-env.d.ts
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download

# Cosmwasm - download correct libwasmvm version
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.$(uname -m).a \
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
wget https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep $(uname -m) | cut -d ' ' -f 1)
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.hermes
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM rust:1.72 as build
ARG VERSION

RUN apt update && apt install git -y

WORKDIR /app/src

RUN git clone https://github.com/informalsystems/ibc-rs --branch v1.5.0
RUN git clone https://github.com/informalsystems/ibc-rs --branch $VERSION

WORKDIR ibc-rs

RUN sed -i 's/CHUNK_LENGTH: usize = 50;/CHUNK_LENGTH: usize = 3;/' ./crates/relayer/src/link/packet_events.rs
RUN cargo build --release

FROM debian:bullseye-slim
Expand Down
20 changes: 9 additions & 11 deletions Dockerfile.osmosis
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@
# Build
# --------------------------------------------------------

FROM golang:1.21-alpine3.18 as build
FROM golang:1.20.11-alpine3.18 as build

RUN set -eux; apk add --no-cache ca-certificates build-base;
RUN apk add git
# Needed by github.com/zondax/hid
RUN apk add linux-headers

RUN git clone https://github.com/osmosis-labs/osmosis /osmosis --branch v12.1.0
RUN git clone https://github.com/osmosis-labs/osmosis /osmosis --branch v21.1.2
WORKDIR /osmosis

# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479

# CosmWasm: copy the right library according to architecture. The final location will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

RUN BUILD_TAGS=muslc LINK_STATICALLY=true make build

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM debian:11
FROM alpine:3.18

RUN apt update && apt install bash -y
COPY --from=build /osmosis/build/osmosisd /bin/osmosisd
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.relayer
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21-alpine3.18 AS builder
FROM golang:1.21.5-alpine3.18 AS builder
RUN apk add --no-cache make git gcc musl-dev openssl-dev linux-headers

RUN git clone https://github.com/cosmos/relayer --branch v2.1.1 /src/app
Expand All @@ -8,7 +8,7 @@ RUN go mod download
RUN make build

# Add to a distroless container
FROM alpine:3.15
FROM alpine:3.18
COPY --from=builder /src/app/build/rly /usr/local/bin/rly
RUN adduser -S -h /rly -D rly -u 1000
USER rly
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ DOCKER_TAG := $(COMMIT_HASH)
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)

HERMES_VERSION=v1.7.4

export GO111MODULE = on

# Default target executed when no arguments are given to make.
Expand Down Expand Up @@ -102,10 +104,7 @@ endif
build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))
build_tags_comma_sep := $(shell echo $(build_tags) | sed 's/ /,/g')
ldflags += -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
Expand Down Expand Up @@ -147,12 +146,12 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

build-docker:
DOCKER_BUILDKIT=1 $(DOCKER) build . -f Dockerfile -t quicksilverzone/quicksilver:$(DOCKER_VERSION) -t quicksilverzone/quicksilver:latest
$(DOCKER) build . -f Dockerfile -t quicksilverzone/quicksilver:$(DOCKER_VERSION) -t quicksilverzone/quicksilver:latest

build-docker-local: build
DOCKER_BUILDKIT=1 $(DOCKER) build -f Dockerfile.local . -t quicksilverzone/quicksilver:$(DOCKER_VERSION)
build-docker-xbuild:
$(DOCKER) buildx build --platform linux/amd64 . -f Dockerfile -t quicksilverzone/quicksilver:$(DOCKER_VERSION) -t quicksilverzone/quicksilver:latest

build-docker-release: build-docker
build-docker-release: build-docker-xbuild
$(DOCKER) run -v /tmp:/tmp quicksilverzone/quicksilver:$(DOCKER_VERSION) cp /usr/local/bin/quicksilverd /tmp/quicksilverd
mv /tmp/quicksilverd build/quicksilverd-$(DOCKER_VERSION)-amd64

Expand Down Expand Up @@ -537,4 +536,10 @@ proto-setup:
@$(DOCKER) build --rm --tag quicksilver-proto:latest --file proto/Dockerfile .
@echo "✅ Setup protobuf environment!"

### Other tools
.PHONY: hermes-build

hermes-build:
docker buildx build --platform linux/amd64 --build-arg VERSION=$HERMES_VERSION -f Dockerfile.hermes . -t quicksilverzone/hermes:$HERMES_VERSION
docker push quicksilverzone/hermes:$HERMES_VERSION

2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func NewQuicksilver(
appOpts servertypes.AppOptions,
wasmOpts []wasm.Option,
mock bool,
enableSupplyEndpoint bool,
baseAppOptions ...func(*baseapp.BaseApp),
) *Quicksilver {
appCodec := encodingConfig.Marshaler
Expand Down Expand Up @@ -162,6 +163,7 @@ func NewQuicksilver(
wasmConfig,
enabledProposals,
wasmOpts,
enableSupplyEndpoint,
)

// **** Module Options ****/
Expand Down
2 changes: 2 additions & 0 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestQuicksilverExport(t *testing.T) {
app.EmptyAppOptions{},
app.GetWasmOpts(app.EmptyAppOptions{}),
false,
false,
)

genesisState := app.NewDefaultGenesisState()
Expand Down Expand Up @@ -87,6 +88,7 @@ func TestQuicksilverExport(t *testing.T) {
app.EmptyAppOptions{},
app.GetWasmOpts(app.EmptyAppOptions{}),
false,
false,
)
_, err = app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
Expand Down
1 change: 1 addition & 0 deletions app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func NewAppConstructor(encCfg EncodingConfig) network.AppConstructor {
EmptyAppOptions{},
GetWasmOpts(EmptyAppOptions{}),
false,
false,
baseapp.SetPruning(purningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)),
// baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices),
)
Expand Down
4 changes: 4 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func NewAppKeepers(
wasmConfig wasm.Config,
wasmEnabledProposals []wasm.ProposalType,
wasmOpts []wasm.Option,
supplyEndpointEnabled bool,
) AppKeepers {
appKeepers := AppKeepers{}

Expand Down Expand Up @@ -183,6 +184,7 @@ func NewAppKeepers(
wasmConfig,
wasmEnabledProposals,
wasmOpts,
supplyEndpointEnabled,
)

appKeepers.SetupHooks()
Expand All @@ -206,6 +208,7 @@ func (appKeepers *AppKeepers) InitKeepers(
wasmConfig wasm.Config,
wasmEnabledProposals []wasm.ProposalType,
wasmOpts []wasm.Option,
supplyEndpointEnabled bool,
) {
// Add 'normal' keepers
proofOpsFn := utils.ValidateProofOps
Expand Down Expand Up @@ -352,6 +355,7 @@ func (appKeepers *AppKeepers) InitKeepers(
appKeepers.BankKeeper,
appKeepers.StakingKeeper,
utils.Keys[[]string](maccPerms),
supplyEndpointEnabled,
)
appKeepers.PacketForwardKeeper.SetTransferKeeper(appKeepers.TransferKeeper)
appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper)
Expand Down
Loading

0 comments on commit d3e5d57

Please sign in to comment.