From 3537b30a255f633eba58fa985414ce23104a4fce Mon Sep 17 00:00:00 2001
From: benesjan <janbenes1234@gmail.com>
Date: Wed, 2 Aug 2023 09:40:06 +0000
Subject: [PATCH 1/2] style: yarn format

---
 yarn-project/aztec.js/package.local.json    | 2 +-
 yarn-project/aztec.js/tsconfig.dest.json    | 6 ++----
 yarn-project/circuits.js/tsconfig.dest.json | 7 ++-----
 yarn-project/foundation/tsconfig.dest.json  | 6 ++----
 yarn-project/types/tsconfig.dest.json       | 6 ++----
 5 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/yarn-project/aztec.js/package.local.json b/yarn-project/aztec.js/package.local.json
index 11f862cc48a..ae44d5384f7 100644
--- a/yarn-project/aztec.js/package.local.json
+++ b/yarn-project/aztec.js/package.local.json
@@ -2,4 +2,4 @@
   "scripts": {
     "build": "yarn clean && tsc -b && webpack"
   }
-}
\ No newline at end of file
+}
diff --git a/yarn-project/aztec.js/tsconfig.dest.json b/yarn-project/aztec.js/tsconfig.dest.json
index f47bbdd408d..34485a9f9f6 100644
--- a/yarn-project/aztec.js/tsconfig.dest.json
+++ b/yarn-project/aztec.js/tsconfig.dest.json
@@ -11,7 +11,5 @@
       "path": "../types/tsconfig.dest.json"
     }
   ],
-  "exclude": [
-    "src/**/*.test.ts"
-  ]
-}
\ No newline at end of file
+  "exclude": ["src/**/*.test.ts"]
+}
diff --git a/yarn-project/circuits.js/tsconfig.dest.json b/yarn-project/circuits.js/tsconfig.dest.json
index 80f53b30eea..5ce7408ee2d 100644
--- a/yarn-project/circuits.js/tsconfig.dest.json
+++ b/yarn-project/circuits.js/tsconfig.dest.json
@@ -5,8 +5,5 @@
       "path": "../foundation/tsconfig.dest.json"
     }
   ],
-  "exclude": [
-    "src/**/*.test.ts",
-    "src/**/*.in.ts"
-  ]
-}
\ No newline at end of file
+  "exclude": ["src/**/*.test.ts", "src/**/*.in.ts"]
+}
diff --git a/yarn-project/foundation/tsconfig.dest.json b/yarn-project/foundation/tsconfig.dest.json
index 86c22947530..032674c6f9f 100644
--- a/yarn-project/foundation/tsconfig.dest.json
+++ b/yarn-project/foundation/tsconfig.dest.json
@@ -1,7 +1,5 @@
 {
   "extends": ".",
   "references": [],
-  "exclude": [
-    "src/**/*.test.ts"
-  ]
-}
\ No newline at end of file
+  "exclude": ["src/**/*.test.ts"]
+}
diff --git a/yarn-project/types/tsconfig.dest.json b/yarn-project/types/tsconfig.dest.json
index 831ec419be6..849be7da93e 100644
--- a/yarn-project/types/tsconfig.dest.json
+++ b/yarn-project/types/tsconfig.dest.json
@@ -8,7 +8,5 @@
       "path": "../foundation/tsconfig.dest.json"
     }
   ],
-  "exclude": [
-    "src/**/*.test.ts"
-  ]
-}
\ No newline at end of file
+  "exclude": ["src/**/*.test.ts"]
+}

From 9e8ee92e544e678012d55749acce3df01ab4c63c Mon Sep 17 00:00:00 2001
From: benesjan <janbenes1234@gmail.com>
Date: Wed, 2 Aug 2023 09:41:42 +0000
Subject: [PATCH 2/2] refactor: not breaking note processing on missing func
 error

---
 .../acir-simulator/src/client/simulator.ts    |  2 +-
 .../src/note_processor/note_processor.ts      | 32 +++++++++++--------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/yarn-project/acir-simulator/src/client/simulator.ts b/yarn-project/acir-simulator/src/client/simulator.ts
index 6911a1c4e0a..425d1caf27b 100644
--- a/yarn-project/acir-simulator/src/client/simulator.ts
+++ b/yarn-project/acir-simulator/src/client/simulator.ts
@@ -173,7 +173,7 @@ export class AcirSimulator {
       };
     } catch (e) {
       throw new Error(
-        `Please define an unconstrained function "${computeNoteHashAndNullifierSignature}" in the noir contract. Bubbled error message: ${e}`,
+        `Mandatory implementation of "${computeNoteHashAndNullifierSignature}" missing in noir contract ${contractAddress.toString()}.`,
       );
     }
   }
diff --git a/yarn-project/aztec-rpc/src/note_processor/note_processor.ts b/yarn-project/aztec-rpc/src/note_processor/note_processor.ts
index 712e0477fc7..fff0de1703f 100644
--- a/yarn-project/aztec-rpc/src/note_processor/note_processor.ts
+++ b/yarn-project/aztec-rpc/src/note_processor/note_processor.ts
@@ -114,20 +114,24 @@ export class NoteProcessor {
                 indexOfTxInABlock * MAX_NEW_NULLIFIERS_PER_TX,
                 (indexOfTxInABlock + 1) * MAX_NEW_NULLIFIERS_PER_TX,
               );
-              userPertainingTxIndices.add(indexOfTxInABlock);
-              const { index, nonce, nullifier } = await this.findNoteIndexAndNullifier(
-                dataStartIndexForTx,
-                newCommitments,
-                newNullifiers[0],
-                noteSpendingInfo,
-              );
-              noteSpendingInfoDaos.push({
-                ...noteSpendingInfo,
-                index,
-                nonce,
-                nullifier,
-                publicKey: this.publicKey,
-              });
+              try {
+                const { index, nonce, nullifier } = await this.findNoteIndexAndNullifier(
+                  dataStartIndexForTx,
+                  newCommitments,
+                  newNullifiers[0],
+                  noteSpendingInfo,
+                );
+                noteSpendingInfoDaos.push({
+                  ...noteSpendingInfo,
+                  index,
+                  nonce,
+                  nullifier,
+                  publicKey: this.publicKey,
+                });
+                userPertainingTxIndices.add(indexOfTxInABlock);
+              } catch (e) {
+                this.log.warn(`Could not process note because of "${e}". Skipping note...`);
+              }
             }
           }
         }