Skip to content

Commit

Permalink
Merge pull request #1931 from Sifchain/testnet
Browse files Browse the repository at this point in the history
[ChainOps] Latest merge to master
  • Loading branch information
intl-man authored Sep 28, 2021
2 parents a54165b + 9ebdd10 commit 1997a34
Show file tree
Hide file tree
Showing 425 changed files with 102,234 additions and 584,497 deletions.
19 changes: 0 additions & 19 deletions .devcontainer/Dockerfile

This file was deleted.

37 changes: 0 additions & 37 deletions .devcontainer/devcontainer.json

This file was deleted.

36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# v0.9.7
> September 17, 2021
>
## ⭐ Features

- [Sifnode] Enabling of inflationary block rewards.

# v0.9.5
> August 24, 2021
>
## ⭐ Features

- [Sifnode] IBC Support is now available.

# v0.9.1
> August 6, 2021
>
## ⭐ Features

- [Sifnode] Numerous updates to allow for the enabling of IBC in the coming weeks.

# v0.9.0
> July 28, 2021
>
## ⭐ Features

- [Sifnode] Upgraded to version 0.42 of the Cosmos SDK.

# v0.8.8
> July 16, 2021
>
Expand All @@ -9,11 +37,11 @@

# v0.8.7
> June 9, 2021
>
>
## 🛠 Improvements

- [UI] Introduction of a footer! User's can sign-up for our newsletter, and link to our privacy policy, roadmap, and legal disclaimer.
- [UI] Removal of negative signs in the Pool Stats>Arbitrage as these are confusing and not necessary.
- [UI] Introduction of a footer! User's can sign-up for our newsletter, and link to our privacy policy, roadmap, and legal disclaimer.
- [UI] Removal of negative signs in the Pool Stats>Arbitrage as these are confusing and not necessary.
- [UI] Removal of the words Peg and Unpeg. We have updated our language across our entire application to use 'Import' and 'Export' instead. We did this to be more clear with the action that is being done, as well as to prepare for more chains being integrated into Sifchain.
- [UI] Included the ability for a user to see their net gain/loss on their liquidity pool position. This includes earnings from swap fees AND any gains or losses associated with changes in the tokens' prices. This number is represented as USDT.
- [Peggy] Relayer Upgrade - Implementation of Retry Logic.
Expand Down Expand Up @@ -65,7 +93,7 @@
## 🛠 Improvements

- [UI] Added logic for when clicking on max button in ROWAN to take into consideration necessary gas fees.
- [UI] In swap confirmation screen, built in cleaner UX logic around the way we display numbers.
- [UI] In swap confirmation screen, built in cleaner UX logic around the way we display numbers.
- [UI] Included logic in the token list pop-ups when doing a swap or liquidity add for how we sort the displayed tokens. We are also now calling in user's balances directly in this pop-up as well for easy viewing.
- [Peggy] Add retry logic when infura gives us a not found error. Add additional retry logic to try to retrieve the tx if it cannot be found on the first query.
- [Sifnode] Ability to propose and vote on new jailing parameters.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Follow the links below to setup sifnode as a standalone (compile and run on your

### Standalone

See [here](https://github.com/Sifchain/sifnode/tree/master/docs/chainOps/standalone/README.md).
See [here](https://github.com/Sifchain/sifnode/tree/develop/docs/chainOps/standalone/README.md).

### Kubernetes (k8s)

See [here](https://github.com/Sifchain/sifnode/tree/master/docs/chainOps/k8s/README.md).
See [here](https://github.com/Sifchain/sifnode/tree/develop/docs/chainOps/k8s/README.md).

## Additional Resources

Expand Down
7 changes: 4 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Sifchain looks forward to working with the security community to find vulnerabil

## Responsible Disclosure

For all security related issues refer to our [Bug Bounty Program](https://hackerone.com/sifchain). **Do not open up a GitHub issue if the bug is a security vulnerability**
For all security related issues refer to our [Bug Bounty Program](https://immunefi.com/bounty/sifchain/). **Do not open up a GitHub issue if the bug is a security vulnerability**

**Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/Sifchain/sifnode/issues).

Expand All @@ -22,7 +22,8 @@ We’ll try to keep you informed about our progress throughout the process.

### Disclosure Policy

* Follow HackerOne's [disclosure guidelines](https://www.hackerone.com/disclosure-guidelines).
* Vulnerabilities should be disclosed through the Immunefi platform. Immunefi will then handle bug bounty communications.
* Public disclosure of a vulnerability makes it ineligible for a bounty. If the user reports the vulnerability to other security teams (e.g. Ethereum or Cosmos) but reports to Sifchain with considerable delay, then Sifchain may reduce or cancel the bounty.
* Users who violate the rules of participation will not receive bug bounty payouts and may be temporarily suspended or banned from the bug bounty program.

For more information check Sifchain bounty program policy at [HackerOne](https://hackerone.com/sifchain)
For more information check Sifchain bounty program policy at [ImmuneFi](https://immunefi.com/bounty/sifchain/)
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ import (
ethbridgekeeper "github.com/Sifchain/sifnode/x/ethbridge/keeper"
ethbridgetypes "github.com/Sifchain/sifnode/x/ethbridge/types"
ibctransferoverride "github.com/Sifchain/sifnode/x/ibctransfer"
sctransfertypes "github.com/Sifchain/sifnode/x/ibctransfer/types"
"github.com/Sifchain/sifnode/x/oracle"
oraclekeeper "github.com/Sifchain/sifnode/x/oracle/keeper"
oracletypes "github.com/Sifchain/sifnode/x/oracle/types"
Expand Down Expand Up @@ -138,6 +139,7 @@ var (
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner, authtypes.Staking},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
sctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ethbridgetypes.ModuleName: {authtypes.Minter, authtypes.Burner},
clptypes.ModuleName: {authtypes.Burner, authtypes.Minter},
dispensation.ModuleName: {authtypes.Burner, authtypes.Minter},
Expand Down
18 changes: 3 additions & 15 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,14 @@ package app
import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/mint"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

const upgradeName = "0.9.7"
const upgradeName = "0.9.8"

func SetupHandlers(app *SifchainApp) {
SetupHandlersForMint(app)
}

func SetupHandlersForMint(app *SifchainApp) {
app.UpgradeKeeper.SetUpgradeHandler(upgradeName, func(ctx sdk.Context, plan types.Plan) {
app.Logger().Info("Running upgrade handler for " + upgradeName + " with new store " + minttypes.StoreKey)
// Install initial params and minter for mint module.
mintGenesis := minttypes.DefaultGenesisState()
// Replace default MintDenom with staking bond denom.
mintGenesis.Params.MintDenom = app.StakingKeeper.GetParams(ctx).BondDenom
mint.InitGenesis(ctx, app.MintKeeper, app.AccountKeeper, mintGenesis)

app.Logger().Info("Running upgrade handler for " + upgradeName)
})

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
Expand All @@ -32,7 +20,7 @@ func SetupHandlersForMint(app *SifchainApp) {

if upgradeInfo.Name == upgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{minttypes.StoreKey},
Added: []string{},
}

// Use upgrade store loader for the initial loading of all stores when app starts,
Expand Down
51 changes: 0 additions & 51 deletions cmd/sifcrg/main.go

This file was deleted.

4 changes: 3 additions & 1 deletion cmd/sifgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func main() {
_nodeCreateCmd.PersistentFlags().Bool("with-cosmovisor", false, "setup cosmovisor")
_nodeCreateCmd.PersistentFlags().Bool("enable-grpc", false, "enable gRPC")
_nodeCreateCmd.PersistentFlags().Bool("enable-api", false, "enable API")
_nodeCreateCmd.PersistentFlags().String("keyring-backend", "test", "Select keyring's backend (os|file|kwallet|pass|test|memory)")
_nodeCmd.AddCommand(_nodeCreateCmd, nodeResetStateCmd())

_keyCmd := keyCmd()
Expand Down Expand Up @@ -123,8 +124,9 @@ func nodeCreateCmd() *cobra.Command {
withCosmovisor, _ := cmd.Flags().GetBool("with-cosmovisor")
enableGrpc, _ := cmd.Flags().GetBool("enable-grpc")
enableAPI, _ := cmd.Flags().GetBool("enable-api")
keyringBackend, _ := cmd.Flags().GetString("keyring-backend")

node := sifgen.NewSifgen(&args[0]).NewNode()
node := sifgen.NewSifgen(&args[0]).NewNode(keyringBackend)
node.Moniker = args[1]
node.Mnemonic = args[2]

Expand Down
Empty file removed deploy/rake/genesis.rake
Empty file.
4 changes: 4 additions & 0 deletions docker/localnet/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
IMAGE_TAG?=latest

build-image:
docker build -t sifchain/$(SERVICE):$(IMAGE_TAG) -f $(SERVICE)/Dockerfile ../../
66 changes: 66 additions & 0 deletions docker/localnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# IBC LocalNet

This will launch the following:

* Two sifnode instances running independent chains.
* An [IBC relayer](https://github.com/confio/ts-relayer) to connect both chains.

## Setup/Build

1. Switch to the `deploy/docker/localnet/ibc` directory.

2. Build a new `sifnode` image:

```bash
SERVICE=sifnode make build-image
```

3. Build a new `ts-relayer` image:

```bash
SERVICE=ts-relayer make build-image
```

## Run

1. Switch to the `deploy/docker/localnet/ibc` directory.

2. Launch `docker-compose` as follows:

```bash
CHAINNET0=${CHAINNET0} \
CHAINNET1=${CHAINNET1} \
IPADDR0=${IPADDR0} \
IPADDR1=${IPADDR1} \
IPADDR2=${IPADDR2} \
SUBNET=${SUBNET} \
MNEMONIC='${MNEMONIC}' docker-compose up
```

Where:

|Var|Description|
|---|-----------|
|`${CHAINNET0}`|The Chain ID of the first sifnode (e.g.: `sifchain-ibc-0`)|
|`${CHAINNET1}`|The Chain ID of the second sifnode (e.g.: `sifchain-ibc-1`)|
|`${IPADDR0}`|The IP Address of the first sifnode (e.g.: `192.168.65.2`)|
|`${IPADDR1}`|The IP Address of the second sifnode (e.g.: `192.168.65.3`)|
|`${IPADDR2}`|The IP Address of the relayer (e.g.: `192.168.65.3`)|
|`${SUBNET}`|The subnet of the bridged network that Docker needs to create (e.g.: `192.168.65.1/24`)|
|`${MNEMONIC}`|The mnemonic both sifnode's will use for their genesis accounts.|

e.g.:

```bash
CHAINNET0=sifchain-ibc-0 \
CHAINNET1=sifchain-ibc-1 \
IPADDR0=192.168.65.2 \
IPADDR1=192.168.65.3 \
IPADDR2=192.168.65.4 \
SUBNET=192.168.65.1/24 \
MNEMONIC='toddler spike waste purpose neutral beach science dawn joke stock help beyond' docker-compose up
```

## Notes

Currently, the relayer generates its own mnemonic, and the resulting address needs to be funded on both chains. The script `ts-relayer.sh` will perform this automatically when the container boots. This TypeScript implementation was used simply as a proof of concept, given the [issues experienced](https://discord.com/channels/669268347736686612/773388941947568148/839049449551691797) when attempting to use Cosmos' own IBC relayer.
16 changes: 16 additions & 0 deletions docker/localnet/compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

CHAINNET0=sifchain-ibc-0
CHAINNET1=sifchain-ibc-1
IPADDR0=192.168.65.2
IPADDR1=192.168.65.3
IPADDR2=192.168.65.4
SUBNET=192.168.65.1/24

CHAINNET0=${CHAINNET0} \
CHAINNET1=${CHAINNET1} \
IPADDR0=${IPADDR0} \
IPADDR1=${IPADDR1} \
IPADDR2=${IPADDR2} \
SUBNET=${SUBNET} \
MNEMONIC="${MNEMONIC}" docker compose $1
Loading

0 comments on commit 1997a34

Please sign in to comment.