Skip to content

Commit

Permalink
Merge v1.0.0 into main (#261)
Browse files Browse the repository at this point in the history
* update participation rewards to support storing lastEpoch claim records, and use these to inform intentSignalChanges
* update aggegate intent to consider offchain assets as per PR claims
* add tests for intent aggregation, inclusion of off chain assets in calculation
* lint fixes
* osmosis-upgrade: v12.0.0
- added osmosis-types/appparams;
- updated osmosis-types/gamm;
- updated osmosis-types/lockup;
* add pr valdiation for osmosis pools
* gofumpt
* fix lint error
* fix app.go ordering for setting of participation rewards
* release/v0.9.4 - add redelegation records (not yet used), fix PR submodules, move epochblock callback from ICS to PR
* use ledger-go v0.9.3 to support ledger nano s plus
* fix statusCompleted bug, fix rebalance / epochInfo bug; add tests
* DOCKER_BUILDKIT in makefile
* revert ordering in app.go
* use memo to pass epoch identifier when rebalancing
* hot-fix: participation-rewards scores
- fixed incorrect logic condition;
* ensure we only use OPEN transfer channels, not just the first one we come across
* update multi test for 0.46
* fix typo
* add v0.9.5 upgrade handler
* .github/workflows: add gosec + staticmajor
This change adds 2 static analyzers:
* Gosec with custom rules for the Cosmos-SDK & Cosmos ecosystem
* Staticmajor to catch leaking resources + performance issues
* fix withdrawal status complete bug; add tests; remove debug logging
* fixes #29; properly wrap errors in log output
* osmosis PR fixes
* ancilliary changes
* dragonberry; bump sdk to v0.46.2, bump ibc-go to v0.5.0
* show chain in ICQ log messages
* use a constant for Osmosis PoolsPrefix
* gofumpt
* lint fix
* further lint fixes
* Bump github.com/gogo/protobuf from 1.3.1 to 1.3.2 in /ics23
* .github/workflows: disable staticmajor till WASM deps are fixed
* x/*: fix expensive and unnecessary string constructions with b.WriteString(fmt.Sprint...)
* Benchmarks
Also while here fixed unnecessary uses of fmt.Errorf("...") to instead
use errors.New("...")
* participation-rewards: tests & updates (wip)
- updated incorrect proto comment;
- update static test addresses to use utils;
- updated genesis tests;
- updated epoch tests;
- updated query tests;
- added "epoch" to DefaultGenesis;
- gofumpt update;
- updated tests to use correct keys;
- added grpc query tests;
- test keeper updated with multiple zones;
- moved UnmarshalProtocolData test to types;
- added appropriate AddProtocolDataProposal tests;
- HandleAddProtocolDataProposal now calls ValidateBasic on proposal;
- updated proposal ValidateBasic;
* tests: minor fixes
* testing: participationrewards updates & fixes
- go mod updates
- removed PoolsPrefix from validation.go
- removed incorrect comment from osmosis-types/codec.go
- added osmosis-types/pool-models
- added ProtocolDataType to proto
- removed unnecessary protocol string
- updated protocoldata query
- updated callbacks
- added claims_test
- updated claim key usage
- updated ProtocolData grpc_query
- updated keeper_test
- added GetCodec to keeper
- added msg_server_test
- updated participationrewards codec with osmosis-types
- added tests in genesis_test
- added new key getters
- fixed TestNewMsgSubmitClaim
- added SrcZone to ValidateBasic
- added tests for osmosis_params
- updated many tests
* testing: participationrewards
- LastUpdated now updates on callback
- updated keeper_test with ibc/denoms (?order?)
- hackey unmarshal to deal with concrete type
- added intermediary for unmarshal
* testing: participationrewards
- fixed unmarshal test
* fix icq bug
* add type field to osmosis pool protocol data
* add prefix to connection protocol data
* tests: added pooltype and prefix to tests
- fixed lint issue (naming);
* add originChainId to liquidToken protocoldata
* tests: updated tests for OriginChainID
* testing: updates & fixes
- added nil guard for balance.Amount in UpdateIntent (interchainstaking)
- moved executeOsmosisPoolUpdateCallback to callback_test
- restructured claim_test for reusability
- added tests for IterateLastEpochUserClaims (debugging)
- added fn nil guard to participationrewards iterators
- participationrewards keeper test suite (wip) updates
* change ordering of app.go to avoid panic in interchainstakingkeeper.UpdateIntent()
* claimsmanager: prepare new module for integration
* x/participationrewards/client/cli: move inexpensive/unrelated checks first in GetSubmitClaimTxCmd
Noticed in an audit that it was unnecessary to read an entire file, then
JSON unmarshal it then later on throw away all that work if the
claimTypeStr value wasn't known in types.ClaimType_value
* claimsmanager
* x/participationrewards/client/cli: move inexpensive/unrelated checks first in GetSubmitClaimTxCmd
Noticed in an audit that it was unnecessary to read an entire file, then
JSON unmarshal it then later on throw away all that work if the
claimTypeStr value wasn't known in types.ClaimType_value
* testing: updates & fixes
- added nil guard for balance.Amount in UpdateIntent (interchainstaking)
- moved executeOsmosisPoolUpdateCallback to callback_test
- restructured claim_test for reusability
- added tests for IterateLastEpochUserClaims (debugging)
- added fn nil guard to participationrewards iterators
- participationrewards keeper test suite (wip) updates
* claimsmanager: prepare new module for integration
* add queries; fix missing type
* gofumpt
* add v0.10.0 upgrade handler
* no context for logger
* call upgradeStoreLoader only within upgrade handler
* call setStoreLoader earlier
* Add test for x/interchainstaking/keeper.AllBalancesCallback
* Add test for x/interchanstaking/keeper.AccountBalanceCallback
* add osmosis forceprune
* update proto def tags for json
* security: started a SECURITY.md file
* use gogoproto.jsontag field
* bump sdk / tm
* update pr codec
* implement legacytx.LegacyMsg interface for particitipationrewards msgs
* revert jsontags
* release: revert to sdk 46.2 & lint fixes
* minor fixes
* claim validation needs to use source zone height
* prove against connectiondata connection and chain, and not zone
* migrate x/participationrewards/types.Proof to x/claimsmanager; refactor x/airdrop and x/participationrewards to use x/claimsmanager.Proof
* fixup queries
* update field names on AllowLiquidTokenDenom protocoldata to avoid confusion
* ibc 501
* Update go.mod
* Update go.mod
* local assets removal from intents and PR
- removed unutilized AllOrdinalizedIntents func
- removed local assets from AggregateIntents logic
- removed local assets from UpdateIntents logic
- removed local assets from calcUserHoldingsAllocations logic
- updated tests
* local asset removal: lint fixes
* updated go.sum (ics32 v0.8.0)
* temporarily remove gosec.yml
* local assets removal: update
- calcUserHoldingsAllocations now uses iterator
* local assets removal: updated user claim calc
- removed userAmount internal struct
- user amount now computes across claim types
* make cm user queries cross zone
* fix incorrect denom, fixes #57
* revert key for osmosis params type; fixed #59
* payload in claim will always be Lock, not LockedResponse, as it refers to a kv store entry, not a query response
* off by one error in the key matching logic; fixes #61
* add logic to trigger client update at the epoch boundary; fixes #60
* remove ics23 path from Dockerfile copy
* Add test for x/interchainstaking/keeper.AllBalancesCallback
* Add test for x/interchanstaking/keeper.AccountBalanceCallback
* testing: claimsmanager
- moved testaddress to keeper_test
- renamed predefined claims to testClaims
- added Queries tests
* testing: test script updates
* testing: mock validation and better coverage (wip)
- added mock flag for app instantiation;
- added convert address to prefix (utils);
- added ProofOpsFn type;
- added MockProofOps that always succeeds (wip);
- added receipts and claims to PR tests;
- added/extended MsgServer tests;
* testing: rebase cleanup & fixes
* testing:
- added ValidatorSelectionRewardsCallback test;
- extended keeper_test (replicating ICA setup from interchainstaking);
- will be done on rebase
- added appropriate callback payload for test suite
- removed manual performance account for chainB
- removed manual connection from connection keeper
- setting validators now records rewards for test
- setupChannelForICA now part of KeeperTestSuite
- added PortPath capability
- added and commented out channel reopen logic test (still fails)
- updated claim_tests with zero value claim
- added efficiency optimization to distributeToUsers
- added receipts, intents and claims to core test
- added and commented some debug output
* testing: post rebase fixes & updates
* allow callbackId to be zero-length string in makeRequest()
* fix address conversion in pr distribution
* relative_weight -> weight
* add debug logging to intent calcs
* fix claims manager lookup for user claims (ensure we include 0x00 separator)
* add additional logging to update intent with claims
* fix div by zero
* revert clientUpdate query pruning
* pass zone by reference into aggregateIntents
* add json_tag to valoper_address in validator intent
* ensure that query height for epoch boundary is not +1, as icq relayer already adds 1 to fetch header for ClientUpdate
* change MsgSignalIntent msg to use a string representation of intent, to avoid (un)marshalling issues
* bump to v0.46.4 of cosmos-sdk and v0.34.23 of tendermint
* bump to ibc-go v5.1.0
* fix tests broken with MsgSignalIntent changes;
* patch wasmd
* add upgrade handler for v0.10.1
* Update changelog
* chore: gofumpt
* isActiveChannel() does not check state; use GetOpenActiveChannel() instead
* add performance delegations getter/setter logic
* lint
* fix lsm redemption flow; do not trigger redemption queueing
* allow connection_id to be changed for uninitialised zones; add protection to ensure that connections and clients are valid and active at the point the proposal runs
* fix transfer channel lookup
* add upgrade handler for v0.10.3 and comment out ensureICA logic
* fix swapped args to hasPrefix
* bump sdk, golang, math, tendermint
* fix codecov.yml
* add code coverage to tests
* clean up plus some tests
* gofumpt
* minor: fix (ics): implement receipt error handling
* chunk ica messages into batches, for smaller ibc txs
* testing: Liquid ProtocolData test update
- callback test for SetEpochBlockCallback;
- issue with empty key vs empty module check;
* testing: refactor
- keeper_test refactored for better clarity and adaptability;
- AllKeyedProtocolDatas covered;
* testing: claimsmanager keys
- added test for GetPrefixUserClaim;
- added test for GetPrefixLastEpochUserClaim;
* testing: wip update
- SetEpochBlockCallback test added
* patch: testing (ics): add query tests
- removed debug output from icq keeper;
- SetupZones renamed to setupTestZones;
- add grpc_query_test.go;
- removed superfluous found check in DelegatorIntent;
- removed double import from ibc_packet_handlers;
- intent_test now uses int64 instead of sdk.Coin;
- refactor keeper_test;
- TestOwnerAddress renamed to testAddress;
* patch: testing (ics): fix channel status issue
- UpdateTime() breaks channel status checks;
* initial changes to selective delegation; validator callback test
* fix callback test
* gofumpt+lint
* ensure unbonding always takes place before rebalance
* remove unused func
* update error message to be less scary
* fix status for rebalancing test
* make rebalancing consider existing redelegations, and check for validator status; set TG-147 #closed
* gofumpmt
* more linty goodness
* x/interchainstaking/keeper: create Pagination if nil in DepositIntervalCallback
* x/interchainstaking/keeper: create PageRequest if unmarshalled as nil
* x/interchainstaking/keeper: valid Coin inside AccoutBalanceCallback to avoid crash
* TG-170 #closed - initialise pagination object in repeat query
* add gating to participation rewards claims and unbonding
* add missing getParam methods
* fix tests that were negated by unbonding and pr gating
* Apply suggestions from code review
* patch: tests (ics): additional test coverage
- delegation store
- intent store
- msg_server (add some debug output)
- minor fix in keeper_test
* patch: tests (ics): resolve merge issues
* patch: test (ics): lint
- spelling...
* update unbonding to respect locked tokens
* lint fixes
* fix request redemption tests that now require delegation objects to exist in kv store
* fix param upgrades in handler
* add callback tests for setting balances
* bump dependencies
* lint
* release/v0.10.6
* lookup redelegation record by the correct address
* add no-op upgrade handler
* add upgrade handler for v0.10.8
* .github/workflows, Makefile: add Go vulnerability checker
* CVE GO-2022-1143 https://pkg.go.dev/vuln/GO-2022-1143
* CVE GO-2022-1144 https://pkg.go.dev/vuln/GO-2022-1144
* all: use len(args) == 0 instead of bytes.Equal(args, []byte(""))
* v0.46.7: important security update
* patch: fix (ics): performance delegations
* ensure we only build against go1.19
* Update x/interchainstaking/types/zones.go

Co-authored-by: Zanicar <[email protected]>
Co-authored-by: Emmanuel T Odeke <[email protected]>
Co-authored-by: Elias Naur <[email protected]>
Co-authored-by: Jacob Gadikian <[email protected]>
  • Loading branch information
5 people authored Dec 15, 2022
1 parent 68483f2 commit 6371729
Show file tree
Hide file tree
Showing 415 changed files with 75,574 additions and 25,022 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ name: compile quicksilver
# or API.
on: [push, pull_request, workflow_dispatch]

# This workflow makes x86_64 and arm binaries for windows, and linux.
# This workflow makes x86_64 for windows, and linux.

jobs:
build:
strategy:
matrix:
targetos: [linux, windows]
arch: [amd64, arm64]
arch: [amd64]
runs-on: ubuntu-latest
name: build quicksilver
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.18'
go-version: '^1.19.4'
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
Expand All @@ -40,6 +40,7 @@ jobs:
make install
- name: Archive quicksilver binaries
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: quicksilverd-${{ matrix.targetos }}-${{ matrix.arch }}
Expand All @@ -53,7 +54,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.18'
go-version: '^1.19.4'
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
Expand All @@ -70,7 +71,19 @@ jobs:
- name: test quicksilver
run: |
make test
make test-unit-cover
cat coverage.txt | grep .pb.go -v | grep .pb.gw.go -v | grep osmosis-types -v > coverage_nogen.txt
- name: "Go vulnerability checks"
run: make vulncheck

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage_nogen.txt
flags: unittests
fail_ci_if_error: true
verbose: true


4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ data

# python script
autotest.py
scripts/wallets.sh

# Coverage
coverage.txt
11 changes: 7 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ run:
tests: false
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
skip-dirs:
- osmosis-types/*

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- goconst
- gocritic
- gofmt
- gofumpt
- goimports
- revive
- gosec
- gosimple
Expand All @@ -25,11 +24,15 @@ linters:
- nakedret
- exportloopref
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- unparam
- misspell
- nolintlint

exclude-rules:
- linters:
- nolintlint
text: "should be written without leading space"
20 changes: 8 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# Changelog

## Unreleased
### v0.6.0
- Minor fixes and improvements. No functional change.
- Genesis import / export
- Don't store zone struct in deposit receipt #151
- Fetch remote zone height at epoch boundary for PR calculations #161

## Released
### v0.5.1
- Linting and formatting. No functional change.
### v0.10.1
- Fix signal intents pass-by-value bug
- Refactor MsgSignalIntent to fix amino (un)marshal issue
- Fix off-by-one error in epoch end client update
- Bump Cosmos-SDK to v0.46.4
- Bump Tendermint to v0.34.23
- Bump ibc-go to v5.1.0
- Bump Wasmd

### v0.5.0
- Add initial airdrop module
- Make Tx Queries provable
37 changes: 32 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
FROM golang:1.18-alpine3.15 AS builder
RUN apk add --no-cache make git gcc musl-dev openssl-dev linux-headers
FROM golang:1.19-alpine3.17 AS builder
RUN apk add --no-cache git musl-dev openssl-dev linux-headers ca-certificates build-base

WORKDIR /src/app/

COPY go.mod go.sum* ./
RUN go mod download

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/v1.0.0/libwasmvm_muslc.$(uname -m).a \
-O /lib/libwasmvm_muslc.a

# Cosmwasm - verify checksum
RUN wget https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep $(uname -m) | cut -d ' ' -f 1)

COPY . .
RUN make build
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
VERSION=$(echo $(git describe --tags) | sed 's/^v//') && \
COMMIT=$(git log -1 --format='%H') && \
go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags "-X github.com/cosmos/cosmos-sdk/version.Name="quicksilver" \
-X github.com/cosmos/cosmos-sdk/version.AppName="quicksilverd" \
-X github.com/cosmos/cosmos-sdk/version.Version=$VERSION \
-X github.com/cosmos/cosmos-sdk/version.Commit=$COMMIT \
-X github.com/cosmos/cosmos-sdk/version.BuildTags='netgo,ledger,muslc' \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /src/app/build/ \
./...

# Add to a distroless container
FROM alpine:3.15
FROM alpine:3.17
COPY --from=builder /src/app/build/quicksilverd /usr/local/bin/quicksilverd
RUN adduser -S -h /quicksilver -D quicksilver -u 1000
USER quicksilver
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.hermes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apt update && apt install git -y

WORKDIR /app/src

RUN git clone https://github.com/informalsystems/ibc-rs --branch v0.15.0
RUN git clone https://github.com/informalsystems/ibc-rs --branch v1.0.0

WORKDIR ibc-rs

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.osmosis
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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 v10.1.1
RUN git clone https://github.com/osmosis-labs/osmosis /osmosis --branch v12.1.0
WORKDIR /osmosis

# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.relayer
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.18-alpine3.15 AS builder
RUN apk add --no-cache make git gcc musl-dev openssl-dev linux-headers

RUN git clone https://github.com/ingenuity-build/relayer --branch master /src/app
RUN git clone https://github.com/cosmos/relayer --branch v2.1.1 /src/app
WORKDIR /src/app/

RUN go mod download
Expand Down
Loading

0 comments on commit 6371729

Please sign in to comment.