Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aergoio/SMT
/ functions
Functions
66 in github.com/aergoio/SMT
⨍
Functions
66
◇
Types & classes
5
↓ 43 callers
Function
getFreshData
(size, length int)
smt_test.go:566
↓ 21 callers
Method
Update
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 callers
Function
NewSMT
NewSMT creates a new SMT given a keySize and a hash function.
smt.go:54
↓ 15 callers
Function
bitIsSet
(bits []byte, i int)
util.go:25
↓ 14 callers
Method
Get
Get fetches the value of a key by going down the current trie root.
smt_tools.go:16
↓ 12 callers
Method
update
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 callers
Method
Commit
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 callers
Method
loadChildren
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 callers
Function
bitSet
(bits []byte, i int)
util.go:28
↓ 7 callers
Method
get
get fetches the value of a key given a trie root
smt_tools.go:24
↓ 4 callers
Method
AtomicUpdate
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 callers
Function
Hasher
(data ...[]byte)
util.go:41
↓ 4 callers
Method
VerifyMerkleProofCompressed
VerifyMerkleProofCompressed verifies that key/value is included in the trie with latest root
smt_merkle_proof.go:155
↓ 4 callers
Method
maybeDeleteRevertedNode
maybeDeleteRevertedNode adds the node to updatedNodes to be reverted
smt_revert.go:155
↓ 3 callers
Method
MerkleProofCompressed
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 callers
Function
benchmark10MAccounts10Ktps
(smt *SMT, b *testing.B)
smt_test.go:580
↓ 3 callers
Method
interiorHash
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 callers
Method
MerkleProof
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 callers
Method
MerkleProofCompressed2
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 callers
Method
Stash
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 callers
Method
VerifyMerkleProof
VerifyMerkleProof verifies that key/value is included in the trie with latest root
smt_merkle_proof.go:150
↓ 2 callers
Method
deleteOldNode
deleteOldNode deletes an old node that has been updated
smt.go:496
↓ 2 callers
Method
loadDefaultHashes
loadDefaultHashes creates the default hashes
smt.go:73
↓ 2 callers
Method
merkleProof
merkleProof generates a Merke proof of inclusion or non inclusion for a given trie root
smt_merkle_proof.go:52
↓ 2 callers
Method
shortcutToSubTreeRoot
shortcutToSubTreeRoot computes the subroot at height of a subtree containing one key
smt_merkle_proof.go:189
↓ 1 callers
Method
Revert
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 callers
Method
commit
commit stores the updated nodes to disk.
trie_cache.go:35
↓ 1 callers
Method
deleteSubTree
deleteSubTree deletes all the nodes contained in a tree
smt_revert.go:124
↓ 1 callers
Method
loadBatch
loadBatch fetches a batch of nodes in cache or db
smt.go:326
↓ 1 callers
Method
maybeAddShortcutToKV
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 callers
Method
maybeDeleteSubTree
maybeDeleteSubTree compares the subtree nodes of 2 tries and keeps only the older one
smt_revert.go:61
↓ 1 callers
Method
merkleProofCompressed
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 callers
Method
parseBatch
parseBatch decodes the byte data into a slice of nodes and bitmap
smt.go:382
↓ 1 callers
Method
serializeBatch
(batch [][]byte)
trie_cache.go:49
↓ 1 callers
Method
splitKeys
splitKeys devides the array of keys into 2 so they can update left and right branches in parallel
smt.go:246
↓ 1 callers
Method
storeNode
storeNode stores a batch and deletes the old node from cache
smt.go:475
↓ 1 callers
Method
unrollShortcutAndKey
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 callers
Method
unrollShortcutAndKeyCompressed
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 callers
Method
updateLeft
updateLeft updates the left side of the tree
smt.go:233
↓ 1 callers
Method
updateParallel
updateParallel updates both sides of the trie simultaneously
smt.go:198
↓ 1 callers
Method
updateRight
updateRight updates the right side of the tree
smt.go:220
↓ 1 callers
Method
verifyMerkleProof
verifyMerkleProof verifies that a key/value is included in the trie with given root
smt_merkle_proof.go:160
↓ 1 callers
Method
verifyMerkleProofCompressed
verifyMerkleProof verifies that a key/value is included in the trie with given root
smt_merkle_proof.go:171
Function
BenchmarkCacheHeightLimit233
go test -run=xxx -bench=. -benchmem -test.benchtime=20s
smt_test.go:612
Function
BenchmarkCacheHeightLimit238
(b *testing.B)
smt_test.go:624
Function
BenchmarkCacheHeightLimit245
(b *testing.B)
smt_test.go:636
Method
CheckRoot
CheckRoot returns true if the root exists in Database.
smt_tools.go:54
Method
DefaultHash
DefaultHash is a getter for the defaultHashes array
smt_tools.go:49
Method
Len
()
util.go:52
Method
Less
(i, j int)
util.go:58
Method
Swap
(i, j int)
util.go:55
Function
TestSmtCommit
(t *testing.T)
smt_test.go:361
Function
TestSmtDelete
* // 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
Function
TestSmtEmptyTrie
(t *testing.T)
smt_test.go:26
Function
TestSmtMerkleProof
(t *testing.T)
smt_test.go:294
Function
TestSmtMerkleProofCompressed
(t *testing.T)
smt_test.go:314
Function
TestSmtMerkleProofCompressed2
(t *testing.T)
smt_test.go:346
Function
TestSmtPublicUpdateAndGet
(t *testing.T)
smt_test.go:106
Function
TestSmtRaisesError
(t *testing.T)
smt_test.go:465
Function
TestSmtRevert
(t *testing.T)
smt_test.go:398
Function
TestSmtUpdateAndGet
(t *testing.T)
smt_test.go:33
Function
TestStash
(t *testing.T)
smt_test.go:511
Function
TestTrieAtomicUpdate
(t *testing.T)
smt_test.go:78
Function
TestTrieUpdateAndDelete
test updating and deleting at the same time
smt_test.go:258
Function
bitSplit
(bits []byte, i int)
util.go:34
Function
bitUnSet
(bits []byte, i int)
util.go:31