Compare commits

..

23 Commits

Author SHA1 Message Date
Ethan Buchman
2aa2b63cad Merge pull request #1942 from tendermint/release/v0.22.3
Release/v0.22.3
2018-07-10 14:12:56 -04:00
Ethan Buchman
17c924de7e changelog, version 2018-07-10 11:56:22 -04:00
Ethan Buchman
ebe97d3956 dep: pin all deps to version or commit 2018-07-10 11:56:19 -04:00
Ethan Buchman
9d81a74429 dev version 2018-07-10 10:12:55 -04:00
Ethan Buchman
5ff65274b8 Merge pull request #1935 from tendermint/release/v0.22.2
Release/v0.22.2
2018-07-10 10:01:55 -04:00
Ethan Buchman
ac3b764b52 update changelog 2018-07-10 09:55:15 -04:00
Ethan Buchman
223095d12f remove Wait from consensus reactor OnStop 2018-07-10 09:48:01 -04:00
Ethan Buchman
af697d3c4a changelog, version 2018-07-10 09:47:40 -04:00
Ethan Buchman
7c06a98b71 Merge branch 'master' into develop 2018-07-10 09:46:31 -04:00
Ethan Buchman
ce824d0b70 Merge pull request #1915 from tendermint/release/v0.22.1
Release/v0.22.1
2018-07-10 09:11:46 -04:00
Anton Kaliaev
4de9d42e4c limit the number of requests in flights for Prometheus server (#1927)
* limit the number of requests in flights for Prometheus server

Closes #1804

Default to 1 because usually there's just one collector.

* config: Up default for prom connections
2018-07-10 15:49:48 +04:00
Alexander Simmerl
ce33914f70 Merge pull request #1928 from tendermint/646-decode-msg
Unexport DecodeMessage
2018-07-10 12:50:33 +02:00
Alexander Simmerl
1cd7d862fa Merge pull request #1929 from tendermint/1901-changelog-2
Add missing changelog entry
2018-07-09 19:48:08 +02:00
Anton Kaliaev
22133ef97a add missing changelog entry
Refs #1901
2018-07-09 13:54:32 +04:00
Anton Kaliaev
a19e857f2e [pex] switch to MustMarshalBinaryBare and UnmarshalBinaryBare
Refs #646
2018-07-09 13:11:41 +04:00
Anton Kaliaev
9120fd5d14 unexport DecodeMessage functions
Refs #646
2018-07-09 13:01:23 +04:00
Alexander Simmerl
f93798f72d Merge branch 'master' into release/v0.22.1 2018-07-07 11:45:20 +02:00
Ethan Buchman
2fa9962835 changelog and version 2018-07-05 12:03:23 -04:00
Ethan Buchman
64bae01d00 Merge pull request #1913 from tendermint/zach/path-fix
HOTFIX: fix url path because cloudfront
2018-07-05 11:48:12 -04:00
Zach
e282b3d761 Merge branch 'master' into zach/path-fix 2018-07-05 10:10:11 -04:00
Ethan Buchman
fa05b03956 Merge pull request #1894 from tendermint/ebuchman-patch-1
Update CHANGELOG.md
2018-07-03 21:20:03 -04:00
Ethan Buchman
087d3e54d2 Update CHANGELOG.md
Emphasize that all integers are encoded as strings in the rpc
2018-07-03 18:52:26 -04:00
Zach Ramsay
71da5e128a fix url path because cloudfront 2018-06-29 09:56:15 -04:00
16 changed files with 173 additions and 109 deletions

View File

@@ -1,16 +1,57 @@
# Changelog
## 0.23.0
## 0.22.3
IMPROVEMENT
IMPROVEMENTS
- Update dependencies
* pin all values in Gopkg.toml to version or commit
* update golang/protobuf to v1.1.0
## 0.22.2
*July 10th, 2018*
IMPROVEMENTS
- More cleanup post repo merge!
- [docs] Include `ecosystem.json` and `tendermint-bft.md` from deprecated `aib-data` repository.
- [config] Add `instrumentation.max_open_connections`, which limits the number
of requests in flight to Prometheus server (if enabled). Default: 3.
BUG FIXES
- [rpc] Allow unquoted integers in requests
- NOTE: this is only for URI requests. JSONRPC requests and all responses
will use quoted integers (the proto3 JSON standard).
- [consensus] Fix halt on shutdown
## 0.22.1
*July 5th, 2018*
IMPROVEMENTS
* Cleanup post repo-merge.
* [docs] Various improvements.
BUG FIXES
* [state] Return error when EndBlock returns a 0-power validator that isn't
already in the validator set.
* [consensus] Shut down WAL properly.
## 0.22.0
*July 2nd, 2018*
BREAKING CHANGES:
- [config] Rename `skip_upnp` to `upnp`, and turn it off by default.
- [config]
* Remove `max_block_size_txs` and `max_block_size_bytes` in favor of
consensus params from the genesis file.
* Rename `skip_upnp` to `upnp`, and turn it off by default.
* Change `max_packet_msg_size` back to `max_packet_msg_payload_size`
- [rpc]
* All integers are encoded as strings (part of the update for Amino v0.10.1)
* `syncing` is now called `catching_up`
- [types] Update Amino to v0.10.1
* Amino is now fully proto3 compatible for the basic types
* JSON-encoded types now use the type name instead of the prefix bytes
@@ -21,9 +62,6 @@ BREAKING CHANGES:
* `tmlibs/merkle` -> `crypto/merkle`. Uses SHA256 instead of RIPEMD160
- [tmlibs] Update to v0.9.0 and merge into `libs`
* remove `merkle` package (moved to `crypto/merkle`)
- [rpc] `syncing` is now called `catching_up`.
- [config] Remove `max_block_size_txs` and `max_block_size_bytes` in favor of
consensus params from the genesis file.
FEATURES
- [cmd] Added metrics (served under `/metrics` using a Prometheus client;

27
Gopkg.lock generated
View File

@@ -11,10 +11,9 @@
branch = "master"
name = "github.com/btcsuite/btcd"
packages = ["btcec"]
revision = "86fed781132ac890ee03e906e4ecd5d6fa180c64"
revision = "fdfc19097e7ac6b57035062056f5b7b4638b8898"
[[projects]]
branch = "master"
name = "github.com/btcsuite/btcutil"
packages = [
"base58",
@@ -29,16 +28,15 @@
version = "v1.1.0"
[[projects]]
branch = "master"
name = "github.com/ebuchman/fail-test"
packages = ["."]
revision = "95f809107225be108efcf10a3509e4ea6ceef3c4"
[[projects]]
branch = "master"
name = "github.com/fortytw2/leaktest"
packages = ["."]
revision = "b008db64ef8daabb22ff6daa557f33b41d8f6ccd"
revision = "a5ef70473c97b71626b9abeda80ee92ba2a7de9e"
version = "v1.2.0"
[[projects]]
name = "github.com/fsnotify/fsnotify"
@@ -185,8 +183,7 @@
"prometheus",
"prometheus/promhttp"
]
revision = "c5b7fccd204277076155f10851dad72b76a49317"
version = "v0.8.0"
revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632"
[[projects]]
branch = "master"
@@ -213,10 +210,9 @@
"nfs",
"xfs"
]
revision = "40f013a808ec4fa79def444a1a56de4d1727efcb"
revision = "ae68e2d4c00fed4943b5f6698d504a5fe083da8a"
[[projects]]
branch = "master"
name = "github.com/rcrowley/go-metrics"
packages = ["."]
revision = "e2704e165165ec55d062f5919b4b29494e9fa790"
@@ -266,8 +262,8 @@
"assert",
"require"
]
revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
version = "v1.2.2"
revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71"
version = "v1.2.1"
[[projects]]
branch = "master"
@@ -286,7 +282,7 @@
"leveldb/table",
"leveldb/util"
]
revision = "e2150783cd35f5b607daca48afd8c57ec54cc995"
revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445"
[[projects]]
branch = "master"
@@ -326,7 +322,6 @@
revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = [
"context",
@@ -338,7 +333,7 @@
"netutil",
"trace"
]
revision = "4cb1c02c05b0e749b0365f61ae859a8e0cfceed9"
revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f"
[[projects]]
branch = "master"
@@ -347,7 +342,7 @@
"cpu",
"unix"
]
revision = "7138fd3d9dc8335c567ca206f4333fb75eb05d56"
revision = "1b2967e3c290b7c545b3db0deeda16e9be4f98a2"
[[projects]]
name = "golang.org/x/text"
@@ -414,6 +409,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "71753a9d4ece4252d23941f116f5ff66c0d5da730a099e5a9867491d223ed93b"
inputs-digest = "b0718135d5ade0a75c6b8fe703f70eb9d8064ba871ec31abd9ace3c4ab944100"
solver-name = "gps-cdcl"
solver-version = 1

View File

@@ -23,16 +23,12 @@
# non-go = false
# go-tests = true
# unused-packages = true
#
###########################################################
# NOTE: All packages should be pinned to specific versions.
# Packages without releases must pin to a commit.
[[constraint]]
name = "github.com/ebuchman/fail-test"
branch = "master"
[[constraint]]
name = "github.com/fortytw2/leaktest"
branch = "master"
[[constraint]]
name = "github.com/go-kit/kit"
version = "=0.6.0"
@@ -47,16 +43,12 @@
[[constraint]]
name = "github.com/gorilla/websocket"
version = "~1.2.0"
version = "=1.2.0"
[[constraint]]
name = "github.com/pkg/errors"
version = "=0.8.0"
[[constraint]]
name = "github.com/rcrowley/go-metrics"
branch = "master"
[[constraint]]
name = "github.com/spf13/cobra"
version = "=0.0.1"
@@ -67,29 +59,60 @@
[[constraint]]
name = "github.com/stretchr/testify"
version = "~1.2.1"
version = "=1.2.1"
[[constraint]]
name = "github.com/tendermint/go-amino"
version = "~0.10.1"
version = "=0.10.1"
[[constraint]]
name = "google.golang.org/grpc"
version = "~1.11.3"
version = "=1.11.3"
# this got updated and broke, so locked to an old working commit ...
[[constraint]]
name = "github.com/fortytw2/leaktest"
version = "=1.2.0"
###################################
## Some repos dont have releases.
## Pin to revision
## We can remove this one by updating protobuf to v1.1.0
## but then the grpc tests break with
#--- FAIL: TestBroadcastTx (0.01s)
#panic: message/group field common.KVPair:bytes without pointer [recovered]
# panic: message/group field common.KVPair:bytes without pointer
#
# ...
#
# github.com/tendermint/tendermint/rpc/grpc_test.TestBroadcastTx(0xc420a5ab40)
# /go/src/github.com/tendermint/tendermint/rpc/grpc/grpc_test.go:29 +0x141
[[override]]
name = "google.golang.org/genproto"
revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200"
[[constraint]]
name = "github.com/ebuchman/fail-test"
revision = "95f809107225be108efcf10a3509e4ea6ceef3c4"
# last revision used by go-crypto
[[constraint]]
name = "github.com/btcsuite/btcutil"
revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4"
# Haven't made a release since 2016.
[[constraint]]
name = "github.com/prometheus/client_golang"
revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632"
[[constraint]]
name = "github.com/rcrowley/go-metrics"
revision = "e2704e165165ec55d062f5919b4b29494e9fa790"
[[constraint]]
name = "golang.org/x/net"
revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f"
[prune]
go-tests = true
unused-packages = true
[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.8.0"
[[constraint]]
branch = "master"
name = "golang.org/x/net"

View File

@@ -5,12 +5,13 @@ import (
"reflect"
"time"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/p2p"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
)
const (
@@ -174,7 +175,7 @@ func (bcR *BlockchainReactor) respondToPeer(msg *bcBlockRequestMessage,
// Receive implements Reactor by handling 4 types of messages (look below).
func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
msg, err := DecodeMessage(msgBytes)
msg, err := decodeMsg(msgBytes)
if err != nil {
bcR.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
bcR.Switch.StopPeerForError(src, err)
@@ -342,17 +343,11 @@ func RegisterBlockchainMessages(cdc *amino.Codec) {
cdc.RegisterConcrete(&bcStatusRequestMessage{}, "tendermint/mempool/StatusRequest", nil)
}
// DecodeMessage decodes BlockchainMessage.
// TODO: ensure that bz is completely read.
func DecodeMessage(bz []byte) (msg BlockchainMessage, err error) {
func decodeMsg(bz []byte) (msg BlockchainMessage, err error) {
if len(bz) > maxMsgSize {
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
len(bz), maxMsgSize)
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
}
err = cdc.UnmarshalBinaryBare(bz, &msg)
if err != nil {
err = cmn.ErrorWrap(err, "DecodeMessage() had bytes left over")
}
return
}

View File

@@ -606,6 +606,12 @@ type InstrumentationConfig struct {
// Address to listen for Prometheus collector(s) connections.
PrometheusListenAddr string `mapstructure:"prometheus_listen_addr"`
// Maximum number of simultaneous connections.
// If you want to accept more significant number than the default, make sure
// you increase your OS limits.
// 0 - unlimited.
MaxOpenConnections int `mapstructure:"max_open_connections"`
}
// DefaultInstrumentationConfig returns a default configuration for metrics
@@ -614,6 +620,7 @@ func DefaultInstrumentationConfig() *InstrumentationConfig {
return &InstrumentationConfig{
Prometheus: false,
PrometheusListenAddr: ":26660",
MaxOpenConnections: 3,
}
}

View File

@@ -262,6 +262,12 @@ prometheus = {{ .Instrumentation.Prometheus }}
# Address to listen for Prometheus collector(s) connections
prometheus_listen_addr = "{{ .Instrumentation.PrometheusListenAddr }}"
# Maximum number of simultaneous connections.
# If you want to accept more significant number than the default, make sure
# you increase your OS limits.
# 0 - unlimited.
max_open_connections = {{ .Instrumentation.MaxOpenConnections }}
`
/****** these are for test settings ***********/

View File

@@ -9,11 +9,11 @@ import (
"github.com/pkg/errors"
amino "github.com/tendermint/go-amino"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
cstypes "github.com/tendermint/tendermint/consensus/types"
cmn "github.com/tendermint/tendermint/libs/common"
tmevents "github.com/tendermint/tendermint/libs/events"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/p2p"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/types"
@@ -80,7 +80,6 @@ func (conR *ConsensusReactor) OnStop() {
conR.BaseReactor.OnStop()
conR.unsubscribeFromBroadcastEvents()
conR.conS.Stop()
conR.conS.Wait()
}
// SwitchToConsensus switches from fast_sync mode to consensus mode.
@@ -184,7 +183,7 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)
return
}
msg, err := DecodeMessage(msgBytes)
msg, err := decodeMsg(msgBytes)
if err != nil {
conR.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
conR.Switch.StopPeerForError(src, err)
@@ -1307,11 +1306,9 @@ func RegisterConsensusMessages(cdc *amino.Codec) {
cdc.RegisterConcrete(&ProposalHeartbeatMessage{}, "tendermint/ProposalHeartbeat", nil)
}
// DecodeMessage decodes the given bytes into a ConsensusMessage.
func DecodeMessage(bz []byte) (msg ConsensusMessage, err error) {
func decodeMsg(bz []byte) (msg ConsensusMessage, err error) {
if len(bz) > maxMsgSize {
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
len(bz), maxMsgSize)
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
}
err = cdc.UnmarshalBinaryBare(bz, &msg)
return

View File

@@ -8,7 +8,7 @@ Welcome to Tendermint!
This location for our documentation has been deprecated, please see:
- https://tendermint.com/docs
- https://tendermint.com/docs/
The last version built by Read The Docs will still be available at:

View File

@@ -209,4 +209,10 @@ prometheus = false
# Address to listen for Prometheus collector(s) connections
prometheus_listen_addr = ":26660"
# Maximum number of simultaneous connections.
# If you want to accept a more significant number than the default, make sure
# you increase your OS limits.
# 0 - unlimited.
max_open_connections = 3
```

View File

@@ -5,10 +5,10 @@ import (
"reflect"
"time"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
clist "github.com/tendermint/tendermint/libs/clist"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/types"
)
@@ -73,7 +73,7 @@ func (evR *EvidenceReactor) RemovePeer(peer p2p.Peer, reason interface{}) {
// Receive implements Reactor.
// It adds any received evidence to the evpool.
func (evR *EvidenceReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
msg, err := DecodeMessage(msgBytes)
msg, err := decodeMsg(msgBytes)
if err != nil {
evR.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
evR.Switch.StopPeerForError(src, err)
@@ -204,11 +204,9 @@ func RegisterEvidenceMessages(cdc *amino.Codec) {
"tendermint/evidence/EvidenceListMessage", nil)
}
// DecodeMessage decodes a byte-array into a EvidenceMessage.
func DecodeMessage(bz []byte) (msg EvidenceMessage, err error) {
func decodeMsg(bz []byte) (msg EvidenceMessage, err error) {
if len(bz) > maxMsgSize {
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
len(bz), maxMsgSize)
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
}
err = cdc.UnmarshalBinaryBare(bz, &msg)
return

View File

@@ -247,11 +247,12 @@ func (mem *Mempool) CheckTx(tx types.Tx, cb func(*abci.Response)) (err error) {
// WAL
if mem.wal != nil {
var buf bytes.Buffer
buf.Write([]byte(tx))
buf.Write([]byte("\n"))
// TODO: Notify administrators when WAL fails
_, err := mem.wal.Write(buf.Bytes())
_, err := mem.wal.Write([]byte(tx))
if err != nil {
mem.logger.Error("Error writing to WAL", "err", err)
}
_, err = mem.wal.Write([]byte("\n"))
if err != nil {
mem.logger.Error("Error writing to WAL", "err", err)
}

View File

@@ -78,7 +78,7 @@ func (memR *MempoolReactor) RemovePeer(peer p2p.Peer, reason interface{}) {
// Receive implements Reactor.
// It adds any received transactions to the mempool.
func (memR *MempoolReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
msg, err := DecodeMessage(msgBytes)
msg, err := decodeMsg(msgBytes)
if err != nil {
memR.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
memR.Switch.StopPeerForError(src, err)
@@ -90,11 +90,7 @@ func (memR *MempoolReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
case *TxMessage:
err := memR.Mempool.CheckTx(msg.Tx, nil)
if err != nil {
if err != ErrTxInCache {
memR.Logger.Error("Could not check tx", "tx", TxID(msg.Tx), "err", err)
} else {
memR.Logger.Debug("Could not check tx", "tx", TxID(msg.Tx), "err", err)
}
memR.Logger.Info("Could not check tx", "tx", TxID(msg.Tx), "err", err)
}
// broadcasting happens from go routines per peer
default:
@@ -139,8 +135,8 @@ func (memR *MempoolReactor) broadcastTxRoutine(peer p2p.Peer) {
memTx := next.Value.(*mempoolTx)
// make sure the peer is up to date
height := memTx.Height()
if peerStateI := peer.Get(types.PeerStateKey); peerStateI != nil {
peerState := peerStateI.(PeerState)
if peerState_i := peer.Get(types.PeerStateKey); peerState_i != nil {
peerState := peerState_i.(PeerState)
peerHeight := peerState.GetHeight()
if peerHeight < height-1 { // Allow for a lag of 1 block
time.Sleep(peerCatchupSleepIntervalMS * time.Millisecond)
@@ -178,11 +174,9 @@ func RegisterMempoolMessages(cdc *amino.Codec) {
cdc.RegisterConcrete(&TxMessage{}, "tendermint/mempool/TxMessage", nil)
}
// DecodeMessage decodes a byte-array into a MempoolMessage.
func DecodeMessage(bz []byte) (msg MempoolMessage, err error) {
func decodeMsg(bz []byte) (msg MempoolMessage, err error) {
if len(bz) > maxMsgSize {
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
len(bz), maxMsgSize)
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
}
err = cdc.UnmarshalBinaryBare(bz, &msg)
return

View File

@@ -8,6 +8,7 @@ import (
"net"
"net/http"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
amino "github.com/tendermint/go-amino"
@@ -599,8 +600,13 @@ func (n *Node) startRPC() ([]net.Listener, error) {
// collectors on addr.
func (n *Node) startPrometheusServer(addr string) *http.Server {
srv := &http.Server{
Addr: addr,
Handler: promhttp.Handler(),
Addr: addr,
Handler: promhttp.InstrumentMetricHandler(
prometheus.DefaultRegisterer, promhttp.HandlerFor(
prometheus.DefaultGatherer,
promhttp.HandlerOpts{MaxRequestsInFlight: n.config.Instrumentation.MaxOpenConnections},
),
),
}
go func() {
if err := srv.ListenAndServe(); err != http.ErrServerClosed {

View File

@@ -206,7 +206,7 @@ func (r *PEXReactor) RemovePeer(p Peer, reason interface{}) {
// Receive implements Reactor by handling incoming PEX messages.
func (r *PEXReactor) Receive(chID byte, src Peer, msgBytes []byte) {
msg, err := DecodeMessage(msgBytes)
msg, err := decodeMsg(msgBytes)
if err != nil {
r.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
r.Switch.StopPeerForError(src, err)
@@ -287,7 +287,7 @@ func (r *PEXReactor) RequestAddrs(p Peer) {
return
}
r.requestsSent.Set(id, struct{}{})
p.Send(PexChannel, cdc.MustMarshalBinary(&pexRequestMessage{}))
p.Send(PexChannel, cdc.MustMarshalBinaryBare(&pexRequestMessage{}))
}
// ReceiveAddrs adds the given addrs to the addrbook if theres an open
@@ -324,7 +324,7 @@ func (r *PEXReactor) ReceiveAddrs(addrs []*p2p.NetAddress, src Peer) error {
// SendAddrs sends addrs to the peer.
func (r *PEXReactor) SendAddrs(p Peer, netAddrs []*p2p.NetAddress) {
p.Send(PexChannel, cdc.MustMarshalBinary(&pexAddrsMessage{Addrs: netAddrs}))
p.Send(PexChannel, cdc.MustMarshalBinaryBare(&pexAddrsMessage{Addrs: netAddrs}))
}
// SetEnsurePeersPeriod sets period to ensure peers connected.
@@ -670,13 +670,11 @@ func RegisterPexMessage(cdc *amino.Codec) {
cdc.RegisterConcrete(&pexAddrsMessage{}, "tendermint/p2p/PexAddrsMessage", nil)
}
// DecodeMessage implements interface registered above.
func DecodeMessage(bz []byte) (msg PexMessage, err error) {
func decodeMsg(bz []byte) (msg PexMessage, err error) {
if len(bz) > maxMsgSize {
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
len(bz), maxMsgSize)
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
}
err = cdc.UnmarshalBinary(bz, &msg)
err = cdc.UnmarshalBinaryBare(bz, &msg)
return
}

View File

@@ -134,11 +134,11 @@ func TestPEXReactorReceive(t *testing.T) {
size := book.Size()
addrs := []*p2p.NetAddress{peer.NodeInfo().NetAddress()}
msg := cdc.MustMarshalBinary(&pexAddrsMessage{Addrs: addrs})
msg := cdc.MustMarshalBinaryBare(&pexAddrsMessage{Addrs: addrs})
r.Receive(PexChannel, peer, msg)
assert.Equal(t, size+1, book.Size())
msg = cdc.MustMarshalBinary(&pexRequestMessage{})
msg = cdc.MustMarshalBinaryBare(&pexRequestMessage{})
r.Receive(PexChannel, peer, msg) // should not panic.
}
@@ -154,7 +154,7 @@ func TestPEXReactorRequestMessageAbuse(t *testing.T) {
assert.True(t, sw.Peers().Has(peer.ID()))
id := string(peer.ID())
msg := cdc.MustMarshalBinary(&pexRequestMessage{})
msg := cdc.MustMarshalBinaryBare(&pexRequestMessage{})
// first time creates the entry
r.Receive(PexChannel, peer, msg)
@@ -191,7 +191,7 @@ func TestPEXReactorAddrsMessageAbuse(t *testing.T) {
assert.True(t, sw.Peers().Has(peer.ID()))
addrs := []*p2p.NetAddress{peer.NodeInfo().NetAddress()}
msg := cdc.MustMarshalBinary(&pexAddrsMessage{Addrs: addrs})
msg := cdc.MustMarshalBinaryBare(&pexAddrsMessage{Addrs: addrs})
// receive some addrs. should clear the request
r.Receive(PexChannel, peer, msg)
@@ -303,7 +303,7 @@ func TestPEXReactorDoesNotAddPrivatePeersToAddrBook(t *testing.T) {
size := book.Size()
addrs := []*p2p.NetAddress{peer.NodeInfo().NetAddress()}
msg := cdc.MustMarshalBinary(&pexAddrsMessage{Addrs: addrs})
msg := cdc.MustMarshalBinaryBare(&pexAddrsMessage{Addrs: addrs})
pexR.Receive(PexChannel, peer, msg)
assert.Equal(t, size, book.Size())

View File

@@ -3,14 +3,14 @@ package version
// Version components
const (
Maj = "0"
Min = "23"
Fix = "0"
Min = "22"
Fix = "3"
)
var (
// Version is the current version of Tendermint
// Must be a string because scripts like dist.sh read this file.
Version = "0.23.0-dev"
Version = "0.22.3"
// GitCommit is the current HEAD set using ldflags.
GitCommit string