Skip to content

Commit 313b745

Browse files
author
HaoyangLiu
authored
Merge pull request #1356 from irisnet/release0.13
R4R: release version v0.13.0-rc0
2 parents 6a0c96d + 5c70b32 commit 313b745

File tree

33 files changed

+226
-65
lines changed

33 files changed

+226
-65
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 0.13.0-rc0
4+
5+
*March 13th, 2019*
6+
7+
- [iris] fix unexpect coin flow if tx is out of gas
8+
- [iris] Improve error message for insufficient balance
9+
- [iris] Add pagination params for lcd validators query
10+
- [iris] Check the validator existence and validator status before getting its pubkey
11+
- [iris] Reset the init value for metrics
12+
13+
- [tendermint] Fix consensus round issue
14+
- [tendermint] Fix the bug of update the LRU cache
15+
- [tendermint] Add maximum msg size in CheckTx
16+
17+
318
## 0.12.3
419

520
*February 27th, 2019*

Gopkg.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
[[override]]
3333
name = "github.com/tendermint/tendermint"
3434
source = "https://github.com/irisnet/tendermint.git"
35-
version = "=v0.27.3-iris7"
35+
version = "=v0.27.3-iris8"
3636

3737
[[constraint]]
3838
name = "github.com/emicklei/proto"

app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func NewIrisApp(logger log.Logger, db dbm.DB, config *cfg.InstrumentationConfig,
8080
cmn.Exit(fmt.Sprintf("Your software doesn't support the required protocol (version %d)!", current))
8181
}
8282
app.BaseApp.txDecoder = auth.DefaultTxDecoder(engine.GetCurrentProtocol().GetCodec())
83-
83+
engine.GetCurrentProtocol().InitMetrics(app.cms)
8484
return app
8585
}
8686

app/baseapp.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ func (app *BaseApp) runTx(mode RunTxMode, txBytes []byte, tx sdk.Tx) (result sdk
736736
result = sdk.ErrInternal(log).Result()
737737
}
738738
}
739-
739+
ctx.CoinFlowTags().TagClean()
740740
result.GasWanted = gasWanted
741741
result.GasUsed = ctx.GasMeter().GasConsumed()
742742
}()
@@ -836,8 +836,6 @@ func (app *BaseApp) runTx(mode RunTxMode, txBytes []byte, tx sdk.Tx) (result sdk
836836
if result.IsOK() {
837837
msCache.Write()
838838
ctx.CoinFlowTags().TagWrite()
839-
} else {
840-
ctx.CoinFlowTags().TagClean()
841839
}
842840

843841
return

app/protocol/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ type Protocol interface {
2626
Load()
2727
Init()
2828
GetCodec() *codec.Codec
29+
InitMetrics(store sdk.CommitMultiStore) // init metrics
2930
}

app/v0/protocol_v0.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ func (p *ProtocolV0) GetCodec() *codec.Codec {
102102
return p.cdc
103103
}
104104

105+
func (p *ProtocolV0) InitMetrics(store sdk.CommitMultiStore){
106+
p.StakeKeeper.InitMetrics(store.GetKVStore(protocol.KeyStake))
107+
p.serviceKeeper.InitMetrics(store.GetKVStore(protocol.KeyService))
108+
}
109+
105110
func (p *ProtocolV0) configCodec() {
106111
p.cdc = MakeCodec()
107112
}

client/stake/lcd/query.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,26 @@ func delegatorValidatorHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec) ht
214214
// HTTP request handler to query list of validators
215215
func validatorsHandlerFn(cliCtx context.CLIContext, cdc *codec.Codec) http.HandlerFunc {
216216
return func(w http.ResponseWriter, r *http.Request) {
217-
res, err := cliCtx.QueryWithData("custom/stake/validators", nil)
217+
err := r.ParseForm()
218+
if err != nil {
219+
utils.WriteErrorResponse(w, http.StatusBadRequest, sdk.AppendMsgToErr("could not parse query parameters", err.Error()))
220+
return
221+
}
222+
pageStr := r.FormValue("page")
223+
sizeStr := r.FormValue("size")
224+
params, err := ConvertPaginationParams(pageStr, sizeStr)
225+
if err != nil {
226+
utils.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
227+
return
228+
}
229+
230+
bz, err := cdc.MarshalJSON(params)
231+
if err != nil {
232+
utils.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
233+
return
234+
}
235+
236+
res, err := cliCtx.QueryWithData("custom/stake/validators", bz)
218237
if err != nil {
219238
utils.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
220239
return

client/stake/lcd/utils.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package lcd
33
import (
44
"fmt"
55
"net/http"
6+
"strconv"
67

78
"github.com/gorilla/mux"
89
"github.com/irisnet/irishub/client/context"
@@ -315,3 +316,25 @@ func queryValidator(cliCtx context.CLIContext, cdc *codec.Codec, endpoint string
315316
utils.PostProcessResponse(w, cdc, res, cliCtx.Indent)
316317
}
317318
}
319+
320+
func ConvertPaginationParams(pageString, sizeString string) (paginationParams sdk.PaginationParams, err error) {
321+
page := uint64(0)
322+
size := uint16(100)
323+
if pageString != "" {
324+
page, err = strconv.ParseUint(pageString, 10, 64)
325+
if err != nil {
326+
err = fmt.Errorf("page '%s' is not a valid uint64", pageString)
327+
return paginationParams, err
328+
}
329+
}
330+
if sizeString != "" {
331+
sizeUint64, err := strconv.ParseUint(sizeString, 10, 16)
332+
if err != nil {
333+
err = fmt.Errorf("size '%s' is not a valid uint16", sizeString)
334+
return paginationParams, err
335+
}
336+
size = uint16(sizeUint64)
337+
}
338+
paginationParams = sdk.NewPaginationParams(page, size)
339+
return paginationParams, err
340+
}

client/tendermint/tx/searchtx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func SearchTxCmd(cdc *codec.Codec) *cobra.Command {
3333
Long: strings.TrimSpace(`
3434
Search for transactions that match exactly the given tags. For example:
3535
36-
$ iriscli query txs --tags '<tag1>:<value1>&<tag2>:<value2>'
36+
$ iriscli tendermint txs --tags '<tag1>:<value1>&<tag2>:<value2>'
3737
`),
3838
RunE: func(cmd *cobra.Command, args []string) error {
3939
tagsStr := viper.GetString(flagTags)

0 commit comments

Comments
 (0)