@@ -15,7 +15,7 @@ using aztec3::utils::types::CircuitTypes;
15
15
using aztec3::utils::types::NativeTypes;
16
16
using std::is_same;
17
17
18
- template <typename NCT> struct ConstantHistoricBlockData {
18
+ template <typename NCT> struct HistoricBlockData {
19
19
using fr = typename NCT::fr;
20
20
using boolean = typename NCT::boolean;
21
21
@@ -29,7 +29,7 @@ template <typename NCT> struct ConstantHistoricBlockData {
29
29
30
30
// Public data
31
31
fr public_data_tree_root = 0 ;
32
- fr prev_global_variables_hash = 0 ;
32
+ fr global_variables_hash = 0 ;
33
33
34
34
// for serialization, update with new fields
35
35
MSGPACK_FIELDS (private_data_tree_root,
@@ -39,44 +39,44 @@ template <typename NCT> struct ConstantHistoricBlockData {
39
39
blocks_tree_root,
40
40
private_kernel_vk_tree_root,
41
41
public_data_tree_root,
42
- prev_global_variables_hash );
42
+ global_variables_hash );
43
43
44
- boolean operator ==(ConstantHistoricBlockData <NCT> const & other) const
44
+ boolean operator ==(HistoricBlockData <NCT> const & other) const
45
45
{
46
46
return private_data_tree_root == other.private_data_tree_root &&
47
47
nullifier_tree_root == other.nullifier_tree_root && contract_tree_root == other.contract_tree_root &&
48
48
l1_to_l2_messages_tree_root == other.l1_to_l2_messages_tree_root &&
49
49
blocks_tree_root == other.historic_block_root &&
50
50
private_kernel_vk_tree_root == other.private_kernel_vk_tree_root &&
51
51
public_data_tree_root == other.public_data_tree_root &&
52
- prev_global_variables_hash == other.prev_global_variables_hash ;
52
+ global_variables_hash == other.global_variables_hash ;
53
53
};
54
54
55
- template <typename Builder> ConstantHistoricBlockData <CircuitTypes<Builder>> to_circuit_type (Builder& builder) const
55
+ template <typename Builder> HistoricBlockData <CircuitTypes<Builder>> to_circuit_type (Builder& builder) const
56
56
{
57
57
static_assert ((std::is_same<NativeTypes, NCT>::value));
58
58
59
59
// Capture the circuit builder:
60
60
auto to_ct = [&](auto & e) { return aztec3::utils::types::to_ct (builder, e); };
61
61
62
- ConstantHistoricBlockData <CircuitTypes<Builder>> data = {
63
- to_ct (private_data_tree_root), to_ct (nullifier_tree_root), to_ct (contract_tree_root),
64
- to_ct (l1_to_l2_messages_tree_root), to_ct (blocks_tree_root), to_ct (private_kernel_vk_tree_root),
65
- to_ct (public_data_tree_root), to_ct (prev_global_variables_hash ),
62
+ HistoricBlockData <CircuitTypes<Builder>> data = {
63
+ to_ct (private_data_tree_root), to_ct (nullifier_tree_root), to_ct (contract_tree_root),
64
+ to_ct (l1_to_l2_messages_tree_root), to_ct (blocks_tree_root), to_ct (private_kernel_vk_tree_root),
65
+ to_ct (public_data_tree_root), to_ct (global_variables_hash ),
66
66
};
67
67
68
68
return data;
69
69
};
70
70
71
- template <typename Builder> ConstantHistoricBlockData <NativeTypes> to_native_type () const
71
+ template <typename Builder> HistoricBlockData <NativeTypes> to_native_type () const
72
72
{
73
73
static_assert (std::is_same<CircuitTypes<Builder>, NCT>::value);
74
74
auto to_nt = [&](auto & e) { return aztec3::utils::types::to_nt<Builder>(e); };
75
75
76
- ConstantHistoricBlockData <NativeTypes> data = {
77
- to_nt (private_data_tree_root), to_nt (nullifier_tree_root), to_nt (contract_tree_root),
78
- to_nt (l1_to_l2_messages_tree_root), to_nt (blocks_tree_root), to_nt (private_kernel_vk_tree_root),
79
- to_nt (public_data_tree_root), to_nt (prev_global_variables_hash ),
76
+ HistoricBlockData <NativeTypes> data = {
77
+ to_nt (private_data_tree_root), to_nt (nullifier_tree_root), to_nt (contract_tree_root),
78
+ to_nt (l1_to_l2_messages_tree_root), to_nt (blocks_tree_root), to_nt (private_kernel_vk_tree_root),
79
+ to_nt (public_data_tree_root), to_nt (global_variables_hash ),
80
80
};
81
81
82
82
return data;
@@ -93,13 +93,13 @@ template <typename NCT> struct ConstantHistoricBlockData {
93
93
blocks_tree_root.set_public ();
94
94
private_kernel_vk_tree_root.set_public ();
95
95
public_data_tree_root.set_public ();
96
- prev_global_variables_hash .set_public ();
96
+ global_variables_hash .set_public ();
97
97
}
98
98
99
99
100
100
fr hash ()
101
101
{
102
- return compute_block_hash (prev_global_variables_hash ,
102
+ return compute_block_hash (global_variables_hash ,
103
103
private_data_tree_root,
104
104
nullifier_tree_root,
105
105
contract_tree_root,
@@ -108,8 +108,7 @@ template <typename NCT> struct ConstantHistoricBlockData {
108
108
}
109
109
};
110
110
111
- template <typename NCT>
112
- std::ostream& operator <<(std::ostream& os, ConstantHistoricBlockData<NCT> const & historic_tree_roots)
111
+ template <typename NCT> std::ostream& operator <<(std::ostream& os, HistoricBlockData<NCT> const & historic_tree_roots)
113
112
{
114
113
return os << " private_data_tree_root: " << historic_tree_roots.private_data_tree_root << " \n "
115
114
<< " nullifier_tree_root: " << historic_tree_roots.nullifier_tree_root << " \n "
@@ -118,7 +117,7 @@ std::ostream& operator<<(std::ostream& os, ConstantHistoricBlockData<NCT> const&
118
117
<< " blocks_tree_root: " << historic_tree_roots.blocks_tree_root << " \n "
119
118
<< " private_kernel_vk_tree_root: " << historic_tree_roots.private_kernel_vk_tree_root << " \n "
120
119
<< " public_data_tree_root: " << historic_tree_roots.public_data_tree_root << " \n "
121
- << " prev_global_variables_hash: " << historic_tree_roots.prev_global_variables_hash << " \n " ;
120
+ << " prev_global_variables_hash: " << historic_tree_roots.global_variables_hash << " \n " ;
122
121
}
123
122
124
123
} // namespace aztec3::circuits::abis
0 commit comments