-
Notifications
You must be signed in to change notification settings - Fork 201
Candidate for 6.0.5 release #2416
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
base: master
Are you sure you want to change the base?
Changes from all commits
1e262e0
d5f4093
351b1d2
8133222
3244892
2782c74
9dd7f10
98e74e3
81e0502
0f2f5be
7b394cc
639ddd8
688750f
1d4d1da
dfec320
d663f89
204d11c
4638278
85136c7
21c327f
85f2c4b
a2ffb6e
2a7c0fb
b5ea1e2
f622d73
3444d58
cbd885b
e4fb82f
da363e8
f89dcbf
b91bc67
be0d857
4777818
a3ac58d
17f578a
366a046
594eeb9
cdd89ce
ce1dfac
706a916
3cc7f3c
28d644a
14e7e71
eaa7f1b
b7baa6c
83b15cc
514800b
130518a
84b1638
e9cb942
7f8218f
cdde03d
dc22b0b
1172a8f
dbab2d1
266c2c6
de722ce
c8814ec
093b152
aec2bdd
e11133c
0c05936
88fdaf7
7589493
e027c73
e5844b1
bd6991d
ea00db7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| package org.ergoplatform.modifiers.history.popow | ||
|
|
||
| import scala.util.Try | ||
|
|
||
| /** | ||
| * NiPoPoW proof params from the KMZ17 paper | ||
| * | ||
|
|
@@ -12,5 +14,15 @@ package org.ergoplatform.modifiers.history.popow | |
| * to the block header) | ||
| * | ||
| */ | ||
| case class PoPowParams(m: Int, k: Int, continuous: Boolean) | ||
| final class PoPowParams private (val m: Int, val k: Int, val continuous: Boolean, val minChainLength: Int) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MINOR:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MINOR |
||
|
|
||
| object PoPowParams { | ||
| def isValid(m: Int, k: Int): Boolean = | ||
| m >= 1 && k >= 1 && m.toLong + k.toLong <= Int.MaxValue | ||
|
|
||
| def apply(m: Int, k: Int, continuous: Boolean): Try[PoPowParams] = Try { | ||
| require(isValid(m, k), s"Invalid NiPoPoW parameters: m=$m, k=$k") | ||
| new PoPowParams(m, k, continuous, m + k) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: |
||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,9 @@ class OpenApiSpec extends AnyFlatSpec with IntegrationSuite { | |
| .withFallback(nodeSeedConfigs.head) | ||
| .withFallback(allowLocalConfig) | ||
|
|
||
| // `lazy` so the container is only started when a test actually touches `node`. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: the |
||
| // The single test below is currently `ignore`d (the openapi-checker image is gone), | ||
| // so without `lazy` we would start and tear down a node for nothing. | ||
| lazy val node: Node = docker.startDevNetNode(offlineGeneratingPeer).get | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MINOR The spec's only test remains |
||
|
|
||
| def renderTemplate(template: String, varMapping: Map[String, String]): String = | ||
|
|
||
This file was deleted.
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.
MINOR Validating every header's Autolykos PoW is the right fix, but
isValidis evaluated insideErgoNodeViewSynchronizer'sreceive(case Success(proof) if proof.isValidaround line 1085 ofErgoNodeViewSynchronizer.scala), so a proof chain of hundreds of headers now runs full PoW verification on the synchronizer's dispatcher thread, stalling its mailbox during nipopow bootstrap — and several proofs can arrive back-to-back from thep2pNipopowspeers.Suggestion: run the proof validation in a
Futureon a dedicated dispatcher andpipeTothe result back, keeping the synchronizer responsive.