Skip to content

Commit b594593

Browse files
authored
chore: Accumulated backports to v4 (#22030)
BEGIN_COMMIT_OVERRIDE fix: deploy-staging-public waits for any semver tag instead of release-please version (#21984) fix: Fix blob encoding when uploaded from proposals (#22045) END_COMMIT_OVERRIDE
2 parents 1294089 + db55b9c commit b594593

3 files changed

Lines changed: 20 additions & 21 deletions

File tree

.github/workflows/deploy-staging-public.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,39 @@ jobs:
2626
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
2727
fetch-depth: 0
2828

29-
- name: Read version from manifest
30-
id: manifest
31-
run: |
32-
VERSION=$(jq -r '."."' .release-please-manifest.json)
33-
echo "version=$VERSION"
34-
echo "version=$VERSION" >> $GITHUB_OUTPUT
35-
36-
- name: Poll for tag at HEAD
29+
- name: Poll for semver tag at HEAD
3730
id: poll-tag
3831
run: |
39-
# wait for tag to be pushed (either RC or stable release)
40-
VERSION="${{ steps.manifest.outputs.version }}"
4132
HEAD_SHA=$(git rev-parse HEAD)
4233
MAX_ATTEMPTS=60
43-
echo "Looking for tag matching v${VERSION} or v${VERSION}-rc.* at HEAD ($HEAD_SHA)"
34+
echo "Looking for any semver tag at HEAD ($HEAD_SHA)"
4435
4536
for i in $(seq 1 $MAX_ATTEMPTS); do
4637
git fetch --tags --force
4738
48-
TAG=$(git tag --points-at HEAD | grep -E "^v${VERSION}(-rc\.[0-9]+)?$" | sort -V | tail -n 1 || true)
39+
# Collect all valid semver tags pointing at HEAD
40+
SEMVER_TAGS=()
41+
for t in $(git tag --points-at HEAD); do
42+
if ci3/semver check "$t"; then
43+
SEMVER_TAGS+=("$t")
44+
fi
45+
done
4946
50-
if [ -n "$TAG" ]; then
47+
# If we found valid semver tags, pick the highest
48+
if [ ${#SEMVER_TAGS[@]} -gt 0 ]; then
49+
TAG=$(ci3/semver sort "${SEMVER_TAGS[@]}" | tail -n 1)
5150
echo "Found tag: $TAG"
5251
SEMVER="${TAG#v}"
5352
echo "tag=$TAG" >> $GITHUB_OUTPUT
5453
echo "semver=$SEMVER" >> $GITHUB_OUTPUT
5554
exit 0
5655
fi
5756
58-
echo "Attempt $i/$MAX_ATTEMPTS: No matching tag yet, waiting 10s..."
57+
echo "Attempt $i/$MAX_ATTEMPTS: No semver tag yet, waiting 10s..."
5958
sleep 10
6059
done
6160
62-
echo "Error: No tag found for v${VERSION} at HEAD after 10 minutes"
61+
echo "Error: No semver tag found at HEAD after 10 minutes"
6362
exit 1
6463
6564
wait-for-ci3:

yarn-project/validator-client/src/proposal_handler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { BlobClientInterface } from '@aztec/blob-client/client';
2-
import { type Blob, getBlobsPerL1Block } from '@aztec/blob-lib';
2+
import { type Blob, encodeCheckpointBlobDataFromBlocks, getBlobsPerL1Block } from '@aztec/blob-lib';
33
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
44
import type { EpochCache } from '@aztec/epoch-cache';
55
import { validateFeeAssetPriceModifier } from '@aztec/ethereum/contracts';
@@ -886,7 +886,8 @@ export class ProposalHandler {
886886
return;
887887
}
888888

889-
const blobFields = blocks.flatMap(b => b.toBlobFields());
889+
const blockBlobData = blocks.map(b => b.toBlockBlobData());
890+
const blobFields = encodeCheckpointBlobDataFromBlocks(blockBlobData);
890891
const blobs: Blob[] = await getBlobsPerL1Block(blobFields);
891892
await this.blobClient.sendBlobsToFilestore(blobs);
892893
this.log.debug(`Uploaded ${blobs.length} blobs to filestore for checkpoint at slot ${proposal.slotNumber}`, {

yarn-project/validator-client/src/validator.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from '@aztec/p2p';
2424
import { OffenseType, WANT_TO_SLASH_EVENT } from '@aztec/slasher';
2525
import { AztecAddress } from '@aztec/stdlib/aztec-address';
26-
import type { BlockData, L2Block, L2BlockSink, L2BlockSource } from '@aztec/stdlib/block';
26+
import { type BlockData, L2Block, type L2BlockSink, type L2BlockSource } from '@aztec/stdlib/block';
2727
import type { getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
2828
import type { SlasherConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
2929
import { type L1ToL2MessageSource, computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
@@ -903,8 +903,7 @@ describe('ValidatorClient', () => {
903903
const proposalInfo = { slotNumber: 1, archive: '0x00', proposer: '0x00', txCount: 0 };
904904

905905
it('should send blobs from blocks in the slot to filestore', async () => {
906-
const blobFields = [Fr.random(), Fr.random()];
907-
const mockBlock = { toBlobFields: () => blobFields } as unknown as L2Block;
906+
const mockBlock = L2Block.empty();
908907
blockSource.getBlockHeaderByArchive.mockResolvedValue(makeBlockHeader());
909908
blockSource.getBlocksForSlot.mockResolvedValue([mockBlock]);
910909

@@ -931,7 +930,7 @@ describe('ValidatorClient', () => {
931930
});
932931

933932
it('should not throw when blob upload fails', async () => {
934-
const mockBlock = { toBlobFields: () => [Fr.random()] } as unknown as L2Block;
933+
const mockBlock = L2Block.empty();
935934
blockSource.getBlockHeaderByArchive.mockResolvedValue(makeBlockHeader());
936935
blockSource.getBlocksForSlot.mockResolvedValue([mockBlock]);
937936
blobClient.sendBlobsToFilestore.mockRejectedValue(new Error('upload failed'));

0 commit comments

Comments
 (0)