MCPcopy Create free account

hub / github.com/aergoio/SMT / functions

Functions66 in github.com/aergoio/SMT

↓ 43 callersFunctiongetFreshData
(size, length int)
smt_test.go:566
↓ 21 callersMethodUpdate
Update adds a sorted list of keys and their values to the trie If Update is called multiple times, only the state after the last update is commited. W
smt.go:89
↓ 20 callersFunctionNewSMT
NewSMT creates a new SMT given a keySize and a hash function.
smt.go:54
↓ 15 callersFunctionbitIsSet
(bits []byte, i int)
util.go:25
↓ 14 callersMethodGet
Get fetches the value of a key by going down the current trie root.
smt_tools.go:16
↓ 12 callersMethodupdate
update adds a sorted list of keys and their values to the trie. It returns the root of the updated tree.
smt.go:147
↓ 11 callersMethodCommit
Commit stores the updated nodes to disk Commit should be called for every block otherwise past tries are not recorded and it is not possible to revert
smt_tools.go:66
↓ 9 callersMethodloadChildren
loadChildren looks for the children of a node. if the node is not stored in cache, it will be loaded from db.
smt.go:299
↓ 8 callersFunctionbitSet
(bits []byte, i int)
util.go:28
↓ 7 callersMethodget
get fetches the value of a key given a trie root
smt_tools.go:24
↓ 4 callersMethodAtomicUpdate
AtomicUpdate can be called multiple times and all the updated nodes will be commited and roots will be stored in past tries. Can be used for updating
smt.go:113
↓ 4 callersFunctionHasher
(data ...[]byte)
util.go:41
↓ 4 callersMethodVerifyMerkleProofCompressed
VerifyMerkleProofCompressed verifies that key/value is included in the trie with latest root
smt_merkle_proof.go:155
↓ 4 callersMethodmaybeDeleteRevertedNode
maybeDeleteRevertedNode adds the node to updatedNodes to be reverted
smt_revert.go:155
↓ 3 callersMethodMerkleProofCompressed
MerkleProofCompressed returns a compressed merkle proof. The proof contains a bitmap of non default hashes and the non default hashes.
smt_merkle_proof.go:22
↓ 3 callersFunctionbenchmark10MAccounts10Ktps
(smt *SMT, b *testing.B)
smt_test.go:580
↓ 3 callersMethodinteriorHash
interiorHash hashes 2 children to get the parent hash and stores it in the updatedNodes and maybe in liveCache. the key is the hash and the value is t
smt.go:406
↓ 2 callersMethodMerkleProof
MerkleProof creates a merkle proof for a key in the latest trie A non inclusion proof is a proof to a default value
smt_merkle_proof.go:14
↓ 2 callersMethodMerkleProofCompressed2
MerkleProofCompressed2 returns a compressed merkle proof like MerkleProofCompressed This version 1st calls MerkleProof and then removes the default no
smt_merkle_proof.go:32
↓ 2 callersMethodStash
Stash rolls back the changes made by previous updates made without commit and loads the cache from before the rollback.
smt_tools.go:89
↓ 2 callersMethodVerifyMerkleProof
VerifyMerkleProof verifies that key/value is included in the trie with latest root
smt_merkle_proof.go:150
↓ 2 callersMethoddeleteOldNode
deleteOldNode deletes an old node that has been updated
smt.go:496
↓ 2 callersMethodloadDefaultHashes
loadDefaultHashes creates the default hashes
smt.go:73
↓ 2 callersMethodmerkleProof
merkleProof generates a Merke proof of inclusion or non inclusion for a given trie root
smt_merkle_proof.go:52
↓ 2 callersMethodshortcutToSubTreeRoot
shortcutToSubTreeRoot computes the subroot at height of a subtree containing one key
smt_merkle_proof.go:189
↓ 1 callersMethodRevert
Revert rewinds the state tree to a previous version All the nodes (subtree roots and values) reverted are deleted from the database.
smt_revert.go:15
↓ 1 callersMethodcommit
commit stores the updated nodes to disk.
trie_cache.go:35
↓ 1 callersMethoddeleteSubTree
deleteSubTree deletes all the nodes contained in a tree
smt_revert.go:124
↓ 1 callersMethodloadBatch
loadBatch fetches a batch of nodes in cache or db
smt.go:326
↓ 1 callersMethodmaybeAddShortcutToKV
maybeAddShortcutToKV adds a shortcut key to the keys array to be updated. this is used when a subtree containing a shortcut node is being updated
smt.go:257
↓ 1 callersMethodmaybeDeleteSubTree
maybeDeleteSubTree compares the subtree nodes of 2 tries and keeps only the older one
smt_revert.go:61
↓ 1 callersMethodmerkleProofCompressed
merkleProofCompressed generates a Merke proof of inclusion or non inclusion for a given trie root a proof node is only appended if it is non default a
smt_merkle_proof.go:97
↓ 1 callersMethodparseBatch
parseBatch decodes the byte data into a slice of nodes and bitmap
smt.go:382
↓ 1 callersMethodserializeBatch
(batch [][]byte)
trie_cache.go:49
↓ 1 callersMethodsplitKeys
splitKeys devides the array of keys into 2 so they can update left and right branches in parallel
smt.go:246
↓ 1 callersMethodstoreNode
storeNode stores a batch and deletes the old node from cache
smt.go:475
↓ 1 callersMethodunrollShortcutAndKey
unrollShortcutAndKey returns the merkle proof nodes of an empty key in a subtree that contains another key the key we are proving is not in the tree,
smt_merkle_proof.go:201
↓ 1 callersMethodunrollShortcutAndKeyCompressed
unrollShortcutAndKeyCompressed returns the merkle proof nodes of an empty key in a subtree that contains another key the key we are proving is not in
smt_merkle_proof.go:214
↓ 1 callersMethodupdateLeft
updateLeft updates the left side of the tree
smt.go:233
↓ 1 callersMethodupdateParallel
updateParallel updates both sides of the trie simultaneously
smt.go:198
↓ 1 callersMethodupdateRight
updateRight updates the right side of the tree
smt.go:220
↓ 1 callersMethodverifyMerkleProof
verifyMerkleProof verifies that a key/value is included in the trie with given root
smt_merkle_proof.go:160
↓ 1 callersMethodverifyMerkleProofCompressed
verifyMerkleProof verifies that a key/value is included in the trie with given root
smt_merkle_proof.go:171
FunctionBenchmarkCacheHeightLimit233
go test -run=xxx -bench=. -benchmem -test.benchtime=20s
smt_test.go:612
FunctionBenchmarkCacheHeightLimit238
(b *testing.B)
smt_test.go:624
FunctionBenchmarkCacheHeightLimit245
(b *testing.B)
smt_test.go:636
MethodCheckRoot
CheckRoot returns true if the root exists in Database.
smt_tools.go:54
MethodDefaultHash
DefaultHash is a getter for the defaultHashes array
smt_tools.go:49
MethodLen
()
util.go:52
MethodLess
(i, j int)
util.go:58
MethodSwap
(i, j int)
util.go:55
FunctionTestSmtCommit
(t *testing.T)
smt_test.go:361
FunctionTestSmtDelete
* // Because of the batching, variable sized keys are no longer available func TestSmtDifferentKeySize(t *testing.T) { keySize := 20 smt := NewSMT(u
smt_test.go:198
FunctionTestSmtEmptyTrie
(t *testing.T)
smt_test.go:26
FunctionTestSmtMerkleProof
(t *testing.T)
smt_test.go:294
FunctionTestSmtMerkleProofCompressed
(t *testing.T)
smt_test.go:314
FunctionTestSmtMerkleProofCompressed2
(t *testing.T)
smt_test.go:346
FunctionTestSmtPublicUpdateAndGet
(t *testing.T)
smt_test.go:106
FunctionTestSmtRaisesError
(t *testing.T)
smt_test.go:465
FunctionTestSmtRevert
(t *testing.T)
smt_test.go:398
FunctionTestSmtUpdateAndGet
(t *testing.T)
smt_test.go:33
FunctionTestStash
(t *testing.T)
smt_test.go:511
FunctionTestTrieAtomicUpdate
(t *testing.T)
smt_test.go:78
FunctionTestTrieUpdateAndDelete
test updating and deleting at the same time
smt_test.go:258
FunctionbitSplit
(bits []byte, i int)
util.go:34
FunctionbitUnSet
(bits []byte, i int)
util.go:31