Skip to content

Commit

Permalink
squashed v10.0.0
Browse files Browse the repository at this point in the history
git diff v10.0.0 - ''

## What's Changed
* Upgrade to Cosmos SDK v50.9 with help from @01builders
* refactor test to have bellow and equal gas transactions by @edjroz in #233
* try running with wasmd 51 by @ash-burnt in #235
* fix: add SetPreblocker that was preventing upgrades from working by @facundomedica in #251
* merge new workflows from main by @2xburnt in #255
## New Contributors
* @facundomedica made their first contribution in #251
**Full Changelog**: v9.0.1...v10.0.0
  • Loading branch information
2xburnt committed Dec 21, 2024
1 parent 9c04c34 commit 25a322b
Show file tree
Hide file tree
Showing 123 changed files with 9,337 additions and 4,695 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ jobs:
uses: burnt-labs/xion/.github/workflows/docker-build.yml@main
secrets: inherit

push-docker:
needs: build-docker
name: Heighliner Build
uses: burnt-labs/xion/.github/workflows/docker-push.yml@main
secrets: inherit

docker-scout:
needs: build-docker
name: Docker Scout
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ env:

jobs:
build-integration-tests:
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.runner.selector }}
strategy:
fail-fast: false
matrix:
runner:
- burnt-labs-amd64
- burnt-labs-arm64
- selector: ubuntu-latest
platform: linux/amd64
# - selector: burnt-labs-arm64
# platform: linux/arm64
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -26,12 +28,13 @@ jobs:
- name: Prepare Environment
run: |
sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod | tee -a $GITHUB_ENV
echo "PLATFORM=linux-$(echo ${{ matrix.runner }} | cut -d- -f3-)" | tee -a $GITHUB_ENV
echo "PLATFORM=${{ matrix.runner.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^${{ env.GO_VERSION }}
cache: false

- name: build go test binary
working-directory: integration_tests
Expand Down Expand Up @@ -59,14 +62,16 @@ jobs:
retention-days: 3

interchain-tests:
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.runner.selector }}
needs: build-integration-tests
strategy:
fail-fast: false
matrix:
runner:
- burnt-labs-amd64
- burnt-labs-arm64
- selector: ubuntu-latest
platform: linux/amd64
# - selector: burnt-labs-arm64
# platform: linux/arm64
test_type:
- "DungeonTransferBlock"
- "XionSendPlatformFee"
Expand Down Expand Up @@ -101,7 +106,7 @@ jobs:
OS: ${{ steps.string.outputs.lowercase }}
run: |
mkdir -p lib
echo "PLATFORM=${OS}-$(echo ${{ matrix.runner }} | cut -d- -f3-)" | tee -a $GITHUB_ENV
echo "PLATFORM=${{ matrix.runner.platform }}" | tr '/' '-' | tee -a $GITHUB_ENV
- name: Download integration test binary
uses: actions/download-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

push-docker:
needs: build-docker
name: Heighliner Build
name: Push Docker Images
uses: burnt-labs/xion/.github/workflows/docker-push.yml@main
secrets: inherit

Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
run : |
set -Eeuo pipefail
upgrade_name=$(echo $GITHUB_REF_NAME | cut -d. -f1)
jq -s '.[0] * .[1]' <(go mod edit -json | jq --arg name $upgrade_name '{
jq -s '.[0] * (.[1] // {})' <(go mod edit -json | jq --arg name $upgrade_name '{
name: $name,
tag: "${{ github.ref_name }}",
height: 0,
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Set up Golang
- name: Prepare Environment
run: |
sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod | tee -a $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ~1.21
- name: Setup Golang caches
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
go-version: ${{ env.GO_VERSION }}

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
129 changes: 65 additions & 64 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.21"
ARG GO_VERSION="1.22"
ARG ALPINE_VERSION="3.18"

# --------------------------------------------------------
Expand All @@ -20,55 +20,55 @@ ARG VERSION

# Consume Args to env
ENV COMMIT=${COMMIT} \
VERSION=${VERSION} \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH}
VERSION=${VERSION} \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH}

# Install dependencies
RUN set -eux; \
apk add --no-cache \
build-base \
ca-certificates \
linux-headers \
#binutils-gold \
git
apk add --no-cache \
build-base \
ca-certificates \
linux-headers \
binutils-gold \
git

# Set the workdir
WORKDIR /go/src/github.com/burnt-labs/xion

# Download go dependencies
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/pkg/mod \
set -eux; \
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0; \
go mod download
--mount=type=cache,target=/root/pkg/mod \
set -eux; \
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0; \
go mod download

# Cosmwasm - Download correct libwasmvm version
RUN set -eux; \
WASMVM_REPO="github.com/CosmWasm/wasmvm"; \
WASMVM_MOD_VERSION="$(grep ${WASMVM_REPO} go.mod | cut -d ' ' -f 1)"; \
WASMVM_VERSION="$(go list -m ${WASMVM_MOD_VERSION} | cut -d ' ' -f 2)"; \
[ ${TARGETPLATFORM} = "linux/amd64" ] && LIBWASM="libwasmvm_muslc.x86_64.a"; \
[ ${TARGETPLATFORM} = "linux/arm64" ] && LIBWASM="libwasmvm_muslc.aarch64.a"; \
[ ${TARGETOS} = "darwin" ] && LIBWASM="libwasmvmstatic_darwin.a"; \
[ -z "$LIBWASM" ] && echo "Arch ${TARGETARCH} not recognized" && exit 1; \
wget "https://${WASMVM_REPO}/releases/download/${WASMVM_VERSION}/${LIBWASM}" -O "/lib/${LIBWASM}"; \
# verify checksum
EXPECTED=$(wget -q "https://${WASMVM_REPO}/releases/download/${WASMVM_VERSION}/checksums.txt" -O- | grep "${LIBWASM}" | awk '{print $1}'); \
sha256sum "/lib/${LIBWASM}" | grep "${EXPECTED}"; \
cp /lib/${LIBWASM} /lib/libwasmvm_muslc.a;
WASMVM_REPO="github.com/CosmWasm/wasmvm"; \
WASMVM_MOD_VERSION="$(grep ${WASMVM_REPO} go.mod | cut -d ' ' -f 1)"; \
WASMVM_VERSION="$(go list -m ${WASMVM_MOD_VERSION} | cut -d ' ' -f 2)"; \
[ ${TARGETPLATFORM} = "linux/amd64" ] && LIBWASM="libwasmvm_muslc.x86_64.a"; \
[ ${TARGETPLATFORM} = "linux/arm64" ] && LIBWASM="libwasmvm_muslc.aarch64.a"; \
[ ${TARGETOS} = "darwin" ] && LIBWASM="libwasmvmstatic_darwin.a"; \
[ -z "$LIBWASM" ] && echo "Arch ${TARGETARCH} not recognized" && exit 1; \
wget "https://${WASMVM_REPO}/releases/download/${WASMVM_VERSION}/${LIBWASM}" -O "/lib/${LIBWASM}"; \
# verify checksum
EXPECTED=$(wget -q "https://${WASMVM_REPO}/releases/download/${WASMVM_VERSION}/checksums.txt" -O- | grep "${LIBWASM}" | awk '{print $1}'); \
sha256sum "/lib/${LIBWASM}" | grep "${EXPECTED}"; \
cp /lib/${LIBWASM} /lib/libwasmvm_muslc.a;

# Copy local files
COPY . .

# Build xiond binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/pkg/mod \
set -eux; \
export CGO_ENABLED=1 LINK_STATICALLY=true BUILD_TAGS=muslc; \
make test-version; \
make install;
--mount=type=cache,target=/root/pkg/mod \
set -eux; \
export CGO_ENABLED=1 LINK_STATICALLY=true BUILD_TAGS=muslc; \
make test-version; \
make install;

# --------------------------------------------------------
# Heighliner
Expand Down Expand Up @@ -102,36 +102,37 @@ RUN ["busybox", "ln", "/bin/busybox", "sh"]
# Will then only have one copy of the busybox minimal binary file with all utils pointing to the same underlying inode
RUN set -eux; \
for bin in \
cat \
date \
df \
du \
env \
grep \
head \
less \
ls \
md5sum \
pwd \
sha1sum \
sha256sum \
sha3sum \
sha512sum \
sleep \
stty \
tail \
tar \
tee \
tr \
watch \
which \
cat \
date \
df \
du \
env \
grep \
head \
less \
ls \
md5sum \
pwd \
sha1sum \
sha256sum \
sha3sum \
sha512sum \
sleep \
stty \
tail \
tar \
tee \
tr \
watch \
which \
; do busybox ln /bin/busybox $bin; \
done;
done;

RUN set -eux; \
busybox mkdir -p /home/heighliner; \
busybox mkdir -p /tmp /home/heighliner; \
busybox addgroup --gid 1025 -S heighliner; \
busybox adduser --uid 1025 -h /home/heighliner -S heighliner -G heighliner; \
busybox chown 1025:1025 /tmp /home/heighliner; \
busybox unlink busybox;

WORKDIR /home/heighliner
Expand All @@ -157,14 +158,14 @@ EXPOSE 26657
EXPOSE 26660

RUN set -euxo pipefail; \
apk add --no-cache bash openssl curl htop jq lz4 tini; \
addgroup --gid 1000 -S xiond; \
adduser --uid 1000 -S xiond \
--disabled-password \
--gecos xiond \
--ingroup xiond; \
mkdir -p /home/xiond; \
chown -R xiond:xiond /home/xiond
apk add --no-cache bash openssl curl htop jq lz4 tini; \
addgroup --gid 1000 -S xiond; \
adduser --uid 1000 -S xiond \
--disabled-password \
--gecos xiond \
--ingroup xiond; \
mkdir -p /home/xiond; \
chown -R xiond:xiond /home/xiond

USER xiond:xiond
WORKDIR /home/xiond/.xiond
Expand Down
26 changes: 16 additions & 10 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/larry0x/abstract-account/x/abstractaccount"
aakeeper "github.com/larry0x/abstract-account/x/abstractaccount/keeper"
feeabsante "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/ante"
feeabskeeper "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/keeper"
feeabsante "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/ante"
feeabskeeper "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/keeper"

ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
"github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
"github.com/cosmos/ibc-go/v8/modules/core/keeper"

corestoretypes "cosmossdk.io/core/store"
errorsmod "cosmossdk.io/errors"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand All @@ -31,7 +31,7 @@ type HandlerOptions struct {

IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
TXCounterStoreKey storetypes.StoreKey
TXCounterStoreService corestoretypes.KVStoreService
GlobalFeeSubspace paramtypes.Subspace
StakingKeeper *stakingkeeper.Keeper
AbstractAccountKeeper aakeeper.Keeper
Expand All @@ -57,8 +57,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.GlobalFeeSubspace.Name() == "" {
return nil, errorsmod.Wrap(sdkerrors.ErrNotFound, "globalfee param store is required for AnteHandler")
}
if options.TXCounterStoreKey == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
if options.TXCounterStoreService == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm store service is required for ante builder")
}
if options.FeeAbsKeeper == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "fee abstraction keeper is required for AnteHandler")
Expand All @@ -67,11 +67,17 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
// this changes the minGasFees,
// and must occur before gas fee checks
globalfeeante.NewFeeDecorator(options.GlobalFeeSubspace, options.StakingKeeper.BondDenom),
globalfeeante.NewFeeDecorator(options.GlobalFeeSubspace, func(context sdk.Context) string {
bondDenom, err := options.StakingKeeper.BondDenom(context)
if err != nil {
panic(err)
}
return bondDenom
}),
feeabsante.NewFeeAbstrationMempoolFeeDecorator(*options.FeeAbsKeeper),

// validation checks
Expand Down
Loading

0 comments on commit 25a322b

Please sign in to comment.