Skip to content

Commit

Permalink
Merge pull request #2059 from irisnet/develop
Browse files Browse the repository at this point in the history
R4R: Release v0.16.0-rc0
  • Loading branch information
dreamer-zq authored Nov 5, 2019
2 parents a9d5a97 + b5532ae commit c30ec25
Show file tree
Hide file tree
Showing 715 changed files with 29,613 additions and 21,272 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
vendor
.DS_Store
.idea
.vscode
build/
.out
docs/.vuepress/dist/
Expand All @@ -9,4 +10,3 @@ package.json
yarn.lock
lite/statik/statik.go
dependency-graph.png

58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# Changelog

## Unreleased

### Breaking Changes

* [\#1912](https://github.com/irisnet/irishub/issues/1912) Update prometheus metrics

### LCD (REST API)

* [\#1858](https://github.com/irisnet/irishub/issues/1858) Add new function - AddLiquidity
* [\#1859](https://github.com/irisnet/irishub/issues/1859) Add new function - RemoveLiquidity
* [\#1860](https://github.com/irisnet/irishub/issues/1860) Add new function - Swap Coin
* [\#1861](https://github.com/irisnet/irishub/issues/1861) Add new function - Query Exchange
* [\#1948](https://github.com/irisnet/irishub/issues/1948) Add client for HTLC

### CLI

* [\#1948](https://github.com/irisnet/irishub/issues/1948) Add client for HTLC
* [\#2030](https://github.com/irisnet/irishub/issues/2030) Fix CLI test for HTLC

### Application

* [\#1858](https://github.com/irisnet/irishub/issues/1858) Add new function - AddLiquidity
* [\#1859](https://github.com/irisnet/irishub/issues/1859) Add new function - RemoveLiquidity
* [\#1860](https://github.com/irisnet/irishub/issues/1860) Add new function - Swap Coin
* [\#1861](https://github.com/irisnet/irishub/issues/1861) Add new function - Query Exchange
* [\#1872](https://github.com/irisnet/irishub/issues/1872) Replace time.Time with uint64 in coinswap msgs
* [\#1811](https://github.com/irisnet/irishub/issues/1811) Add docs for coin-swap
* [\#1879](https://github.com/irisnet/irishub/issues/1879) Add tags for coinswap module
* [\#1910](https://github.com/irisnet/irishub/issues/1910) Add coin-flow for coin-swap module
* [\#1912](https://github.com/irisnet/irishub/issues/1912) Update prometheus metrics
* [\#1936](https://github.com/irisnet/irishub/issues/1936) Update denom's specification
* [\#1941](https://github.com/irisnet/irishub/issues/1941) Refactor document website documentation
* [\#1946](https://github.com/irisnet/irishub/issues/1946) Add new function - Create HTLC
* [\#1949](https://github.com/irisnet/irishub/issues/1949) Add new function - Claim and Refund in HTLC
* [\#1965](https://github.com/irisnet/irishub/issues/1965) Add user docs and specification for HTLC
* [\#1984](https://github.com/irisnet/irishub/issues/1984) Update HTLC docs
* [\#1985](https://github.com/irisnet/irishub/issues/1985) Code formatting and cleaning
* [\#1988](https://github.com/irisnet/irishub/issues/1988) Add HTLC genesis
* [\#1991](https://github.com/irisnet/irishub/issues/1991) Add Coinswap feature doc
* [\#1995](https://github.com/irisnet/irishub/issues/1995) Improve HTLC
* [\#2008](https://github.com/irisnet/irishub/issues/2008) Enhance HTLC genesis test
* [\#2013](https://github.com/irisnet/irishub/issues/2013) Modify timestamp type in LCD
* [\#2015](https://github.com/irisnet/irishub/issues/2015) Add HTLC feature docs

### Tendermint

* [\#1880](https://github.com/irisnet/irishub/issues/1880) Ensure generated private keys are valid
* [\#1885](https://github.com/irisnet/irishub/issues/1885) tendermint use Go modules instead of dep
* [\#1908](https://github.com/irisnet/irishub/issues/1908) Update p2p to v0.32
* [\#1909](https://github.com/irisnet/irishub/issues/1909) Support boltdb
* [\#1913](https://github.com/irisnet/irishub/issues/1913) Remove db from in favor of tendermint/tm-db
* [\#1917](https://github.com/irisnet/irishub/issues/1917) Create a peer state in consensus reactor before the peer is started
* [\#1918](https://github.com/irisnet/irishub/issues/1918) Improve error message returned from AddSignatureFromPubKey
* [\#1919](https://github.com/irisnet/irishub/issues/1919) Self node in addrbook.json and node tries to dial itself
* [\#1920](https://github.com/irisnet/irishub/issues/1920) Fix profiler blocking the entire node
* [\#1921](https://github.com/irisnet/irishub/issues/1921) Exit if SwitchToConsensus fails
* [\#1922](https://github.com/irisnet/irishub/issues/1922) Improve transaction search

## 0.15.5

*Oct 30th, 2019*
Expand Down
89 changes: 46 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# Contributing

Thank you for considering making contributions to irishub!
Thank you for considering making contributions to irishub!

Contributing to this repo can mean many things such as participated in
discussion or proposing code changes. To ensure a smooth workflow for all
contributors, the general procedure for contributing has been established:

1. either [open](https://github.com/irisnet/irishub/issues/new) or
[find](https://github.com/irisnet/irishub/issues) an issue you'd like to help with,
2. participate in thoughtful discussion on that issue,
[find](https://github.com/irisnet/irishub/issues) an issue you'd like to help with,
2. participate in thoughtful discussion on that issue,
3. if you would then like to contribute code:
1. if the issue is a proposal, ensure that the proposal has been accepted,
1. if the issue is a proposal, ensure that the proposal has been accepted,
2. ensure that nobody else has already begun working on this issue, if they have
make sure to contact them to collaborate,
make sure to contact them to collaborate,
3. if nobody has been assigned the issue and you would like to work on it
make a comment on the issue to inform the community of your intentions
to begin work,
4. follow standard github best practices: fork the repo,
to begin work,
4. follow standard github best practices: fork the repo,
if the issue if a bug fix, branch from the
tip of `develop`, make some commits, and submit a PR to `develop`; if the issue is a new feature, branch from the tip of `feature/XXX`, make some commits, and submit a PR to `feature/XXX`
5. include `WIP:` in the PR-title to and submit your PR early, even if it's
incomplete, this indicates to the community you're working on something and
allows them to provide comments early in the development process. When the code
is complete it can be marked as ready-for-review by replacing `WIP:` with
`R4R:` in the PR-title.
`R4R:` in the PR-title.

Note that for very small or blatantly obvious problems (such as typos) it is
not required to an open issue to submit a PR, but be aware that for more complex
problems/features, if a PR is opened before an adequate design discussion has
taken place in a github issue, that PR runs a high likelihood of being rejected.

Note, we use `make
get_dev_tools` and `make update_dev_tools` for installing the linting tools.Please make sure to use `gofmt` before every commit - the easiest way to do this is have your editor run it for you upon saving a file.
get_dev_tools` and `make update_dev_tools` for installing the linting tools.Please make sure to use `gofmt` before every commit - the easiest way to do this is have your editor run it for you upon saving a file.

## Pull Requests

To accommodate review process we suggest that PRs are categorically broken up.
To accommodate review process we suggest that PRs are categorically broken up.
Ideally each PR addresses only a single issue. Additionally, as much as possible
code refactoring and cleanup should be submitted as a separate PRs. And the feature branch `feature/XXX` should be synced with `develop` regularly.

Expand All @@ -45,7 +45,7 @@ We use [dep](https://github.com/golang/dep) to manage dependencies.

Since some dependencies are not under our control, a third party may break our
build, in which case we can fall back on `dep ensure` (or `make
get_vendor_deps`).
get_vendor_deps`).

## Testing

Expand All @@ -56,41 +56,44 @@ We expect tests to use `require` or `assert` rather than `t.Skip` or `t.Fail`,un
### PR Targeting

Ensure that you base and target your PR on the correct branch:
- `release/vxx.yy` for a merge into a release candidate
- `master` for a merge of a release
- `develop` in the usual case

- `release/vxx.yy` for a merge into a release candidate
- `master` for a merge of a release
- `develop` in the usual case

All feature additions should be targeted against `feature/XXX`. Bug fixes for an outstanding release candidate
should be targeted against the release candidate branch. Release candidate branches themselves should be the
only pull requests targeted directly against master.

### Development Procedure:
- the latest state of development is on `develop`
- `develop` must never fail `make test`
- no --force onto `develop` (except when reverting a broken commit, which should seldom happen)

### Pull Merge Procedure:
- ensure `feature/XXX` is rebased on `develop`
- ensure pull branch is rebased on `feature/XXX`
- run `make test` to ensure that all tests pass
- merge pull request
- push `feature/XXX` into `develop` regularly

### Release Procedure:
- start on `develop`
- prepare changelog/release issue
- bump versions
- push to `release-vX.X.X` to run CI
- merge to master
- merge master back to develop

### Hotfix Procedure:
- start on `release-vX.X.X`
- make the required changes
- these changes should be small and an absolute necessity
- add a note to CHANGELOG.md
- bump versions
- merge `release-vX.X.X` to master if necessary
- merge `release-vX.X.X` to develop if necessary

### Development Procedure

- the latest state of development is on `develop`
- `develop` must never fail `make test`
- no --force onto `develop` (except when reverting a broken commit, which should seldom happen)

### Pull Merge Procedure

- ensure `feature/XXX` is rebased on `develop`
- ensure pull branch is rebased on `feature/XXX`
- run `make test` to ensure that all tests pass
- merge pull request
- push `feature/XXX` into `develop` regularly

### Release Procedure

- start on `develop`
- prepare changelog/release issue
- bump versions
- push to `release-vX.X.X` to run CI
- merge to master
- merge master back to develop

### Hotfix Procedure

- start on `release-vX.X.X`
- make the required changes
- these changes should be small and an absolute necessity
- add a note to CHANGELOG.md
- bump versions
- merge `release-vX.X.X` to master if necessary
- merge `release-vX.X.X` to develop if necessary
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation' | grep -v '/server' | grep -v '/tests')
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation' | grep -v '/tests')
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')

export GO111MODULE = on
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# IRISHub

![Banner](https://raw.githubusercontent.com/irisnet/irishub/master/docs/pics/iris.jpg)

[![License](https://img.shields.io/github/license/irisnet/irishub.svg)](https://github.com/irisnet/irishub/blob/master/LICENSE)
Expand All @@ -9,21 +10,18 @@
IRIS network (a.k.a. IRISnet) aims to establish a technology foundation to facilitate construction of next-generation distributed applications. By incorporating a comprehensive service infrastructure and an enhanced IBC protocol into the Tendermint & Cosmos stack, IRISnet enables service interoperability as well as token transfers across an internet of blockchains.
As the centerpiece of IRISnet, IRIS Hub (a.k.a. IRIShub) will be the first regional hub connecting to the main Cosmos Hub, thus making IRISnet an inseparable part of the whole Cosmos network.


## IRIS Hub Mainnet

To join the mainnet, follow
[this guide](https://www.irisnet.org/docs/get-started/Join-the-Mainnet.html).
To join the mainnet, follow [this guide](https://www.irisnet.org/docs/get-started/mainnet.html).

## Install

See the
[install instructions](https://www.irisnet.org/docs/software/How-to-install-irishub.html).
See the [install instructions](https://www.irisnet.org/docs/get-started/install.html).

## Resources

* Explorer: https://www.irisplorer.io/#/home
* Riot chat: https://riot.im/app/#/room/#irisvalidators:matrix.org
* Explorer: <https://www.irisplorer.io>
* Riot chat: <https://riot.im/app/#/room/#irisvalidators:matrix.org>

## How To Contribute

Expand Down
25 changes: 17 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/irisnet/irishub/app/protocol"
v0 "github.com/irisnet/irishub/app/v0"
v1 "github.com/irisnet/irishub/app/v1"
v2 "github.com/irisnet/irishub/app/v2"
"github.com/irisnet/irishub/codec"
"github.com/irisnet/irishub/modules/auth"
"github.com/irisnet/irishub/store"
Expand All @@ -19,17 +20,20 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
cfg "github.com/tendermint/tendermint/config"
cmn "github.com/tendermint/tendermint/libs/common"
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
)

const (
appName = "IrisApp"
appPrometheusNamespace = "iris"
FlagReplay = "replay-last-block"
DefaultSyncableHeight = store.NumStoreEvery // Multistore saves a snapshot every 10000 blocks
DefaultCacheSize = store.NumRecent // Multistore saves last 100 blocks
// FlagReplay used for replaying last block
FlagReplay = "replay-last-block"
// Multistore saves a snapshot every 10000 blocks
DefaultSyncableHeight = store.NumStoreEvery
// Multistore saves last 100 blocks
DefaultCacheSize = store.NumRecent
)

// default home directories for expected binaries
Expand All @@ -39,11 +43,12 @@ var (
DefaultNodeHome = os.ExpandEnv("$HOME/.iris")
)

// Extended ABCI application
//IrisApp Extended ABCI application
type IrisApp struct {
*BaseApp
}

// NewIrisApp generates an iris application
func NewIrisApp(logger log.Logger, db dbm.DB, config *cfg.InstrumentationConfig, traceStore io.Writer, baseAppOptions ...func(*BaseApp)) *IrisApp {
bApp := NewBaseApp(appName, logger, db, baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
Expand Down Expand Up @@ -73,6 +78,7 @@ func NewIrisApp(logger log.Logger, db dbm.DB, config *cfg.InstrumentationConfig,
appPrometheusConfig.Namespace = appPrometheusNamespace
engine.Add(v0.NewProtocolV0(0, logger, protocolKeeper, app.checkInvariant, app.trackCoinFlow, &appPrometheusConfig))
engine.Add(v1.NewProtocolV1(1, logger, protocolKeeper, app.checkInvariant, app.trackCoinFlow, &appPrometheusConfig))
engine.Add(v2.NewProtocolV2(2, logger, protocolKeeper, app.checkInvariant, app.trackCoinFlow, &appPrometheusConfig))
// engine.Add(v1.NewProtocolV1(1, ...))
// engine.Add(v2.NewProtocolV1(2, ...))

Expand All @@ -85,16 +91,18 @@ func NewIrisApp(logger log.Logger, db dbm.DB, config *cfg.InstrumentationConfig,
return app
}

// latest version of codec
// MakeLatestCodec loads the lastest verson codec
func MakeLatestCodec() *codec.Codec {
var cdc = v1.MakeCodec() // replace with latest protocol version
var cdc = v2.MakeCodec() // replace with latest protocol version
return cdc
}

// LastBlockHeight returns the last blcok height
func (app *IrisApp) LastBlockHeight() int64 {
return app.BaseApp.LastBlockHeight()
}

// ResetOrReplay returns whether you need to reset or replay
func (app *IrisApp) ResetOrReplay(replayHeight int64) (replay bool, height int64) {
lastBlockHeight := app.BaseApp.LastBlockHeight()
if replayHeight > lastBlockHeight {
Expand Down Expand Up @@ -155,12 +163,13 @@ func (app *IrisApp) ResetOrReplay(replayHeight int64) (replay bool, height int64

}

// export the state of iris for a genesis file
// ExportAppStateAndValidators exports the state of iris for a genesis file
func (app *IrisApp) ExportAppStateAndValidators(forZeroHeight bool) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error) {
ctx := app.NewContext(true, abci.Header{Height: app.LastBlockHeight()})
return app.Engine.GetCurrentProtocol().ExportAppStateAndValidators(ctx, forZeroHeight)
}

// LoadHeight loads to the specified height
func (app *IrisApp) LoadHeight(height int64) error {
return app.LoadVersion(height, protocol.KeyMain, false)
}
Expand Down
8 changes: 4 additions & 4 deletions app/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/pkg/errors"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
tmstate "github.com/tendermint/tendermint/state"
dbm "github.com/tendermint/tm-db"
)

// Key to store the consensus params in the main store.
Expand Down Expand Up @@ -507,7 +507,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
// by InitChain. Context is now updated with Header information.
app.deliverState.ctx = app.deliverState.ctx.
WithBlockHeader(req.Header).
WithBlockHeight(req.Header.Height).WithCheckValidNum(0)
WithCheckValidNum(sdk.NewValidTxCounter())
}

// add block gas meter
Expand Down Expand Up @@ -706,7 +706,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (
return ctx.WithMultiStore(msCache), msCache
}

// runTx processes a transaction. The transactions is proccessed via an
// runTx processes a transaction. The transactions is processed via an
// anteHandler. txBytes may be nil in some cases, eg. in tests. Also, in the
// future we may support "internal" transactions.
func (app *BaseApp) runTx(mode RunTxMode, txBytes []byte, tx sdk.Tx) (result sdk.Result) {
Expand Down Expand Up @@ -745,7 +745,7 @@ func (app *BaseApp) runTx(mode RunTxMode, txBytes []byte, tx sdk.Tx) (result sdk
}

if mode == RunTxModeDeliver {
app.deliverState.ctx = app.deliverState.ctx.WithCheckValidNum(app.deliverState.ctx.CheckValidNum() + 1)
app.deliverState.ctx.ValidTxCounter().Incr()
}

defer func() {
Expand Down
2 changes: 1 addition & 1 deletion app/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/irisnet/irishub/store"
sdk "github.com/irisnet/irishub/types"
dbm "github.com/tendermint/tendermint/libs/db"
dbm "github.com/tendermint/tm-db"
)

// File for storing in-package BaseApp optional functions,
Expand Down
Loading

0 comments on commit c30ec25

Please sign in to comment.