Skip to content

Commit

Permalink
Merge branch 'main' into add-seeds-for-easy-mainnet-connect-and-webui
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat authored Dec 31, 2023
2 parents 0859212 + 79b93f6 commit 6034b8b
Show file tree
Hide file tree
Showing 53 changed files with 551 additions and 282 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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ updates:
interval: daily
open-pull-requests-limit: 20
ignore:
- github.com/cosmos/cosmos-sdk
- dependency-name: "github.com/cosmos/cosmos-sdk"
labels:
- automerge
- dependencies
4 changes: 2 additions & 2 deletions .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v3
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@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: devskim-results.sarif
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
4 changes: 4 additions & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import (
"github.com/quicksilver-zone/quicksilver/x/participationrewards"
participationrewardsclient "github.com/quicksilver-zone/quicksilver/x/participationrewards/client"
participationrewardstypes "github.com/quicksilver-zone/quicksilver/x/participationrewards/types"
"github.com/quicksilver-zone/quicksilver/x/supply"
supplytypes "github.com/quicksilver-zone/quicksilver/x/supply/types"
"github.com/quicksilver-zone/quicksilver/x/tokenfactory"
tokenfactorytypes "github.com/quicksilver-zone/quicksilver/x/tokenfactory/types"
Expand Down Expand Up @@ -110,6 +111,7 @@ var (
airdrop.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
wasm.AppModuleBasic{},
supply.AppModuleBasic{},
)

// module account permissions.
Expand Down Expand Up @@ -178,6 +180,7 @@ func appModules(
airdrop.NewAppModule(appCodec, app.AirdropKeeper),
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
supply.NewAppModule(appCodec, app.SupplyKeeper),
}
}

Expand Down Expand Up @@ -216,6 +219,7 @@ func simulationModules(
participationrewards.NewAppModule(appCodec, app.ParticipationRewardsKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper),
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
// supply.NewAppModule(appCodec, app.SupplyKeeper),
// wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
}
}
Expand Down
2 changes: 2 additions & 0 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func Setup(t *testing.T, isCheckTx bool) *Quicksilver {
EmptyAppOptions{},
GetWasmOpts(EmptyAppOptions{}),
false,
false,
)

genesisState := NewDefaultGenesisState()
Expand Down Expand Up @@ -142,6 +143,7 @@ func SetupTestingApp() (testApp ibctesting.TestingApp, genesisState map[string]j
EmptyAppOptions{},
GetWasmOpts(EmptyAppOptions{}),
true, // set mock state to true
false,
)
return app, NewDefaultGenesisState()
}
Expand Down
12 changes: 6 additions & 6 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ func (app *Quicksilver) setUpgradeStoreLoaders() {
var storeUpgrades *storetypes.StoreUpgrades

switch upgradeInfo.Name { // nolint:gocritic
// case v001000UpgradeName:

// storeUpgrades = &storetypes.StoreUpgrades{
// Added: []string{claimsmanagertypes.ModuleName},
// }

case upgrades.V010402rc3UpgradeName:

storeUpgrades = &storetypes.StoreUpgrades{
Expand All @@ -57,6 +51,12 @@ func (app *Quicksilver) setUpgradeStoreLoaders() {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{supplytypes.ModuleName},
}

case upgrades.V010405UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{packetforwardtypes.ModuleName, supplytypes.ModuleName},
}

default:
// no-op
}
Expand Down
11 changes: 9 additions & 2 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import (
// upgrade name consts: vMMmmppUpgradeName (M=Major, m=minor, p=patch).
const (
ProductionChainID = "quicksilver-2"
RhyeChainID = "rhye-1"
DevnetChainID = "magic-1"
RhyeChainID = "rhye-2"
DevnetChainID = "magic-2"
TestChainID = "testchain1"
OsmosisTestnetChainID = "osmo-test-5"
JunoTestnetChainID = "uni-6"
StargazeTestnetChainID = "elgafar-1"
SommelierChainID = "sommelier-3"

// testnet upgrades
V010402rc1UpgradeName = "v1.4.2-rc1"
V010402rc2UpgradeName = "v1.4.2-rc2"
V010402rc3UpgradeName = "v1.4.2-rc3"
Expand All @@ -41,6 +42,12 @@ const (
V010404rc3UpgradeName = "v1.4.4-rc.3"
V010404rc4UpgradeName = "v1.4.4-rc.4"
V010405rc0UpgradeName = "v1.4.5-rc0"
V010405rc2UpgradeName = "v1.4.5-rc2"
V010405rc3UpgradeName = "v1.4.5-rc3"
V010405rc4UpgradeName = "v1.4.5-rc4"

// mainnet upgrades
V010405UpgradeName = "v1.4.5"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
4 changes: 4 additions & 0 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func Upgrades() []Upgrade {
{UpgradeName: V010404rc2UpgradeName, CreateUpgradeHandler: V010404beta10UpgradeHandler},
{UpgradeName: V010404rc3UpgradeName, CreateUpgradeHandler: NoOpHandler},
{UpgradeName: V010404rc4UpgradeName, CreateUpgradeHandler: NoOpHandler},
{UpgradeName: V010405rc2UpgradeName, CreateUpgradeHandler: NoOpHandler},
{UpgradeName: V010405rc3UpgradeName, CreateUpgradeHandler: NoOpHandler},
{UpgradeName: V010405rc4UpgradeName, CreateUpgradeHandler: NoOpHandler},
{UpgradeName: V010405UpgradeName, CreateUpgradeHandler: NoOpHandler},
}
}

Expand Down
Loading

0 comments on commit 6034b8b

Please sign in to comment.