-
Notifications
You must be signed in to change notification settings - Fork 113
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
Revise AionBlockStore for supporting unity-protocol #981
Conversation
18684d2
to
7dcc1f0
Compare
@@ -3,6 +3,7 @@ | |||
import static com.google.common.truth.Truth.assertThat; | |||
import static org.aion.zero.impl.blockchain.BlockchainTestUtils.generateRandomChain; | |||
import static org.aion.zero.impl.blockchain.BlockchainTestUtils.generateRandomChainWithoutTransactions; | |||
import static org.junit.Assert.assertNull; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidental import
} else { | ||
System.out.print(" " + shortHash(blockInfo.getHash()) + " "); | ||
} | ||
@SuppressWarnings("unchecked") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has not changed, so it shouldn't be part of the diff.
@@ -1511,140 +1796,199 @@ public void load() { | |||
} | |||
|
|||
public enum IntegrityCheckResult { | |||
ERROR, | |||
MISSING_GENESIS, | |||
MISSING_LEVEL, | |||
FIXED, | |||
CORRECT | |||
} | |||
|
|||
public IntegrityCheckResult indexIntegrityCheck() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be preferable to disable this and write an issue to add tests. Without tests to ensure correctness, this may end up corrupting the database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AKI-370
@@ -2084,7 +2087,8 @@ public synchronized boolean recoverIndexEntry(Repository repository, Block block | |||
other.getShortHash(), | |||
other.getNumber(), | |||
other.getTransactionsList().size()); | |||
totalDiff = repo.getBlockStore().correctIndexEntry(other, totalDiff); | |||
//TODO: [unity] revise it after the blockchainImpl class introducing the unity difficulty concept | |||
totalDiff = repo.getBlockStore().correctIndexEntry(other, totalDiff, BigInteger.ONE).getCumulativeDifficulty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recovery option should be disabled and an issue created to re-enable it with tests for correct functionality with staking blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AKI-371
7dcc1f0
to
c015db5
Compare
c015db5
to
0d59bba
Compare
Notice
Please submit your PR to the
master
branch and rebase your code onmaster
before opening the pull request.Description
Please include a brief summary of the change that this pull request proposes. Include any relevant motivation and context. List any dependencies required for this change.
Fixes Issue # .
Type of change
Insert x into the following checkboxes to confirm (eg. [x]):
Testing
Please describe the tests you used to validate this pull request. Provide any relevant details for test configurations as well as any instructions to reproduce these results.