Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: memiavl restore not fast enough (backport #1241) #1245

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- [#1241](https://github.com/crypto-org-chain/cronos/pull/1241) Improve parallelization of memiavl restoration.

### State Machine Breaking

- [cronos#695](https://github.com/crypto-org-chain/cronos/pull/695) Implement ADR-007, generic events format with indexed params.
Expand Down
4 changes: 3 additions & 1 deletion memiavl/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

const NodeChannelBuffer = 2048

// Import restore memiavl db from state-sync snapshot stream
func Import(
dir string, height uint64, format uint32, protoReader protoio.Reader,
Expand Down Expand Up @@ -116,7 +118,7 @@ type TreeImporter struct {
}

func NewTreeImporter(dir string, version int64) *TreeImporter {
nodesChan := make(chan *iavl.ExportNode)
nodesChan := make(chan *iavl.ExportNode, NodeChannelBuffer)
quitChan := make(chan error)
go func() {
defer close(quitChan)
Expand Down
Loading