nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: ponder-sh/ponder
Pull request #1193 (2024-10-26 16:39:07)

support hyperliquid retry ranges


Patch:
diff --git a/.changeset/pink-schools-glow.md b/.changeset/pink-schools-glow.md
new file mode 100644
index 00000000..8b89a3fc
--- /dev/null
+++ b/.changeset/pink-schools-glow.md
@@ -0,0 +1,5 @@
+---
+"@ponder/utils": patch
+---
+
+Added retry range support for hyperliquid.
diff --git a/packages/utils/src/getLogsRetryHelper.ts b/packages/utils/src/getLogsRetryHelper.ts
index 81e2e984..d07aec9a 100644
--- a/packages/utils/src/getLogsRetryHelper.ts
+++ b/packages/utils/src/getLogsRetryHelper.ts
@@ -357,6 +357,25 @@ export const getLogsRetryHelper = ({
     } as const;
   }
 
+  // hyperliquid
+  match = sError.match(/query exceeds max block range ([\d,.]+)/);
+  if (match !== null) {
+    const ranges = chunk({
+      params,
+      range: BigInt(match[1]!.replace(/[,.]/g, "")),
+    });
+
+    if (isRangeUnchanged(params, ranges)) {
+      return { shouldRetry: false } as const;
+    }
+
+    return {
+      shouldRetry: true,
+      ranges,
+      isSuggestedRange: true,
+    } as const;
+  }
+
   // No match found
   return {
     shouldRetry: false,


Test patch:
diff --git a/packages/utils/src/_test/hyperliquid.test.ts b/packages/utils/src/_test/hyperliquid.test.ts
new file mode 100644
index 00000000..2bcba24b
--- /dev/null
+++ b/packages/utils/src/_test/hyperliquid.test.ts
@@ -0,0 +1,59 @@
+import { RpcError, numberToHex } from "viem";
+import { expect, test } from "vitest";
+import { getLogsRetryHelper } from "../getLogsRetryHelper.js";
+import { type Params, getRequest } from "./utils.js";
+
+const request = getRequest("https://api.hyperliquid-testnet.xyz/evm");
+const fromBlock = 9419400;
+const maxBlockRange = 50;
+
+test("hyperliquid success", async () => {
+  const logs = await request({
+    method: "eth_getLogs",
+    params: [
+      {
+        fromBlock: numberToHex(fromBlock),
+        toBlock: numberToHex(fromBlock + maxBlockRange),
+      },
+    ],
+  });
+
+  expect(logs).toHaveLength(5);
+});
+
+test("hyperliquid block range", async () => {
+  const params: Params = [
+    {
+      fromBlock: numberToHex(fromBlock),
+      toBlock: numberToHex(fromBlock + maxBlockRange + 1),
+    },
+  ];
+
+  const error = await request({
+    method: "eth_getLogs",
+    params,
+  }).catch((error) => error);
+
+  expect(error).toBeInstanceOf(RpcError);
+  expect(JSON.stringify(error)).includes("query exceeds max block range 50");
+
+  const retry = getLogsRetryHelper({
+    params,
+    error: error,
+  });
+
+  expect(retry).toStrictEqual({
+    shouldRetry: true,
+    isSuggestedRange: true,
+    ranges: [
+      {
+        fromBlock: numberToHex(fromBlock),
+        toBlock: numberToHex(fromBlock + maxBlockRange),
+      },
+      {
+        fromBlock: numberToHex(fromBlock + maxBlockRange + 1),
+        toBlock: numberToHex(fromBlock + maxBlockRange + 1),
+      },
+    ],
+  });
+});
Repository: ponder-sh/ponder
Pull request #1381 (2024-12-28 18:20:13)

fix: raw sql insert followed by in-memory find


Patch:
diff --git a/.changeset/five-walls-sleep.md b/.changeset/five-walls-sleep.md
new file mode 100644
index 00000000..82442bd2
--- /dev/null
+++ b/.changeset/five-walls-sleep.md
@@ -0,0 +1,5 @@
+---
+"ponder": patch
+---
+
+Fixed a bug where data inserted using raw SQL near the beginning of historical indexing was not found by subsequent `find`, `update`, or `delete` operations using the store/in-memory API.
diff --git a/packages/core/src/indexing-store/historical.ts b/packages/core/src/indexing-store/historical.ts
index 676b23b0..42ecb5d1 100644
--- a/packages/core/src/indexing-store/historical.ts
+++ b/packages/core/src/indexing-store/historical.ts
@@ -731,6 +731,7 @@ export const createHistoricalIndexingStore = ({
         await database.createTriggers();
         await indexingStore.flush();
         await database.removeTriggers();
+        isDatabaseEmpty = false;
 
         const query: QueryWithTypings = { sql: _sql, params, typings };
 


Test patch:
diff --git a/packages/core/src/indexing-store/historical.test.ts b/packages/core/src/indexing-store/historical.test.ts
index 1f44a57f..725bd69e 100644
--- a/packages/core/src/indexing-store/historical.test.ts
+++ b/packages/core/src/indexing-store/historical.test.ts
@@ -453,6 +453,41 @@ test("sql", async (context) => {
   await cleanup();
 });
 
+test("sql followed by find", async (context) => {
+  const schema = {
+    account: onchainTable("account", (p) => ({
+      address: p.hex().primaryKey(),
+      balance: p.bigint().notNull(),
+    })),
+  };
+
+  const { database, cleanup } = await setupDatabaseServices(context, {
+    schema,
+  });
+
+  const indexingStore = createHistoricalIndexingStore({
+    common: context.common,
+    database,
+    schema,
+    initialCheckpoint: encodeCheckpoint(zeroCheckpoint),
+  });
+
+  await indexingStore.sql
+    .insert(schema.account)
+    .values({ address: zeroAddress, balance: 10n });
+
+  const row = await indexingStore.find(schema.account, {
+    address: zeroAddress,
+  });
+
+  expect(row).toStrictEqual({
+    address: zeroAddress,
+    balance: 10n,
+  });
+
+  await cleanup();
+});
+
 test("onchain table", async (context) => {
   const { database, cleanup } = await setupDatabaseServices(context);
Repository: ponder-sh/ponder
Pull request #1416 (2025-01-07 20:44:41)

fix duplicate triggers


Patch:
diff --git a/.changeset/modern-ads-mate.md b/.changeset/modern-ads-mate.md
new file mode 100644
index 00000000..3afb7ef3
--- /dev/null
+++ b/.changeset/modern-ads-mate.md
@@ -0,0 +1,5 @@
+---
+"ponder": patch
+---
+
+Fixed a bug causing the error: `trigger "_reorg__xyz" for relation "xyz" already exists`.
diff --git a/packages/core/src/database/index.ts b/packages/core/src/database/index.ts
index 44cd3292..32161539 100644
--- a/packages/core/src/database/index.ts
+++ b/packages/core/src/database/index.ts
@@ -1032,7 +1032,7 @@ $$ LANGUAGE plpgsql
 
           await sql
             .raw(`
-          CREATE TRIGGER "${tableName.trigger}"
+          CREATE OR REPLACE TRIGGER "${tableName.trigger}"
           AFTER INSERT OR UPDATE OR DELETE ON "${preBuild.namespace}"."${tableName.sql}"
           FOR EACH ROW EXECUTE FUNCTION ${tableName.triggerFn};
           `)


Test patch:
diff --git a/packages/core/src/database/index.test.ts b/packages/core/src/database/index.test.ts
index d1e30ce3..fcb5149e 100644
--- a/packages/core/src/database/index.test.ts
+++ b/packages/core/src/database/index.test.ts
@@ -648,6 +648,27 @@ test("createTriggers()", async (context) => {
   await database.kill();
 });
 
+test("createTriggers() duplicate", async (context) => {
+  const database = createDatabase({
+    common: context.common,
+    preBuild: {
+      databaseConfig: context.databaseConfig,
+      namespace: "public",
+    },
+    schemaBuild: {
+      schema: { account },
+      statements: buildSchema({ schema: { account } }).statements,
+    },
+  });
+
+  await database.setup({ buildId: "abc" });
+  await database.createTriggers();
+  await database.createTriggers();
+
+  await database.unlock();
+  await database.kill();
+});
+
 test("complete()", async (context) => {
   const database = createDatabase({
     common: context.common,
Repository: FormidableLabs/spectacle
Pull request #357 (2017-09-10 21:45:20)

Update presenter-components.js
Adding a width so that the notes aren't hidden behind the slide in the event there is a css issue with the slide width.


Patch:
diff --git a/src/components/presenter-components.js b/src/components/presenter-components.js
index 63ccbf4..5810929 100644
--- a/src/components/presenter-components.js
+++ b/src/components/presenter-components.js
@@ -36,6 +36,7 @@ export const PreviewCurrentSlide = styled.div`
   display: flex;
   flex: 0 0 100%;
   height: 55%;
+  width: 55%;
   padding: 20px;
 `;
 


Test patch:
diff --git a/src/components/__snapshots__/presenter.test.js.snap b/src/components/__snapshots__/presenter.test.js.snap
index d51e130..96f219d 100644
--- a/src/components/__snapshots__/presenter.test.js.snap
+++ b/src/components/__snapshots__/presenter.test.js.snap
@@ -88,7 +88,7 @@ exports[`<Presenter /> should render correctly 1`] = `
                 className="spectacle-presenter-main"
               >
                 <div
-                  className="spectacle-presenter-main jmeTwE"
+                  className="spectacle-presenter-main eNGgOD"
                 >
                   <Slide
                     dispatch={[Function]}
@@ -262,7 +262,7 @@ exports[`<Presenter /> should render timer when set in params. 1`] = `
                 className="spectacle-presenter-main"
               >
                 <div
-                  className="spectacle-presenter-main jmeTwE"
+                  className="spectacle-presenter-main eNGgOD"
                 >
                   <Slide
                     dispatch={[Function]}
@@ -422,7 +422,7 @@ exports[`<Presenter /> should render with notes when slides have them. 1`] = `
                 className="spectacle-presenter-main"
               >
                 <div
-                  className="spectacle-presenter-main jmeTwE"
+                  className="spectacle-presenter-main eNGgOD"
                 >
                   <Slide
                     dispatch={[Function]}