Skip to content

[BUG] findSpores / findSporesBySigner with clusterId: "" Also Return Clustered Spores #599

Description

@phroi

Hello folks at CKB DevRel,

I noticed that clusterId: "", documented as the way to find public spores, returns every spore, including the ones in a cluster.

Minimal Reproduction

import { ccc } from "@ckb-ccc/core";
import { spore } from "@ckb-ccc/spore";
import { packRawSporeData } from "@ckb-ccc/spore/advanced";

const client = new ccc.ClientPublicTestnet();
client.findCellsOnChain = async function* () {}; // Only the cells below, no node.
const lock = { codeHash: "0x" + "00".repeat(32), hashType: "type", args: "0x" } as const;
const { codeHash, hashType } = spore.getSporeScriptInfo(client);

// One public spore and one in a cluster.
for (const [i, clusterId] of [undefined, "0x" + "66".repeat(32)].entries()) {
  await client.cache.markUsable({
    outPoint: { txHash: "0x" + "77".repeat(32), index: i },
    cellOutput: { lock, type: { codeHash, hashType, args: "0x" + `0${i}`.repeat(32) } },
    outputData: packRawSporeData({ contentType: "", content: "0x", clusterId }),
  });
}

for await (const { sporeData } of spore.findSpores({ client, lock, clusterId: "" })) {
  console.log(sporeData.clusterId ?? "public");
}

Behavior

public
0x6666666666666666666666666666666666666666666666666666666666666666

Only public should be printed. The filter in findSpores and findSporesBySigner starts with !clusterId, which is already true for "". So the clusterId === "" branch never gets to exclude clustered spores.

Environment

  • @ckb-ccc/core@1.23.0, @ckb-ccc/spore@1.6.15
  • Node.js 24.18.0, Linux

Keep up the Great Work,
Phroi %18

Activity

  1. added theissue type on Oct 13, 2026
  2. ashuralyk commented on Oct 24, 2026

    @ashuralyk
    Contributor

    Great work, bro, I'm on it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions