Skip to content

Commit

Permalink
Release/v1.7.x (#1733)
Browse files Browse the repository at this point in the history
* beta.0

* wip

* handle celestia inclusion proofs

* tidy versioning

* bump docker build deps

* docker build fixes

* bump all workflows to go1.23

* bump docker containers to go1.23 alpine3.20

* remove relayer Dockerfile

* Release/v1.7.0-rc1 (#1737)

* register inclusion proof implementations

* handle compat mode properly

* fix issue with proof reconstruction from non-zero index

* ensure we unmarshal the result for default tx types

* guard against panic in epoch hook for brand new zone

* fix bug in claims manager if local chain id has multiple hyphens

* update deposit tx tests to use new proof marshalling format

* update test to check value of found

* lint fix

* bump linter to v1.62.0

* fix lint (#1739)

* ignore typecast lints (#1740)

* feat: add periodic delegation balance poling icq (#1741)

* add periodic poling icq

* revert redundant callback

* add completion time field to unbonding record, and populate on acknowledgement; make RR logic ignore unbonding and escrowed tokens, add v1.7.0 upgrade handler (#1742)

* lint fix

* fix tests to reflect RR logic change

* Update icq-relayer/pkg/types/config.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update x/interchainstaking/keeper/ibc_packet_handlers.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* remove redundant import

* go 1.23.3

* Revert "Update x/interchainstaking/keeper/ibc_packet_handlers.go"

This reverts commit 4990cf4.

* Update utils/proofs/proofs.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update utils/proofs/proofs.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update utils/proofs/proofs.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update utils/proofs/proofs.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* lint

---------

Co-authored-by: Joe Bowman <[email protected]>
Co-authored-by: Ajaz Ahmed <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 14, 2024
1 parent e14df24 commit 96439da
Show file tree
Hide file tree
Showing 102 changed files with 6,371 additions and 2,106 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@ on:
pull_request:
branches:
- main
- develop
- unstable
- unstable-v1.5
paths-ignore:
- "quicksilverjs/**"
- "webui/**"
workflow_dispatch:
push:
branches:
- main
- develop
- unstable
- unstable-v1.5
paths-ignore:
- "quicksilverjs/**"
- "webui/**"
Expand All @@ -41,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22.4"
go-version: "1.23.3"
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
Expand Down Expand Up @@ -72,7 +66,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22.4"
go-version: "1.23.3"
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
Expand Down Expand Up @@ -123,6 +117,6 @@ jobs:
${{ runner.os }}-go-
- uses: actions/setup-go@v5
with:
go-version: "1.22.4"
go-version: "1.23.3"
- name: Run simulation tests
run: make test-sim-ci
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.4
go-version: 1.23.3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22.4"
go-version: "1.23.3"

- name: Setup Golang caches
uses: actions/cache@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- develop
- main
paths-ignore:
- 'web-ui/**'
- "web-ui/**"

permissions:
contents: read
Expand All @@ -23,12 +23,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22.x"
go-version: "1.23.3"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57.2
version: v1.62.0
args: --timeout 15m
# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/icq-relayer-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
on:
push:
paths:
- icq-relayer/**
- icq-relayer/**
pull_request:
paths:
- icq-relayer/**
- icq-relayer/**

name: icq-relayer
jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
go-version: [1.23.3]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -25,7 +25,7 @@ jobs:
build:
strategy:
matrix:
go-version: [1.22.x]
go-version: [1.23.3]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
${{ runner.os }}-go-
- uses: actions/setup-go@v5
with:
go-version: "1.22.4"
go-version: "1.23.3"

- name: Run simulation tests
run: make test-sim-non-determinism
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dist
rocksdb
data
heighliner
icq-relayer/icq-relayer

# python script
autotest.py
Expand Down
18 changes: 9 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run:
linters:
disable-all: true
enable:
- exportloopref
- copyloopvar
- errcheck
- gci
- goconst
Expand All @@ -32,10 +32,10 @@ linters:

issues:
exclude-rules:
- text: 'differs only by capitalization to method'
- text: "differs only by capitalization to method"
linters:
- revive
- text: 'Use of weak random number generator'
- text: "Use of weak random number generator"
linters:
- gosec

Expand Down Expand Up @@ -117,9 +117,9 @@ linters-settings:
- name: unhandled-error # enable later, currently covered by errcheck
disabled: true
arguments:
- 'b.WriteString'
- 'respJSON.Write'
- 'fmt.Printf'
- 'fmt.Print'
- 'fmt.Println'
- 'fmt.Fprintf'
- "b.WriteString"
- "respJSON.Write"
- "fmt.Printf"
- "fmt.Print"
- "fmt.Println"
- "fmt.Fprintf"
11 changes: 2 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.4-alpine3.19 AS builder
FROM golang:1.23.3-alpine3.20 AS builder
RUN apk add --no-cache git musl-dev openssl-dev linux-headers ca-certificates build-base

WORKDIR /src/app/
Expand All @@ -9,20 +9,13 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download

#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)

COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
LINK_STATICALLY=true make build

# Add to a distroless container
FROM alpine:3.19
FROM alpine:3.20
COPY --from=builder /src/app/build/quicksilverd /usr/local/bin/quicksilverd
RUN adduser -S -h /quicksilver -D quicksilver -u 1000
USER quicksilver
Expand Down
14 changes: 0 additions & 14 deletions Dockerfile.relayer

This file was deleted.

5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ default_target: all

build_tags = netgo
build_tags += pebbledb
build_tags += osusergo

ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -103,8 +104,8 @@ endif
BUILD_TARGETS := build install

check_version:
ifneq ($(GO_MINOR_VERSION),22)
@echo "ERROR: Go version 1.22 is required for building Quicksilver. Detected version: $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION). There are consensus breaking changes between binaries compiled with different Go versions."
ifneq ($(GO_MINOR_VERSION),23)
@echo "ERROR: Go version 1.23 is required for building Quicksilver. Detected version: $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION). There are consensus breaking changes between binaries compiled with different Go versions."
exit 1
endif

Expand Down
4 changes: 2 additions & 2 deletions app/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (app *Quicksilver) ShipMetrics(ctx sdk.Context) {
buf := &bytes.Buffer{}
defer buf.Reset()

e := expfmt.NewEncoder(buf, expfmt.FmtText)
e := expfmt.NewEncoder(buf, expfmt.NewFormat(expfmt.TypeTextPlain))
for _, mf := range metricsFamilies {
if err := e.Encode(mf); err != nil {
ctx.Logger().Error("Error encoding metrics", "error", err)
Expand All @@ -70,7 +70,7 @@ func (app *Quicksilver) ShipMetrics(ctx sdk.Context) {
ctx.Logger().Error("Error creating metrics request", "error", err)
return
}
req.Header.Set("Content-Type", string(expfmt.FmtText))
req.Header.Set("Content-Type", string(expfmt.NewFormat(expfmt.TypeTextPlain)))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
Expand Down
14 changes: 8 additions & 6 deletions app/tps_counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package app

import (
"context"
"fmt"
"math"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -102,18 +104,18 @@ const (
statusFailure = "failure"
)

func (*tpsCounter) recordValue(ctx context.Context, latest, previous uint64, status status) (int64, error) {
func (tpc *tpsCounter) recordValue(ctx context.Context, latest, previous uint64, status status) (int64, error) {
if latest < previous {
return 0, nil
}

n := int64(latest - previous)
if n < 0 {
// Perhaps we exceeded the uint64 limits then wrapped around, for the latest value.
// TODO: Perhaps log this?
return 0, nil
diff := latest - previous

if diff > math.MaxInt64 {
return 0, fmt.Errorf("difference exceeds int64 max value")
}

n := int64(diff)
statusValue := "OK"
if status == statusFailure {
statusValue = "ERR"
Expand Down
2 changes: 1 addition & 1 deletion app/tps_counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ func (wl *writerLogger) Info(msg string, keyVals ...interface{}) {
defer wl.mu.Unlock()

wl.nTotalTPS += keyVals[1].(float64)
fmt.Fprintf(wl.w, msg+" "+fmt.Sprintf("%s %.2f\n", keyVals[0], keyVals[1]))
fmt.Fprintf(wl.w, "%s %s %.2f\n", msg, keyVals[0], keyVals[1])
}
2 changes: 2 additions & 0 deletions app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const (
V010602UpgradeName = "v1.6.2"
V010603UpgradeName = "v1.6.3"
V010604UpgradeName = "v1.6.4"

V010700UpgradeName = "v1.7.0"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
1 change: 1 addition & 0 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func Upgrades() []Upgrade {
{UpgradeName: V010602UpgradeName, CreateUpgradeHandler: NoOpHandler},
{UpgradeName: V010603UpgradeName, CreateUpgradeHandler: V010603UpgradeHandler},
{UpgradeName: V010604UpgradeName, CreateUpgradeHandler: V010604UpgradeHandler},
{UpgradeName: V010700UpgradeName, CreateUpgradeHandler: V010700UpgradeHandler},
}
}

Expand Down
50 changes: 50 additions & 0 deletions app/upgrades/v1_7.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package upgrades

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/quicksilver-zone/quicksilver/app/keepers"
icstypes "github.com/quicksilver-zone/quicksilver/x/interchainstaking/types"
)

func V010700UpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
appKeepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
if isMainnet(ctx) || isTest(ctx) {

hashes := []struct {
Zone string
Hash string
}{
{Zone: "cosmoshub-4", Hash: "0c8269f04109a55a152d3cdfd22937b4e5c2746111d579935eef4cd7ffa71f7f"},
}
for _, hashRecord := range hashes {
// delete duplicate records.
appKeepers.InterchainstakingKeeper.DeleteWithdrawalRecord(ctx, hashRecord.Zone, hashRecord.Hash, icstypes.WithdrawStatusUnbond)
appKeepers.InterchainstakingKeeper.Logger(ctx).Info("delete duplicate withdrawal record", "hash", hashRecord.Hash, "zone", hashRecord.Zone)
}

err := appKeepers.BankKeeper.MintCoins(ctx, icstypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqatom", sdk.NewInt(50699994))))
if err != nil {
panic(err)
}
err = appKeepers.BankKeeper.SendCoinsFromModuleToModule(ctx, icstypes.ModuleName, icstypes.EscrowModuleAccount, sdk.NewCoins(sdk.NewCoin("uqatom", sdk.NewInt(50699994))))
if err != nil {
panic(err)
}

appKeepers.InterchainstakingKeeper.IterateZones(ctx, func(index int64, zone *icstypes.Zone) (stop bool) {
appKeepers.InterchainstakingKeeper.OverrideRedemptionRateNoCap(ctx, zone)
return false
})

}

return mm.RunMigrations(ctx, configurator, fromVM)
}
}
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,3 @@ services:
- icq-relayer
- run
restart: always
relayer:
image: quicksilverzone/relayer:v2.3.0
build:
context: .
dockerfile: Dockerfile.relayer
volumes:
- ./data/rly:/rly/.relayer
command:
- rly
- start
- demo
#- -p
#- events
#- -b
#- "100"
restart: always
3 changes: 3 additions & 0 deletions docs/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4818,6 +4818,9 @@ paths:
custom method
signatures required by gogoproto.
completion_time:
type: string
format: date-time
pagination:
type: object
properties:
Expand Down
Loading

0 comments on commit 96439da

Please sign in to comment.