Skip to content

Commit

Permalink
Merge pull request #2767 from Sifchain/release/0.13.3
Browse files Browse the repository at this point in the history
v0.13.3
  • Loading branch information
timlind authored May 19, 2022
2 parents cfeae11 + b862031 commit c904f56
Show file tree
Hide file tree
Showing 23 changed files with 482 additions and 303 deletions.
69 changes: 9 additions & 60 deletions .github/workflows/peggy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,66 +6,15 @@ on:
- 'future/peggy2'

jobs:
build:
dispatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get commit hash
id: hash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build docker images
working-directory: docs/peggy
run: |
docker build -t sifchain/peggy-docs:${{ steps.hash.outputs.sha_short }} .
- name: Push docker images
run: |
docker push sifchain/peggy-docs:${{ steps.hash.outputs.sha_short }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/github-script@v6
with:
repository: Sifchain/sifchain-devops
path: sifchain-devops
token: "${{ secrets.GIT_PAT }}"

- name: Get commit hash
id: hash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Configure AWS Credentials
working-directory: sifchain-devops
run: |
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
AWS_REGION=${{ secrets.AWS_REGION }} \
AWS_ROLE=${{ secrets.AWS_ROLE }} \
PROFILE=sifchain-aws-sifchain-data \
make provider-aws-configure
- name: Generate kubernetes config
working-directory: sifchain-devops
run: |
CLUSTER_NAME=sifchain-aws-sifchain-data \
AWS_REGION=${{ secrets.AWS_REGION }} \
AWS_PROFILE=sifchain-aws-sifchain-data \
AWS_ROLE=${{ secrets.AWS_ROLE }} \
make provider-aws-kubeconfig
- name: Deploy peggy docs
working-directory: sifchain-devops
run: |
helm upgrade peggy-docs helm/standalone/peggy-docs --install -n peggy-docs \
--create-namespace \
--set image.tag=${{ steps.hash.outputs.sha_short }}
github-token: ${{ secrets.GIT_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
repo: 'sifchain/sifchain-chainops',
workflow_id: 'peggy-deploy-docs-peggy-2.yml',
ref: 'main'
})
56 changes: 15 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,22 @@ on:
- published

jobs:
release:
name: Release
dispatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
repository: Sifchain/sifchain-devops
path: sifchain-devops
token: "${{ secrets.GIT_PAT }}"

- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get version
id: version
run: |
echo "::set-output name=version::$(cat version)"
- name: Build docker images
run: |
make IMAGE_TAG=${{ steps.version.outputs.version }} BINARY=sifnoded build-image
make IMAGE_TAG=${{ steps.version.outputs.version }} BINARY=ebrelayer build-image
- name: Push docker images
run: |
docker push sifchain/sifnoded:${{ steps.version.outputs.version }}
docker push sifchain/ebrelayer:${{ steps.version.outputs.version }}
- name: Get commit hash
id: hash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Get the tag
id: release_tag
run: echo ::set-output name=name::${GITHUB_REF/refs\/tags\//}

- name: Release a new sifnoded binary
uses: ./sifchain-devops/release
- uses: actions/github-script@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: amd64
goversion: "1.17"
project_path: "./cmd/sifnoded"
binary_name: "sifnoded"
ldflags: "-X github.com/cosmos/cosmos-sdk/version.Name=sifchain -X github.com/cosmos/cosmos-sdk/version.ServerName=sifnoded -X github.com/cosmos/cosmos-sdk/version.ClientName=sifnoded -X github.com/cosmos/cosmos-sdk/version.Version=${{ steps.version.outputs.version }} -X github.com/cosmos/cosmos-sdk/version.Commit=${{ steps.hash.outputs.sha_short }}"
sha256sum: true
github-token: ${{ secrets.GIT_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
repo: 'sifchain/sifchain-chainops',
workflow_id: 'sifnode-release.yml',
ref: 'main',
inputs: {
release_tag: ${{ steps.release_tag.outputs.name }}
}
})
21 changes: 1 addition & 20 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
package app

import (
clptypes "github.com/Sifchain/sifnode/x/clp/types"
dispensationtypes "github.com/Sifchain/sifnode/x/dispensation/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
m "github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const releaseVersion = "0.13.2"
const releaseVersion = "0.13.3"

func SetupHandlers(app *SifchainApp) {
app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm m.VersionMap) (m.VersionMap, error) {
app.Logger().Info("Running upgrade handler for " + releaseVersion)
amt, ok := sdk.NewIntFromString("150000000000000000000000000")
if !ok {
panic("error converting mint amount")
}
mintCoins := sdk.NewCoins(sdk.NewCoin(clptypes.GetSettlementAsset().Symbol, amt))
err := app.BankKeeper.MintCoins(ctx, dispensationtypes.ModuleName, mintCoins)
if err != nil {
panic(err)
}
address, err := sdk.AccAddressFromBech32("sif1ct2s3t8u2kffjpaekhtngzv6yc4vm97xajqyl3")
if err != nil {
panic(err)
}
err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, dispensationtypes.ModuleName, address, mintCoins)
if err != nil {
panic(err)
}

return app.mm.RunMigrations(ctx, app.configurator, vm)
})
Expand Down
4 changes: 4 additions & 0 deletions proto/sifnode/clp/v1/querier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ message ParamsRes {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string symmetry_ratio_threshold = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

message RewardParamsReq {}
Expand Down
4 changes: 4 additions & 0 deletions proto/sifnode/clp/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ message MsgSetSymmetryThreshold {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string ratio = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

message MsgSetSymmetryThresholdResponse {}
Expand Down
12 changes: 9 additions & 3 deletions scripts/ibc/tokenregistration/envs/betanet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ SIFCHAIN_ID=sifchain-1 \
BAND_CHANNEL_ID= \
BAND_COUNTERPARTY_CHANNEL_ID= \
SECRET_CHAIN_ID=secret-4 \
SECRET_CHANNEL_ID=channel-33 \
SECRET_COUNTERPARTY_CHANNEL_ID=channel-4 \
SECRET_CHANNEL_ID=channel-65 \
SECRET_COUNTERPARTY_CHANNEL_ID=channel-15 \
COMDEX_CHAIN_ID=comdex-1 \
COMDEX_CHANNEL_ID=channel-30 \
COMDEX_COUNTERPARTY_CHANNEL_ID=channel-8
Expand All @@ -58,4 +58,10 @@ SIFCHAIN_ID=sifchain-1 \
BITCANNA_COUNTERPARTY_CHANNEL_ID=channel-2 \
BITSONG_CHAIN_ID=bitsong-2b \
BITSONG_CHANNEL_ID=channel-36 \
BITSONG_COUNTERPARTY_CHANNEL_ID=channel-6
BITSONG_COUNTERPARTY_CHANNEL_ID=channel-6 \
STARNAME_CHAIN_ID=iov-mainnet-ibc \
STARNAME_CHANNEL_ID=channel-54 \
STARNAME_COUNTERPARTY_CHANNEL_ID=channel-18 \
EVMOS_CHAIN_ID=evmos_9001-2 \
EVMOS_CHANNEL_ID=channel-55 \
EVMOS_COUNTERPARTY_CHANNEL_ID=channel-7
36 changes: 36 additions & 0 deletions scripts/ibc/tokenregistration/generate-ibc-jsons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,39 @@ sifnoded q tokenregistry generate -o json \
echo "\n\ngenerated entry for $BITCANNA_CHAIN_ID"

cat $SIFCHAIN_ID/ubcna.json | jq

sifnoded q tokenregistry generate -o json \
--token_base_denom=uiov \
--token_ibc_counterparty_chain_id=$STARNAME_CHAIN_ID \
--token_ibc_channel_id=$STARNAME_CHANNEL_ID \
--token_ibc_counterparty_channel_id=$STARNAME_COUNTERPARTY_CHANNEL_ID \
--token_ibc_counterparty_denom="" \
--token_unit_denom="" \
--token_decimals=6 \
--token_display_name="Starname" \
--token_external_symbol="" \
--token_permission_clp=true \
--token_permission_ibc_export=true \
--token_permission_ibc_import=true | jq > $SIFCHAIN_ID/uiov.json

echo "\n\ngenerated entry for $STARNAME_CHAIN_ID"

cat $SIFCHAIN_ID/uiov.json | jq

sifnoded q tokenregistry generate -o json \
--token_base_denom=aevmos \
--token_ibc_counterparty_chain_id=$EVMOS_CHAIN_ID \
--token_ibc_channel_id=$EVMOS_CHANNEL_ID \
--token_ibc_counterparty_channel_id=$EVMOS_COUNTERPARTY_CHANNEL_ID \
--token_ibc_counterparty_denom="" \
--token_unit_denom="" \
--token_decimals=6 \
--token_display_name="Evmos" \
--token_external_symbol="" \
--token_permission_clp=true \
--token_permission_ibc_export=true \
--token_permission_ibc_import=true | jq > $SIFCHAIN_ID/aevmos.json

echo "\n\ngenerated entry for $EVMOS_CHAIN_ID"

cat $SIFCHAIN_ID/aevmos.json | jq
26 changes: 26 additions & 0 deletions scripts/ibc/tokenregistration/sifchain-1/aevmos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"entries": [
{
"decimals": "6",
"denom": "ibc/57BB0CFF9782730595988FD330AA41605B0628E11507BABC1207B830A23493B9",
"base_denom": "aevmos",
"path": "transfer/channel-55",
"ibc_channel_id": "channel-55",
"ibc_counterparty_channel_id": "channel-7",
"display_name": "Evmos",
"display_symbol": "",
"network": "",
"address": "",
"external_symbol": "",
"transfer_limit": "",
"permissions": [
"CLP",
"IBCEXPORT",
"IBCIMPORT"
],
"unit_denom": "",
"ibc_counterparty_denom": "",
"ibc_counterparty_chain_id": "evmos_9001-2"
}
]
}
8 changes: 4 additions & 4 deletions scripts/ibc/tokenregistration/sifchain-1/scrt.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"entries": [
{
"decimals": "6",
"denom": "ibc/AB71F94BB809FB05FB4547C471A92C3F9826BA24E660BB4782B5ED61FB9AB867",
"denom": "ibc/345D30E8ED06B47FC538ED131D99D16126F07CD6F8B35DE96AAF4C1E445AF466",
"base_denom": "uscrt",
"path": "transfer/channel-33",
"ibc_channel_id": "channel-33",
"ibc_counterparty_channel_id": "channel-4",
"path": "transfer/channel-65",
"ibc_channel_id": "channel-65",
"ibc_counterparty_channel_id": "channel-15",
"display_name": "Secret",
"display_symbol": "",
"network": "",
Expand Down
26 changes: 26 additions & 0 deletions scripts/ibc/tokenregistration/sifchain-1/uiov.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"entries": [
{
"decimals": "6",
"denom": "ibc/F20C4E30E4202C11FE009D6D58B2FF212C99084CB6F767287A51A93EFD960086",
"base_denom": "uiov",
"path": "transfer/channel-54",
"ibc_channel_id": "channel-54",
"ibc_counterparty_channel_id": "channel-18",
"display_name": "Starname",
"display_symbol": "",
"network": "",
"address": "",
"external_symbol": "",
"transfer_limit": "",
"permissions": [
"CLP",
"IBCEXPORT",
"IBCIMPORT"
],
"unit_denom": "",
"ibc_counterparty_denom": "",
"ibc_counterparty_chain_id": "iov-mainnet-ibc"
}
]
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.2
0.13.3
5 changes: 5 additions & 0 deletions x/clp/client/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
FlagMintParams = "mint-params"
FlagMinter = "minter"
FlagSymmetryThreshold = "threshold"
FlagSymmetryRatioThreshold = "ratio"
)

// common flagsets to add to various functions
Expand Down Expand Up @@ -60,6 +61,8 @@ var (
FsFlagNewPolicy = flag.NewFlagSet("", flag.ContinueOnError)
FsFlagMintParams = flag.NewFlagSet("", flag.ContinueOnError)
FsFlagMinter = flag.NewFlagSet("", flag.ContinueOnError)
FsSymmetryThreshold = flag.NewFlagSet("", flag.ContinueOnError)
FsSymmetryRatioThreshold = flag.NewFlagSet("", flag.ContinueOnError)
)

func init() {
Expand Down Expand Up @@ -89,4 +92,6 @@ func init() {
FsFlagRewardPeriods.String(FlagRewardPeriods, "", "Path to Json File containing reward periods")
FsFlagMintParams.String(FlagMintParams, "", "Inflation")
FsFlagMinter.String(FlagMinter, "", "Inflation Max")
FsSymmetryThreshold.String(FlagSymmetryThreshold, "", "Set slippage adjustement threshold for symmetric liquitidy add")
FsSymmetryRatioThreshold.String(FlagSymmetryRatioThreshold, "", "Set ratio threshold for symmetric liquitidy add")
}
8 changes: 7 additions & 1 deletion x/clp/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,23 @@ func GetCmdSetSymmetryThreshold() *cobra.Command {
if err != nil {
return err
}
ratioThreshold, err := sdk.NewDecFromStr(viper.GetString(FlagSymmetryRatioThreshold))
if err != nil {
return err
}
msg := types.MsgSetSymmetryThreshold{
Signer: signer.String(),
Threshold: threshold,
Ratio: ratioThreshold,
}
if err := msg.ValidateBasic(); err != nil {
return err
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
},
}
cmd.Flags().String(FlagSymmetryThreshold, "", "")
cmd.Flags().AddFlagSet(FsSymmetryThreshold)
cmd.Flags().AddFlagSet(FsSymmetryRatioThreshold)
flags.AddTxFlagsToCmd(cmd)
return cmd
}
Expand Down
Loading

0 comments on commit c904f56

Please sign in to comment.