Skip to content

Commit

Permalink
Merge pull request #2007 from Sifchain/testnet
Browse files Browse the repository at this point in the history
Merge testnet to master for 0.9.10
  • Loading branch information
timlind authored Oct 7, 2021
2 parents 1997a34 + f5ac02a commit 76f3e42
Show file tree
Hide file tree
Showing 58 changed files with 9,920 additions and 494 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/ibc_add_eth_token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: "[Token Registry] Add new ETH token to registry"
about: "[Token Registry] Add a new ETH token to registry"
title: '[Token Registry] Add ... ETH token on ...sifchain network'
labels: 'Sifnode, Token Registry'
assignees: '@sifnode'
---

<!-- Please fill in issue title -->

### Details?

Sifchain Chain ID:
Denom:
Denom:
Decimals:
Display Name:
Network:

<!--
Example:
Sifchain Chain ID: sifchain-devnet-1
Denom: ceth
Decimals: 18
Display Name: ETH
Network: Ethereum Mainnet
-->

33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/ibc_chain_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: "[Token Registry] Add new IBC chain channel and token"
about: "[Token Registry] Add a new IBC chain, channel and token"
title: '[Token Registry] Add ... chain on ... sifchain network'
labels: 'Sifnode, Token Registry'
assignees: '@sifnode'

---

<!-- Please fill in issue title -->

### Details?

Sifchain Chain ID:
Counterparty Chain ID:
Channel ID:
Counterparty Channel ID:
Base Denom:
Decimals:
Display Name:

<!--
Example:
Sifchain Chain ID: sifchain-devnet-1
Counterparty Chain ID: cosmoshub-4
Channel ID: channel-1
Counterparty Channel ID: channel-36
Base Denom: uatom
Decimals: 6
Display Name: ATOM
-->

28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/ibc_token_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: "[Token Registry] Add new IBC token to existing chain channel"
about: "[Token Registry] Add a new IBC token to existing channel"
title: '[Token Registry] Add ... token to ... counterparty chain ... on ... sifchain network'
labels: 'Sifnode, Token Registry'
assignees: '@sifnode'
---

<!-- Please fill in issue title -->

### Details?

Sifchain Chain ID:
Counterparty Chain ID:
Base Denom:
Decimals:
Display Name:

<!--
Example:
Sifchain Chain ID: sifchain-devnet-1
Counterparty Chain ID: cosmoshub-4
Counterparty Base Denom: uatom
Decimals: 6
Display Name: ATOM
-->

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ frontend/.cache
.DS_Store
.testCoverage.txt
.environments
.ruby-version
deploy/networks
log/*.log
.env
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v0.9.10
> October 8, 2021
>
## ⭐ Features

- [Sifnode] Support for transferring high precision tokens over IBC via denom conversion.

# v0.9.7
> September 17, 2021
>
Expand Down
2 changes: 1 addition & 1 deletion app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const upgradeName = "0.9.8"
const upgradeName = "0.9.10"

func SetupHandlers(app *SifchainApp) {
app.UpgradeKeeper.SetUpgradeHandler(upgradeName, func(ctx sdk.Context, plan types.Plan) {
Expand Down
9 changes: 4 additions & 5 deletions cmd/sifnoded/cmd/clpadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ func AddGenesisCLPAdminCmd(defaultNodeHome string) *cobra.Command {

cmd := &cobra.Command{
Use: "add-genesis-clp-admin [address_or_key_name]",
Short: "Add a genesis account to genesis.json",
Long: `Add a genesis account to genesis.json. The provided account must specify
the account address or key name and a list of initial coins. If a key name is given,
the address will be looked up in the local Keybase. The list of initial tokens must
contain valid denominations. Accounts may optionally be supplied with vesting parameters.
Short: "Add clp admin account to genesis.json",
Long: `Add clp account to genesis.json by appending it to clp genesis state AddressWhitelist.
The provided account must specify the account address or key name.
If a key name is given, the address will be looked up in the Keybase based on --keyring-backend flag.
`,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
18 changes: 9 additions & 9 deletions docs/chainOps/standalone/tutorials/testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
```

4. Generate a new mnemonic key for your node. This key is what your node will use to eventually sign transactions/blocks on the network.
4. Compile `sifnoded` and `sifgen`:

```bash
make install
```

5. Generate a new mnemonic key for your node. This key is what your node will use to eventually sign transactions/blocks on the network.

```bash
rake "sifnode:keys:generate:mnemonic"
```

5. Import your newly generated key:
6. Import your newly generated key:

```bash
rake "sifnode:keys:import[<moniker>]"
Expand All @@ -41,7 +47,7 @@ e.g.:
rake "sifnode:keys:import[my-node]"
```

6. Check that it's been imported accordingly:
7. Check that it's been imported accordingly:

```bash
rake "sifnode:keys:show[<moniker>]"
Expand All @@ -59,12 +65,6 @@ e.g.:
rake "sifnode:keys:show[my-node]"
```

7. Compile `sifnoded`:

```bash
make install
```

8. Boot your node:

```bash
Expand Down
97 changes: 97 additions & 0 deletions docs/proposals/dispensation_new_types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Dispensation Multiple Types
## Concepts

- We need the ability to add and remove dispensation types.The present design uses an enum for the types .

- The plan is to replace this enum with a register , which can be controlled by an admin account or through a governance proposal .


## Changes

- All are checks for claimtype are stateless, we do validations by matching the string to the enum value, this would need to be changed to statefull changes , therefore can only be processed in checkTx and deliverTx , and not ValidateBasic.This will change the User Experience a bit becuase the user might not get error responses immediatly , would need to be checked though `raw_log` or `events` .

> Example : This function called from `dispensation/client/tx.go`
```go=
func GetDistributionTypeFromShortString(distributionType string) (DistributionType, bool) {
switch distributionType {
case "Airdrop":
return DistributionType_DISTRIBUTION_TYPE_AIRDROP, true
case "LiquidityMining":
return DistributionType_DISTRIBUTION_TYPE_LIQUIDITY_MINING, true
case "ValidatorSubsidy":
return DistributionType_DISTRIBUTION_TYPE_VALIDATOR_SUBSIDY, true
default:
return DistributionType_DISTRIBUTION_TYPE_UNSPECIFIED, false
}
}
```

> Will change and be called from `dispensation/keeper/msg_server.go`
```go=
(func (keeper) GetClaimByType (ctx sdk.Context,claimType string) ClaimType {}).IsClaimable
```



- Changes in validation logic in msg_server for
```go=
func (srv msgServer) CreateUserClaim(ctx context.Context,
claim *types.MsgCreateUserClaim) (*types.MsgCreateClaimResponse, error)
func (srv msgServer) CreateDistribution(ctx context.Context,
msg *types.MsgCreateDistribution) (*types.MsgCreateDistributionResponse, error)
```

- Changes in
```go=
func (k Keeper) DistributeDrops(ctx sdk.Context, height int64, distributionName string, authorizedRunner string, distributionType types.DistributionType) (*types.DistributionRecords, error) {
if record.DoesTypeSupportClaim() {}
}
```

## State

```go=
type ClaimType struct {
Type : string ,
IsClaimable : bool ,
IsActive : bool ,
}
```

## State Transitions

```go=
func (keeper) SetNewClaimType(ctx sdk.Context,c Claimtype){} {
// Can only be called by admin
}
```

## Helpers

```go=
func (keeper) IsClaimTypeActive (ctx sdk.Context,c Claimtype) bool {}
func (keeper) IsClaimTypeClaimabale (ctx sdk.Context,c Claimtype) bool {}
```

## Queries

```go=
func (keeper) GetAllClaimTypes(ctx sdk.Context)[]ClaimType {}
func (keeper) GetClaimByType(ctx sdk.Context,claimtype string)ClaimType {}
```


## Migrations

- Claimtypes for Existing Distribution records would need to be modified, to use `ClaimType` struct instead of the enum.
- Set Claimtypes in InitGenesis

## Misc Questions

- We use the same type for Claims and Distributions . It was called distributionType earlier . I am using ClaimType in this doc , but the name is debatable . I would prefer to use a more generic name if possible , and any suggestions for be great .

- Should we test and move Distribute Records back to block ender / beginner . It would save a lot of the logistics we are dealing with , using the whole run distribution . The mechanism is used in other places in the module , and if tested properly should be doable .
5 changes: 5 additions & 0 deletions scripts/ibc/tokenregistration/deregister-all-betanet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

SIFCHAIN_ID=sifchain-1 \
KEYRING_BACKEND=test \
SIF_NODE=https://rpc.sifchain.finance:443 ./template/deregister-all.sh
5 changes: 5 additions & 0 deletions scripts/ibc/tokenregistration/deregister-all-devnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

SIFCHAIN_ID=sifchain-devnet-1 \
KEYRING_BACKEND=test \
SIF_NODE=https://rpc-devnet.sifchain.finance:443 ./template/deregister-all.sh
5 changes: 5 additions & 0 deletions scripts/ibc/tokenregistration/deregister-all-testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

SIFCHAIN_ID=sifchain-testnet-1 \
KEYRING_BACKEND=test \
SIF_NODE=https://rpc-testnet.sifchain.finance:443 ./template/deregister-all.sh
3 changes: 3 additions & 0 deletions scripts/ibc/tokenregistration/generate-all-betanet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

SIFCHAIN_ID=sifchain-1 ./template/generate-all.sh
3 changes: 3 additions & 0 deletions scripts/ibc/tokenregistration/generate-all-devnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

SIFCHAIN_ID=sifchain-devnet-1 ./template/generate-all.sh
3 changes: 3 additions & 0 deletions scripts/ibc/tokenregistration/generate-all-testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

SIFCHAIN_ID=sifchain-testnet-1 ./template/generate-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ SIFCHAIN_ID=sifchain-1 \
REGEN_CHAIN_ID=regen-1 \
REGEN_CHANNEL_ID=channel-10 \
REGEN_COUNTERPARTY_CHANNEL_ID=channel-28 \
JUNO_CHAIN_ID=juno-1 \
JUNO_CHANNEL_ID=channel-14 \
JUNO_COUNTERPARTY_CHANNEL_ID=channel-5 \
TERRA_CHAIN_ID= \
TERRA_CHANNEL_ID= \
TERRA_COUNTERPARTY_CHANNEL_ID= \
OSMOSIS_CHAIN_ID= \
OSMOSIS_CHANNEL_ID= \
OSMOSIS_COUNTERPARTY_CHANNEL_ID= \
CRYPTO_ORG_CHAIN_ID=crypto-org-chain-mainnet-1 \
CRYPTO_ORG_CHANNEL_ID=channel-9 \
CRYPTO_ORG_COUNTERPARTY_CHANNEL_ID=channel-33 ./template/generate-all-ibc.sh
CRYPTO_ORG_COUNTERPARTY_CHANNEL_ID=channel-33 ./template/generate-ibc-jsons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ SIFCHAIN_ID=sifchain-devnet-1 \
REGEN_CHAIN_ID=regen-1 \
REGEN_CHANNEL_ID=channel-121 \
REGEN_COUNTERPARTY_CHANNEL_ID=channel-26 \
JUNO_CHAIN_ID=juno-1 \
JUNO_CHANNEL_ID=channel-129 \
JUNO_COUNTERPARTY_CHANNEL_ID=channel-3 \
TERRA_CHAIN_ID=bombay-10 \
TERRA_CHANNEL_ID=channel-123 \
TERRA_COUNTERPARTY_CHANNEL_ID=channel-3 \
OSMOSIS_CHAIN_ID=osmosis-1 \
OSMOSIS_CHANNEL_ID=channel-122 \
OSMOSIS_COUNTERPARTY_CHANNEL_ID=channel-34 ./template/generate-all-ibc.sh
OSMOSIS_COUNTERPARTY_CHANNEL_ID=channel-34 ./template/generate-ibc-jsons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ SIFCHAIN_ID=sifchain-testnet-1 \
REGEN_CHAIN_ID=regen-1 \
REGEN_CHANNEL_ID=channel-17 \
REGEN_COUNTERPARTY_CHANNEL_ID=channel-27 \
JUNO_CHAIN_ID=juno-1 \
JUNO_CHANNEL_ID=channel-36 \
JUNO_COUNTERPARTY_CHANNEL_ID=channel-4 \
TERRA_CHAIN_ID=bombay-12 \
TERRA_CHANNEL_ID=channel-33 \
TERRA_COUNTERPARTY_CHANNEL_ID=channel-0 \
CRYPTO_ORG_CHAIN_ID=crypto-org-chain-mainnet-1 \
CRYPTO_ORG_CHANNEL_ID=channel-16 \
CRYPTO_ORG_COUNTERPARTY_CHANNEL_ID=channel-32 ./template/generate-all-ibc.sh
CRYPTO_ORG_COUNTERPARTY_CHANNEL_ID=channel-32 ./template/generate-ibc-jsons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

SIFCHAIN_ID=sifchain-1 \
KEYRING_BACKEND=test \
SIF_NODE=https://rpc.sifchain.finance:443 ./template/register-all-ibc.sh
SIF_NODE=https://rpc.sifchain.finance:443 ./template/register-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

SIFCHAIN_ID=sifchain-devnet-1 \
KEYRING_BACKEND=test \
SIF_NODE=https://rpc-devnet.sifchain.finance:443 ./template/register-all-ibc.sh
SIF_NODE=https://rpc-devnet.sifchain.finance:443 ./template/register-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

SIFCHAIN_ID=sifchain-testnet-1 \
KEYRING_BACKEND=test \
SIF_NODE=https://rpc-testnet.sifchain.finance:443 ./template/register-all-ibc.sh
SIF_NODE=https://rpc-testnet.sifchain.finance:443 ./template/register-all.sh
Loading

0 comments on commit 76f3e42

Please sign in to comment.