Skip to content

Commit

Permalink
Merge pull request #1306 from irisnet/release0.12
Browse files Browse the repository at this point in the history
R4R: Release version 0.12.2-rc0
  • Loading branch information
wukongcheng authored Feb 26, 2019
2 parents c7d0047 + 5d87825 commit 92dd825
Show file tree
Hide file tree
Showing 157 changed files with 1,695 additions and 632 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# Changelog

## 0.12.2-rc0

*February 26th, 2019*

- Set max commission rate and max commission change rate to 100%
- Implement coin flow record feature for "internal transactions"
- Support Ledger Nano S and KMS
- Update the default gas_price_threshold to be 6000iris-nano
- No slashing for Censorship or Downtime
- No slashing for non-voting for proposals
- Configure the default build environment as mainnet
- Set the default gas limit to be 50000
- Fix wrong withdraw address
- Fix gas simulate issue
- Display correct validator consensus pubkey
- Improve the documents


## 0.12.1

*February 14th, 2019*

- Fix the bug of repeatability check about evidence in the tendermint
- Change the invariant level for mainnet


## 0.12.0

*February 11th, 2019*
Expand Down
40 changes: 40 additions & 0 deletions Dockerfile-Testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Simple usage with a mounted data directory:
# > docker build -t irishub .
# > docker run -v $HOME/.iris:/root/.iris iris init
# > docker run -v $HOME/.iris:/root/.iris iris start

FROM golang:1.10-alpine3.7 as builder

# Set up dependencies
ENV PACKAGES make gcc git libc-dev bash

# Set up GOPATH & PATH

ENV GOPATH /root/go
ENV BASE_PATH $GOPATH/src/github.com/irisnet
ENV REPO_PATH $BASE_PATH/irishub
ENV PATH $GOPATH/bin:$PATH

# Add source files
COPY . $REPO_PATH/

# Install minimum necessary dependencies, build Cosmos SDK, remove packages
RUN cd $REPO_PATH && \
apk add --no-cache $PACKAGES && \
go get github.com/golang/dep/cmd/dep && \
make get_tools && \
make get_vendor_deps && \
make test_unit && \
make build_linux && \
source scripts/setTestEnv.sh && \
make install && \
make test_cli

FROM alpine:3.7

# p2p port
EXPOSE 26656
# rpc port
EXPOSE 26657

COPY --from=builder /root/go/src/github.com/irisnet/irishub/build/ /usr/local/bin/
42 changes: 0 additions & 42 deletions Dockerfile-dev

This file was deleted.

41 changes: 25 additions & 16 deletions Gopkg.lock

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

9 changes: 6 additions & 3 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
[[override]]
name = "github.com/tendermint/tendermint"
source = "https://github.com/irisnet/tendermint.git"
version = "=v0.27.3-iris6"
version = "=v0.27.3-iris7"

[[constraint]]
name = "github.com/emicklei/proto"
Expand Down Expand Up @@ -83,8 +83,8 @@
revision = "52158e4697b87de16ed390e1bdaf813e581008fa"

[[constraint]]
name = "github.com/zondax/ledger-goclient"
version = "=v0.1.0"
name = "github.com/zondax/ledger-cosmos-go"
version = "=v0.9.7"

## transitive deps, with releases:

Expand Down Expand Up @@ -114,3 +114,6 @@
[prune]
go-tests = true
unused-packages = true
[[prune.project]]
name = "github.com/zondax/hid"
unused-packages = false
42 changes: 35 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,48 @@ all: get_tools get_vendor_deps install build_cur

COMMIT_HASH := $(shell git rev-parse --short HEAD)

InvariantLevel := $(shell if [ -z ${InvariantLevel} ]; then echo "panic"; else echo ${InvariantLevel}; fi)
NetworkType := $(shell if [ -z ${NetworkType} ]; then echo "testnet"; else echo ${NetworkType}; fi)
InvariantLevel := $(shell if [ -z ${InvariantLevel} ]; then echo "error"; else echo ${InvariantLevel}; fi)
NetworkType := $(shell if [ -z ${NetworkType} ]; then echo "mainnet"; else echo ${NetworkType}; fi)

BUILD_FLAGS = -ldflags "\
BUILD_TAGS = netgo

BUILD_FLAGS = -tags "$(BUILD_TAGS)" -ldflags "\
-X github.com/irisnet/irishub/version.GitCommit=${COMMIT_HASH} \
-X github.com/irisnet/irishub/types.InvariantLevel=${InvariantLevel} \
-X github.com/irisnet/irishub/types.NetworkType=${NetworkType}"
LEDGER_ENABLED ?= true

########################################
### Build/Install

ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
GCCEXE = $(shell where gcc.exe 2> NUL)
ifeq ($(GCCEXE),)
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
BUILD_TAGS += ledger
endif
else
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S),OpenBSD)
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
else
GCC = $(shell command -v gcc 2> /dev/null)
ifeq ($(GCC),)
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
BUILD_TAGS += ledger
endif
endif
endif
endif

########################################
### Tools & dependencies

echo_bech32_prefix:
@echo "\"source scripts/setProdEnv.sh\" to set compile environment variables for your product, or default values will be applied"
@echo "If you want to build binaries for testnet, please execute \"source scripts/setTestEnv.sh\" first"
@echo InvariantLevel=${InvariantLevel}
@echo NetworkType=${NetworkType}

Expand Down Expand Up @@ -120,17 +149,16 @@ test_sim_iris_slow:
@go test ./app -run TestFullIrisSimulation -v -SimulationEnabled=true -SimulationNumBlocks=1000 -SimulationVerbose=true -timeout 24h

testnet_init:
@echo "Work well only when Bech32PrefixAccAddr equal faa"
@if ! [ -f build/iris ]; then $(MAKE) build_linux ; fi
@if ! [ -f build/nodecluster/node0/iris/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/home ubuntu:16.04 /home/iris testnet --v 4 --output-dir /home/nodecluster --chain-id irishub-test --starting-ip-address 192.168.10.2 ; fi
@echo "To install jq command, please refer to this page: https://stedolan.github.io/jq/download/"
@jq '.app_state.accounts+= [{"address": "faa1ljemm0yznz58qxxs8xyak7fashcfxf5lssn6jm", "coins": [ "1000000iris" ], "sequence_number": "0", "account_number": "0"}]' build/nodecluster/node0/iris/config/genesis.json > build/genesis_temp.json
@if [ ${NetworkType} = "testnet" ]; then jq '.app_state.accounts+= [{"address": "faa1ljemm0yznz58qxxs8xyak7fashcfxf5lssn6jm", "coins": [ "1000000iris" ], "sequence_number": "0", "account_number": "0"}]' build/nodecluster/node0/iris/config/genesis.json > build/genesis_temp.json ; else jq '.app_state.accounts+= [{"address": "iaa1ljemm0yznz58qxxs8xyak7fashcfxf5lgl4zjx", "coins": [ "1000000iris" ], "sequence_number": "0", "account_number": "0"}]' build/nodecluster/node0/iris/config/genesis.json > build/genesis_temp.json ; fi
@sudo cp build/genesis_temp.json build/nodecluster/node0/iris/config/genesis.json
@sudo cp build/genesis_temp.json build/nodecluster/node1/iris/config/genesis.json
@sudo cp build/genesis_temp.json build/nodecluster/node2/iris/config/genesis.json
@sudo cp build/genesis_temp.json build/nodecluster/node3/iris/config/genesis.json
@rm build/genesis_temp.json
@echo "Faucet address: faa1ljemm0yznz58qxxs8xyak7fashcfxf5lssn6jm"
@if [ ${NetworkType} = "testnet" ]; then echo "Faucet address: faa1ljemm0yznz58qxxs8xyak7fashcfxf5lssn6jm" ; else echo "Faucet address: iaa1ljemm0yznz58qxxs8xyak7fashcfxf5lgl4zjx" ; fi
@echo "Faucet coin amount: 1000000iris"
@echo "Faucet key seed: tube lonely pause spring gym veteran know want grid tired taxi such same mesh charge orient bracket ozone concert once good quick dry boss"

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewIrisApp(logger log.Logger, db dbm.DB, config *cfg.InstrumentationConfig,
appPrometheusConfig := *config
//Change namespace to appName
appPrometheusConfig.Namespace = appPrometheusNamespace
engine.Add(v0.NewProtocolV0(0, logger, protocolKeeper, app.checkInvariant, &appPrometheusConfig))
engine.Add(v0.NewProtocolV0(0, logger, protocolKeeper, app.checkInvariant, app.trackCoinFlow, &appPrometheusConfig))
// engine.Add(v1.NewProtocolV1(1, ...))
// engine.Add(v2.NewProtocolV1(2, ...))

Expand Down
18 changes: 15 additions & 3 deletions app/baseapp.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app

import (
"encoding/hex"
"fmt"
"io"
"runtime/debug"
Expand Down Expand Up @@ -73,6 +74,9 @@ type BaseApp struct {
// enable invariant check
checkInvariant bool

// enable track coin flow
trackCoinFlow bool

// flag for sealing
sealed bool
}
Expand Down Expand Up @@ -210,6 +214,9 @@ func (app *BaseApp) SetMinimumFees(fees sdk.Coins) { app.minimumFees = fees }
// SetInvariantCheck sets the invariant check config.
func (app *BaseApp) SetCheckInvariant(check bool) { app.checkInvariant = check }

// SetTrackCoinFlow sets the config about track coin flow
func (app *BaseApp) SetTrackCoinFlow(enable bool) { app.trackCoinFlow = enable }

// NewContext returns a new Context with the correct store, the given header, and nil txBytes.
func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) sdk.Context {
if isCheckTx {
Expand Down Expand Up @@ -381,7 +388,7 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) (res abc
if err != nil {
result = err.Result()
} else {
result = app.Simulate(tx)
result = app.Simulate(tx, txBytes)
}
case "version":
return abci.ResponseQuery{
Expand Down Expand Up @@ -499,7 +506,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
gasMeter = sdk.NewInfiniteGasMeter()
}
app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(gasMeter).
WithLogger(app.deliverState.ctx.Logger().With("height", app.deliverState.ctx.BlockHeight()))
WithLogger(app.deliverState.ctx.Logger().With("height", app.deliverState.ctx.BlockHeight())).WithCoinFlowTags(sdk.NewCoinFlowRecord(app.trackCoinFlow))

beginBlocker := app.Engine.GetCurrentProtocol().GetBeginBlocker()

Expand Down Expand Up @@ -588,10 +595,12 @@ func validateBasicTxMsgs(msgs []sdk.Msg) sdk.Error {

// retrieve the context for the tx w/ txBytes and other memoized values.
func (app *BaseApp) getContextForTx(mode RunTxMode, txBytes []byte) (ctx sdk.Context) {
txHash := hex.EncodeToString(tmhash.Sum(txBytes))
ctx = app.getState(mode).ctx.
WithTxBytes(txBytes).
WithVoteInfos(app.voteInfos).
WithConsensusParams(app.consensusParams)
WithConsensusParams(app.consensusParams).
WithCoinFlowTrigger(txHash)
if mode == RunTxModeSimulate {
ctx, _ = ctx.CacheContext()
}
Expand Down Expand Up @@ -826,6 +835,9 @@ func (app *BaseApp) runTx(mode RunTxMode, txBytes []byte, tx sdk.Tx) (result sdk
// only update state if all messages pass
if result.IsOK() {
msCache.Write()
ctx.CoinFlowTags().TagWrite()
} else {
ctx.CoinFlowTags().TagClean()
}

return
Expand Down
Loading

0 comments on commit 92dd825

Please sign in to comment.