Skip to content

fix: transaction duplicate counting - #172

Open
silent-cipher wants to merge 3 commits into
mainfrom
fix/tx-count
Open

fix: transaction duplicate counting#172
silent-cipher wants to merge 3 commits into
mainfrom
fix/tx-count

Conversation

@silent-cipher

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings August 24, 2026 14:28
@silent-cipher silent-cipher self-assigned this Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pdp-explorer Ready Ready Preview Aug 27, 2026 10:48am

Request Review

@FilOzzy FilOzzy added this to FOC Aug 24, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Aug 24, 2026
@FilOzzy FilOzzy moved this from 📌 Triage to 🔎 Awaiting review in FOC Aug 25, 2026
Comment thread subgraph/src/pdp-verifier.ts Outdated
eventLog.save();

// create "processPieceDeletions" transaction
const transactionCreated = getOrCreateTransaction(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this exist in the pdpVerifier abi?
or maybe this should be nextProvingPeriod? Since the existing dataset-status test says PiecesRemoved is emitted as part of nextProvingPeriod.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need to be in the verifier abi unless we configure a handler for that method.

Also, in this PDPVerifier update, PiecesRemoved was moved out of nextProvingPeriod and is now emitted from processPieceDeletions. I've updated the handling to attribute it to the method it is actually emitted from.

To keep the ABI from becoming stale, we can implement something like https://github.com/FIL-Builders/fwss-subgraph/blob/d6da072ac778addf4f69f03d9f9db8013b530add/scripts/utils/config-loader.ts#L82.

Comment thread subgraph/src/helper.ts
event: ethereum.Event,
method: string,
): boolean {
if (Transaction.loadInBlock(transactionEntityId) != null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ID is only the tx hash, so if a router/batch transaction touches two datasets, the first dataset creates the Transaction and the second one returns false. That means the second dataset won’t increment totalTransactions, and its event log points to a Transaction linked to the first dataset. Could we scope this by tx hash + set ID, or add a dataset-transaction entity? A same-hash, cross-dataset test would catch this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this earlier but couldn't come up with a solution that handled the different batching cases cleanly. I gave it some more thought today and changed the transaction ID to txHash + setID + methodSig.

methodSig was added so we can keep each Transaction entity immutable instead of changing transaction.method into a mutable array. This also allows the ui to represent the same tx hash as separate tx entries when it contains multiple method calls.

This covers:

  • different methods on the same dataset,
  • the same method on different datasets, and
  • different methods on different datasets within the same transaction.

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ⌨️ In Progress in FOC Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ⌨️ In Progress

Development

Successfully merging this pull request may close these issues.

4 participants