MCPcopy Create free account

hub / github.com/deroproject/graviton / functions

Functions179 in github.com/deroproject/graviton

↓ 67 callersMethodGetTree
Gets most recent tree committed to the store
snapshot.go:137
↓ 66 callersMethodLoadSnapshot
Load a specific snapshot from the store, 0th version = load most recent version as a special case note: 0th tree is not stored in disk also note tha
snapshot.go:21
↓ 53 callersMethodPut
put a key value in the tree, if the value exists, it's overwritten. ToDO: it should ignore duplicate key value, if first using a get and then a put
tree.go:43
↓ 32 callersFunctionsum
(key []byte)
hash.go:18
↓ 31 callersMethodCommit
commit the tree to disk, the current version
tree.go:219
↓ 29 callersFunctionNewMemStore
start a new memory backed store which may be useful for testing and other temporaray use cases.
store.go:49
↓ 27 callersMethodhashSkipError
()
tree_test.go:35
↓ 26 callersMethodGet
(*Store, [HASHSIZE]byte)
node.go:28
↓ 23 callersFunctionNewDiskStore
open/create a disk based store, if the directory pre-exists, it is used as is. Since we are an append only keyvalue store, we do not delete any data.
store.go:56
↓ 16 callersMethodGetVersion
Get current version number of tree
tree.go:30
↓ 15 callersFunctionCommit
Commit the tree (or a number of trees) to persistance, write a new snapshot which can be accessed henceforth without any modifications Commiting multi
tree.go:106
↓ 15 callersMethodHash
(*Store)
node.go:27
↓ 15 callersMethodInsert
all puts must be checked with deduplication and skipped if duplicate
node_inner.go:105
↓ 15 callersMethodloadfullleaffromstore
(store *Store)
node_leaf.go:128
↓ 15 callersMethoduint_to_filename
4 billion files each of 4 GB seems to be enough for quite some time, we will run out of handles much earlier note that the structure is independant o
store.go:90
↓ 13 callersMethodCursor
get Cursor which is used as an iterator that can traverse over all key/value pairs in a tree in hash sorted order.
cursor.go:18
↓ 13 callersFunctionhandle_error
(err error, msg string)
examples/data_corruption_showcase/data_corruption_showcase.go:16
↓ 11 callersMethodwrite
we are here means we have a currently open file this function is single threaded
store.go:182
↓ 10 callersMethodNext
Next moves the cursor to the next item in the tree and returns its key and value.If the tree is empty then an error is returned.If the cursor is at th
cursor.go:83
↓ 10 callersMethodnext_internal
this function will descend and reach the next or previous value
cursor.go:35
↓ 10 callersFunctionrandString
(len int)
diff_tree_test.go:13
↓ 9 callersMethodClose
()
store.go:64
↓ 9 callersFunctiongetNodeType
we can get away with runtime type detection
node.go:10
↓ 8 callersMethodDelete
(*Store, [HASHSIZE]byte)
node.go:29
↓ 8 callersMethodVerifyMembership
(root [HASHSIZE]byte, key []byte)
proof.go:86
↓ 8 callersFunctionisBitSet
(keyhash []byte, index uint)
node.go:40
↓ 8 callersMethodloadinnerfromstore
(store *Store)
node_inner.go:269
↓ 8 callersFunctionnewLeaf
(keyhash [HASHSIZE]byte, key, value []byte)
node_leaf.go:30
↓ 8 callersFunctionrandStr
(len int)
cursor_test.go:12
↓ 8 callersFunctionsetupDeterministicTree
(tb testing.TB, keycount int)
tree_test.go:14
↓ 7 callersFunctionDiff
This function can be used to diff 2 trees and thus find all the keys which have been deleted, modified, inserted. The algorithm is linear time in the
diff_tree.go:29
↓ 7 callersMethodFirst
First moves the cursor to the first item in the tree and returns its key and value. If the tree is empty then an error is returned. The returned key a
cursor.go:23
↓ 7 callersMethodIsDirty
Check whether the tree is currently dirty or not
tree.go:85
↓ 6 callersMethodGetKeyValue
should we return a copy
special.go:69
↓ 6 callersMethodGetTreeWithVersion
Load a versioned tree from the store all trees have there own version number
snapshot.go:90
↓ 6 callersMethodReadVersionData
versions are 1 based
store.go:298
↓ 6 callersMethodReset
prepare the structure for reuse
proof.go:30
↓ 6 callersMethodputRaw
(keyhash [HASHSIZE]byte, key, value []byte)
tree.go:46
↓ 6 callersMethodread
(findex, fpos uint32, buf []byte)
store.go:242
↓ 5 callersMethodGenerateProof
Generate proof of any key, which can be used to prove whether the key exists or not.Please note that the tree root hash (tree.Hash()) is not part of t
tree.go:93
↓ 5 callersMethodGetParentVersion
Get parent version number of tree from which this tree was derived, they might not be sequential but they will be monotonically increasing this can be
tree.go:36
↓ 5 callersMethodPrev
Prev moves the cursor to the prev item in the tree and returns its key and value.If the tree is empty then an error is returned.If the cursor is at th
cursor.go:115
↓ 5 callersMethodcompare_nodes
(base_node, head_node node, deleted, modified, inserted DiffHandler)
diff_tree.go:58
↓ 5 callersFunctionisOnlyChildleaf
leafs return nil,false, inner returns nil, false if both children are present or absent, if single child is present, it is returned nodes can only be
node_inner.go:191
↓ 5 callersFunctionleafHash
(hkey, hvalue []byte)
node_leaf.go:53
↓ 5 callersMethodloadTree
load tree using the specfic global version
snapshot.go:73
↓ 5 callersMethodload_partial
(store *Store)
node_inner.go:62
↓ 5 callersFunctionnewInner
(bit uint8)
node_inner.go:30
↓ 4 callersMethodGetTreeHighestVersion
Gets highest stored version number of the specific tree
snapshot.go:113
↓ 4 callersFunctionNewProof
()
proof.go:13
↓ 4 callersMethodUnmarshal
Unmarshal follows reverse of marshal to deserialize the array of bytes to proof for verification.
proof.go:174
↓ 4 callersMethodload_partial
(*Store)
node.go:26
↓ 4 callersMethodloadrootusingpos
(findex, fpos uint32)
snapshot.go:55
↓ 3 callersMethodDelete
todo we need to take care to prune single branches to achieve same root hash insertion/deletion the returns are in this order empty, changed, err
node_inner.go:220
↓ 3 callersMethodGetTreeWithRootHash
Gets the tree which has specific roothash
snapshot.go:146
↓ 3 callersMethodGetTreeWithTag
Gets the tree which has specific tag NOTE: same tags might point to different trees in different snapshots of db
snapshot.go:152
↓ 3 callersMethodLast
Last moves the cursor to the last item in the tree and returns its key and value. If the tree is empty then an error is returned. The returned key and
cursor.go:29
↓ 3 callersMethodPosition
()
node.go:30
↓ 3 callersMethodProve
(*Store, [HASHSIZE]byte, *Proof)
node.go:31
↓ 3 callersMethodUnmarshal
first byte is skipped and processed elsewhere
node_inner.go:449
↓ 3 callersMethodVerifyNonMembership
(root [HASHSIZE]byte, key []byte)
proof.go:95
↓ 3 callersFunctioncheck_tree_name
(bucket string)
snapshot.go:156
↓ 3 callersMethodcommit_inner
this is mostly recursive and must skip non modified branches reusing them and must skip dirty parts
tree.go:274
↓ 3 callersMethodcreate_first_file
()
store.go:157
↓ 3 callersMethodgenerateProofRaw
(key [HASHSIZE]byte, proof *Proof)
tree.go:99
↓ 3 callersFunctionhasher
all empty nodes have this hash
hash.go:12
↓ 3 callersMethodisDirty
()
node.go:25
↓ 3 callersMethodlhash
(store *Store)
node_inner.go:48
↓ 3 callersMethodrhash
(store *Store)
node_inner.go:55
↓ 3 callersMethodrootForLeaf
(keyhash [HASHSIZE]byte, leaf []byte)
proof.go:62
↓ 3 callersMethodverifyMembershipRaw
(root [HASHSIZE]byte, key [HASHSIZE]byte)
proof.go:90
↓ 3 callersMethodverifyNonMembershipRaw
(root [HASHSIZE]byte, key [HASHSIZE]byte)
proof.go:99
↓ 3 callersMethodwriteVersionData
versions are 1 based
store.go:271
↓ 2 callersMethodDiscard
Reload the tree from the disk, causing all current changes to be discarded,
tree.go:227
↓ 2 callersMethodMarshal
Serialize the proof to a byte array
proof.go:120
↓ 2 callersMethodMarshalTo
Serialize the proof to a bytes Buffer the following are the size requirements for proof 1 byte for version 1 byte for type varint trace length
proof.go:136
↓ 2 callersMethodValue
if the proof is for existence for a key, it's associated value can be read here
proof.go:110
↓ 2 callersMethodaddDeadend
()
proof.go:47
↓ 2 callersMethodaddTrace
add paths
proof.go:43
↓ 2 callersMethodchanges_internal
extract changes one bye one
diff_tree.go:35
↓ 2 callersMethodcommit_leaf
this is never recursive leaf marshalling is done at only one place while committing this is done here avoid an allocation which can be done from the
tree.go:242
↓ 2 callersFunctionencode
encode findex,fpos
tree.go:393
↓ 2 callersMethodfindhighestsnapshotinram
()
store.go:326
↓ 2 callersMethodinit
init and load some items from the store
store.go:84
↓ 2 callersMethodisEmpty
()
node_inner.go:44
↓ 2 callersMethodloadfiles
load all files from the disk we may need to increase file handles
store.go:106
↓ 2 callersFunctionparse_node
(level byte, nodetype byte, buf []byte)
node_inner.go:375
↓ 2 callersMethodputTreeHighestVersion
store highest version of tree
snapshot.go:168
↓ 1 callersMethodDelete
(store *Store, keyhash [HASHSIZE]byte)
node_leaf.go:111
↓ 1 callersMethodGet
Get a specifically value associated with a key TODO, we need to expose this in other forms so as memory allocations and better error detection could b
tree.go:57
↓ 1 callersMethodGet
should we return a copy
node_leaf.go:98
↓ 1 callersMethodGet
(store *Store, keyhash [HASHSIZE]byte)
node_inner.go:171
↓ 1 callersMethodHash
Give the merkle hash of the entire tree
tree.go:68
↓ 1 callersMethodHash
(store *Store)
node_leaf.go:63
↓ 1 callersMethodHash
(store *Store)
node_inner.go:69
↓ 1 callersMethodProve
(store *Store, keyhash [HASHSIZE]byte, proof *Proof)
node_leaf.go:192
↓ 1 callersMethodPut
this always assummes that keyhash already matches to new keyhash this function is only used once , in node_inner.go insert
node_leaf.go:81
↓ 1 callersFunctionRunStep
each step consists of generating pseudorandom data, which is first committed and then verified after each step
cmd/stress/stress.go:95
↓ 1 callersMethodaddCollision
(key, val []byte)
proof.go:56
↓ 1 callersMethodaddValue
(value []byte)
proof.go:51
next →1–100 of 179, ranked by callers