Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/deroproject/graviton
/ functions
Functions
179 in github.com/deroproject/graviton
⨍
Functions
179
◇
Types & classes
13
↓ 67 callers
Method
GetTree
Gets most recent tree committed to the store
snapshot.go:137
↓ 66 callers
Method
LoadSnapshot
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 callers
Method
Put
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 callers
Function
sum
(key []byte)
hash.go:18
↓ 31 callers
Method
Commit
commit the tree to disk, the current version
tree.go:219
↓ 29 callers
Function
NewMemStore
start a new memory backed store which may be useful for testing and other temporaray use cases.
store.go:49
↓ 27 callers
Method
hashSkipError
()
tree_test.go:35
↓ 26 callers
Method
Get
(*Store, [HASHSIZE]byte)
node.go:28
↓ 23 callers
Function
NewDiskStore
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 callers
Method
GetVersion
Get current version number of tree
tree.go:30
↓ 15 callers
Function
Commit
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 callers
Method
Hash
(*Store)
node.go:27
↓ 15 callers
Method
Insert
all puts must be checked with deduplication and skipped if duplicate
node_inner.go:105
↓ 15 callers
Method
loadfullleaffromstore
(store *Store)
node_leaf.go:128
↓ 15 callers
Method
uint_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 callers
Method
Cursor
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 callers
Function
handle_error
(err error, msg string)
examples/data_corruption_showcase/data_corruption_showcase.go:16
↓ 11 callers
Method
write
we are here means we have a currently open file this function is single threaded
store.go:182
↓ 10 callers
Method
Next
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 callers
Method
next_internal
this function will descend and reach the next or previous value
cursor.go:35
↓ 10 callers
Function
randString
(len int)
diff_tree_test.go:13
↓ 9 callers
Method
Close
()
store.go:64
↓ 9 callers
Function
getNodeType
we can get away with runtime type detection
node.go:10
↓ 8 callers
Method
Delete
(*Store, [HASHSIZE]byte)
node.go:29
↓ 8 callers
Method
VerifyMembership
(root [HASHSIZE]byte, key []byte)
proof.go:86
↓ 8 callers
Function
isBitSet
(keyhash []byte, index uint)
node.go:40
↓ 8 callers
Method
loadinnerfromstore
(store *Store)
node_inner.go:269
↓ 8 callers
Function
newLeaf
(keyhash [HASHSIZE]byte, key, value []byte)
node_leaf.go:30
↓ 8 callers
Function
randStr
(len int)
cursor_test.go:12
↓ 8 callers
Function
setupDeterministicTree
(tb testing.TB, keycount int)
tree_test.go:14
↓ 7 callers
Function
Diff
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 callers
Method
First
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 callers
Method
IsDirty
Check whether the tree is currently dirty or not
tree.go:85
↓ 6 callers
Method
GetKeyValue
should we return a copy
special.go:69
↓ 6 callers
Method
GetTreeWithVersion
Load a versioned tree from the store all trees have there own version number
snapshot.go:90
↓ 6 callers
Method
ReadVersionData
versions are 1 based
store.go:298
↓ 6 callers
Method
Reset
prepare the structure for reuse
proof.go:30
↓ 6 callers
Method
putRaw
(keyhash [HASHSIZE]byte, key, value []byte)
tree.go:46
↓ 6 callers
Method
read
(findex, fpos uint32, buf []byte)
store.go:242
↓ 5 callers
Method
GenerateProof
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 callers
Method
GetParentVersion
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 callers
Method
Prev
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 callers
Method
compare_nodes
(base_node, head_node node, deleted, modified, inserted DiffHandler)
diff_tree.go:58
↓ 5 callers
Function
isOnlyChildleaf
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 callers
Function
leafHash
(hkey, hvalue []byte)
node_leaf.go:53
↓ 5 callers
Method
loadTree
load tree using the specfic global version
snapshot.go:73
↓ 5 callers
Method
load_partial
(store *Store)
node_inner.go:62
↓ 5 callers
Function
newInner
(bit uint8)
node_inner.go:30
↓ 4 callers
Method
GetTreeHighestVersion
Gets highest stored version number of the specific tree
snapshot.go:113
↓ 4 callers
Function
NewProof
()
proof.go:13
↓ 4 callers
Method
Unmarshal
Unmarshal follows reverse of marshal to deserialize the array of bytes to proof for verification.
proof.go:174
↓ 4 callers
Method
load_partial
(*Store)
node.go:26
↓ 4 callers
Method
loadrootusingpos
(findex, fpos uint32)
snapshot.go:55
↓ 3 callers
Method
Delete
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 callers
Method
GetTreeWithRootHash
Gets the tree which has specific roothash
snapshot.go:146
↓ 3 callers
Method
GetTreeWithTag
Gets the tree which has specific tag NOTE: same tags might point to different trees in different snapshots of db
snapshot.go:152
↓ 3 callers
Method
Last
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 callers
Method
Position
()
node.go:30
↓ 3 callers
Method
Prove
(*Store, [HASHSIZE]byte, *Proof)
node.go:31
↓ 3 callers
Method
Unmarshal
first byte is skipped and processed elsewhere
node_inner.go:449
↓ 3 callers
Method
VerifyNonMembership
(root [HASHSIZE]byte, key []byte)
proof.go:95
↓ 3 callers
Function
check_tree_name
(bucket string)
snapshot.go:156
↓ 3 callers
Method
commit_inner
this is mostly recursive and must skip non modified branches reusing them and must skip dirty parts
tree.go:274
↓ 3 callers
Method
create_first_file
()
store.go:157
↓ 3 callers
Method
generateProofRaw
(key [HASHSIZE]byte, proof *Proof)
tree.go:99
↓ 3 callers
Function
hasher
all empty nodes have this hash
hash.go:12
↓ 3 callers
Method
isDirty
()
node.go:25
↓ 3 callers
Method
lhash
(store *Store)
node_inner.go:48
↓ 3 callers
Method
rhash
(store *Store)
node_inner.go:55
↓ 3 callers
Method
rootForLeaf
(keyhash [HASHSIZE]byte, leaf []byte)
proof.go:62
↓ 3 callers
Method
verifyMembershipRaw
(root [HASHSIZE]byte, key [HASHSIZE]byte)
proof.go:90
↓ 3 callers
Method
verifyNonMembershipRaw
(root [HASHSIZE]byte, key [HASHSIZE]byte)
proof.go:99
↓ 3 callers
Method
writeVersionData
versions are 1 based
store.go:271
↓ 2 callers
Method
Discard
Reload the tree from the disk, causing all current changes to be discarded,
tree.go:227
↓ 2 callers
Method
Marshal
Serialize the proof to a byte array
proof.go:120
↓ 2 callers
Method
MarshalTo
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 callers
Method
Value
if the proof is for existence for a key, it's associated value can be read here
proof.go:110
↓ 2 callers
Method
addDeadend
()
proof.go:47
↓ 2 callers
Method
addTrace
add paths
proof.go:43
↓ 2 callers
Method
changes_internal
extract changes one bye one
diff_tree.go:35
↓ 2 callers
Method
commit_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 callers
Function
encode
encode findex,fpos
tree.go:393
↓ 2 callers
Method
findhighestsnapshotinram
()
store.go:326
↓ 2 callers
Method
init
init and load some items from the store
store.go:84
↓ 2 callers
Method
isEmpty
()
node_inner.go:44
↓ 2 callers
Method
loadfiles
load all files from the disk we may need to increase file handles
store.go:106
↓ 2 callers
Function
parse_node
(level byte, nodetype byte, buf []byte)
node_inner.go:375
↓ 2 callers
Method
putTreeHighestVersion
store highest version of tree
snapshot.go:168
↓ 1 callers
Method
Delete
(store *Store, keyhash [HASHSIZE]byte)
node_leaf.go:111
↓ 1 callers
Method
Get
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 callers
Method
Get
should we return a copy
node_leaf.go:98
↓ 1 callers
Method
Get
(store *Store, keyhash [HASHSIZE]byte)
node_inner.go:171
↓ 1 callers
Method
Hash
Give the merkle hash of the entire tree
tree.go:68
↓ 1 callers
Method
Hash
(store *Store)
node_leaf.go:63
↓ 1 callers
Method
Hash
(store *Store)
node_inner.go:69
↓ 1 callers
Method
Prove
(store *Store, keyhash [HASHSIZE]byte, proof *Proof)
node_leaf.go:192
↓ 1 callers
Method
Put
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 callers
Function
RunStep
each step consists of generating pseudorandom data, which is first committed and then verified after each step
cmd/stress/stress.go:95
↓ 1 callers
Method
addCollision
(key, val []byte)
proof.go:56
↓ 1 callers
Method
addValue
(value []byte)
proof.go:51
next →
1–100 of 179, ranked by callers