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

Rescan tokens to process missing transactions #202

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

lucasmenendez
Copy link
Collaborator

@lucasmenendez lucasmenendez commented Jun 21, 2024

Includes new endpoints to run a token rescan storing just the no processed logs. It includes the use of arbo merkle tree as key-value database to store the processed logs by token.

It also includes a scanner refactor splitting it in two background tasks, the scanner, which now just short the tokens to scan to include them into the updater, and the updater, which manage a queue of tokens to scan, associated to a start and end block. This refactor allows to rescan a token from the API, including it in the updater.

@lucasmenendez lucasmenendez added the enhancement New feature or request label Jun 21, 2024
@lucasmenendez lucasmenendez self-assigned this Jun 21, 2024
Copy link

github-actions bot commented Jun 21, 2024

Image description CodeRabbit


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 237c90d and 3979a7d commits.
Files selected (25)
  • .golangci.yml (1)
  • api/api.go (4)
  • api/errors.go (1)
  • api/tokens.go (3)
  • api/types.go (1)
  • cmd/census3/main.go (7)
  • db/queries/tokens.sql (1)
  • db/treedb/treedb.go (1)
  • helpers/web3/web3_client.go (2)
  • scanner/const.go (1)
  • scanner/helpers.go (1)
  • scanner/providers/farcaster/provider.go (2)
  • scanner/providers/gitcoin/gitcoin_provider.go (3)
  • scanner/providers/gitcoin/gitcoin_provider_test.go (3)
  • scanner/providers/holders_provider.go (2)
  • scanner/providers/poap/poap_provider.go (2)
  • scanner/providers/poap/poap_provider_test.go (1)
  • scanner/providers/web3/erc20_provider.go (8)
  • scanner/providers/web3/erc721_provider.go (8)
  • scanner/providers/web3/erc777_provider.go (8)
  • scanner/providers/web3/errors.go (1)
  • scanner/providers/web3/web3_provider.go (1)
  • scanner/scanner.go (10)
  • scanner/updater.go (1)
  • scripts/block_logs/main.go (1)
Files not summarized due to errors (25)
  • .golangci.yml (nothing obtained from openai)
  • api/api.go (nothing obtained from openai)
  • api/types.go (nothing obtained from openai)
  • api/tokens.go (nothing obtained from openai)
  • cmd/census3/main.go (nothing obtained from openai)
  • api/errors.go (nothing obtained from openai)
  • helpers/web3/web3_client.go (nothing obtained from openai)
  • scanner/const.go (nothing obtained from openai)
  • db/treedb/treedb.go (nothing obtained from openai)
  • db/queries/tokens.sql (nothing obtained from openai)
  • scanner/providers/farcaster/provider.go (nothing obtained from openai)
  • scanner/helpers.go (nothing obtained from openai)
  • scanner/providers/poap/poap_provider.go (nothing obtained from openai)
  • scanner/providers/holders_provider.go (nothing obtained from openai)
  • scanner/providers/gitcoin/gitcoin_provider_test.go (nothing obtained from openai)
  • scanner/providers/web3/erc20_provider.go (nothing obtained from openai)
  • scanner/providers/gitcoin/gitcoin_provider.go (nothing obtained from openai)
  • scanner/scanner.go (diff tokens exceeds limit)
  • scanner/updater.go (diff tokens exceeds limit)
  • scanner/providers/poap/poap_provider_test.go (nothing obtained from openai)
  • scanner/providers/web3/erc721_provider.go (nothing obtained from openai)
  • scanner/providers/web3/web3_provider.go (nothing obtained from openai)
  • scanner/providers/web3/erc777_provider.go (nothing obtained from openai)
  • scanner/providers/web3/errors.go (nothing obtained from openai)
  • scripts/block_logs/main.go (nothing obtained from openai)
Files not reviewed due to errors (25)
  • api/types.go (no response)
  • api/errors.go (no response)
  • cmd/census3/main.go (no response)
  • api/tokens.go (no response)
  • .golangci.yml (no response)
  • api/api.go (no response)
  • db/treedb/treedb.go (no response)
  • scanner/const.go (no response)
  • db/queries/tokens.sql (no response)
  • scanner/helpers.go (no response)
  • scanner/providers/farcaster/provider.go (no response)
  • helpers/web3/web3_client.go (no response)
  • scanner/providers/poap/poap_provider_test.go (no response)
  • scanner/providers/gitcoin/gitcoin_provider.go (no response)
  • scanner/providers/poap/poap_provider.go (no response)
  • scanner/providers/holders_provider.go (no response)
  • scanner/providers/gitcoin/gitcoin_provider_test.go (no response)
  • scanner/providers/web3/erc20_provider.go (no response)
  • scanner/providers/web3/errors.go (no response)
  • scanner/providers/web3/web3_provider.go (no response)
  • scanner/providers/web3/erc721_provider.go (no response)
  • scanner/providers/web3/erc777_provider.go (no response)
  • scanner/scanner.go (no response)
  • scanner/updater.go (no response)
  • scripts/block_logs/main.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 3979a7d and 09f8392 commits.
Files selected (6)
  • cmd/census3/main.go (7)
  • scanner/providers/web3/erc20_provider.go (8)
  • scanner/providers/web3/erc721_provider.go (8)
  • scanner/providers/web3/erc777_provider.go (8)
  • scanner/scanner.go (10)
  • scanner/updater.go (1)
Files not summarized due to errors (6)
  • scanner/scanner.go (diff tokens exceeds limit)
  • scanner/updater.go (diff tokens exceeds limit)
  • cmd/census3/main.go (nothing obtained from openai)
  • scanner/providers/web3/erc20_provider.go (nothing obtained from openai)
  • scanner/providers/web3/erc777_provider.go (nothing obtained from openai)
  • scanner/providers/web3/erc721_provider.go (nothing obtained from openai)
Files not reviewed due to errors (6)
  • scanner/providers/web3/erc721_provider.go (no response)
  • scanner/providers/web3/erc777_provider.go (no response)
  • scanner/providers/web3/erc20_provider.go (no response)
  • cmd/census3/main.go (no response)
  • scanner/updater.go (no response)
  • scanner/scanner.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 09f8392 and 4c4b318 commits.
Files selected (9)
  • db/treedb/treedb.go (1)
  • scanner/providers/holders_provider.go (2)
  • scanner/providers/web3/erc20_provider.go (8)
  • scanner/providers/web3/erc721_provider.go (8)
  • scanner/providers/web3/erc777_provider.go (8)
  • scanner/providers/web3/errors.go (1)
  • scanner/providers/web3/web3_provider.go (2)
  • scanner/scanner.go (10)
  • scanner/updater.go (1)
Files not summarized due to errors (9)
  • scanner/providers/web3/erc20_provider.go (diff tokens exceeds limit)
  • scanner/providers/web3/erc777_provider.go (nothing obtained from openai)
  • scanner/scanner.go (diff tokens exceeds limit)
  • scanner/updater.go (diff tokens exceeds limit)
  • db/treedb/treedb.go (nothing obtained from openai)
  • scanner/providers/web3/web3_provider.go (nothing obtained from openai)
  • scanner/providers/web3/erc721_provider.go (nothing obtained from openai)
  • scanner/providers/web3/errors.go (nothing obtained from openai)
  • scanner/providers/holders_provider.go (nothing obtained from openai)
Files not reviewed due to errors (9)
  • scanner/providers/web3/errors.go (no response)
  • scanner/providers/holders_provider.go (no response)
  • db/treedb/treedb.go (no response)
  • scanner/providers/web3/erc721_provider.go (no response)
  • scanner/providers/web3/erc777_provider.go (no response)
  • scanner/providers/web3/erc20_provider.go (no response)
  • scanner/providers/web3/web3_provider.go (no response)
  • scanner/updater.go (no response)
  • scanner/scanner.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 4c4b318 and 5299dce commits.
Files selected (1)
  • scanner/providers/gitcoin/gitcoin_provider_test.go (3)
Files not summarized due to errors (1)
  • scanner/providers/gitcoin/gitcoin_provider_test.go (nothing obtained from openai)
Files not reviewed due to errors (1)
  • scanner/providers/gitcoin/gitcoin_provider_test.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

@lucasmenendez lucasmenendez requested a review from p4u June 24, 2024 09:13
@lucasmenendez lucasmenendez marked this pull request as ready for review June 24, 2024 09:13
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 5299dce and ef978c2 commits.
Files selected (3)
  • api/tokens.go (3)
  • scanner/scanner.go (10)
  • scanner/updater.go (1)
Files not summarized due to errors (3)
  • scanner/scanner.go (diff tokens exceeds limit)
  • scanner/updater.go (diff tokens exceeds limit)
  • api/tokens.go (nothing obtained from openai)
Files not reviewed due to errors (3)
  • api/tokens.go (no response)
  • scanner/scanner.go (no response)
  • scanner/updater.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between ef978c2 and 1810575 commits.
Files selected (1)
  • api/types.go (1)
Files not summarized due to errors (1)
  • api/types.go (nothing obtained from openai)
Files not reviewed due to errors (1)
  • api/types.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

db/treedb/treedb.go Outdated Show resolved Hide resolved
db/treedb/treedb.go Outdated Show resolved Hide resolved
scanner/const.go Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 1810575 and c6cf141 commits.
Files selected (9)
  • db/treedb/treedb.go (1)
  • scanner/const.go (1)
  • scanner/providers/holders_provider.go (2)
  • scanner/providers/web3/erc20_provider.go (8)
  • scanner/providers/web3/erc721_provider.go (8)
  • scanner/providers/web3/erc777_provider.go (8)
  • scanner/providers/web3/web3_provider.go (2)
  • scanner/scanner.go (10)
  • scanner/updater.go (1)
Files not summarized due to errors (9)
  • scanner/providers/web3/erc20_provider.go (diff tokens exceeds limit)
  • db/treedb/treedb.go (nothing obtained from openai)
  • scanner/scanner.go (diff tokens exceeds limit)
  • scanner/updater.go (diff tokens exceeds limit)
  • scanner/providers/web3/erc721_provider.go (nothing obtained from openai)
  • scanner/const.go (nothing obtained from openai)
  • scanner/providers/web3/erc777_provider.go (nothing obtained from openai)
  • scanner/providers/web3/web3_provider.go (nothing obtained from openai)
  • scanner/providers/holders_provider.go (nothing obtained from openai)
Files not reviewed due to errors (9)
  • scanner/providers/holders_provider.go (no response)
  • scanner/providers/web3/erc20_provider.go (no response)
  • scanner/const.go (no response)
  • db/treedb/treedb.go (no response)
  • scanner/providers/web3/erc721_provider.go (no response)
  • scanner/providers/web3/erc777_provider.go (no response)
  • scanner/providers/web3/web3_provider.go (no response)
  • scanner/updater.go (no response)
  • scanner/scanner.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

…ers to add them to the token filter after save holders
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 1810575 and cb943ab commits.
Files selected (9)
  • db/treedb/treedb.go (1)
  • scanner/const.go (1)
  • scanner/providers/holders_provider.go (2)
  • scanner/providers/web3/erc20_provider.go (8)
  • scanner/providers/web3/erc721_provider.go (8)
  • scanner/providers/web3/erc777_provider.go (8)
  • scanner/providers/web3/web3_provider.go (2)
  • scanner/scanner.go (10)
  • scanner/updater.go (1)
Files not summarized due to errors (9)
  • scanner/providers/web3/erc20_provider.go (diff tokens exceeds limit)
  • scanner/providers/web3/web3_provider.go (nothing obtained from openai)
  • scanner/scanner.go (diff tokens exceeds limit)
  • scanner/updater.go (diff tokens exceeds limit)
  • scanner/providers/web3/erc777_provider.go (nothing obtained from openai)
  • scanner/const.go (nothing obtained from openai)
  • db/treedb/treedb.go (nothing obtained from openai)
  • scanner/providers/web3/erc721_provider.go (nothing obtained from openai)
  • scanner/providers/holders_provider.go (nothing obtained from openai)
Files not reviewed due to errors (9)
  • scanner/const.go (no response)
  • scanner/providers/holders_provider.go (no response)
  • scanner/providers/web3/erc777_provider.go (no response)
  • db/treedb/treedb.go (no response)
  • scanner/providers/web3/erc721_provider.go (no response)
  • scanner/providers/web3/erc20_provider.go (no response)
  • scanner/providers/web3/web3_provider.go (no response)
  • scanner/scanner.go (no response)
  • scanner/updater.go (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants