Skip to content

Commit 376fdc2

Browse files
authored
Merge branch 'next' into claudebox/fix-nightly-bb-debug-build
2 parents a8d081c + a864dec commit 376fdc2

226 files changed

Lines changed: 8089 additions & 3900 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ci3_labels_to_env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function main {
3737
echo "NO_FAIL_FAST=1" >> $GITHUB_ENV
3838
fi
3939

40+
# Handle skip-compat-e2e label (escape hatch for backwards compat test failures on release PRs)
41+
if has_label "ci-skip-compat-e2e"; then
42+
echo "SKIP_COMPAT_E2E=1" >> $GITHUB_ENV
43+
fi
44+
4045
# Determine CI mode based on event, labels, and target branch
4146
local ci_mode
4247
if [ "${GITHUB_EVENT_NAME:-}" == "merge_group" ] || has_label "ci-merge-queue"; then

.github/workflows/ci3.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,108 @@ jobs:
445445
AWS_SHUTDOWN_TIME: 180
446446
run: |
447447
./.github/ci3.sh network-tests-kind
448+
449+
# Backwards compatibility e2e tests.
450+
# Runs e2e tests with contract artifacts from every prior stable release to validate
451+
# that new client code works with old contract artifacts ("new pxe / old contracts").
452+
# Blocking for stable/RC releases: ci-release-publish requires this job to pass before
453+
# publishing. Observational for nightlies: runs, but continue-on-error keeps the workflow
454+
# green and ci-release-publish's condition publishes nightlies regardless of the result.
455+
# Escape hatch: ci-skip-compat-e2e label makes failures non-blocking on release PRs.
456+
ci-compat-e2e:
457+
runs-on: ubuntu-latest
458+
permissions:
459+
id-token: write
460+
contents: read
461+
needs: [ci]
462+
if: |
463+
always()
464+
&& (needs.ci.result == 'success' || needs.ci.result == 'skipped')
465+
&& github.event.pull_request.head.repo.fork != true
466+
&& github.event.pull_request.draft == false
467+
&& (
468+
(startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-commit.'))
469+
|| contains(github.event.pull_request.labels.*.name, 'ci-compat-e2e')
470+
|| contains(github.event.pull_request.labels.*.name, 'ci-release-pr')
471+
)
472+
# Non-blocking for nightlies and when ci-skip-compat-e2e escape hatch is applied.
473+
continue-on-error: ${{ contains(github.ref_name, '-nightly.') || contains(github.event.pull_request.labels.*.name, 'ci-skip-compat-e2e') }}
474+
steps:
475+
- name: Checkout
476+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
477+
with:
478+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
479+
480+
- name: Configure AWS credentials (OIDC)
481+
uses: aws-actions/configure-aws-credentials@v4
482+
with:
483+
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }}
484+
aws-region: us-east-2
485+
role-session-name: ci3-compat-e2e-${{ github.run_id }}
486+
role-duration-seconds: 21600 # 6h – covers AWS_SHUTDOWN_TIME (300 min) + 60 min buffer
487+
488+
- name: Run Backwards Compatibility E2E Tests
489+
timeout-minutes: 330
490+
env:
491+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
492+
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
493+
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
494+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
495+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
496+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
497+
CI3_INSTANCE_PROFILE_NAME: ${{ secrets.CI3_INSTANCE_PROFILE_NAME }}
498+
CI3_SECURITY_GROUP_ID: ${{ secrets.CI3_SECURITY_GROUP_ID }}
499+
RUN_ID: ${{ github.run_id }}
500+
AWS_SHUTDOWN_TIME: 300
501+
run: ./.github/ci3.sh compat-e2e
502+
503+
# Publishes the release (npm, Docker, GitHub release, aztec-up scripts, etc.).
504+
# Gated on ci-compat-e2e: a compat regression blocks stable/RC publishing. Nightlies
505+
# publish regardless — compat-e2e runs there observationally. Dev `-commit.` tags from
506+
# the ci-release-pr flow never reach this job (they are not real releases).
507+
ci-release-publish:
508+
runs-on: ubuntu-latest
509+
environment: master
510+
permissions:
511+
id-token: write
512+
contents: read
513+
needs: [ci, ci-compat-e2e]
514+
if: |
515+
startsWith(github.ref, 'refs/tags/v')
516+
&& !contains(github.ref_name, '-commit.')
517+
&& needs.ci.result == 'success'
518+
&& (
519+
contains(github.ref_name, '-nightly.')
520+
|| needs.ci-compat-e2e.result == 'success'
521+
)
522+
steps:
523+
- name: Checkout
524+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
525+
with:
526+
ref: ${{ github.sha }}
527+
528+
- name: Configure AWS credentials (OIDC)
529+
uses: aws-actions/configure-aws-credentials@v4
530+
with:
531+
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }}
532+
aws-region: us-east-2
533+
role-session-name: ci3-release-publish-${{ github.run_id }}
534+
role-duration-seconds: 21600
535+
536+
- name: Run Release Publish
537+
env:
538+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
539+
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
540+
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
541+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
542+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
543+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
544+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
545+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
546+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
547+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
548+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
549+
CI3_INSTANCE_PROFILE_NAME: ${{ secrets.CI3_INSTANCE_PROFILE_NAME }}
550+
CI3_SECURITY_GROUP_ID: ${{ secrets.CI3_SECURITY_GROUP_ID }}
551+
RUN_ID: ${{ github.run_id }}
552+
run: ./.github/ci3.sh release-publish

.github/workflows/metrics-deploy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ on:
3737
required: true
3838
type: string
3939
default: "grafana-dashboard-password"
40+
slack_alert_mention_user_ids:
41+
description: Optional Terraform list of Slack user IDs to mention on Grafana alert notifications
42+
required: false
43+
type: string
44+
default: '["U0AHB6VR8N5"]'
4045
secrets:
4146
GCP_SA_KEY:
4247
required: true
@@ -70,6 +75,10 @@ on:
7075
description: The name of the secret which holds the Grafana dashboard password
7176
required: true
7277
default: "grafana-dashboard-password"
78+
slack_alert_mention_user_ids:
79+
description: Optional Terraform list of Slack user IDs to mention on Grafana alert notifications
80+
required: false
81+
default: '["U0AHB6VR8N5"]'
7382

7483
jobs:
7584
metrics_deployment:
@@ -96,6 +105,7 @@ jobs:
96105
SLACK_WEBHOOK_NEXT_NET_SECRET_NAME: slack-webhook-next-net-url
97106
SLACK_WEBHOOK_TESTNET_SECRET_NAME: slack-webhook-testnet-url
98107
SLACK_WEBHOOK_MAINNET_SECRET_NAME: slack-webhook-mainnet-url
108+
TF_VAR_SLACK_ALERT_MENTION_USER_IDS: ${{ inputs.slack_alert_mention_user_ids }}
99109

100110
steps:
101111
- name: Checkout code

barretenberg/bbup/bbup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ get_bb_version_for_noir() {
5050

5151
local lookup_url="https://raw.githubusercontent.com/AztecProtocol/aztec-packages/next/barretenberg/bbup/bb-versions.json"
5252

53-
# Extract BB version from install script
54-
local bb_version=$(curl --fail -s "$lookup_url" | jq -r --arg version "$resolved_version" '.[$version]')
53+
# bb-versions.json is a flat "<noir-version>": "<bb-version>" map with one entry per line.
54+
local bb_version=$(curl --fail -s "$lookup_url" | grep -F "\"$resolved_version\":" | head -1 | cut -d'"' -f4)
5555
echo "$bb_version"
5656
}
5757

barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_changed.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ script_path="$root/barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_cha
2121
# - Generate a hash for versioning: sha256sum bb-chonk-inputs.tar.gz
2222
# - Upload the compressed results: aws s3 cp bb-chonk-inputs.tar.gz s3://aztec-ci-artifacts/protocol/bb-chonk-inputs-[hash(0:8)].tar.gz
2323
# Note: In case of the "Test suite failed to run ... Unexpected token 'with' " error, need to run: docker pull aztecprotocol/build:3.0
24-
pinned_short_hash="ae9c2d06"
24+
pinned_short_hash="c09aeb0c"
2525
pinned_chonk_inputs_url="https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/protocol/bb-chonk-inputs-${pinned_short_hash}.tar.gz"
2626

2727
function update_pinned_hash_in_script {

barretenberg/cpp/src/barretenberg/bbapi/bbapi_ecc.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ Bn254G2Mul::Response Bn254G2Mul::execute(BBApiRequest& request) &&
9999
if (!point.on_curve()) {
100100
BBAPI_ERROR(request, "Input point must be on the curve");
101101
}
102+
// BN254 G2 has cofactor h2 ≈ 2^254. An on-curve point may lie in a cofactor subgroup of order
103+
// dividing h2 rather than the prime-order subgroup; we do not want to allow such points
104+
// as inputs to bbapi.
105+
if (!point.is_in_prime_subgroup()) {
106+
BBAPI_ERROR(request, "Input point must lie in the prime-order subgroup");
107+
}
102108
auto result = point * scalar;
103109
if (!result.on_curve()) {
104110
BBAPI_ERROR(request, "Output point must be on the curve");

barretenberg/cpp/src/barretenberg/bbapi/bbapi_srs.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,15 @@ SrsInitSrs::Response SrsInitSrs::execute(BB_UNUSED BBApiRequest& request) &&
5050
std::to_string(bytes_per_point));
5151
}
5252

53-
// Parse G2 point from buffer (128 bytes)
53+
// Parse G2 point from buffer (128 bytes). `serialize_from_buffer` validates that the bytes
54+
// decode to a curve point but does NOT enforce subgroup membership. BN254 G2 has a non-trivial
55+
// cofactor (h2 ≈ 2^254), so a curve point may lie in a small cofactor subgroup of order
56+
// dividing h2 rather than the prime-order subgroup of order r. Reject anything outside
57+
// the prime-order subgroup before it reaches the SRS factory.
5458
auto g2_point_elem = from_buffer<g2::affine_element>(g2_point.data());
59+
if (!g2_point_elem.is_in_prime_subgroup()) {
60+
throw_or_abort("SrsInitSrs: g2_point is not in the BN254 G2 prime-order subgroup");
61+
}
5562

5663
// Initialize BN254 SRS
5764
bb::srs::init_bn254_mem_crs_factory(g1_points, g2_point_elem);

barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph_description_goblin.test.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ class BoomerangGoblinRecursiveVerifierTests : public testing::Test {
4545
{
4646
Goblin goblin;
4747
GoblinMockCircuits::construct_and_merge_mock_circuits(goblin, 5);
48+
goblin.op_queue->construct_zk_columns();
4849

4950
// Merge the ecc ops from the newly constructed circuit
5051
auto goblin_proof = goblin.prove();
5152
// Subtable values and commitments - needed for (Recursive)MergeVerifier
5253
MergeCommitments merge_commitments;
5354
auto t_current = goblin.op_queue->construct_current_ultra_ops_subtable_columns();
54-
auto T_prev = goblin.op_queue->construct_previous_ultra_ops_table_columns();
55-
CommitmentKey<curve::BN254> pcs_commitment_key(goblin.op_queue->get_ultra_ops_table_num_rows());
55+
auto T_prev = goblin.op_queue->construct_table_columns_up_to_tail();
56+
CommitmentKey<curve::BN254> pcs_commitment_key(goblin.op_queue->get_ultra_ops_table_num_rows() +
57+
UltraEccOpsTable::ZK_ULTRA_OPS);
5658
for (size_t idx = 0; idx < MegaFlavor::NUM_WIRES; idx++) {
5759
merge_commitments.t_commitments[idx] = pcs_commitment_key.commit(t_current[idx]);
5860
merge_commitments.T_prev_commitments[idx] = pcs_commitment_key.commit(T_prev[idx]);
@@ -86,7 +88,7 @@ TEST_F(BoomerangGoblinRecursiveVerifierTests, graph_description_basic)
8688

8789
auto transcript = std::make_shared<GoblinRecursiveVerifier::Transcript>();
8890
GoblinStdlibProof stdlib_proof(builder, proof);
89-
GoblinRecursiveVerifier verifier{ transcript, stdlib_proof, recursive_merge_commitments, MergeSettings::APPEND };
91+
GoblinRecursiveVerifier verifier{ transcript, stdlib_proof, recursive_merge_commitments };
9092
GoblinRecursiveVerifier::ReductionResult output = verifier.reduce_to_pairing_check_and_ipa_opening();
9193

9294
// Aggregate merge + translator pairing points

barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph_description_goblin_avm.test.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,14 @@ class BoomerangGoblinAvmRecursiveVerifierTests : public testing::Test {
5454
GoblinAvm goblin(inner_builder);
5555
MockCircuits::construct_arithmetic_circuit(inner_builder);
5656

57-
// Build a MegaAvm prover instance to get ecc_op_wire commitments matching the real flow.
58-
auto mega_avm_instance = std::make_shared<ProverInstance_<MegaAvmFlavor>>(inner_builder);
59-
CommitmentKey<curve::BN254> pcs_commitment_key(mega_avm_instance->dyadic_size());
60-
6157
auto goblin_proof = goblin.prove();
6258

63-
// Commit to ecc_op_wire polynomials from the MegaAvm prover instance
59+
// Commit to op_queue columns.
6460
TableCommitments table_commitments;
65-
size_t idx = 0;
66-
for (auto& wire : mega_avm_instance->polynomials.get_ecc_op_wires()) {
67-
table_commitments[idx++] = pcs_commitment_key.commit(wire);
61+
auto ultra_ops_table_columns = goblin.op_queue->construct_ultra_ops_table_columns(/*include_zk_ops=*/false);
62+
CommitmentKey<curve::BN254> pcs_commitment_key(goblin.op_queue->get_ultra_ops_table_num_rows());
63+
for (size_t idx = 0; idx < MegaFlavor::NUM_WIRES; idx++) {
64+
table_commitments[idx] = pcs_commitment_key.commit(ultra_ops_table_columns[idx]);
6865
}
6966

7067
RecursiveTableCommitments recursive_table_commitments;

barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph_description_merge_recursive_verifier.test.cpp

Lines changed: 26 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,37 @@ template <class RecursiveBuilder> class BoomerangRecursiveMergeVerifierTest : pu
4747
EXPECT_EQ(result.second.size(), 0);
4848
}
4949

50-
static void prove_and_verify_merge(const std::shared_ptr<ECCOpQueue>& op_queue,
51-
const MergeSettings settings = MergeSettings::PREPEND,
52-
const bool run_analyzer = false)
50+
static std::shared_ptr<ECCOpQueue> construct_final_merge_op_queue(const size_t num_subtables_up_to_tail)
51+
{
52+
auto op_queue = std::make_shared<ECCOpQueue>();
53+
54+
for (size_t idx = 0; idx < num_subtables_up_to_tail; ++idx) {
55+
InnerBuilder circuit{ op_queue };
56+
GoblinMockCircuits::construct_simple_circuit(circuit);
57+
op_queue->merge();
58+
}
59+
60+
op_queue->construct_zk_columns();
61+
62+
InnerBuilder hiding_circuit{ op_queue };
63+
GoblinMockCircuits::construct_simple_circuit(hiding_circuit);
64+
return op_queue;
65+
}
66+
67+
static void prove_and_verify_merge(const std::shared_ptr<ECCOpQueue>& op_queue, const bool run_analyzer = false)
5368

5469
{
5570
RecursiveBuilder outer_circuit;
5671

5772
auto prover_transcript = std::make_shared<NativeTranscript>();
58-
MergeProver merge_prover{ op_queue, prover_transcript, settings };
73+
MergeProver merge_prover{ op_queue, prover_transcript };
5974
auto merge_proof = merge_prover.construct_proof();
6075

6176
// Subtable values and commitments - needed for (Recursive)MergeVerifier
6277
MergeCommitments merge_commitments;
6378
RecursiveMergeCommitments recursive_merge_commitments;
6479
auto t_current = op_queue->construct_current_ultra_ops_subtable_columns();
65-
auto T_prev = op_queue->construct_previous_ultra_ops_table_columns();
80+
auto T_prev = op_queue->construct_table_columns_up_to_tail();
6681
for (size_t idx = 0; idx < InnerFlavor::NUM_WIRES; idx++) {
6782
merge_commitments.t_commitments[idx] = merge_prover.pcs_commitment_key.commit(t_current[idx]);
6883
merge_commitments.T_prev_commitments[idx] = merge_prover.pcs_commitment_key.commit(T_prev[idx]);
@@ -78,7 +93,7 @@ template <class RecursiveBuilder> class BoomerangRecursiveMergeVerifierTest : pu
7893

7994
// Create a recursive merge verification circuit for the merge proof
8095
auto merge_transcript = std::make_shared<StdlibTranscript<RecursiveBuilder>>();
81-
RecursiveMergeVerifier verifier{ settings, merge_transcript };
96+
RecursiveMergeVerifier verifier{ merge_transcript };
8297
const stdlib::Proof<RecursiveBuilder> stdlib_merge_proof(outer_circuit, merge_proof);
8398
auto [pairing_points, merged_commitments, reduction_succeeded] =
8499
verifier.reduce_to_pairing_check(stdlib_merge_proof, recursive_merge_commitments);
@@ -96,53 +111,20 @@ template <class RecursiveBuilder> class BoomerangRecursiveMergeVerifierTest : pu
96111
}
97112
}
98113

99-
static void test_recursive_merge_verification_prepend()
100-
{
101-
auto op_queue = std::make_shared<ECCOpQueue>();
102-
103-
InnerBuilder circuit{ op_queue };
104-
GoblinMockCircuits::construct_simple_circuit(circuit);
105-
prove_and_verify_merge(op_queue);
106-
107-
InnerBuilder circuit2{ op_queue };
108-
GoblinMockCircuits::construct_simple_circuit(circuit2);
109-
prove_and_verify_merge(op_queue);
110-
111-
InnerBuilder circuit3{ op_queue };
112-
GoblinMockCircuits::construct_simple_circuit(circuit3);
113-
prove_and_verify_merge(op_queue, MergeSettings::PREPEND, true);
114-
}
115-
116-
static void test_recursive_merge_verification_append()
114+
static void test_recursive_merge_verification()
117115
{
118-
auto op_queue = std::make_shared<ECCOpQueue>();
119-
120-
InnerBuilder circuit{ op_queue };
121-
GoblinMockCircuits::construct_simple_circuit(circuit);
122-
prove_and_verify_merge(op_queue);
123-
124-
InnerBuilder circuit2{ op_queue };
125-
GoblinMockCircuits::construct_simple_circuit(circuit2);
126-
prove_and_verify_merge(op_queue);
127-
128-
InnerBuilder circuit3{ op_queue };
129-
GoblinMockCircuits::construct_simple_circuit(circuit3);
130-
prove_and_verify_merge(op_queue, MergeSettings::APPEND, true);
116+
auto op_queue = construct_final_merge_op_queue(/*num_subtables_up_to_tail=*/3);
117+
prove_and_verify_merge(op_queue, /*run_analyzer=*/true);
131118
}
132119
};
133120

134121
using Builder = testing::Types<MegaCircuitBuilder>;
135122

136123
TYPED_TEST_SUITE(BoomerangRecursiveMergeVerifierTest, Builder);
137124

138-
TYPED_TEST(BoomerangRecursiveMergeVerifierTest, RecursiveVerificationPrepend)
139-
{
140-
TestFixture::test_recursive_merge_verification_prepend();
141-
};
142-
143-
TYPED_TEST(BoomerangRecursiveMergeVerifierTest, RecursiveVerificationAppend)
125+
TYPED_TEST(BoomerangRecursiveMergeVerifierTest, RecursiveMergeVerification)
144126
{
145-
TestFixture::test_recursive_merge_verification_append();
127+
TestFixture::test_recursive_merge_verification();
146128
};
147129

148130
} // namespace bb::stdlib::recursion::goblin

0 commit comments

Comments
 (0)