Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #170 from bnb-chain/develop
Browse files Browse the repository at this point in the history
[R4R] prepare for release v0.32.3-binance.7
  • Loading branch information
forcodedancing authored Apr 28, 2022
2 parents 75949c2 + 1b02d16 commit 98f2190
Show file tree
Hide file tree
Showing 53 changed files with 190 additions and 189 deletions.
46 changes: 25 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
# Changelog
## v0.32.3-binance.7
- [bug-fix] [\#167](https://github.com/bnb-chain/bnc-tendermint/pull/167) change file permission and add error handling
- [go] [\#168](https://github.com/bnb-chain/bnc-tendermint/pull/168) upgrade go version to 1.17 and replace ioutil with io/os

## v0.32.3-binance.6
- [go] [\#163](https://github.com/binance-chain/bnc-tendermint/pull/163) update go version to 1.16
- [crypto] [\#164](https://github.com/binance-chain/bnc-tendermint/pull/164) fix infinite recursion in Secp256k1 String() method
- [go] [\#163](https://github.com/bnb-chain/bnc-tendermint/pull/163) update go version to 1.16
- [crypto] [\#164](https://github.com/bnb-chain/bnc-tendermint/pull/164) fix infinite recursion in Secp256k1 String() method

## v0.32.3-binance.5
- [api] [\#150](https://github.com/binance-chain/bnc-tendermint/pull/150) relax tx querying
- [p2p] [\#151](https://github.com/binance-chain/bnc-tendermint/pull/151) return masked IP (not the actual IP) in addrbook#groupKey
- [consensus] [\#152](https://github.com/binance-chain/bnc-tendermint/pull/152) validate incoming messages
- [consensus] [\#153](https://github.com/binance-chain/bnc-tendermint/pull/153) Fix consensus failure when remote signer drops
- [bug-fix] [\#155](https://github.com/binance-chain/bnc-tendermint/pull/155) Bugfix post v0.32
- [api] [\#150](https://github.com/bnb-chain/bnc-tendermint/pull/150) relax tx querying
- [p2p] [\#151](https://github.com/bnb-chain/bnc-tendermint/pull/151) return masked IP (not the actual IP) in addrbook#groupKey
- [consensus] [\#152](https://github.com/bnb-chain/bnc-tendermint/pull/152) validate incoming messages
- [consensus] [\#153](https://github.com/bnb-chain/bnc-tendermint/pull/153) Fix consensus failure when remote signer drops
- [bug-fix] [\#155](https://github.com/bnb-chain/bnc-tendermint/pull/155) Bugfix post v0.32

## v0.32.3-binance.4
- [sync] [\#157](https://github.com/binance-chain/bnc-tendermint/pull/157) fix goroutine/memory leak under hotsync when receive consensus message
- [api] [\#148](https://github.com/binance-chain/bnc-tendermint/pull/148) fix `validators` api does now show correct height issue
- [sync] [\#157](https://github.com/bnb-chain/bnc-tendermint/pull/157) fix goroutine/memory leak under hotsync when receive consensus message
- [api] [\#148](https://github.com/bnb-chain/bnc-tendermint/pull/148) fix `validators` api does now show correct height issue

## v0.32.3-binance.3
- [sync] [\#147](https://github.com/binance-chain/bnc-tendermint/pull/147) fix not panic when do not have block under state sync
- [sync] [\#147](https://github.com/bnb-chain/bnc-tendermint/pull/147) fix not panic when do not have block under state sync

## v0.32.3-binance.2
### BUG FIXES:
- [status] [\#140](https://github.com/binance-chain/bnc-tendermint/pull/140) fix hot sync not a catched up status
- [consensus] [\#141](https://github.com/binance-chain/bnc-tendermint/pull/141) fix bug in load last validator set
- [index] [\#142](https://github.com/binance-chain/bnc-tendermint/pull/142) fix index height can not set after state sync
- [status] [\#140](https://github.com/bnb-chain/bnc-tendermint/pull/140) fix hot sync not a catched up status
- [consensus] [\#141](https://github.com/bnb-chain/bnc-tendermint/pull/141) fix bug in load last validator set
- [index] [\#142](https://github.com/bnb-chain/bnc-tendermint/pull/142) fix index height can not set after state sync

## v0.32.3-binance.1

### IMPROVEMENTS:

- [Performance] [\#110](https://github.com/binance-chain/bnc-tendermint/pull/110) Improve performance
- [Performance] [\#110](https://github.com/bnb-chain/bnc-tendermint/pull/110) Improve performance

### BUG FIXES:

- [index] [\#129](https://github.com/binance-chain/bnc-tendermint/pull/129) fix tx indexer lag behind block
- [index] [\#129](https://github.com/bnb-chain/bnc-tendermint/pull/129) fix tx indexer lag behind block

## v0.32.3

Expand Down Expand Up @@ -296,20 +300,20 @@ accepting new peers and only allowing `ed25519` pubkeys.
## v0.31.5-binance.2
*Sep 6th, 2019*
### FEATURES:
- [config] [\#115](https://github.com/binance-chain/bnc-tendermint/pull/115) add option to enable range query for tx indexer;add option to disable websocket
- [sync] [\#97](https://github.com/binance-chain/bnc-tendermint/pull/97) supoort hot sync reactor
- [config] [\#115](https://github.com/bnb-chain/bnc-tendermint/pull/115) add option to enable range query for tx indexer;add option to disable websocket
- [sync] [\#97](https://github.com/bnb-chain/bnc-tendermint/pull/97) supoort hot sync reactor

### IMPROVEMENTS:
- [index] [\#106](https://github.com/binance-chain/bnc-tendermint/pull/106) index service recover from data lost
- [P2P] [\#106](https://github.com/binance-chain/bnc-tendermint/pull/107) introduce skip_tx_from_persistent config and other basic p2p improvement
- [index] [\#106](https://github.com/bnb-chain/bnc-tendermint/pull/106) index service recover from data lost
- [P2P] [\#106](https://github.com/bnb-chain/bnc-tendermint/pull/107) introduce skip_tx_from_persistent config and other basic p2p improvement


## v0.31.5-binance.1
*July 17th, 2019*

### IMPROVEMENTS:
- [mempool] [\#100](https://github.com/binance-chain/bnc-tendermint/pull/100) add OnlyPersistent to config of mempool
- [metrics] [\#96](https://github.com/binance-chain/bnc-tendermint/pull/96) monitor: add more metrics about p2p
- [mempool] [\#100](https://github.com/bnb-chain/bnc-tendermint/pull/100) add OnlyPersistent to config of mempool
- [metrics] [\#96](https://github.com/bnb-chain/bnc-tendermint/pull/96) monitor: add more metrics about p2p


## v0.31.5
Expand Down
8 changes: 4 additions & 4 deletions abci/example/kvstore/kvstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kvstore
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"sort"
"testing"

Expand Down Expand Up @@ -57,7 +57,7 @@ func TestKVStoreKV(t *testing.T) {
}

func TestPersistentKVStoreKV(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-kvstore-test") // TODO
dir, err := os.MkdirTemp("/tmp", "abci-kvstore-test")
if err != nil {
t.Fatal(err)
}
Expand All @@ -73,7 +73,7 @@ func TestPersistentKVStoreKV(t *testing.T) {
}

func TestPersistentKVStoreInfo(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-kvstore-test") // TODO
dir, err := os.MkdirTemp("/tmp", "abci-kvstore-test")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestPersistentKVStoreInfo(t *testing.T) {

// add a validator, remove a validator, update a validator
func TestValUpdates(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-kvstore-test") // TODO
dir, err := os.MkdirTemp("/tmp", "abci-kvstore-test")
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions abci/types/protoreplace/protoreplace.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//go:build ignore
// +build ignore

package main

import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"regexp"
Expand All @@ -21,7 +21,7 @@ func main() {
bytePattern := regexp.MustCompile("[[][]]byte")
const oldPath = "types/types.pb.go"
const tmpPath = "types/types.pb.new"
content, err := ioutil.ReadFile(oldPath)
content, err := os.ReadFile(oldPath)
if err != nil {
panic("cannot read " + oldPath)
os.Exit(1)
Expand Down
11 changes: 5 additions & 6 deletions abci/types/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
"crypto/sha256"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -99,7 +98,7 @@ func (reader *SnapshotReader) LoadFromRestoration(hash SHA256Sum) ([]byte, error

func (reader *SnapshotReader) loadImpl(hash SHA256Sum, category string) ([]byte, error) {
toRead := filepath.Join(reader.DbDir, snapshotDir, strconv.FormatInt(reader.Height, 10), category, fmt.Sprintf("%x", hash))
return ioutil.ReadFile(toRead)
return os.ReadFile(toRead)
}

func (reader *SnapshotReader) LoadManifest(height int64) (int64, []byte, error) {
Expand All @@ -114,7 +113,7 @@ func (reader *SnapshotReader) LoadManifest(height int64) (int64, []byte, error)
return 0, nil, fmt.Errorf("requested wrong height: %d, reader height: %d", height, reader.Height)
} else {
toRead := filepath.Join(reader.DbDir, snapshotDir, strconv.FormatInt(lookupHeight, 10), finalizedDir, manifestFileName)
manifest, err := ioutil.ReadFile(toRead)
manifest, err := os.ReadFile(toRead)
return lookupHeight, manifest, err
}
}
Expand All @@ -129,7 +128,7 @@ func (reader *SnapshotReader) InitSnapshotHeight() int64 {
var latestHeight int64

toTraverse := filepath.Join(reader.DbDir, snapshotDir)
if files, err := ioutil.ReadDir(toTraverse); err == nil {
if files, err := os.ReadDir(toTraverse); err == nil {
for _, f := range files {
if f.IsDir() {
if height, err := strconv.ParseInt(f.Name(), 10, 64); err == nil && height > latestHeight {
Expand Down Expand Up @@ -157,7 +156,7 @@ func (writer *SnapshotWriter) Write(hash SHA256Sum, chunk []byte) error {
return err
}
toWrite := filepath.Join(path, fmt.Sprintf("%x", hash))
return ioutil.WriteFile(toWrite, chunk, 0644)
return os.WriteFile(toWrite, chunk, 0600)
}

func (writer *SnapshotWriter) WriteManifest(manifest []byte) error {
Expand All @@ -166,7 +165,7 @@ func (writer *SnapshotWriter) WriteManifest(manifest []byte) error {
return err
}
toWrite := filepath.Join(path, manifestFileName)
return ioutil.WriteFile(toWrite, manifest, 0644)
return os.WriteFile(toWrite, manifest, 0600)
}

func (writer *SnapshotWriter) Finalize() error {
Expand Down
2 changes: 1 addition & 1 deletion blockchain/v1/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/assert"
abci "github.com/tendermint/tendermint/abci/types"
cfg "github.com/tendermint/tendermint/config"
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/mock"
"github.com/tendermint/tendermint/p2p"
Expand All @@ -20,7 +21,6 @@ import (
"github.com/tendermint/tendermint/store"
"github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"
dbm "github.com/tendermint/tendermint/libs/db"
)

var config *cfg.Config
Expand Down
3 changes: 1 addition & 2 deletions cmd/tendermint/commands/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package commands

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -168,5 +167,5 @@ func WriteConfigVals(dir string, vals map[string]string) error {
data += fmt.Sprintf("%s = \"%s\"\n", k, v)
}
cfile := filepath.Join(dir, "config.toml")
return ioutil.WriteFile(cfile, []byte(data), 0666)
return os.WriteFile(cfile, []byte(data), 0600)
}
16 changes: 8 additions & 8 deletions config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"text/template"

Expand Down Expand Up @@ -59,7 +59,7 @@ func WriteConfigFile(configFilePath string, config *Config) {
panic(err)
}

cmn.MustWriteFile(configFilePath, buffer.Bytes(), 0644)
cmn.MustWriteFile(configFilePath, buffer.Bytes(), 0600)
}

// Note: any changes to the comments/variables/mapstructure
Expand Down Expand Up @@ -211,7 +211,7 @@ disable_websocket = {{ .RPC.DisableWebsocket }}
# 10 - default size.
# Should be {WebsocketPoolSpawnSize} =< {WebsocketPoolMaxSize}
websocket_pool_size = {{ .RPC.WebsocketPoolMaxSize }}
# The queued buffer for workers to process requests.
# 10 -default
websocket_pool_queue_size = {{ .RPC.WebsocketPoolQueueSize }}
Expand Down Expand Up @@ -354,7 +354,7 @@ recheck = {{ .Mempool.Recheck }}
broadcast = {{ .Mempool.Broadcast }}
wal_dir = "{{ js .Mempool.WalPath }}"
# If set true, will only broadcast transactions to persistent peers.
# If set true, will only broadcast transactions to persistent peers.
only_to_persistent = {{ .Mempool.OnlyToPersistent }}
# If set true, only the transaction from none persistent peer will broadcast.
Expand Down Expand Up @@ -480,7 +480,7 @@ func ResetTestRoot(testName string) *Config {

func ResetTestRootWithChainID(testName string, chainID string) *Config {
// create a unique, concurrency-safe test directory under os.TempDir()
rootDir, err := ioutil.TempDir("", fmt.Sprintf("%s-%s_", chainID, testName))
rootDir, err := os.MkdirTemp("", fmt.Sprintf("%s-%s_", chainID, testName))
if err != nil {
panic(err)
}
Expand All @@ -507,11 +507,11 @@ func ResetTestRootWithChainID(testName string, chainID string) *Config {
chainID = "tendermint_test"
}
testGenesis := fmt.Sprintf(testGenesisFmt, chainID)
cmn.MustWriteFile(genesisFilePath, []byte(testGenesis), 0644)
cmn.MustWriteFile(genesisFilePath, []byte(testGenesis), 0600)
}
// we always overwrite the priv val
cmn.MustWriteFile(privKeyFilePath, []byte(testPrivValidatorKey), 0644)
cmn.MustWriteFile(privStateFilePath, []byte(testPrivValidatorState), 0644)
cmn.MustWriteFile(privKeyFilePath, []byte(testPrivValidatorKey), 0600)
cmn.MustWriteFile(privStateFilePath, []byte(testPrivValidatorState), 0600)

config := TestConfig().SetRoot(rootDir)
return config
Expand Down
7 changes: 3 additions & 4 deletions config/toml_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package config

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand All @@ -23,15 +22,15 @@ func TestEnsureRoot(t *testing.T) {
require := require.New(t)

// setup temp dir for test
tmpDir, err := ioutil.TempDir("", "config-test")
tmpDir, err := os.MkdirTemp("", "config-test")
require.Nil(err)
defer os.RemoveAll(tmpDir) // nolint: errcheck

// create root dir
EnsureRoot(tmpDir)

// make sure config is set properly
data, err := ioutil.ReadFile(filepath.Join(tmpDir, defaultConfigFilePath))
data, err := os.ReadFile(filepath.Join(tmpDir, defaultConfigFilePath))
require.Nil(err)

if !checkConfig(string(data)) {
Expand All @@ -52,7 +51,7 @@ func TestEnsureTestRoot(t *testing.T) {
rootDir := cfg.RootDir

// make sure config is set properly
data, err := ioutil.ReadFile(filepath.Join(rootDir, defaultConfigFilePath))
data, err := os.ReadFile(filepath.Join(rootDir, defaultConfigFilePath))
require.Nil(err)

if !checkConfig(string(data)) {
Expand Down
2 changes: 1 addition & 1 deletion consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ func newCounter() abci.Application {
}

func newPersistentKVStore() abci.Application {
dir, err := ioutil.TempDir("", "persistent-kvstore")
dir, err := os.MkdirTemp("", "persistent-kvstore")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ func TestNewValidBlockMessageValidateBasic(t *testing.T) {
},
{
func(msg *NewValidBlockMessage) { msg.BlockParts = cmn.NewBitArray(types.MaxBlockPartsCount + 1) },
"BlockParts bit array size 1602 not equal to BlockPartsHeader.Total 1",
"BlockParts bit array size 102 not equal to BlockPartsHeader.Total 1",
},
}

Expand Down
2 changes: 1 addition & 1 deletion consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func startNewConsensusStateAndWaitForBlock(t *testing.T, consensusReplayConfig *
cs := newConsensusStateWithConfigAndBlockStore(consensusReplayConfig, state, privValidator, kvstore.NewKVStoreApplication(), blockDB)
cs.SetLogger(logger)

bytes, _ := ioutil.ReadFile(cs.config.WalFile())
bytes, _ := os.ReadFile(cs.config.WalFile())
t.Logf("====== WAL: \n\r%X\n", bytes)

err := cs.Start()
Expand Down
7 changes: 3 additions & 4 deletions consensus/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package consensus
import (
"bytes"
"crypto/rand"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -27,7 +26,7 @@ const (
)

func TestWALTruncate(t *testing.T) {
walDir, err := ioutil.TempDir("", "wal")
walDir, err := os.MkdirTemp("", "wal")
require.NoError(t, err)
defer os.RemoveAll(walDir)

Expand Down Expand Up @@ -103,7 +102,7 @@ func TestWALEncoderDecoder(t *testing.T) {
}

func TestWALWrite(t *testing.T) {
walDir, err := ioutil.TempDir("", "wal")
walDir, err := os.MkdirTemp("", "wal")
require.NoError(t, err)
defer os.RemoveAll(walDir)
walFile := filepath.Join(walDir, "wal")
Expand Down Expand Up @@ -166,7 +165,7 @@ func TestWALSearchForEndHeight(t *testing.T) {
}

func TestWALPeriodicSync(t *testing.T) {
walDir, err := ioutil.TempDir("", "wal")
walDir, err := os.MkdirTemp("", "wal")
require.NoError(t, err)
defer os.RemoveAll(walDir)

Expand Down
Loading

0 comments on commit 98f2190

Please sign in to comment.