-
Notifications
You must be signed in to change notification settings - Fork 396
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
feat: blocks backup / restore #3946
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Fixes #1827
WIP
Help needed
Do you know how I could verify and save a block without the next block
LastCommit
?Or should I try to add the end+1 block
LastCommit
to backup?Description
Backup
in the tendermint2 node that allows to stream blocks efficientlyIt has a single method
StreamBlocks
that take a start and end height. If end height is 0 it will stream to the latest height. It is disabled by default and require enabling it in theconfig.toml
contribs
binary namedtm2backup
that pulls blocks from the backup service and store them in compressed 100-blocks files. It takes a start and end height as well as supporting resuming.The tar format was chosen to bundle blocks since it's widely supported and efficient. The zstandard format was chosen for compression because it's fast, has a good compression ratio and is widely supported.
restore
subcommand to the gnoland binary that allows to replay blocks from a backup. It takes the options from thestart
subcommand as well as the backup directory and an optional end height.It will start at the current current node height + 1.
The restore command can only restore at
backupEndHeight-1
because I did not figure a way to commit blockn
without blockn+1
. I'd gladly take ideas on how to do that. (SeeHelp needed
)The backup is fast enough for now IMO (< 20min for test5 on my macbook) but can be optimized because it's not parallelized.
The restore bottleneck seems to be the gnovm currently but I would need to profile to be sure.
How to create a backup
config.toml
tm2backup
commandcd contribs/tm2backup tm2backup-o blocks-backup -remote http://localhost:4242
How to create a node from a backup
TODO