Skip to content

Commit 7655dc0

Browse files
Merge pull request #30 from airchains-network/varanasi-test
feat: Integrate Wasm module into Junction chain by migrating from Deepinject to traditional app wiring
2 parents d8a9fe5 + 8dd7b63 commit 7655dc0

File tree

519 files changed

+35909
-208878
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

519 files changed

+35909
-208878
lines changed

.codecov.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# This codecov.yml is the default configuration for
3+
# all repositories on Codecov. You may adjust the settings
4+
# below in your own codecov.yml in your repository.
5+
#
6+
coverage:
7+
precision: 2
8+
round: down
9+
range: 70...100
10+
11+
status:
12+
# Learn more at https://docs.codecov.io/docs/commit-status
13+
project:
14+
default:
15+
threshold: 1% # allow this much decrease on project
16+
app:
17+
target: 70%
18+
flags:
19+
- app
20+
modules:
21+
target: 70%
22+
flags:
23+
- modules
24+
client:
25+
flags:
26+
- client
27+
changes: false
28+
29+
comment:
30+
layout: "reach, diff, files"
31+
behavior: default # update if exists else create new
32+
require_changes: true
33+
34+
flags:
35+
app:
36+
paths:
37+
- "app/"
38+
modules:
39+
paths:
40+
- "x/"
41+
- "!x/**/client/" # ignore client package
42+
client:
43+
paths:
44+
- "x/**/client/"
45+
46+
ignore:
47+
- "cmd/"
48+
- "docs/"
49+
- "docker/"
50+
- "scripts/"
51+
- "*.md"
52+
- "*.rst"
53+
- "x/**/*.pb.go"
54+
- "x/**/*.pb.gw.go"
55+
- "x/**/test_common.go"
56+
- "x/**/testdata/"

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Folders we don't want to copy to Docker daemon in `docker build . -t junction/junctiond:latest`
2+
build/

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[{Makefile,*.go}]
15+
indent_style = tab
16+
indent_size = 4

.gitattributes

Whitespace-only changes.

.gitignore

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
1-
vue/node_modules
2-
vue/dist
3-
release/
4-
.idea/
5-
.vscode/
1+
# OS
62
.DS_Store
7-
*.dot
3+
*.swp
4+
*.swo
5+
*.swl
6+
*.swm
7+
*.swn
8+
.vscode
9+
.idea
10+
11+
# Build
12+
vendor
13+
build
14+
tools/bin/*
15+
examples/build/*
16+
docs/_build
17+
docs/client
18+
docs/tutorial
19+
dist
20+
tools-stamp
21+
docs/node_modules
22+
23+
# Data - ideally these don't exist
24+
baseapp/data/*
25+
client/lcd/keys/*
26+
mytestnet
27+
28+
# Testing
29+
coverage.txt
30+
profile.out
31+
32+
# Vagrant
33+
.vagrant/
34+
*.box
835
*.log
9-
*.ign
10-
/.trunk
11-
/.idea
12-
build
36+
vagrant
37+
38+
# IDE
39+
.idea/
40+
*.iml
41+
42+
# Graphviz
43+
dependency-graph.png
44+
45+
# Latex
46+
*.aux
47+
*.out
48+
*.synctex.gz

.golangci.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
run:
2+
tests: true
3+
timeout: 15m
4+
sort-results: true
5+
allow-parallel-runners: true
6+
exclude-dir: testutil/testdata
7+
skip-files:
8+
- server/grpc/gogoreflection/fix_registration.go
9+
- ".*\\.pb\\.go$"
10+
- ".*\\.pb\\.gw\\.\\.go$"
11+
- ".*\\.pulsar\\.go$"
12+
13+
linters:
14+
disable-all: true
15+
enable:
16+
- errcheck
17+
- dogsled
18+
- exportloopref
19+
- goconst
20+
- gocritic
21+
- gci
22+
- gofumpt
23+
- gosec
24+
- gosimple
25+
- govet
26+
- ineffassign
27+
- misspell
28+
- nakedret
29+
- nolintlint
30+
- staticcheck
31+
- revive
32+
- stylecheck
33+
- typecheck
34+
# - thelper # too many positives with table tests that have custom setup(*testing.T)
35+
- unconvert
36+
- unused
37+
38+
issues:
39+
exclude-rules:
40+
- text: 'Use of weak random number generator'
41+
linters:
42+
- gosec
43+
- text: 'ST1003:'
44+
linters:
45+
- stylecheck
46+
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
47+
# https://github.com/dominikh/go-tools/issues/389
48+
- text: 'ST1016:'
49+
linters:
50+
- stylecheck
51+
- path: 'migrations'
52+
text: 'SA1019:'
53+
linters:
54+
- staticcheck
55+
- text: 'SA1019: codec.NewAminoCodec is deprecated' # TODO remove once migration path is set out
56+
linters:
57+
- staticcheck
58+
- text: 'SA1019: legacybech32.MustMarshalPubKey' # TODO remove once ready to remove from the sdk
59+
linters:
60+
- staticcheck
61+
- text: 'SA1019: legacybech32.MarshalPubKey' # TODO remove once ready to remove from the sdk
62+
linters:
63+
- staticcheck
64+
- text: 'SA1019: legacybech32.UnmarshalPubKey' # TODO remove once ready to remove from the sdk
65+
linters:
66+
- staticcheck
67+
- text: 'SA1019: params.SendEnabled is deprecated' # TODO remove once ready to remove from the sdk
68+
linters:
69+
- staticcheck
70+
- text: 'leading space'
71+
linters:
72+
- nolintlint
73+
max-issues-per-linter: 10000
74+
max-same-issues: 10000
75+
76+
linters-settings:
77+
gci:
78+
custom-order: true
79+
sections:
80+
- standard # Standard section: captures all standard packages.
81+
- default # Default section: contains all imports that could not be matched to another section type.
82+
- prefix(cosmossdk.io)
83+
- prefix(github.com/cosmos/cosmos-sdk)
84+
- prefix(github.com/airchains-network/junction)
85+
revive:
86+
rules:
87+
- name: redefines-builtin-id
88+
disabled: true
89+
90+
gosec:
91+
# To select a subset of rules to run.
92+
# Available rules: https://github.com/securego/gosec#available-rules
93+
# Default: [] - means include all rules
94+
includes:
95+
# - G101 # Look for hard coded credentials
96+
- G102 # Bind to all interfaces
97+
- G103 # Audit the use of unsafe block
98+
- G104 # Audit errors not checked
99+
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
100+
- G107 # Url provided to HTTP request as taint input
101+
- G108 # Profiling endpoint automatically exposed on /debug/pprof
102+
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
103+
- G110 # Potential DoS vulnerability via decompression bomb
104+
- G111 # Potential directory traversal
105+
- G112 # Potential slowloris attack
106+
- G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772)
107+
- G114 # Use of net/http serve function that has no support for setting timeouts
108+
- G201 # SQL query construction using format string
109+
- G202 # SQL query construction using string concatenation
110+
- G203 # Use of unescaped data in HTML templates
111+
- G204 # Audit use of command execution
112+
- G301 # Poor file permissions used when creating a directory
113+
- G302 # Poor file permissions used with chmod
114+
- G303 # Creating tempfile using a predictable path
115+
- G304 # File path provided as taint input
116+
- G305 # File traversal when extracting zip/tar archive
117+
- G306 # Poor file permissions used when writing to a new file
118+
- G307 # Deferring a method which returns an error
119+
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
120+
- G402 # Look for bad TLS connection settings
121+
- G403 # Ensure minimum RSA key length of 2048 bits
122+
- G404 # Insecure random number source (rand)
123+
- G501 # Import blocklist: crypto/md5
124+
- G502 # Import blocklist: crypto/des
125+
- G503 # Import blocklist: crypto/rc4
126+
- G504 # Import blocklist: net/http/cgi
127+
- G505 # Import blocklist: crypto/sha1
128+
- G601 # Implicit memory aliasing of items from a range statement
129+
misspell:
130+
locale: US
131+
gofumpt:
132+
extra-rules: true
133+
dogsled:
134+
max-blank-identifiers: 6
135+
maligned:
136+
suggest-new: true
137+
nolintlint:
138+
allow-unused: false
139+
allow-leading-space: true
140+
require-explanation: false
141+
require-specific: false
142+
gosimple:
143+
checks: ['all']
144+
gocritic:
145+
disabled-checks:
146+
- regexpMust
147+
- appendAssign
148+
- ifElseChain

.mergify.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
queue_rules:
2+
- name: default
3+
conditions:
4+
- "#approved-reviews-by>0"
5+
6+
pull_request_rules:
7+
- name: backport patches to main branch
8+
conditions:
9+
- base=releases/v0.4x
10+
- label=backport/main
11+
actions:
12+
backport:
13+
branches:
14+
- main
15+
- name: backport patches to sdk45 release branch
16+
conditions:
17+
- base=main
18+
- label=backport/v0.3x
19+
actions:
20+
backport:
21+
branches:
22+
- releases/v0.3x
23+
- name: backport patches to sdk47 release branch
24+
conditions:
25+
- base=main
26+
- label=backport/v0.4x
27+
actions:
28+
backport:
29+
branches:
30+
- releases/v0.4x

.sonarcloud.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# see https://docs.sonarcloud.io/advanced-setup/automatic-analysis/
2+
sonar.sources=.
3+
sonar.exclusions=**/tests/**,**/benchmarks/**,**/ibctesting/**,**/wasmtesting/**,**/simulation/**,**/testdata/**,**/*.pb.go,**/*.pb.gw.go,**/*.test.go,**/test_*.go,**/*_fixtures.go,**/mock_*.go,**/*_mock.go
4+
5+
sonar.tests=.

Dockerfile

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
FROM ubuntu:latest
2-
LABEL authors="deadlium, computerKeeda, Hitisha-G, saatvik333"
1+
# docker build . -t junction/junctiond:latest
2+
# docker run --rm -it junction/junctiond:latest /bin/sh
33

4-
ENTRYPOINT ["top", "-b"]
4+
# Using Alpine 3.19+ as the build system is currently broken,
5+
# see https://github.com/CosmWasm/wasmvm/issues/523
6+
FROM golang:1.21-alpine3.18 AS go-builder
7+
8+
# this comes from standard alpine nightly file
9+
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile
10+
# with some changes to support our toolchain, etc
11+
RUN set -eux; apk add --no-cache ca-certificates build-base;
12+
13+
RUN apk add git
14+
# NOTE: add these to run with LEDGER_ENABLED=true
15+
# RUN apk add libusb-dev linux-headers
16+
17+
WORKDIR /code
18+
COPY . /code/
19+
# See https://github.com/CosmWasm/wasmvm/releases
20+
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.1.4/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
21+
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.1.4/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
22+
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 090b97641157fae1ae45e7ed368a1a8c091f3fef67958d3bc7c2fa7e7c54b6b4
23+
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep a4a3d09b36fabb65b119d5ba23442c23694401fcbee4451fe6b7e22e325a4bac
24+
25+
# force it to use static lib (from above) not standard libgo_cosmwasm.so file
26+
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
27+
RUN echo "Ensuring binary is statically linked ..." \
28+
&& (file /code/build/junctiond | grep "statically linked")
29+
30+
# --------------------------------------------------------
31+
FROM alpine:3.18
32+
33+
COPY --from=go-builder /code/build/wasmd /usr/bin/wasmd
34+
35+
COPY docker/* /opt/
36+
RUN chmod +x /opt/*.sh
37+
38+
WORKDIR /opt
39+
40+
# rest server
41+
EXPOSE 1317
42+
# tendermint p2p
43+
EXPOSE 26656
44+
# tendermint rpc
45+
EXPOSE 26657
46+
47+
CMD ["/usr/bin/wasmd", "version"]

0 commit comments

Comments
 (0)