Skip to content

Commit

Permalink
Release v1.4.0-rc4 (#290)
Browse files Browse the repository at this point in the history
* x/interchainstaking/keeper: preallocate slice capacity in CalculateDeltas

Given that types.ValidatorIntents is already a slice, this change
just extracts its length and uses that as a slice capacity hint
to improve performance.

Fixes #97

* x/interchainstaking/keeper: use .IncrementBalanceWaitgroup() instead of naked ++

Instead of using a naked increment for an exported struct, this change
uses its .IncrementBalanceWaitgroup() which helps in logical checks.

Fixes #98

* x/interchainstaking/keeper: add fuzzers

Adds fuzzers that we've written to help find vulnerabilities.
While here, using go test -short to skip fuzzing being run in regular
tests per `make test`.

Updates #90

* bump proto-gen container to v0.9.0, to support go 1.19

* add channel close/reopen proposals

* lint/gofumpt

* regen proto files with additional comments

* error catching epochs added

* fixed test cases

* lint fix

* codecov secrets

* add no-op upgrade handler for v1.3.0

* added check for deposit addr (#281)

* Release/v1.3.2 (#285)

* UpdateWithdrawAddress callback patched

* added pagination fix

* keeper-tests added

* add deposit interval test

* add adjacent verification; add deposit callback tests;

* remove ibc/ prefix check from validateBasic

* gofumpt

* add rts functionality; enable/disable unbonding and deposits per zone; store decimals in zone struct; store first_seen and complete timestamps against receipts; add upgrade handler to migrate zones

* rebase fixes

* store added for self-consensus-state

* handle submission of PR claims against Quicksilver

* [WIP] verifying self claims

* added delete method

* claim from local chain

* lint fix

* update epoch hooks in cm

* update zone struct in tests

* support v0.47.x balances returned by kvstore lookup

* lint fix

* fix: harcoded prefix

* feature: [TG-420] add stats to zone(s) endpoints

* lint fixes

* use correct token in error message; fixes i#118

* gofumpt

* remove pedantic error checking in allocateLockupRewards

* defensive check against negative validator vp

* check for nil value in sdkAmount

* make errors deterministic

* improve error handling by propogating error

* be super defensive and check for negative values, not just zero equality

* reject nil value coins

* set the quick prefix in the correct place

* revert backwards incompatible changes to zones and related props

* fix lint

* tests and fixes for TG-416 slash withdrawal fix

* bump tenermint version

* bump tendermint to v0.34.25

* allow port to be reopened via tx

* pr fixes

* verbose logging

* skip zone allocations for zones with no price information

* lint

* extended upgrade handler to clear uni-5 records

* more verbose logging on unbonding satisfaction

* added logic to burn uqjunox

* other records removed and test case added

* lint fix

* check for innuendo specific upgrade-handler

* Deprecation warning fix and testchain included for upgradehandler

* imports tidy

* errors.Register deprecation fix

* deprecation fixes

* lint fix

* fix self consensus state store/delete fns

* ensure cm hooks are registered

* add pebble into default build

---------

Co-authored-by: Emmanuel T Odeke <[email protected]>
Co-authored-by: Ajaz Ahmed Ansari <[email protected]>
  • Loading branch information
3 people authored Feb 7, 2023
1 parent 6b36873 commit 3c296c3
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
COMMIT=$(git log -1 --format='%H') && \
go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-tags "netgo,ledger,muslc,pebbledb" \
-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 \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/make -f
DOCKER_BUILDKIT=1
COSMOS_BUILD_OPTIONS ?= ""
COSMOS_BUILD_OPTIONS ?= "pebbledb"
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation')
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION=$(shell git describe --tags | head -n1)
Expand Down
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ func NewQuicksilver(
app.EpochsKeeper = *epochsKeeper.SetHooks(
epochstypes.NewMultiEpochHooks(
app.MintKeeper.Hooks(),
app.ClaimsManagerKeeper.Hooks(),
app.InterchainstakingKeeper.Hooks(),
app.ParticipationRewardsKeeper.Hooks(),
),
Expand Down
6 changes: 3 additions & 3 deletions x/claimsmanager/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ func (k Keeper) StoreSelfConsensusState(ctx sdk.Context, key string) error {
}

state := selfConsState.(*ibctmtypes.ConsensusState)
k.SetSelfConsensusState(ctx, key, *state)
k.SetSelfConsensusState(ctx, key, state)
} else {
// ONLY FOR TESTING - ibctesting module chains donot follow standard [chainname]-[num] structure
height := ibcclienttypes.Height{
RevisionNumber: 1,
RevisionNumber: 0, // revision number for testchain1 is 0 (because parseChainId splits on '-')
RevisionHeight: uint64(ctx.BlockHeight() - 1),
}

Expand All @@ -75,7 +75,7 @@ func (k Keeper) StoreSelfConsensusState(ctx sdk.Context, key string) error {
}

state := selfConsState.(*ibctmtypes.ConsensusState)
k.SetSelfConsensusState(ctx, key, *state)
k.SetSelfConsensusState(ctx, key, state)

}
return nil
Expand Down
15 changes: 9 additions & 6 deletions x/claimsmanager/keeper/self_consensus_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ import (
// GetSelfConsensusState returns consensus state stored every epoch
func (k Keeper) GetSelfConsensusState(ctx sdk.Context, key string) (ibctmtypes.ConsensusState, bool) {
store := ctx.KVStore(k.storeKey)

var selfConsensusState ibctmtypes.ConsensusState
k.cdc.MustUnmarshal(store.Get(append(types.KeySelfConsensusState, []byte(key)...)), &selfConsensusState)

bz := store.Get(append(types.KeySelfConsensusState, []byte(key)...))
if bz == nil {
return selfConsensusState, false
}
k.cdc.MustUnmarshal(bz, &selfConsensusState)
return selfConsensusState, true
}

// SetSelfConsensusState sets the self consensus state
func (k Keeper) SetSelfConsensusState(ctx sdk.Context, key string, consState ibctmtypes.ConsensusState) {
func (k Keeper) SetSelfConsensusState(ctx sdk.Context, key string, consState *ibctmtypes.ConsensusState) {
store := ctx.KVStore(k.storeKey)
store.Set(store.Get(append(types.KeySelfConsensusState, []byte(key)...)), k.cdc.MustMarshal(&consState))
store.Set(append(types.KeySelfConsensusState, []byte(key)...), k.cdc.MustMarshal(consState))
}

// DeleteSelfConsensusState deletes the self consensus state
func (k Keeper) DeleteSelfConsensusState(ctx sdk.Context, key string, consState ibctmtypes.ConsensusState) {
func (k Keeper) DeleteSelfConsensusState(ctx sdk.Context, key string) {
store := ctx.KVStore(k.storeKey)
store.Delete(store.Get(append(types.KeySelfConsensusState, []byte(key)...)))
store.Delete(append(types.KeySelfConsensusState, []byte(key)...))
}
20 changes: 20 additions & 0 deletions x/claimsmanager/keeper/self_consensus_state_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package keeper_test

func (s *KeeperTestSuite) TestGetSetDelete() {
k := s.GetQuicksilverApp(s.chainA).ClaimsManagerKeeper
ctx := s.chainA.GetContext()

_, found := k.GetSelfConsensusState(ctx, "test")
s.Require().False(found)

err := k.StoreSelfConsensusState(ctx, "test")
s.Require().NoError(err)

_, found = k.GetSelfConsensusState(ctx, "test")
s.Require().True(found)

k.DeleteSelfConsensusState(ctx, "test")

_, found = k.GetSelfConsensusState(ctx, "test")
s.Require().False(found)
}

0 comments on commit 3c296c3

Please sign in to comment.