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

Restarting miners doesn't reinitialize state #1875

Merged
merged 2 commits into from
Dec 9, 2022

Conversation

K-Kumar-01
Copy link
Contributor

Fixes #1755

Changes

  • check for the current round number or lfb
  • initialize only when the round is zero or LFB is nil

Need to be mentioned in CHANGELOG.md?

Details about state can be mentioned.

Tests

Tasks to complete before merging PR:

  • Ensure system tests are passing. If not Run them manually to check for any regressions 📋
  • Do any new system tests need added to test this change? do any existing system tests need updated? If so create a PR at 0chain/system_test
  • Merge your system tests PR to master AFTER merging this PR

Signed-off-by: Kushal Kumar <kushalkumargupta4@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2022

Codecov Report

Merging #1875 (73686bd) into staging (3a37926) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           staging    #1875      +/-   ##
===========================================
- Coverage    26.87%   26.86%   -0.02%     
===========================================
  Files          356      356              
  Lines        59206    59195      -11     
===========================================
- Hits         15912    15902      -10     
- Misses       41389    41392       +3     
+ Partials      1905     1901       -4     
Flag Coverage Δ
Unit-Tests 26.86% <ø> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
code/go/0chain.net/miner/protocol_round.go 5.15% <ø> (ø)
...de/go/0chain.net/smartcontract/vestingsc/config.go 50.52% <0.00%> (-4.74%) ⬇️
code/go/0chain.net/core/datastore/worker.go 97.26% <0.00%> (-2.74%) ⬇️
...ain.net/smartcontract/storagesc/benchmark_tests.go 76.54% <0.00%> (ø)
...ain.net/smartcontract/storagesc/config_settigns.go 54.76% <0.00%> (ø)
...e/go/0chain.net/smartcontract/dbs/event/process.go 1.89% <0.00%> (+<0.01%) ⬆️
...ain.net/smartcontract/storagesc/benchmark_setup.go 4.41% <0.00%> (+0.19%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

code/go/0chain.net/miner/miner/miner.go Outdated Show resolved Hide resolved
Signed-off-by: Kushal Kumar <kushalkumargupta4@gmail.com>
Copy link
Member

@peterlimg peterlimg left a comment

Choose a reason for hiding this comment

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

LGTM

@peterlimg peterlimg merged commit 13b3871 into staging Dec 9, 2022
@peterlimg peterlimg deleted the i1755/restart-miner-reinitializes-state branch December 9, 2022 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restart miner/node may re-Initial state on genesis block
3 participants