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

[backup] Improved writing and reading of blockchain backup file #297

Merged
merged 3 commits into from
Feb 13, 2023

Conversation

0xcb9ff9
Copy link

Description

  • reading and writing use separate goroutine
  • read block use BlockByNumber, circumventing block range limits (grpc load balancing is now available)

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

create backup

dogechain backup --from 1 --to 100 --zstd --out blockchain.bin.zstd

restore backup

dogechain server --chain ./genesis.json --restore blockchain.bin.zstd --data-dir ./data

@0xcb9ff9 0xcb9ff9 added feature New update to Dogechain bug fix Functionality that fixes a bug labels Feb 11, 2023
@0xcb9ff9 0xcb9ff9 self-assigned this Feb 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2023

Codecov Report

Merging #297 (9c975d6) into dev (a840ee8) will decrease coverage by 3.54%.
The diff coverage is 40.75%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##              dev     #297      +/-   ##
==========================================
- Coverage   51.21%   47.67%   -3.54%     
==========================================
  Files         117      131      +14     
  Lines       17525    19836    +2311     
==========================================
+ Hits         8975     9457     +482     
- Misses       7789     9561    +1772     
- Partials      761      818      +57     
Impacted Files Coverage Δ
blockchain/storage/kvstorage/kvstorage.go 54.16% <ø> (+2.46%) ⬆️
chain/chain.go 28.69% <ø> (ø)
consensus/ibft/hooks.go 55.26% <ø> (ø)
consensus/ibft/pos.go 0.00% <0.00%> (ø)
helper/keccak/keccak.go 0.00% <ø> (ø)
helper/keccak/pool.go 0.00% <ø> (ø)
jsonrpc/debug_endpoint.go 36.08% <0.00%> (-0.76%) ⬇️
jsonrpc/net_endpoint.go 0.00% <0.00%> (ø)
network/bootnodes.go 85.71% <ø> (-14.29%) ⬇️
network/connections.go 98.07% <ø> (ø)
... and 131 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

Thanks for your great job.
I do like the producer consumer multithreading model.
Only a few questions left.

archive/backup.go Show resolved Hide resolved
archive/backup.go Outdated Show resolved Hide resolved
archive/backup.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@DarianShawn DarianShawn left a comment

Choose a reason for hiding this comment

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

LGTM

@DarianShawn DarianShawn merged commit 566de84 into dogechain-lab:dev Feb 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2023
@0xcb9ff9 0xcb9ff9 deleted the feature/backup-async-io branch March 3, 2023 03:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug feature New update to Dogechain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants