Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #462

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ FROM golang:${GO_VERSION}-alpine3.20 AS builder
# TODO: maybe extract below args to where called in cicd?
# git log -1 --format='%H'
ARG GIT_VERSION="v4.0.0"
ARG GIT_COMMIT="cbfe5c259cad5b192e6b6353879e80b1e8f2abd8"
ARG GIT_COMMIT="0c69a80ac7daaf633381744ca5d4f02302aa16df"

ENV PACKAGES="ca-certificates build-base binutils-gold curl make git libc-dev bash file gcc linux-headers eudev-dev"
RUN apk add --no-cache $PACKAGES

# Download go dependencies
WORKDIR /ixo
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

# RUN ARCH=$(uname -m)
# Cosmwasm - Download correct libwasmvm version
Expand All @@ -35,7 +37,9 @@ RUN ARCH=x86_64 && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed
COPY . .

# Build ixod binary
RUN GOWORK=off go build \
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import (
v2 "github.com/ixofoundation/ixo-blockchain/v4/app/upgrades/v2"
v3 "github.com/ixofoundation/ixo-blockchain/v4/app/upgrades/v3"
v4 "github.com/ixofoundation/ixo-blockchain/v4/app/upgrades/v4"
"github.com/ixofoundation/ixo-blockchain/v4/docs"
"github.com/ixofoundation/ixo-blockchain/v4/lib/docs"
"github.com/ixofoundation/ixo-blockchain/v4/lib/ixo"
"github.com/spf13/cast"
)
Expand Down
13 changes: 7 additions & 6 deletions app/upgrades/v4/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
smartaccounttypes "github.com/ixofoundation/ixo-blockchain/v4/x/smart-account/types"
)

// TODO: need details below!!

const (
// UpgradeName defines the on-chain upgrade name for the Ixo v4 upgrade.
UpgradeName = "Dominia"
Expand All @@ -41,15 +39,16 @@ const (
// IsSmartAccountActive is used for the smart account circuit breaker, smartaccounts are activated for v4
IsSmartAccountActive = true
// CircuitBreakerController is a DAODAO address, used only to deactivate the smart account module
CircuitBreakerController = "ixo15rwc9v3jfvypve8zemdr7y68dydsrh9m2urvjn"
// Set to the Impact Hub DAO Security Group
CircuitBreakerController = "ixo1rrf8ydfh23y59vdv2aslvtfsua0vp84yyrg6gwflqht5dpexhxns45j7cd"
)

var (
// LIQUID STAKE PARAMS
// -------------------------------------------------
// total weights must be 10000
WhitelistedValidators = []liquidstaketypes.WhitelistedValidator{
// Launchpad Validator to start with
// Internet of Impacts Launchpad Validator to start with
{
ValidatorAddress: "ixovaloper1kr8v9qt46ysltgmzcrtgyw5ckke83up673u2lu",
TargetWeight: math.NewIntFromUint64(10000),
Expand All @@ -62,12 +61,14 @@ var (
LSMAutocompoundFeeRate = math.LegacyZeroDec()
// LSMWhitelistAdminAddress is the address of the whitelist admin, who is allowed to add/remove whitelisted validators,
// pause/unpause the liquid stake module, and set the weighted rewards receivers.
LSMWhitelistAdminAddress = "ixo15rwc9v3jfvypve8zemdr7y68dydsrh9m2urvjn"
// Set to the ZERO DAO Members Group
LSMWhitelistAdminAddress = "ixo1dwaypqeva5j5p8a0dux9n35lp0aspepnfy9zj45fc9s3wmpvcz4sk6duea"
// LSMWeightedRewardsReceivers is the list of weighted rewards receivers who will recieve the staking rewards based
// on their weights.
LSMWeightedRewardsReceivers = []liquidstaketypes.WeightedAddress{}
// LSMFeeAccountAddress is the address of the fee account, which will receive the autocompound fees.
LSMFeeAccountAddress = "ixo15rwc9v3jfvypve8zemdr7y68dydsrh9m2urvjn"
// Set to the ZERO DAO "LS Fees" entity account
LSMFeeAccountAddress = "ixo1qzngrk3hnpytp9apt7442u3gyr0fyv9y4wvy6u"

// STAKING PARAMS
// -------------------------------------------------
Expand Down
26 changes: 13 additions & 13 deletions app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ func CreateUpgradeHandler(
subspace.Set(ctx, stakingtypes.KeyGlobalLiquidStakingCap, ValidatorLiquidStakingCap)
subspace.Set(ctx, stakingtypes.KeyValidatorLiquidStakingCap, GlobalLiquidStakingCap)
}

// If the subspace is for icq, set the new icq params before migration
// otheriwse chain like ixo devnet with no AllowQueries throw error on emoty bytes decode
// during RunMigrations
if subspace.Name() == icqtypes.ModuleName {
ctx.Logger().Info("Set new icq params before migration")
icqparams := icqtypes.DefaultParams()
icqparams.AllowQueries = wasmbinding.GetStargateWhitelistedPaths()
// Adding SmartContractState query to allowlist
icqparams.AllowQueries = append(icqparams.AllowQueries, "/cosmwasm.wasm.v1.Query/SmartContractState")
subspace.Set(ctx, icqtypes.KeyAllowQueries, icqparams.AllowQueries)
subspace.Set(ctx, icqtypes.KeyHostEnabled, icqparams.HostEnabled)
}
}

// Migrate Tendermint consensus parameters from x/params module to a deprecated x/consensus module.
Expand Down Expand Up @@ -210,19 +223,6 @@ func CreateUpgradeHandler(
liquidStakeParams.FeeAccountAddress = LSMFeeAccountAddress
keepers.LiquidStakeKeeper.SetParams(ctx, liquidStakeParams)

// -------------------------------------------------
// Set the ICQ params in the store
// -------------------------------------------------
ctx.Logger().Info("Set ICQKeeper params")
icqparams := icqtypes.DefaultParams()
icqparams.AllowQueries = wasmbinding.GetStargateWhitelistedPaths()
// Adding SmartContractState query to allowlist
icqparams.AllowQueries = append(icqparams.AllowQueries, "/cosmwasm.wasm.v1.Query/SmartContractState")
err = keepers.ICQKeeper.SetParams(ctx, icqparams)
if err != nil {
return nil, err
}

// -------------------------------------------------
// Set the ICA Host params in the store
// -------------------------------------------------
Expand Down
35 changes: 27 additions & 8 deletions docs/config.json → lib/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@
}
}
},
{
"url": "./tmp-swagger-gen/cosmos/mint/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "MintParams"
}
}
},
{
"url": "./tmp-swagger-gen/cosmos/params/v1beta1/query.swagger.json",
"operationIds": {
Expand Down Expand Up @@ -241,6 +233,33 @@
{
"url": "./tmp-swagger-gen/ixo/iid/v1beta1/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/ixo/epochs/v1beta1/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/ixo/liquidstake/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IXOLiquidStakeParams"
}
}
},
{
"url": "./tmp-swagger-gen/ixo/mint/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IXOMintParams"
}
}
},
{
"url": "./tmp-swagger-gen/ixo/smartaccount/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IXOSmartAccountParams"
}
}
},
{
"url": "./tmp-swagger-gen/ixo/token/v1beta1/query.swagger.json",
"operationIds": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading