Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: extra transactions added in realtime #1126

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Conversation

kyscott18
Copy link
Collaborator

The realtime sync functions in two stages, one concurrent stage to extract chain information corresponding to a block such as logs, call traces, transactions, and transaction receipts. This stage does as much filtering as possible but doesn't have access to all factory addresses.

The next stage is serial, and factory addresses are available. The logs and call traces are re-filtered but transactions and transaction receipts are not. This is causing extra transactions to be added to the database.

I fixed this issues by re-filtering transactions and transaction receipts in the second stage handleBlock().

@kyscott18 kyscott18 requested a review from 0xOlias October 2, 2024 19:49
@kyscott18
Copy link
Collaborator Author

Any users that were affected by this bug and want to reduce the database size can do so with the query:

DELETE FROM ponder_sync.transactions WHERE 
  hash NOT IN (SELECT "transactionHash" FROM ponder_sync.logs) 
  AND 
  hash NOT IN (SELECT "transactionHash" FROM ponder_sync."callTraces");

@kyscott18
Copy link
Collaborator Author

I believe the failing ci is most likely the result of a regression in foundry @0xOlias

@kyscott18 kyscott18 merged commit 0a3adb0 into main Oct 2, 2024
6 of 8 checks passed
@kyscott18 kyscott18 deleted the kjs/transactions-filter branch October 2, 2024 22:34
@github-actions github-actions bot mentioned this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant