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

R4R: Replay blockchain to any given height #936

Merged
merged 12 commits into from
Jan 7, 2019

Conversation

chengwenxi
Copy link
Contributor

@chengwenxi chengwenxi commented Dec 28, 2018

This feature is needed to support class3 (hotfix) and class4 (restart) upgrades.

app/app.go Outdated
@@ -35,6 +35,7 @@ import (
const (
appName = "IrisApp"
FlagReplayHeight = "replay_height"
FlagReplay = "replay"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So confused with the flag replay_height

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between replay and replay_height? @chengwenxi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replay_height mean iris replay to appointed height and then software stop for iris export.
replay mean iris and tendermint replay last block and then iris will start. @haifengxi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All iricli flags have dash "-" instead of underscore "_" in their names, shouldn't we follow the same convention for other commands such as iris? @chengwenxi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's review the code tomorrow.

Copy link
Contributor Author

@chengwenxi chengwenxi Dec 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should follow the same convention for all commands.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reorg this PR into two:

  1. iris start --replay-last-block
  2. iris export --height

@chengwenxi chengwenxi changed the title R4R: Welcome replay back WIP: Welcome replay back Jan 4, 2019
@chengwenxi
Copy link
Contributor Author

chengwenxi commented Jan 5, 2019

I'm trying to create a new node for tendermint replay history block by a goroutine, so I can get the replay result in theiris export command and then export the application state.

TODO:

  • modify tendermint dependence
  • modify DefaultIAVLCacheSize=10000

@haifengxi haifengxi changed the title WIP: Welcome replay back WIP: Replay blockchain to any given height Jan 7, 2019
Gopkg.toml Outdated
source = "https://github.com/irisnet/tendermint.git"
branch = "irisnet/v0.27.3-iris"
source = "https://github.com/chengwenxi/tendermint.git"
branch = "v0.27.3-iris"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge the change into the irisnet/tendermint first

@chengwenxi chengwenxi changed the title WIP: Replay blockchain to any given height R4R: Replay blockchain to any given height Jan 7, 2019
app/app.go Outdated
DefaultSyncableHeight = 10000 // Multistore saves a snapshot every 10000 blocks
DefaultCacheSize = 100 // Multistore saves last 100 blocks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add in ivalstore

app/app.go Outdated
}

if lastBlockHeight-replayHeight <= DefaultCacheSize {
err := app.LoadVersion(replayHeight, protocol.KeyMain, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load version false

@chengwenxi chengwenxi changed the title R4R: Replay blockchain to any given height WIP: Replay blockchain to any given height Jan 7, 2019
@chengwenxi chengwenxi changed the title WIP: Replay blockchain to any given height R4R: Replay blockchain to any given height Jan 7, 2019
@haifengxi haifengxi merged commit 2004000 into irisnet:develop Jan 7, 2019
@haifengxi haifengxi added the state label Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants