From 7418400c47b459db4ce16858e9471a9d2a34361e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 14 Feb 2026 19:28:54 +0000 Subject: [PATCH] perf(test): speed up nostr profile fuzz --- extensions/nostr/src/nostr-profile.fuzz.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/nostr/src/nostr-profile.fuzz.test.ts b/extensions/nostr/src/nostr-profile.fuzz.test.ts index 1e67b66a456..21bb1e66178 100644 --- a/extensions/nostr/src/nostr-profile.fuzz.test.ts +++ b/extensions/nostr/src/nostr-profile.fuzz.test.ts @@ -98,7 +98,10 @@ describe("profile unicode attacks", () => { }); it("handles excessive combining characters (Zalgo text)", () => { - const zalgo = "t̷̢̧̨̡̛̛̛͎̩̝̪̲̲̞̠̹̗̩͓̬̱̪̦͙̬̲̤͙̱̫̝̪̱̫̯̬̭̠̖̲̥̖̫̫̤͇̪̣̫̪̖̱̯̣͎̯̲̱̤̪̣̖̲̪̯͓̖̤̫̫̲̱̲̫̲̖̫̪̯̱̱̪̖̯e̶̡̧̨̧̛̛̛̖̪̯̱̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪s̶̨̧̛̛̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯̖̪̯̖̪̱̪̯t"; + // Keep the source small (faster transforms) while still exercising + // "lots of combining marks" behavior. + const marks = "\u0301\u0300\u0336\u034f\u035c\u0360"; + const zalgo = `t${marks.repeat(256)}e${marks.repeat(256)}s${marks.repeat(256)}t`; const profile: NostrProfile = { name: zalgo.slice(0, 256), // Truncate to fit limit }; @@ -453,7 +456,7 @@ describe("event creation edge cases", () => { // Create events in quick succession let lastTimestamp = 0; - for (let i = 0; i < 100; i++) { + for (let i = 0; i < 25; i++) { const event = createProfileEvent(TEST_SK, profile, lastTimestamp); expect(event.created_at).toBeGreaterThan(lastTimestamp); lastTimestamp = event.created_at;