Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions barretenberg/cpp/pil/vm2/bytecode/update_check.pil
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ namespace update_check;
pol commit delayed_public_mutable_hash_slot;
sel * (delayed_public_mutable_slot + constants.UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN - delayed_public_mutable_hash_slot) = 0;

// TODO: Remove this as a column when we can lookup with constants
pol commit public_leaf_index_domain_separator;
sel * (constants.DOM_SEP__PUBLIC_LEAF_INDEX - public_leaf_index_domain_separator) = 0;

// TODO: Remove this as a column when we can lookup with constants
pol commit deployer_protocol_contract_address;
sel * (constants.CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS - deployer_protocol_contract_address) = 0;
Expand Down
10 changes: 5 additions & 5 deletions barretenberg/cpp/src/barretenberg/vm2/generated/columns.hpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ namespace bb::avm2 {

struct AvmFlavorVariables {
static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 123;
static constexpr size_t NUM_WITNESS_ENTITIES = 3063;
static constexpr size_t NUM_WITNESS_ENTITIES = 3062;
static constexpr size_t NUM_SHIFTED_ENTITIES = 345;
static constexpr size_t NUM_WIRES = 2597;
static constexpr size_t NUM_ALL_ENTITIES = 3531;
static constexpr size_t NUM_WIRES = 2596;
static constexpr size_t NUM_ALL_ENTITIES = 3530;

// Need to be templated for recursive verifier
template <typename FF_>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ template <typename FF_> class update_checkImpl {
public:
using FF = FF_;

static constexpr std::array<size_t, 18> SUBRELATION_PARTIAL_LENGTHS = { 3, 2, 3, 3, 3, 3, 3, 4, 3,
3, 3, 2, 3, 5, 3, 5, 5, 5 };
static constexpr std::array<size_t, 17> SUBRELATION_PARTIAL_LENGTHS = { 3, 2, 3, 3, 3, 3, 4, 3, 3,
3, 2, 3, 5, 3, 5, 5, 5 };

template <typename AllEntities> inline static bool skip(const AllEntities& in)
{
Expand All @@ -36,13 +36,13 @@ template <typename FF> class update_check : public Relation<update_checkImpl<FF>
static constexpr const std::string_view NAME = "update_check";

// Subrelation indices constants, to be used in tests.
static constexpr size_t SR_HASH_IS_ZERO_CHECK = 7;
static constexpr size_t SR_NEVER_UPDATED_CHECK = 8;
static constexpr size_t SR_UPDATE_METADATA_DECOMPOSITION = 11;
static constexpr size_t SR_UPDATE_PRE_CLASS_IS_ZERO = 13;
static constexpr size_t SR_UPDATE_POST_CLASS_IS_ZERO = 15;
static constexpr size_t SR_FUTURE_UPDATE_CLASS_ID_ASSIGNMENT = 16;
static constexpr size_t SR_PAST_UPDATE_CLASS_ID_ASSIGNMENT = 17;
static constexpr size_t SR_HASH_IS_ZERO_CHECK = 6;
static constexpr size_t SR_NEVER_UPDATED_CHECK = 7;
static constexpr size_t SR_UPDATE_METADATA_DECOMPOSITION = 10;
static constexpr size_t SR_UPDATE_PRE_CLASS_IS_ZERO = 12;
static constexpr size_t SR_UPDATE_POST_CLASS_IS_ZERO = 14;
static constexpr size_t SR_FUTURE_UPDATE_CLASS_ID_ASSIGNMENT = 15;
static constexpr size_t SR_PAST_UPDATE_CLASS_ID_ASSIGNMENT = 16;

static std::string get_subrelation_label(size_t index)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ void update_checkImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
const auto constants_TIMESTAMP_OF_CHANGE_BIT_SIZE = FF(32);
const auto constants_UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN = FF(3);
const auto constants_UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE = FF(144);
const auto constants_DOM_SEP__PUBLIC_LEAF_INDEX = FF(23);
const auto update_check_HASH_IS_ZERO = (FF(1) - in.get(C::update_check_hash_not_zero));
const auto update_check_TWO_POW_32 = FF(4294967296UL);

Expand Down Expand Up @@ -55,116 +54,109 @@ void update_checkImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
}
{
using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_sel)) *
(CView(constants_DOM_SEP__PUBLIC_LEAF_INDEX) -
static_cast<View>(in.get(C::update_check_public_leaf_index_domain_separator)));
std::get<4>(evals) += (tmp * scaling_factor);
}
{
using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_sel)) *
(CView(constants_CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS) -
static_cast<View>(in.get(C::update_check_deployer_protocol_contract_address)));
std::get<5>(evals) += (tmp * scaling_factor);
std::get<4>(evals) += (tmp * scaling_factor);
}
{
using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
(FF(1) - static_cast<View>(in.get(C::update_check_hash_not_zero)));
std::get<6>(evals) += (tmp * scaling_factor);
std::get<5>(evals) += (tmp * scaling_factor);
}
{ // HASH_IS_ZERO_CHECK
using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
auto tmp = ((static_cast<View>(in.get(C::update_check_update_hash)) *
(CView(update_check_HASH_IS_ZERO) *
(FF(1) - static_cast<View>(in.get(C::update_check_update_hash_inv))) +
static_cast<View>(in.get(C::update_check_update_hash_inv))) -
FF(1)) +
CView(update_check_HASH_IS_ZERO));
std::get<7>(evals) += (tmp * scaling_factor);
std::get<6>(evals) += (tmp * scaling_factor);
}
{ // NEVER_UPDATED_CHECK
using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
auto tmp = (FF(1) - static_cast<View>(in.get(C::update_check_hash_not_zero))) *
(static_cast<View>(in.get(C::update_check_current_class_id)) -
static_cast<View>(in.get(C::update_check_original_class_id)));
std::get<8>(evals) += (tmp * scaling_factor);
std::get<7>(evals) += (tmp * scaling_factor);
}
{
using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
((CView(constants_UPDATES_DELAYED_PUBLIC_MUTABLE_METADATA_BIT_SIZE) -
CView(constants_TIMESTAMP_OF_CHANGE_BIT_SIZE)) -
static_cast<View>(in.get(C::update_check_update_hi_metadata_bit_size)));
std::get<9>(evals) += (tmp * scaling_factor);
std::get<8>(evals) += (tmp * scaling_factor);
}
{
using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
(CView(constants_TIMESTAMP_OF_CHANGE_BIT_SIZE) -
static_cast<View>(in.get(C::update_check_timestamp_of_change_bit_size)));
std::get<10>(evals) += (tmp * scaling_factor);
std::get<9>(evals) += (tmp * scaling_factor);
}
{ // UPDATE_METADATA_DECOMPOSITION
using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
auto tmp = ((static_cast<View>(in.get(C::update_check_update_hi_metadata)) * CView(update_check_TWO_POW_32) +
static_cast<View>(in.get(C::update_check_timestamp_of_change))) -
static_cast<View>(in.get(C::update_check_update_preimage_metadata)));
std::get<11>(evals) += (tmp * scaling_factor);
std::get<10>(evals) += (tmp * scaling_factor);
}
{
using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_update_pre_class_id_is_zero)) *
(FF(1) - static_cast<View>(in.get(C::update_check_update_pre_class_id_is_zero)));
std::get<12>(evals) += (tmp * scaling_factor);
std::get<11>(evals) += (tmp * scaling_factor);
}
{ // UPDATE_PRE_CLASS_IS_ZERO
using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
((static_cast<View>(in.get(C::update_check_update_preimage_pre_class_id)) *
(static_cast<View>(in.get(C::update_check_update_pre_class_id_is_zero)) *
(FF(1) - static_cast<View>(in.get(C::update_check_update_pre_class_inv))) +
static_cast<View>(in.get(C::update_check_update_pre_class_inv))) -
FF(1)) +
static_cast<View>(in.get(C::update_check_update_pre_class_id_is_zero)));
std::get<13>(evals) += (tmp * scaling_factor);
std::get<12>(evals) += (tmp * scaling_factor);
}
{
using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_update_post_class_id_is_zero)) *
(FF(1) - static_cast<View>(in.get(C::update_check_update_post_class_id_is_zero)));
std::get<14>(evals) += (tmp * scaling_factor);
std::get<13>(evals) += (tmp * scaling_factor);
}
{ // UPDATE_POST_CLASS_IS_ZERO
using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
((static_cast<View>(in.get(C::update_check_update_preimage_post_class_id)) *
(static_cast<View>(in.get(C::update_check_update_post_class_id_is_zero)) *
(FF(1) - static_cast<View>(in.get(C::update_check_update_post_class_inv))) +
static_cast<View>(in.get(C::update_check_update_post_class_inv))) -
FF(1)) +
static_cast<View>(in.get(C::update_check_update_post_class_id_is_zero)));
std::get<15>(evals) += (tmp * scaling_factor);
std::get<14>(evals) += (tmp * scaling_factor);
}
{ // FUTURE_UPDATE_CLASS_ID_ASSIGNMENT
using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
static_cast<View>(in.get(C::update_check_timestamp_is_lt_timestamp_of_change)) *
((static_cast<View>(in.get(C::update_check_original_class_id)) *
static_cast<View>(in.get(C::update_check_update_pre_class_id_is_zero)) +
static_cast<View>(in.get(C::update_check_update_preimage_pre_class_id))) -
static_cast<View>(in.get(C::update_check_current_class_id)));
std::get<16>(evals) += (tmp * scaling_factor);
std::get<15>(evals) += (tmp * scaling_factor);
}
{ // PAST_UPDATE_CLASS_ID_ASSIGNMENT
using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
auto tmp = static_cast<View>(in.get(C::update_check_hash_not_zero)) *
(FF(1) - static_cast<View>(in.get(C::update_check_timestamp_is_lt_timestamp_of_change))) *
((static_cast<View>(in.get(C::update_check_original_class_id)) *
static_cast<View>(in.get(C::update_check_update_post_class_id_is_zero)) +
static_cast<View>(in.get(C::update_check_update_preimage_post_class_id))) -
static_cast<View>(in.get(C::update_check_current_class_id)));
std::get<17>(evals) += (tmp * scaling_factor);
std::get<16>(evals) += (tmp * scaling_factor);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ void UpdateCheckTraceBuilder::process(
{ C::update_check_delayed_public_mutable_slot, event.delayed_public_mutable_slot },
{ C::update_check_delayed_public_mutable_hash_slot,
event.delayed_public_mutable_slot + UPDATES_DELAYED_PUBLIC_MUTABLE_VALUES_LEN },
{ C::update_check_public_leaf_index_domain_separator, DOM_SEP__PUBLIC_LEAF_INDEX },
{ C::update_check_deployer_protocol_contract_address, CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS },
{ C::update_check_timestamp_of_change, timestamp_of_change },
{ C::update_check_update_hi_metadata, update_metadata_hi },
Expand Down
Loading