-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1927 from ergoplatform/utxo-set-bootstrapping-pre…
…paration Preliminary functions for bootstrapping with UTXO set snapshot #1
- Loading branch information
Showing
12 changed files
with
41 additions
and
178 deletions.
There are no files selected for viewing
7 changes: 6 additions & 1 deletion
7
avldb/src/main/scala/scorex/crypto/authds/avltree/batch/NodeParameters.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
package scorex.crypto.authds.avltree.batch | ||
|
||
//todo: support arbitrary-size values | ||
/** | ||
* Parameters of AVL+ tree nodes (internal and leaves) | ||
* @param keySize - size of a key (fixed) | ||
* @param valueSize - size of a value in a leaf (fixed, if defined, arbitrary, if None) | ||
* @param labelSize - size of a label (node hash), fixed | ||
*/ | ||
case class NodeParameters(keySize: Int, valueSize: Option[Int], labelSize: Int) |
24 changes: 16 additions & 8 deletions
24
avldb/src/main/scala/scorex/crypto/authds/avltree/batch/ProxyInternalProverNode.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
package scorex.crypto.authds.avltree.batch | ||
|
||
|
||
import scorex.crypto.authds.{ADKey, Balance} | ||
import scorex.crypto.hash.{CryptographicHash, Digest} | ||
import scorex.db.LDBVersionedStore | ||
import InternalNode.InternalNodePrefix | ||
|
||
/** | ||
* Internal node where children are not provided during node construction, only pointers to them, | ||
* and then children nodes are read from database and constructed only when requested (and children internal nodes are | ||
* of the same type). It allows for lazy loading of a tree. | ||
* | ||
*/ | ||
class ProxyInternalProverNode[D <: Digest](protected var pk: ADKey, | ||
val lkey: ADKey, | ||
val rkey: ADKey, | ||
val leftLabel: ADKey, | ||
val rightLabel: ADKey, | ||
protected var pb: Balance = Balance @@ 0.toByte) | ||
(implicit val phf: CryptographicHash[D], | ||
store: LDBVersionedStore, | ||
nodeParameters: NodeParameters) | ||
extends InternalProverNode(k = pk, l = null, r = null, b = pb)(phf) { | ||
|
||
override protected def computeLabel: D = { | ||
hf.hash(Array(InternalNodePrefix, b), lkey, rkey) | ||
hf.hash(Array(InternalNodePrefix, b), leftLabel, rightLabel) | ||
} | ||
|
||
override def left: ProverNodes[D] = { | ||
if (l == null) l = VersionedLDBAVLStorage.fetch[D](lkey) | ||
if (l == null) { | ||
l = VersionedLDBAVLStorage.fetch[D](leftLabel) | ||
} | ||
l | ||
} | ||
|
||
override def right: ProverNodes[D] = { | ||
if (r == null) r = VersionedLDBAVLStorage.fetch[D](rkey) | ||
if (r == null) { | ||
r = VersionedLDBAVLStorage.fetch[D](rightLabel) | ||
} | ||
r | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/main/scala/org/ergoplatform/modifiers/history/NipopowProofModifier.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
...ergoplatform/nodeView/history/storage/modifierprocessors/UTXOSnapshotChunkProcessor.scala
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...latform/nodeView/history/storage/modifierprocessors/popow/EmptyPoPoWProofsProcessor.scala
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...platform/nodeView/history/storage/modifierprocessors/popow/FullPoPoWProofsProcessor.scala
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
...ergoplatform/nodeView/history/storage/modifierprocessors/popow/PoPoWProofsProcessor.scala
This file was deleted.
Oops, something went wrong.