Skip to content

Commit e7ae43c

Browse files
committed
patched
1 parent 28641b1 commit e7ae43c

5 files changed

Lines changed: 102 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dist-ssr
2424
*.sw?
2525

2626
.yarn/*
27+
!.yarn/patches
2728
!.yarn/releases
2829
vite.config.ts.*
2930
*.module.css.d.ts
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
diff --git a/dest/storage/capsule_store/capsule_store.js b/dest/storage/capsule_store/capsule_store.js
2+
index f455fc151d506562fbf20aa5b13b269a30c981b1..dccd521181ed58ccef3a23da2418f4f7648d671f 100644
3+
--- a/dest/storage/capsule_store/capsule_store.js
4+
+++ b/dest/storage/capsule_store/capsule_store.js
5+
@@ -108,11 +108,16 @@ export class CapsuleStore {
6+
this.#setOnStage(jobId, dbSlotKey, Buffer.concat(capsule.map((value)=>value.toBuffer())));
7+
}
8+
/**
9+
- * Returns data previously stored via `storeCapsule` in the per-contract non-volatile database.
10+
+ * Returns data previously stored via `storeCapsule` in the per-contract non-volatile database. Wraps the DB read in
11+
+ * a transactionAsync so it enters the serial queue and never observes a stale IndexedDB transaction set by a
12+
+ * concurrent transactionAsync caller.
13+
* @param contractAddress - The contract address under which the data is scoped.
14+
* @param slot - The slot in the database to read.
15+
* @returns The stored data or `null` if no data is stored under the slot.
16+
*/ async getCapsule(contractAddress, slot, jobId, scope) {
17+
+ return this.#store.transactionAsync(()=>this.#getCapsuleInternal(contractAddress, slot, jobId, scope));
18+
+ }
19+
+ /** Same as getCapsule but without its own transaction — for use inside an existing transactionAsync. */ async #getCapsuleInternal(contractAddress, slot, jobId, scope) {
20+
const dataBuffer = await this.#getFromStage(jobId, dbSlotToKey(contractAddress, slot, scope));
21+
if (!dataBuffer) {
22+
this.logger.trace(`Data not found for contract ${contractAddress.toString()} and slot ${slot.toString()}`);
23+
@@ -182,7 +187,7 @@ export class CapsuleStore {
24+
// and not using a transaction here would heavily impact performance.
25+
return this.#store.transactionAsync(async ()=>{
26+
// Load current length, defaulting to 0 if not found
27+
- const lengthData = await this.getCapsule(contractAddress, baseSlot, jobId, scope);
28+
+ const lengthData = await this.#getCapsuleInternal(contractAddress, baseSlot, jobId, scope);
29+
const currentLength = lengthData ? lengthData[0].toNumber() : 0;
30+
// Store each capsule at consecutive slots after baseSlot + 1 + currentLength
31+
for(let i = 0; i < content.length; i++){
32+
@@ -204,12 +209,12 @@ export class CapsuleStore {
33+
// of jobs: different calls running concurrently on the same contract may cause trouble.
34+
return this.#store.transactionAsync(async ()=>{
35+
// Load length, defaulting to 0 if not found
36+
- const maybeLength = await this.getCapsule(contractAddress, baseSlot, jobId, scope);
37+
+ const maybeLength = await this.#getCapsuleInternal(contractAddress, baseSlot, jobId, scope);
38+
const length = maybeLength ? maybeLength[0].toBigInt() : 0n;
39+
const values = [];
40+
// Read each capsule at consecutive slots after baseSlot
41+
for(let i = 0; i < length; i++){
42+
- const currentValue = await this.getCapsule(contractAddress, arraySlot(baseSlot, i), jobId, scope);
43+
+ const currentValue = await this.#getCapsuleInternal(contractAddress, arraySlot(baseSlot, i), jobId, scope);
44+
if (currentValue == undefined) {
45+
throw new Error(`Expected non-empty value at capsule array in base slot ${baseSlot} at index ${i} for contract ${contractAddress}`);
46+
}
47+
@@ -229,7 +234,7 @@ export class CapsuleStore {
48+
// of jobs: different calls running concurrently on the same contract may cause trouble.
49+
return this.#store.transactionAsync(async ()=>{
50+
// Load current length, defaulting to 0 if not found
51+
- const maybeLength = await this.getCapsule(contractAddress, baseSlot, jobId, scope);
52+
+ const maybeLength = await this.#getCapsuleInternal(contractAddress, baseSlot, jobId, scope);
53+
const originalLength = maybeLength ? maybeLength[0].toNumber() : 0;
54+
// Set the new length
55+
this.setCapsule(contractAddress, baseSlot, [

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"zod": "^3.23.8",
5252
"zone.js": "^0.16.1"
5353
},
54+
"resolutions": {
55+
"@aztec/pxe": "patch:@aztec/pxe@npm%3A4.3.0-nightly.20260416#~/.yarn/patches/@aztec-pxe-npm-4.3.0-nightly.20260416-b01dc128ea.patch"
56+
},
5457
"devDependencies": {
5558
"@aztec/wallets": "v4.3.0-nightly.20260416",
5659
"@eslint/js": "^9.18.0",

src/config/networks/testnet.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,17 @@
1515
"deployer": {
1616
"address": "0x12952c3d8a4116782ee85b93c634afbd4cdf2beabedd8258e89737616c269c33"
1717
},
18-
"deployedAt": "2026-04-16T07:16:45.008Z"
18+
"deployedAt": "2026-04-16T07:16:45.008Z",
19+
"subscriptionFPC": {
20+
"address": "0x029f91316f06e4d46e1d77b831a394dbe01676480e9114403838b8df944ca043",
21+
"secretKey": "0x2bd6014457e941f1ee656a5824cd6016289acfbd708a9019860284c898c9461c",
22+
"functions": {
23+
"0x0cc4ceb7cf7cc514ea8fbc5dc7866bedfca6d42bbe4c20a4ad16f4ecb21d4c84": {
24+
"0xa539bd29": 0
25+
},
26+
"0x181b971d54d29179cf25b3b69f79b028ea991fbf97cc8d4065d64bc53018932a": {
27+
"0xfd228669": 0
28+
}
29+
}
30+
}
1931
}

yarn.lock

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ __metadata:
956956
languageName: node
957957
linkType: hard
958958

959-
"@aztec/pxe@npm:4.3.0-nightly.20260416, @aztec/pxe@npm:v4.3.0-nightly.20260416":
959+
"@aztec/pxe@npm:4.3.0-nightly.20260416":
960960
version: 4.3.0-nightly.20260416
961961
resolution: "@aztec/pxe@npm:4.3.0-nightly.20260416"
962962
dependencies:
@@ -985,6 +985,35 @@ __metadata:
985985
languageName: node
986986
linkType: hard
987987

988+
"@aztec/pxe@patch:@aztec/pxe@npm%3A4.3.0-nightly.20260416#~/.yarn/patches/@aztec-pxe-npm-4.3.0-nightly.20260416-b01dc128ea.patch":
989+
version: 4.3.0-nightly.20260416
990+
resolution: "@aztec/pxe@patch:@aztec/pxe@npm%3A4.3.0-nightly.20260416#~/.yarn/patches/@aztec-pxe-npm-4.3.0-nightly.20260416-b01dc128ea.patch::version=4.3.0-nightly.20260416&hash=784cb2"
991+
dependencies:
992+
"@aztec/bb-prover": "npm:4.3.0-nightly.20260416"
993+
"@aztec/bb.js": "npm:4.3.0-nightly.20260416"
994+
"@aztec/builder": "npm:4.3.0-nightly.20260416"
995+
"@aztec/constants": "npm:4.3.0-nightly.20260416"
996+
"@aztec/ethereum": "npm:4.3.0-nightly.20260416"
997+
"@aztec/foundation": "npm:4.3.0-nightly.20260416"
998+
"@aztec/key-store": "npm:4.3.0-nightly.20260416"
999+
"@aztec/kv-store": "npm:4.3.0-nightly.20260416"
1000+
"@aztec/noir-protocol-circuits-types": "npm:4.3.0-nightly.20260416"
1001+
"@aztec/noir-types": "npm:4.3.0-nightly.20260416"
1002+
"@aztec/protocol-contracts": "npm:4.3.0-nightly.20260416"
1003+
"@aztec/simulator": "npm:4.3.0-nightly.20260416"
1004+
"@aztec/stdlib": "npm:4.3.0-nightly.20260416"
1005+
koa: "npm:^2.16.1"
1006+
koa-router: "npm:^13.1.1"
1007+
lodash.omit: "npm:^4.5.0"
1008+
sha3: "npm:^2.1.4"
1009+
tslib: "npm:^2.4.0"
1010+
viem: "npm:@aztec/viem@2.38.2"
1011+
bin:
1012+
pxe: dest/bin/index.js
1013+
checksum: 10c0/a7445b6727752bf3059b1de923bebe0d3cd501502c6dbb4cfcfe14885daaf97f37a2ab4d721145be7a689b8c6c9885981832579303d295d2b225d1f9225e85bd
1014+
languageName: node
1015+
linkType: hard
1016+
9881017
"@aztec/simulator@npm:4.3.0-nightly.20260416":
9891018
version: 4.3.0-nightly.20260416
9901019
resolution: "@aztec/simulator@npm:4.3.0-nightly.20260416"

0 commit comments

Comments
 (0)