Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tree_meta.hpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: Complete, auditors: [Nishat], commit: 22d6fc368da0fbe5412f4f7b2890a052aa48d803 }
3
// external_1: { status: not started, auditors: [], commit: }
4
// external_2: { status: not started, auditors: [], commit: }
5
// =====================
6
7
#pragma once
8
#include "
barretenberg/crypto/merkle_tree/types.hpp
"
9
#include "
barretenberg/ecc/curves/bn254/fr.hpp
"
10
#include "
barretenberg/serialize/msgpack.hpp
"
11
#include <cstdint>
12
#include <ostream>
13
#include <string>
14
#include <utility>
15
16
namespace
bb::crypto::merkle_tree
{
17
18
struct
TreeMeta
{
19
std::string
name
;
20
uint32_t
depth
;
21
index_t
size
;
22
index_t
committedSize
;
23
bb::fr
root
;
24
index_t
initialSize
;
25
bb::fr
initialRoot
;
26
block_number_t
oldestHistoricBlock
;
27
block_number_t
unfinalizedBlockHeight
;
28
block_number_t
finalizedBlockHeight
;
29
30
SERIALIZATION_FIELDS
(
name
,
31
depth
,
32
size
,
33
committedSize
,
34
root
,
35
initialSize
,
36
initialRoot
,
37
oldestHistoricBlock
,
38
unfinalizedBlockHeight
,
39
finalizedBlockHeight
)
40
41
TreeMeta
(std::string n,
42
uint32_t d,
43
const
index_t
& s,
44
const
index_t
& c,
45
const
bb::fr
& r,
46
const
index_t
& is,
47
const
bb::fr
& ir,
48
const
block_number_t
& o,
49
const
block_number_t
& u,
50
const
block_number_t
& f)
51
:
name
(
std
::move(n))
52
,
depth
(d)
53
,
size
(s)
54
,
committedSize
(c)
55
,
root
(r)
56
,
initialSize
(is)
57
,
initialRoot
(ir)
58
,
oldestHistoricBlock
(o)
59
,
unfinalizedBlockHeight
(u)
60
,
finalizedBlockHeight
(f)
61
{}
62
TreeMeta
() =
default
;
63
~TreeMeta
() =
default
;
64
TreeMeta
(
const
TreeMeta
& other) =
default
;
65
TreeMeta
(
TreeMeta
&& other)
noexcept
{ *
this
=
std::move
(other); }
66
TreeMeta
&
operator=
(
const
TreeMeta
& other) =
default
;
67
TreeMeta
&
operator=
(
TreeMeta
&& other)
noexcept
=
default
;
68
69
bool
operator==
(
const
TreeMeta
& other)
const
70
{
71
return
name
== other.
name
&&
depth
== other.
depth
&&
size
== other.
size
&&
72
committedSize
== other.
committedSize
&&
root
== other.
root
&&
initialRoot
== other.
initialRoot
&&
73
initialSize
== other.
initialSize
&&
unfinalizedBlockHeight
== other.
unfinalizedBlockHeight
&&
74
oldestHistoricBlock
== other.
oldestHistoricBlock
&&
finalizedBlockHeight
== other.
finalizedBlockHeight
;
75
}
76
};
77
78
inline
std::ostream&
operator<<
(std::ostream& os,
const
TreeMeta
& meta)
79
{
80
os <<
"TreeMeta{name: "
<< meta.
name
<<
", depth: "
<< meta.
depth
<<
", size: "
<<
std::dec
<< (meta.
size
)
81
<<
", committedSize: "
<<
std::dec
<< meta.
committedSize
<<
", root: "
<< meta.
root
82
<<
", initialSize: "
<<
std::dec
<< meta.
initialSize
<<
", initialRoot: "
<< meta.
initialRoot
83
<<
", oldestHistoricBlock: "
<<
std::dec
<< meta.
oldestHistoricBlock
<<
", finalizedBlockHeight: "
<<
std::dec
84
<< meta.
finalizedBlockHeight
<<
", unfinalizedBlockHeight: "
<<
std::dec
<< meta.
unfinalizedBlockHeight
<<
"}"
;
85
return
os;
86
}
87
88
}
// namespace bb::crypto::merkle_tree
types.hpp
fr.hpp
msgpack.hpp
bb::crypto::merkle_tree
Definition
content_addressed_append_only_tree.hpp:33
bb::crypto::merkle_tree::block_number_t
uint32_t block_number_t
Definition
types.hpp:19
bb::crypto::merkle_tree::index_t
uint64_t index_t
Definition
types.hpp:18
bb::operator<<
std::ostream & operator<<(std::ostream &os, CircuitKind kind)
Definition
circuit_input.hpp:38
std
STL namespace.
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
bb::crypto::merkle_tree::TreeMeta
Definition
tree_meta.hpp:18
bb::crypto::merkle_tree::TreeMeta::name
std::string name
Definition
tree_meta.hpp:19
bb::crypto::merkle_tree::TreeMeta::root
bb::fr root
Definition
tree_meta.hpp:23
bb::crypto::merkle_tree::TreeMeta::finalizedBlockHeight
block_number_t finalizedBlockHeight
Definition
tree_meta.hpp:28
bb::crypto::merkle_tree::TreeMeta::unfinalizedBlockHeight
block_number_t unfinalizedBlockHeight
Definition
tree_meta.hpp:27
bb::crypto::merkle_tree::TreeMeta::initialSize
index_t initialSize
Definition
tree_meta.hpp:24
bb::crypto::merkle_tree::TreeMeta::committedSize
index_t committedSize
Definition
tree_meta.hpp:22
bb::crypto::merkle_tree::TreeMeta::SERIALIZATION_FIELDS
SERIALIZATION_FIELDS(name, depth, size, committedSize, root, initialSize, initialRoot, oldestHistoricBlock, unfinalizedBlockHeight, finalizedBlockHeight) TreeMeta(std
Definition
tree_meta.hpp:30
bb::crypto::merkle_tree::TreeMeta::size
index_t size
Definition
tree_meta.hpp:21
bb::crypto::merkle_tree::TreeMeta::TreeMeta
TreeMeta()=default
bb::crypto::merkle_tree::TreeMeta::~TreeMeta
~TreeMeta()=default
bb::crypto::merkle_tree::TreeMeta::initialRoot
bb::fr initialRoot
Definition
tree_meta.hpp:25
bb::crypto::merkle_tree::TreeMeta::operator=
TreeMeta & operator=(TreeMeta &&other) noexcept=default
bb::crypto::merkle_tree::TreeMeta::TreeMeta
TreeMeta(const TreeMeta &other)=default
bb::crypto::merkle_tree::TreeMeta::oldestHistoricBlock
block_number_t oldestHistoricBlock
Definition
tree_meta.hpp:26
bb::crypto::merkle_tree::TreeMeta::TreeMeta
TreeMeta(TreeMeta &&other) noexcept
Definition
tree_meta.hpp:65
bb::crypto::merkle_tree::TreeMeta::depth
uint32_t depth
Definition
tree_meta.hpp:20
bb::crypto::merkle_tree::TreeMeta::operator==
bool operator==(const TreeMeta &other) const
Definition
tree_meta.hpp:69
bb::crypto::merkle_tree::TreeMeta::operator=
TreeMeta & operator=(const TreeMeta &other)=default
bb::field< Bn254FrParams >
src
barretenberg
crypto
merkle_tree
node_store
tree_meta.hpp
Generated by
1.9.8