-
Notifications
You must be signed in to change notification settings - Fork 234
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 pruning point proof #1832
Implement pruning point proof #1832
Conversation
…number of connections in the integration test to 32
Codecov Report
@@ Coverage Diff @@
## v0.11.0-dev #1832 +/- ##
===============================================
- Coverage 62.17% 62.11% -0.06%
===============================================
Files 621 619 -2
Lines 28477 28748 +271
===============================================
+ Hits 17705 17857 +152
- Misses 8307 8370 +63
- Partials 2465 2521 +56
Continue to review full report at Codecov.
|
@@ -10,8 +10,8 @@ import ( | |||
) | |||
|
|||
func Test64IncomingConnections(t *testing.T) { | |||
// Much more than 64 hosts creates a risk of running out of available file descriptors for leveldb | |||
const numBullies = 64 | |||
// Much more than 32 hosts creates a risk of running out of available file descriptors for leveldb |
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.
Please update the number in this comment.
@@ -174,6 +174,8 @@ type Params struct { | |||
|
|||
// BaseSubsidy is the starting subsidy amount for mined blocks. | |||
BaseSubsidy uint64 | |||
|
|||
PruningProofM uint64 |
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.
Please add a comment explaining what this is.
@@ -91,6 +91,7 @@ func (c *ConnectionManager) Stop() { | |||
} | |||
|
|||
c.loopTicker.Stop() | |||
c.run() |
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.
Why did you add this?
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 forces the next iteration in the connection loop, so you won't have to wait 30 seconds before the connection loop stops.
ErrPruningProofSelectedTipIsNotThePruningPoint = newRuleError("ErrPruningProofSelectedTipIsNotThePruningPoint") | ||
ErrPruningProofInsufficientBlueWork = newRuleError("ErrPruningProofInsufficientBlueWork") | ||
ErrPruningProofMissingBlockAtDepthMFromNextLevel = newRuleError("ErrPruningProofMissingBlockAtDepthMFromNextLevel") | ||
ErrPruningProofMissesBlocksBelowPruningPoint = newRuleError("ErrPruningProofMissesBlocksBelowPruningPoint") |
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.
Weren't these elsewhere before? Why did you copy them here?
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.
What do you mean? I didn't copy them
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.
Ah, sorry, brain fart. Nevermind.
return nil, err | ||
} | ||
|
||
if !isNotFoundError { |
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.
Is there any other time except for the virtual genesis when the current block would not be found?
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.
The point is that we always prefer to use the data from daaWindowStore
if available, because when we import blocks with trusted data we change their ghostdata data and drop from the merge set every pruned header. So if we rely on the ghostdag data of blocks with trusted data when calculating difficulty we'll get the wrong difficulty.
} | ||
|
||
visited.Add(current) | ||
isAncestorOfPruningPoint, err := ppm.dagTopologyManagers[blockLevel].IsAncestorOf(stagingArea, current, selectedTip) |
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.
The selected tip is not necessarily the pruning point. Please rename this variable.
@@ -91,7 +91,7 @@ func (c *ConnectionManager) Stop() { | |||
} | |||
|
|||
c.loopTicker.Stop() | |||
// Force the next iteration so the connection loop will stop immediately and not after `connectionsLoopInterval`. | |||
// Force the next iteration so the connection loop will stop immediately and not after `connectionsLoopInterval`ErrPruningProofMissesBlocksBelowPruningPoint. |
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.
Copy+paste error.
This reverts commit bca1080.
Implements kaspanet/research#3