Skip to content

feat(labs): port an aztec-packages PR to aztec-node with scripts/labs_port_pr.sh - #25346

Open
ludamad wants to merge 23 commits into
ad/upstream-batchesfrom
ad/labs-port-pr
Open

ludamad wants to merge 23 commits into
ad/upstream-batchesfrom
ad/labs-port-pr

Conversation

@ludamad

@ludamad ludamad commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

scripts/labs_port_pr.sh <pr number|url> — the mechanism people asked for to port a PR to aztec-node.

  • Scope check: every path in the PR's diff must be labs-owned — the in-tree layout (yarn-project/, noir-projects/labs/, docs/, playground/, spartan/, aztec-up/, release-image/, labs-aztec-toolchain/; v5 lines and next before the split) or, after the split, only labs-patches/*.patch (whose contents are the port). Anything else, or a mix of the two layouts, is refused with the files listed.
  • Replay: a temporary worktree of aztec-node main in labs/'s repository; git apply --3way with the diff's pre-image blobs copied from this repository, so drifted context is adapted and an already-landed hunk merges as a no-op. Files that still conflict are committed with markers and listed; lines referencing foundation-only paths (noir-projects/fnd, barretenberg/, …) are flagged. Result: branch port/pr-<n>, commit titled like the PR with the (AztecProtocol/aztec-packages#n) suffix aztec-node uses; the push and gh pr create commands are printed, nothing is pushed.
  • Tried on fix(txe): size guard counts runtime JS only, not sourcemaps #24800 against aztec-node main (which already has the hand port Update trees as we generate blocks #96): the code merged as a no-op and the only conflict was the bump-log comment where the human changed dates and numbers.
  • scripts/tests/labs_port_pr_test (offline, --diff/--no-fetch) runs with make labs-patches-tests.
  • Fixes CLAUDE.md: the </git_staging> / <labs_submodule_patches> tags swallowed by chore(labs-patches): upstream command and a tooling reference in CLAUDE.md #25330's rewrite are restored.

Follow-up, not here: a workflow behind the port-to-aztec-node label that runs this and opens the aztec-node PR as AztecBot.

Adam Domurad added 3 commits August 28, 2026 12:49
… and keep both locks in step with bumps

forge records every submodule of the repository in each foundry.lock and
rewrites a rev that does not match the gitlink, which CI reports as a change to
a rebuild pattern. l1-contracts/foundry.lock got its labs entry with the
submodule; barretenberg/sol/foundry.lock did not, and bb-sol-tests now fails
whenever it actually runs (the private release run hit it; public runs had
been served from the test cache).

Adds the entry, and makes `labs-patches/bootstrap.sh bump` rewrite the labs rev
in every foundry.lock that records it, so a pin move cannot leave a lock
behind. Lifecycle test covers the sync.
One aztec-node PR per patch is not the rule: patches that belong together —
typically those that do not depend on a foundation version bump — go up as one
PR. `labs-patches/bootstrap.sh upstream` now takes any number of patches and
applies them in series order onto one branch (`--branch` to name it); the README
and CLAUDE.md say so.
…_port_pr.sh

`scripts/labs_port_pr.sh <pr>` ports one PR to aztec-node: it downloads the
PR's diff, refuses it unless every path is in the labs half of the tree (the
in-tree layout of the v5 lines, or labs-patches/*.patch after the split — a
mixed PR is split by its author, not guessed at), and replays it onto
aztec-node main in a temporary worktree of labs/'s repository with a 3-way
merge. The pre-image blobs are copied over from this repository so the merge
can adapt to context that moved upstream and treat an already-landed hunk as a
no-op; files that still conflict are committed with markers and listed, as
are lines that reference foundation-only paths. The result is a port/pr-<n>
branch titled like the PR with aztec-node's "(AztecProtocol/aztec-packages#n)"
suffix; nothing is pushed.

An offline test (scripts/tests/labs_port_pr_test) runs with the labs-patches
tests. CLAUDE.md and the README describe the flow, and CLAUDE.md gets back the
</git_staging> and <labs_submodule_patches> tags that the earlier tooling
reference rewrite had swallowed.
Adam Domurad added 8 commits August 31, 2026 12:00
…eam is a local preview

The .patch files are the handoff: the labs team drains them with git am from
their own checkout. upstream keeps building the preview branch (the named
patches in series order on the recorded base) but no longer prints push or PR
commands, and the docs stop describing a foundation-opened aztec-node PR.
…e; upstream is a local preview"

This reverts commit e68f73a.
Also maps in-tree noir-projects/labs/<x> onto aztec-node's noir-projects/<x>
when replaying a port (aztec-node moved noir-projects to its root), with a
lifecycle check.
@ludamad
ludamad changed the base branch from ad/upstream-batches to next September 1, 2026 00:36
@ludamad
ludamad requested a review from charlielye as a code owner September 1, 2026 00:36
@ludamad
ludamad changed the base branch from next to ad/upstream-batches September 1, 2026 00:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant