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

implement node reset #2818

Merged
merged 6 commits into from
Aug 25, 2021
Merged

implement node reset #2818

merged 6 commits into from
Aug 25, 2021

Conversation

jolestar
Copy link
Member

@jolestar jolestar commented Aug 23, 2021

重新实现了 node reset 命令,用于将当前节点的区块重置到某个历史高度,然后重新执行。执行命令后无需重启节点。
用于修复数据以及故障处理。

@jolestar jolestar marked this pull request as draft August 23, 2021 11:45
@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

Merging #2818 (a43acb4) into master (6cdeda6) will decrease coverage by 0.01%.
The diff coverage is 11.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2818      +/-   ##
==========================================
- Coverage   31.60%   31.59%   -0.00%     
==========================================
  Files         509      510       +1     
  Lines       44909    44973      +64     
  Branches    19985    20034      +49     
==========================================
+ Hits        14187    14203      +16     
- Misses      16962    16966       +4     
- Partials    13760    13804      +44     
Flag Coverage Δ
unittests 31.59% <11.23%> (-<0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
node/api/src/message.rs 0.00% <0.00%> (ø)
node/api/src/node_service.rs 2.23% <0.00%> (-0.10%) ⬇️
node/src/node.rs 11.63% <0.00%> (-0.34%) ⬇️
rpc/api/src/node_manager.rs 0.00% <0.00%> (ø)
...ync/src/block_connector/block_connector_service.rs 32.23% <0.00%> (-1.11%) ⬇️
sync/src/block_connector/mod.rs 0.00% <0.00%> (ø)
sync/src/block_connector/test_write_block_chain.rs 14.18% <5.00%> (-1.71%) ⬇️
sync/src/block_connector/write_block_chain.rs 19.74% <11.12%> (-7.87%) ⬇️
chain/src/chain.rs 32.31% <33.34%> (+1.54%) ⬆️
chain/service/src/chain_service.rs 19.30% <100.00%> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cdeda6...a43acb4. Read the comment docs.

@github-actions
Copy link

Benchmark for abf633e

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 2.6±0.16ms 2.6±0.14ms 0.00%
block_apply/block_apply_10 505.5±17.14ms 493.2±7.59ms +2.49%
block_apply/block_apply_1000 51.0±1.40s 50.5±0.72s +0.99%
get_with_proof/db_store 38.4±0.44µs 38.5±0.33µs -0.26%
get_with_proof/mem_store 31.9±0.25µs 31.4±0.26µs +1.59%
put_and_commit/db_store/1 1667.4±97.38µs 1572.3±52.08µs +6.05%
put_and_commit/db_store/10 2.8±0.37ms 2.7±0.26ms +3.70%
put_and_commit/db_store/100 10.1±1.01ms 9.9±0.98ms +2.02%
put_and_commit/db_store/5 2.1±0.18ms 2.1±0.16ms 0.00%
put_and_commit/db_store/50 6.0±0.69ms 6.2±0.54ms -3.23%
put_and_commit/mem_store/1 63.3±6.05µs 63.4±5.61µs -0.16%
put_and_commit/mem_store/10 587.8±46.38µs 588.4±48.65µs -0.10%
put_and_commit/mem_store/100 5.8±0.82ms 5.7±0.81ms +1.75%
put_and_commit/mem_store/5 295.8±24.14µs 297.4±24.32µs -0.54%
put_and_commit/mem_store/50 2.9±0.18ms 2.9±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 3.5±0.07ms 3.6±0.07ms -2.78%
query_block/query_block_in(10)_times(1000) 35.3±0.66ms 35.5±0.64ms -0.56%
query_block/query_block_in(10)_times(10000) 351.9±7.65ms 355.5±5.44ms -1.01%
query_block/query_block_in(1000)_times(100) 897.8±5.56µs 913.1±6.46µs -1.68%
query_block/query_block_in(1000)_times(1000) 9.0±0.06ms 9.1±0.06ms -1.10%
query_block/query_block_in(1000)_times(10000) 89.8±0.50ms 90.8±0.41ms -1.10%
storage_transaction 62.1±3.33ms 62.6±3.88ms -0.80%
vm/transaction_execution/1 351.8±1.73ms 352.3±1.71ms -0.14%
vm/transaction_execution/10 125.1±3.80ms 124.1±0.30ms +0.81%
vm/transaction_execution/20 116.5±0.46ms 116.8±0.23ms -0.26%
vm/transaction_execution/5 147.3±1.33ms 147.8±1.62ms -0.34%
vm/transaction_execution/50 131.7±1.70ms 131.9±0.60ms -0.15%

@github-actions
Copy link

Benchmark for 215f802

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 2.6±0.16ms 2.6±0.11ms 0.00%
block_apply/block_apply_10 490.4±9.65ms 489.2±4.69ms +0.25%
block_apply/block_apply_1000 50.6±1.22s 51.9±0.81s -2.50%
get_with_proof/db_store 38.9±0.35µs 38.7±0.25µs +0.52%
get_with_proof/mem_store 31.8±0.31µs 31.6±0.27µs +0.63%
put_and_commit/db_store/1 1613.6±84.11µs 1827.5±146.91µs -11.70%
put_and_commit/db_store/10 2.7±0.36ms 2.7±0.31ms 0.00%
put_and_commit/db_store/100 10.1±0.93ms 10.1±0.97ms 0.00%
put_and_commit/db_store/5 2.2±0.21ms 2.4±0.25ms -8.33%
put_and_commit/db_store/50 6.1±0.72ms 6.1±0.57ms 0.00%
put_and_commit/mem_store/1 63.3±5.69µs 63.2±5.67µs +0.16%
put_and_commit/mem_store/10 589.1±46.29µs 585.0±47.31µs +0.70%
put_and_commit/mem_store/100 5.7±0.83ms 5.8±0.82ms -1.72%
put_and_commit/mem_store/5 296.5±24.67µs 296.8±24.34µs -0.10%
put_and_commit/mem_store/50 2.9±0.19ms 2.9±0.19ms 0.00%
query_block/query_block_in(10)_times(100) 3.5±0.08ms 3.5±0.13ms 0.00%
query_block/query_block_in(10)_times(1000) 35.5±0.87ms 34.9±0.68ms +1.72%
query_block/query_block_in(10)_times(10000) 351.7±6.65ms 353.2±6.69ms -0.42%
query_block/query_block_in(1000)_times(100) 934.8±6.90µs 896.1±6.88µs +4.32%
query_block/query_block_in(1000)_times(1000) 9.5±0.04ms 9.0±0.03ms +5.56%
query_block/query_block_in(1000)_times(10000) 93.9±0.71ms 89.8±0.49ms +4.57%
storage_transaction 61.9±3.72ms 64.9±4.57ms -4.62%
vm/transaction_execution/1 353.4±0.57ms 351.9±1.49ms +0.43%
vm/transaction_execution/10 124.9±0.88ms 124.1±0.77ms +0.64%
vm/transaction_execution/20 117.3±0.31ms 116.7±0.20ms +0.51%
vm/transaction_execution/5 148.0±1.00ms 146.8±0.47ms +0.82%
vm/transaction_execution/50 132.2±1.45ms 131.4±0.29ms +0.61%

@jolestar jolestar marked this pull request as ready for review August 24, 2021 12:15
@jolestar jolestar changed the title Node reset implement node reset Aug 24, 2021
@github-actions
Copy link

Benchmark for 97ad14d

Click to view benchmark
Test PR Benchmark Master Benchmark %
accumulator_append 2.2±0.11ms 2.4±0.15ms -8.33%
block_apply/block_apply_10 428.9±3.44ms 435.4±6.63ms -1.49%
block_apply/block_apply_1000 45.1±0.62s 44.4±0.58s +1.58%
get_with_proof/db_store 38.3±0.37µs 38.8±0.43µs -1.29%
get_with_proof/mem_store 31.6±0.38µs 31.9±0.24µs -0.94%
put_and_commit/db_store/1 1285.1±51.19µs 1231.2±162.68µs +4.38%
put_and_commit/db_store/10 2.4±0.33ms 2.4±0.35ms 0.00%
put_and_commit/db_store/100 9.7±0.92ms 9.8±0.90ms -1.02%
put_and_commit/db_store/5 2.0±0.16ms 2.1±1.13ms -4.76%
put_and_commit/db_store/50 5.8±0.57ms 5.8±0.58ms 0.00%
put_and_commit/mem_store/1 63.1±5.67µs 63.6±5.63µs -0.79%
put_and_commit/mem_store/10 587.8±47.43µs 587.9±45.93µs -0.02%
put_and_commit/mem_store/100 5.8±0.81ms 5.8±0.95ms 0.00%
put_and_commit/mem_store/5 297.7±24.47µs 298.9±28.63µs -0.40%
put_and_commit/mem_store/50 2.9±0.19ms 2.9±0.18ms 0.00%
query_block/query_block_in(10)_times(100) 3.5±0.07ms 3.5±0.11ms 0.00%
query_block/query_block_in(10)_times(1000) 35.0±1.03ms 36.0±0.67ms -2.78%
query_block/query_block_in(10)_times(10000) 353.3±5.22ms 355.1±7.70ms -0.51%
query_block/query_block_in(1000)_times(100) 918.9±3.23µs 924.0±5.42µs -0.55%
query_block/query_block_in(1000)_times(1000) 9.0±0.06ms 9.0±0.11ms 0.00%
query_block/query_block_in(1000)_times(10000) 90.6±0.19ms 92.7±1.09ms -2.27%
storage_transaction 48.3±3.34ms 55.6±5.60ms -13.13%
vm/transaction_execution/1 350.6±0.52ms 352.2±2.52ms -0.45%
vm/transaction_execution/10 124.0±0.43ms 125.5±4.00ms -1.20%
vm/transaction_execution/20 116.7±0.32ms 116.9±0.38ms -0.17%
vm/transaction_execution/5 146.9±0.68ms 147.5±0.56ms -0.41%
vm/transaction_execution/50 131.3±0.29ms 131.7±0.98ms -0.30%

@nanne007 nanne007 merged commit fa8d554 into master Aug 25, 2021
@nanne007 nanne007 deleted the node_reset branch August 25, 2021 01:29
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.

2 participants