Skip to content

Commit

Permalink
Merge pull request #1 from zhangyelong/develop
Browse files Browse the repository at this point in the history
Merge develop into feature/docs
  • Loading branch information
zhangyelong authored Sep 28, 2018
2 parents b21f6f6 + cde201f commit 8d2cc20
Show file tree
Hide file tree
Showing 55 changed files with 513 additions and 4,693 deletions.
79 changes: 75 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,58 @@
# Changelog


## 0.5.0-rc1

*September 27th, 2018*

BREAKING CHANGES:

- [cointype] Introduce the cointype of iris:
- 1 iris = 10^18 iris-atto
- 1 iris-milli = 10^15 iris-atto
- 1 iris-micro = 10^12 iris-atto
- 1 iris-nano = 10^9 iris-atto
- 1 iris-pico = 10^6 iris-atto
- 1 iris-femto = 10^3 iris-atto

FEATURES:

- [tendermint] Upgrade to Tendermint v0.23.1-rc0
- [cosmos-sdk] Upgrade to cosmos-sdk v0.24.2
- Move the previous irisnet changeset about cosmos-sdk into irishub
- [irisdebug] Add irisdebug tool
- [LCD/cli] Add the proof verification in the LCD and cli
- [iparam] Support governance modify the complex struct type parameter and can be done through the Json parameter config file
- [software-upgrade] Software upgrade solution of the irisnet


## 0.4.2

*September 22th, 2018*

BUG FIXES

- Fix consensus failure due to the double sign evidence be broadcasted before the genesis block

## 0.4.1

*September 12th, 2018*

BUG FIXES

- Missing to set validator intraTxCount in stake genesis init


## 0.4.0

*August 16th, 2018*
*September 6th, 2018*

BREAKING CHANGES:

- [cosmos-sdk] Upgrade to cosmos-sdk v0.23.0
- Change the address prefix format:
- cosmosaccaddr --> faa
- cosmosaccaddr --> fap
- cosmosaccpub --> fap
- cosmosvaladdr --> fva
- cosmosvalpub --> fvp
- Adjust the Route & rootMultiStore Commit for software upgrade
Expand All @@ -19,12 +62,40 @@ BREAKING CHANGES:
FEATURES:

- [tendermint] Upgrade to Tendermint v0.22.6
- Store the pre-state to support the replay function in software upgrade
- Store the pre-state to support the replay function
- [cosmos-sdk] Upgrade to cosmos-sdk v0.23.0
- Add the paramProposal and softwareUpgradeProposal in gov module
- Improve fee token mechanism to more reasonably deduct transaction fee and achieve more ability to defent DDOS attack.
- Introduce the global parameter module
- [irishub] Add the upgrade module and example apps for the async software upgrade

BUG FIXES

- Default account balance in genesis
- Fix iris version issue
- Fix the unit conflict issue in slashing
- Check the voting power when create validator
- Fix evidence amimo register issue


## 0.4.0-rc2

*Sep 5th, 2018*

BUG FIXES

- Fix evidence amimo register issue


## 0.4.0-rc1

*Aug 27th, 2018*

BUG FIXES

- Default account balance in genesis
- iris version issue
- Fix the unit conflict issue in slashing
- Check the voting power when create validator


## 0.3.0
Expand Down
33 changes: 9 additions & 24 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[[constraint]]
name = "github.com/cosmos/cosmos-sdk"
source = "https://github.com/irisnet/cosmos-sdk.git"
branch = "irisnet/develop"
version = "=v0.24.2-iris1"

[[override]]
name = "github.com/golang/protobuf"
Expand All @@ -49,14 +49,13 @@

[[override]]
name = "github.com/tendermint/iavl"
# version = "=v0.9.2"
branch = "irisnet/feature_upgrade"
source = "https://github.com/irisnet/iavl.git"
version = "=v0.9.2-iris1"

[[override]]
name = "github.com/tendermint/tendermint"
source = "https://github.com/irisnet/tendermint.git"
branch = "irisnet/develop"
version = "=v0.23.1-rc0-iris1"

[[constraint]]
name = "github.com/rakyll/statik"
Expand Down
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,22 @@ build_cur: update_irislcd_swagger_docs
go build -o build/iriscli ./cmd/iriscli && \
go build -o build/irislcd ./cmd/irislcd

build_example: update_irislcd_swagger_docs
build_examples: update_irislcd_swagger_docs
go build -o build/iris1 ./examples/irishub1/cmd/iris1
go build -o build/iriscli1 ./examples/irishub1/cmd/iriscli1
go build -o build/iris2 ./examples/irishub2/cmd/iris2
go build -o build/iriscli2 ./examples/irishub2/cmd/iriscli2
go build -o build/iris-bugfix-2 ./examples/irishub-bugfix-2/cmd/iris-bugfix-2
go build -o build/iriscli-bugfix-2 ./examples/irishub-bugfix-2/cmd/iriscli-bugfix-2


install_examples: update_irislcd_swagger_docs
go install ./examples/irishub1/cmd/iris1
go install ./examples/irishub1/cmd/iriscli1
go install ./examples/irishub2/cmd/iris2
go install ./examples/irishub2/cmd/iriscli2
go install ./examples/irishub-bugfix-2/cmd/iris-bugfix-2
go install ./examples/irishub-bugfix-2/cmd/iriscli-bugfix-2


build_example_linux: update_irislcd_swagger_docs
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iris1 ./examples/irishub1/cmd/iris1
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iriscli1 ./examples/irishub1/cmd/iriscli1
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iris2 ./examples/irishub2/cmd/iris2
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iriscli2 ./examples/irishub2/cmd/iriscli2
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iris2-bugfix ./examples/irishub-bugfix-2/cmd/iris-bugfix-2
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iriscli2-bugfix ./examples/irishub-bugfix-2/cmd/iriscli-bugfix-2
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iris3-bugfix ./examples/irishub-bugfix-3/cmd/iris-bugfix-3
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/iriscli3-bugfix ./examples/irishub-bugfix-3/cmd/iriscli-bugfix-3
10 changes: 4 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ type IrisApp struct {
keyGov *sdk.KVStoreKey
keyFeeCollection *sdk.KVStoreKey
keyParams *sdk.KVStoreKey
keyIparams *sdk.KVStoreKey
keyUpgrade *sdk.KVStoreKey

// Manage getting and setting accounts
Expand Down Expand Up @@ -96,7 +95,6 @@ func NewIrisApp(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptio
keyGov: sdk.NewKVStoreKey("gov"),
keyFeeCollection: sdk.NewKVStoreKey("fee"),
keyParams: sdk.NewKVStoreKey("params"),
keyIparams: sdk.NewKVStoreKey("iparams"),
keyUpgrade: sdk.NewKVStoreKey("upgrade"),
}

Expand Down Expand Up @@ -129,7 +127,7 @@ func NewIrisApp(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptio
AddRoute("ibc", []*sdk.KVStoreKey{app.keyIBC, app.keyAccount}, ibc.NewHandler(app.ibcMapper, app.coinKeeper)).
AddRoute("stake", []*sdk.KVStoreKey{app.keyStake, app.keyAccount}, stake.NewHandler(app.stakeKeeper)).
AddRoute("slashing", []*sdk.KVStoreKey{app.keySlashing, app.keyStake}, slashing.NewHandler(app.slashingKeeper)).
AddRoute("gov", []*sdk.KVStoreKey{app.keyGov, app.keyAccount, app.keyStake, app.keyIparams, app.keyParams}, gov.NewHandler(app.govKeeper)).
AddRoute("gov", []*sdk.KVStoreKey{app.keyGov, app.keyAccount, app.keyStake, app.keyParams}, gov.NewHandler(app.govKeeper)).
AddRoute("upgrade", []*sdk.KVStoreKey{app.keyUpgrade, app.keyStake}, upgrade.NewHandler(app.upgradeKeeper))

app.feeManager = bam.NewFeeManager(app.paramsKeeper.Setter())
Expand All @@ -140,7 +138,7 @@ func NewIrisApp(logger log.Logger, db dbm.DB, traceStore io.Writer, baseAppOptio
app.SetAnteHandler(auth.NewAnteHandler(app.accountMapper, app.feeCollectionKeeper))
app.SetFeeRefundHandler(bam.NewFeeRefundHandler(app.accountMapper, app.feeCollectionKeeper, app.feeManager))
app.SetFeePreprocessHandler(bam.NewFeePreprocessHandler(app.feeManager))
app.MountStoresIAVL(app.keyMain, app.keyAccount, app.keyIBC, app.keyStake, app.keySlashing, app.keyGov, app.keyFeeCollection, app.keyParams, app.keyIparams, app.keyUpgrade)
app.MountStoresIAVL(app.keyMain, app.keyAccount, app.keyIBC, app.keyStake, app.keySlashing, app.keyGov, app.keyFeeCollection, app.keyParams, app.keyUpgrade)
app.SetRunMsg(app.runMsgs)

var err error
Expand Down Expand Up @@ -237,10 +235,10 @@ func (app *IrisApp) initChainer(ctx sdk.Context, req abci.RequestInitChain) abci
StartingProposalID: 1,
DepositProcedure: govparams.DepositProcedure{
MinDeposit: sdk.Coins{minDeposit},
MaxDepositPeriod: 10,
MaxDepositPeriod: 30,
},
VotingProcedure: govparams.VotingProcedure{
VotingPeriod: 10,
VotingPeriod: 30,
},
TallyingProcedure: govparams.TallyingProcedure{
Threshold: sdk.NewRat(1, 2),
Expand Down
49 changes: 47 additions & 2 deletions client/upgrade/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ package cli

import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/wire"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
"github.com/irisnet/irishub/client/context"
"github.com/irisnet/irishub/modules/upgrade"
"github.com/irisnet/irishub/modules/upgrade/params"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"os"
)

Expand All @@ -22,8 +25,8 @@ func GetInfoCmd(storeName string, cdc *wire.Codec) *cobra.Command {
WithLogger(os.Stdout).
WithAccountDecoder(authcmd.GetAccountDecoder(cdc))

res_height, _ := cliCtx.QueryStore([]byte("gov/"+upgradeparams.ProposalAcceptHeightParameter.GetStoreKey()), "params")
res_proposalID, _ := cliCtx.QueryStore([]byte("gov/"+upgradeparams.CurrentUpgradeProposalIdParameter.GetStoreKey()), "params")
res_height, _ := cliCtx.QueryStore([]byte(upgradeparams.ProposalAcceptHeightParameter.GetStoreKey()), "params")
res_proposalID, _ := cliCtx.QueryStore([]byte(upgradeparams.CurrentUpgradeProposalIdParameter.GetStoreKey()), "params")
var height int64
var proposalID int64
cdc.MustUnmarshalBinary(res_height, &height)
Expand All @@ -49,3 +52,45 @@ func GetInfoCmd(storeName string, cdc *wire.Codec) *cobra.Command {
}
return cmd
}

// Command to Get a Switch Information
func GetCmdQuerySwitch(storeName string, cdc *wire.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: "query-switch",
Short: "query switch details",
RunE: func(cmd *cobra.Command, args []string) error {
proposalID := viper.GetInt64(flagProposalID)
voterStr := viper.GetString(flagVoter)

voter, err := sdk.AccAddressFromBech32(voterStr)
if err != nil {
return err
}

cliCtx := context.NewCLIContext().
WithCodec(cdc).
WithLogger(os.Stdout).
WithAccountDecoder(authcmd.GetAccountDecoder(cdc))

res, err := cliCtx.QueryStore(upgrade.GetSwitchKey(proposalID, voter), storeName)
if len(res) == 0 || err != nil {
return errors.Errorf("proposalID [%d] is not existed", proposalID)
}

var switchMsg upgrade.MsgSwitch
cdc.MustUnmarshalBinary(res, &switchMsg)
output, err := wire.MarshalJSONIndent(cdc, switchMsg)
if err != nil {
return err
}

fmt.Println(string(output))
return nil
},
}

cmd.Flags().String(flagProposalID, "", "proposalID of upgrade swtich being queried")
cmd.Flags().String(flagVoter, "", "Address sign the switch msg")

return cmd
}
Loading

0 comments on commit 8d2cc20

Please sign in to comment.