Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ejector changes in prep for shutdown. #67

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 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
8 changes: 6 additions & 2 deletions aztec-connect-cpp/src/rollup/proofs/rollup/rollup_circuit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ recursion_output<bn254> rollup_circuit(Composer& composer,
std::vector<suint_ct> defi_deposit_sums(NUM_BRIDGE_CALLS_PER_BLOCK,
suint_ct::create_constant_witness(&composer, 0));

for (size_t i = 0; i < max_num_txs; ++i) {
// As part of ejection work, we want to shrink the size of the circuit.
// The network was not designed for a topology change, so we simply hard limit here while still presenting
// the original 28x32 topology.
const size_t TX_LIMIT = std::min(5UL, max_num_txs);
for (size_t i = 0; i < TX_LIMIT; ++i) {
// Pick verification key and check it's permitted.
auto proof_id_u32 = from_buffer<uint32_t>(rollup.txs[i], InnerProofOffsets::PROOF_ID + 28);
auto recursive_verification_key =
Expand Down Expand Up @@ -447,7 +451,7 @@ recursion_output<bn254> rollup_circuit(Composer& composer,
}
}
// Add tx padding public inputs.
add_zero_public_inputs(composer, (rollup_size_pow2_ - max_num_txs) * PropagatedInnerProofFields::NUM_FIELDS);
add_zero_public_inputs(composer, (rollup_size_pow2_ - TX_LIMIT) * PropagatedInnerProofFields::NUM_FIELDS);

// Publish pairing coords limbs as public inputs.
recursion_output.add_proof_outputs_as_public_inputs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,11 @@ circuit_result_data root_rollup_circuit(Composer& composer,
std::vector<field_ct> defi_deposit_sums(NUM_BRIDGE_CALLS_PER_BLOCK,
field_ct(witness_ct::create_constant_witness(&composer, 0)));

// Loop over each inner proof.
for (uint32_t i = 0; i < max_num_inner_proofs; ++i) {
// As part of ejection work, we want to shrink the size of the circuit.
// The network was not designed for a topology change, so we simply hard limit here while still presenting
// the original 28x32 topology.
const size_t INNER_LIMIT = 1;
for (uint32_t i = 0; i < INNER_LIMIT; ++i) {
auto is_real = num_inner_proofs > i;

// Verify the inner proof.
Expand Down Expand Up @@ -343,6 +346,8 @@ circuit_result_data root_rollup_circuit(Composer& composer,
}
}

inner_input_hashes.resize(max_num_inner_proofs, zero_hash);

// Check defi interaction notes are inserted and computes previous_defi_interaction_hash.
std::vector<field_ct> defi_interaction_note_commitments;
auto previous_defi_interaction_hash = process_defi_interaction_notes(composer,
Expand Down Expand Up @@ -382,7 +387,7 @@ circuit_result_data root_rollup_circuit(Composer& composer,
// Construct list of fields to be broadcast along with proof.
// [ header fields ][ public inputs of each tx ][ zero field padding ]
std::vector<fr> header_fields_fr = map(header_fields, [](auto const& f) { return f.get_value(); });
size_t padding_rollups = num_inner_proofs_pow2 - max_num_inner_proofs;
size_t padding_rollups = num_inner_proofs_pow2 - INNER_LIMIT;
size_t padding_txs = padding_rollups * num_inner_txs_pow2;
std::vector<fr> zero_padding(padding_txs * rollup::PropagatedInnerProofFields::NUM_FIELDS, fr(0));
std::vector<fr> broadcast_fields = join({ header_fields_fr, tx_proof_public_inputs, zero_padding });
Expand Down
5 changes: 5 additions & 0 deletions aztec-connect-cpp/src/rollup/rollup_cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ bool create_root_rollup()
auto result = verify(root_rollup, root_rollup_cd);

root_rollup::root_rollup_broadcast_data broadcast_data(result.broadcast_data);
auto broadcast_data_buf = to_buffer(broadcast_data);
std::cerr << format("Writing ", broadcast_data_buf.size(), " bytes broadcast data.") << std::endl;
std::cerr << format("Writing ", result.proof_data.size(), " bytes proof data.") << std::endl;
auto buf = join({ to_buffer(broadcast_data), result.proof_data });

write(std::cout, buf);
Expand Down Expand Up @@ -173,6 +176,8 @@ bool create_root_verifier()

auto rollup_size = inners_per_root * tx_rollup_cd.rollup_size;
auto tx = root_verifier::create_root_verifier_tx(root_rollup_proof_buf, rollup_size);
std::cerr << format("Read ", tx.broadcast_data.size(), " bytes broadcast data.") << std::endl;
std::cerr << format("Read ", tx.proof_data.size(), " bytes proof data.") << std::endl;

auto result = verify(tx, root_verifier_cd, root_rollup_cd);

Expand Down
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fi

\. ~/.nvm/nvm.sh
nvm install
npm install -g yarn

# Until we push .yarn/cache, we still need to install.
cd yarn-project
Expand Down
11 changes: 6 additions & 5 deletions build_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ PROJECTS=(
aztec-connect-cpp-x86_64:aztec-connect-cpp:./dockerfiles/Dockerfile.x86_64-linux-clang:aztec-connect-cpp-x86_64-linux-clang
aztec-connect-cpp-wasm:aztec-connect-cpp:./dockerfiles/Dockerfile.wasm-linux-clang:aztec-connect-cpp-wasm-linux-clang
blockchain-vks:blockchain-vks
mainnet-fork:mainnet-fork
#mainnet-fork:mainnet-fork
contracts:contracts
yarn-project-base:yarn-project
barretenberg.js:yarn-project
blockchain:yarn-project
aztec-dev-cli:yarn-project
#aztec-dev-cli:yarn-project
halloumi:yarn-project
falafel:yarn-project
kebab:yarn-project
#kebab:yarn-project
# sdk:yarn-project
hummus:yarn-project
#hummus:yarn-project
# wallet:yarn-project
end-to-end:yarn-project
#end-to-end:yarn-project
# wasabi:yarn-project
# explorer:yarn-project
# faucet:faucet
ejector:ejector
)
8 changes: 4 additions & 4 deletions contracts/src/core/processors/RollupProcessorV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ contract RollupProcessorV2 is IRollupProcessorV2, Decoder, Initializable, Access
}

/*----------------------------------------
MUTATING FUNCTIONS WITH ACCESS CONTROL
MUTATING FUNCTIONS WITH ACCESS CONTROL
----------------------------------------*/
/**
* @notice A function which allow the holders of the EMERGENCY_ROLE role to pause the contract
Expand Down Expand Up @@ -709,7 +709,7 @@ contract RollupProcessorV2 is IRollupProcessorV2, Decoder, Initializable, Access
}

/*----------------------------------------
PUBLIC/EXTERNAL MUTATING FUNCTIONS
PUBLIC/EXTERNAL MUTATING FUNCTIONS
----------------------------------------*/

/**
Expand Down Expand Up @@ -938,7 +938,7 @@ contract RollupProcessorV2 is IRollupProcessorV2, Decoder, Initializable, Access
}

/*----------------------------------------
INTERNAL/PRIVATE MUTATING FUNCTIONS
INTERNAL/PRIVATE MUTATING FUNCTIONS
----------------------------------------*/

/**
Expand Down Expand Up @@ -1379,7 +1379,7 @@ contract RollupProcessorV2 is IRollupProcessorV2, Decoder, Initializable, Access
}

/*----------------------------------------
PUBLIC/EXTERNAL NON-MUTATING FUNCTIONS
PUBLIC/EXTERNAL NON-MUTATING FUNCTIONS
----------------------------------------*/

/**
Expand Down
Loading