Skip to content

Commit

Permalink
Merge pull request #75 from binance-chain/develop
Browse files Browse the repository at this point in the history
release v0.25.0-binance.7 (tm0.30.1)
  • Loading branch information
ackratos authored Mar 4, 2019
2 parents 0f6803a + 6eb6213 commit 18b9c16
Show file tree
Hide file tree
Showing 21 changed files with 366 additions and 221 deletions.
36 changes: 18 additions & 18 deletions Gopkg.lock

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

11 changes: 8 additions & 3 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,20 @@

[[override]]
name = "github.com/tendermint/iavl"
version = "=v0.12.0"
source = "github.com/binance-chain/bnc-tendermint-iavl"
version = "=v0.12.0-binance.0"

[[override]]
name = "github.com/tendermint/tendermint"
source = "github.com/BiJie/bnc-tendermint"
version = "=v0.29.1-binance.2"
source = "github.com/binance-chain/bnc-tendermint"
version = "=v0.30.1-binance.0"

## deps without releases:

[[constraint]]
name = "github.com/btcsuite/btcd"
revision = "ed77733ec07dfc8a513741138419b8d9d3de9d2d"

[[override]]
name = "golang.org/x/crypto"
source = "https://github.com/tendermint/crypto"
Expand Down
28 changes: 28 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,31 @@ func (app *BaseApp) Commit() (res abci.ResponseCommit) {
Data: commitID.Hash,
}
}

func (app *BaseApp) LatestSnapshot() (height int64, numKeys []int64, err error) {
return 0, make([]int64, 0), nil
}

func (app *BaseApp) ReadSnapshotChunk(height int64, startIndex, endIndex int64) (chunk [][]byte, err error) {
return make([][]byte, 0), nil
}

func (app *BaseApp) StartRecovery(height int64, numKeys []int64) error {
return nil
}

func (app *BaseApp) WriteRecoveryChunk(chunk [][]byte) error {
return nil
}

func (app *BaseApp) EndRecovery(height int64) error {
return nil
}

func (app *BaseApp) GetDB() dbm.DB {
return app.db
}

func (app *BaseApp) SetPruning(strategy sdk.PruningStrategy) {
app.cms.SetPruning(strategy)
}
11 changes: 6 additions & 5 deletions baseapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ import (

// SetPruning sets a pruning option on the multistore associated with the app
func SetPruning(pruning string) func(*BaseApp) {
var pruningEnum sdk.PruningStrategy
var pruningStrategy sdk.PruningStrategy
switch pruning {
case "nothing":
pruningEnum = sdk.PruneNothing
pruningStrategy = sdk.PruneNothing{}
case "everything":
pruningEnum = sdk.PruneEverything
pruningStrategy = sdk.PruneEverything{}
case "syncable":
pruningEnum = sdk.PruneSyncable
// TODO: make these parameters configurable
pruningStrategy = sdk.PruneSyncable{NumRecent: 100, StoreEvery: 10000}
default:
panic(fmt.Sprintf("invalid pruning strategy: %s", pruning))
}
return func(bap *BaseApp) {
bap.cms.SetPruning(pruningEnum)
bap.SetPruning(pruningStrategy)
}
}

Expand Down
37 changes: 37 additions & 0 deletions server/concurrent/async_local_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,43 @@ func (app *asyncLocalClient) EndBlockSync(req types.RequestEndBlock) (*types.Res

//-------------------------------------------------------

func (app *asyncLocalClient) LatestSnapshot() (height int64, numKeys []int64, err error) {
app.rwLock.RLock()
defer app.rwLock.RUnlock()

return app.Application.LatestSnapshot()
}

func (app *asyncLocalClient) ReadSnapshotChunk(height int64, startIndex, endIndex int64) (chunk [][]byte, err error) {
app.rwLock.RLock()
defer app.rwLock.RUnlock()

return app.Application.ReadSnapshotChunk(height, startIndex, endIndex)
}

func (app *asyncLocalClient) StartRecovery(height int64, numKeys []int64) error {
app.rwLock.Lock()
defer app.rwLock.Unlock()

return app.Application.StartRecovery(height, numKeys)
}

func (app *asyncLocalClient) WriteRecoveryChunk(chunk [][]byte) error {
app.rwLock.Lock()
defer app.rwLock.Unlock()

return app.Application.WriteRecoveryChunk(chunk)
}

func (app *asyncLocalClient) EndRecovery(height int64) error {
app.rwLock.Lock()
defer app.rwLock.Unlock()

return app.Application.EndRecovery(height)
}

//-------------------------------------------------------

func (app *asyncLocalClient) callback(req *types.Request, res *types.Response) *abcicli.ReqRes {
app.Callback(req, res)
return newLocalReqRes(req, res)
Expand Down
16 changes: 16 additions & 0 deletions server/concurrent/async_local_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ func (app *TimedApplication) PreDeliverTx(tx []byte) types.ResponseDeliverTx {
return types.ResponseDeliverTx{}
}

func (cli *TimedApplication) LatestSnapshot() (height int64, numKeys []int64, err error) {
return 0, make([]int64, 0), nil
}
func (cli *TimedApplication) ReadSnapshotChunk(height int64, startIndex, endIndex int64) (chunk [][]byte, err error) {
return make([][]byte, 0), nil
}
func (cli *TimedApplication) StartRecovery(height int64, numKeys []int64) error {
return nil
}
func (cli *TimedApplication) WriteRecoveryChunk(chunk [][]byte) error {
return nil
}
func (cli *TimedApplication) EndRecovery(height int64) error {
return nil
}

var logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "TestLogger")

func TestNewAsyncLocalClient(t *testing.T) {
Expand Down
5 changes: 5 additions & 0 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/server/concurrent"

"github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/blockchain"
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/node"
Expand All @@ -24,6 +25,8 @@ const (
flagSequentialABCI = "seq-abci"
)

var BlockStore *blockchain.BlockStore

// StartCmd runs the service passed in, either stand-alone or in-process with
// Tendermint.
func StartCmd(ctx *Context, appCreator AppCreator) *cobra.Command {
Expand Down Expand Up @@ -140,6 +143,8 @@ func startInProcess(ctx *Context, appCreator AppCreator) (*node.Node, error) {
return nil, err
}

BlockStore = tmNode.BlockStore()

err = tmNode.Start()
if err != nil {
return nil, err
Expand Down
Loading

0 comments on commit 18b9c16

Please sign in to comment.