Skip to content

Commit

Permalink
Merge branch 'main' into artemijspavlovs/add-advanced-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Apr 8, 2024
2 parents 6bad7b8 + 73b3ceb commit c45f17b
Show file tree
Hide file tree
Showing 21 changed files with 702 additions and 208 deletions.
61 changes: 61 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Description

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review.
-->

----

Closes #XXX

**All** items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

- [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [ ] Targeted PR against the correct branch
- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] Linked to the GitHub issue with discussion and accepted design
- [ ] Targets only one GitHub issue
- [ ] Wrote unit and integration tests
- [ ] Wrote relevant migration scripts if necessary
- [ ] All CI checks have passed
- [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code)
- [ ] Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
- [ ] Add an issue in the [e2e-tests repo](https://github.com/dymensionxyz/e2e-tests) if necessary

SDK Checklist
- [ ] Import/Export Genesis
- [ ] Registered Invariants
- [ ] Registered Events
- [ ] Updated openapi.yaml
- [ ] No usage of go `map`
- [ ] No usage of `time.Now()`
- [ ] Used fixed point arithmetic and not float arithmetic
- [ ] Avoid panicking in Begin/End block as much as possible
- [ ] No unexpected math Overflow
- [ ] Used `sendCoin` and not `SendCoins`
- [ ] Out-of-block compute is bounded
- [ ] No serialized ID at the end of store keys
- [ ] UInt to byte conversion should use BigEndian

Full security checklist [here](https://www.faulttolerant.xyz/2024-01-16-cosmos-security-1/)


----;

For Reviewer:

- [ ] Confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] Reviewers assigned
- [ ] Confirmed all author checklist items have been addressed

---;

After reviewer approval:

- [ ] In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
- [ ] In case the PR targets a release branch, PR must be rebased.
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
pull_request:
paths:
- "**.go"
push:
# The branches below must be a subset of the branches above
branches:
- main
- release/**
paths:
- "**.go"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.22"
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: "go"
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality

- name: Build
run: make build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
24 changes: 24 additions & 0 deletions .github/workflows/golangci_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.56.2
skip-cache: true
args: --timeout 5m
19 changes: 19 additions & 0 deletions .github/workflows/markdown_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: markdown-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: markdownlint-cli
uses: nosborn/[email protected]
with:
files: ./
config_file: .markdownlint.yaml
10 changes: 10 additions & 0 deletions .github/workflows/new-pr-notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: new-pr-notification-to-slack
on:
pull_request:
types: [opened]

jobs:
new-pr-notification:
uses: dymensionxyz/common-workflows/.github/workflows/new-pr-notification.yaml@main
secrets:
WEBHOOK_URL: ${{ secrets.SLACK_NEW_PR_CHANNEL_WEBHOOK }}
11 changes: 11 additions & 0 deletions .github/workflows/stale-pr-notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: stale-pr-notification-to-slack
on:
pull_request:
types: [labeled]

jobs:
stale-pr-notification:
if: github.event.label.name == 'Stale'
uses: dymensionxyz/common-workflows/.github/workflows/stale-pr-notification.yaml@main
secrets:
WEBHOOK_URL: ${{ secrets.SLACK_STALE_PR_CHANNEL_WEBHOOK }}
7 changes: 7 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default: true
MD010:
code_blocks: false
MD013: false
MD024: true
MD033:
allowed_elements: ["img"]
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@ RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm |
-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)
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.x86_64.so \
-O /lib/libwasmvm.x86_64.so && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.aarch64.so \
-O /lib/libwasmvm.aarch64.so

# Copy the remaining files
COPY . .

RUN make build

FROM alpine:3.18
FROM ubuntu:latest

RUN apk add curl jq bash vim
RUN apt-get update -y

COPY --from=go-builder /app/build/rollappd /usr/local/bin/
COPY --from=go-builder /lib/libwasmvm.x86_64.so /lib/libwasmvm.x86_64.so
COPY --from=go-builder /lib/libwasmvm.aarch64.so /lib/libwasmvm.aarch64.so

WORKDIR /app

Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ It uses Cosmos-SDK's [simapp](https://github.com/cosmos/cosmos-sdk/tree/main/sim

**Note**: Requires [Go 1.21](https://go.dev/)

## Quick guide

Get started with [building RollApps](https://docs.dymension.xyz/develop/get-started/setup)

## Installing / Getting started

Build and install the ```rollappd``` binary:
Expand All @@ -46,16 +42,26 @@ export ROLLAPP_HOME_DIR="$HOME/.rollapp"
export ROLLAPP_SETTLEMENT_INIT_DIR_PATH="${ROLLAPP_HOME_DIR}/init"
```

if you want to change the max wasm size:
And initialize the rollapp:

```shell
export MAX_WASM_SIZE=WASM_SIZE_IN_BYTES # 2560000
sh scripts/init.sh
```

And initialize the rollapp:
You can find out in <https://github.com/CosmWasm/wasmd#compile-time-parameters> that:

There are a few variables was allow blockchains to customize at compile time. If you build your own chain and import x/wasm, you can adjust a few items via module parameters, but a few others did not fit in that, as they need to be used by stateless ValidateBasic(). Thus, we made them as flags and set them in start.go so that they can be overridden on your custom chain.

```shell
sh scripts/init.sh
rollappd start --max-label-size 64 --max-wasm-size 2048000 --max-wasm-proposal-size 2048000
```

Those flags are optional, the default value was set as:

```go
wasmtypes.MaxLabelSize = 128
wasmtypes.MaxWasmSize = 819200
wasmtypes.MaxProposalWasmSize = 3145728
```

### Download cw20-ics20 smartcontract
Expand All @@ -78,7 +84,7 @@ You should have a running local rollapp!

### Run local dymension hub node

Follow the instructions on [Dymension Hub docs](https://docs.dymension.xyz/develop/get-started/run-base-layers) to run local dymension hub node
Follow the instructions on [Dymension docs](https://docs.dymension.xyz/validate/dymension/build-dymd?network=localhost) to run local dymension hub node

all scripts are adjusted to use local hub node that's hosted on the default port `localhost:36657`.

Expand Down Expand Up @@ -180,7 +186,3 @@ sh scripts/wasm/deploy_contract.sh
```shell
sh scripts/wasm/ibc_transfer.sh
```

## Developers guide

TODO
Loading

0 comments on commit c45f17b

Please sign in to comment.