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

[BUG] Incorrect transaction count in gas.usage_by_address model #7715

Open
sohjag opened this issue Feb 24, 2025 · 2 comments · May be fixed by #7749
Open

[BUG] Incorrect transaction count in gas.usage_by_address model #7715

sohjag opened this issue Feb 24, 2025 · 2 comments · May be fixed by #7749
Labels
bug Something isn't working WIP work in progress

Comments

@sohjag
Copy link
Contributor

sohjag commented Feb 24, 2025

Description

The gas.usage_by_address model is significantly undercounting the number of transactions for addresses.

Current behavior

For example, for address 0xC94eBB328aC25b95DB0E0AA968371885Fa516215:

  • gas.usage_by_address shows 20,534 transactions (query)
SELECT number_of_txs
FROM gas.usage_by_address 
WHERE address = 0xC94eBB328aC25b95DB0E0AA968371885Fa516215
AND blockchain='ethereum'
  • gas.fees (source table) shows 1,397,874 transactions (query)
SELECT COUNT(*) as tx_count
FROM gas.fees 
WHERE tx_from=0xC94eBB328aC25b95DB0E0AA968371885Fa516215
AND blockchain='ethereum'

Expected behavior

Transaction count in gas.usage_by_address should match the count in gas.fees table where currency_symbol is not null.

Impacted model(s)

gas.usage_by_address

Possible solution

Investigate incremental processing logic in the model. May be a full refresh or modification of the incremental merge strategy to properly aggregate historical transactions?

@sohjag sohjag added the bug Something isn't working label Feb 24, 2025
@pfedan
Copy link

pfedan commented Feb 24, 2025

I just ran the spellbook as a normal query, and it returns correct values: https://dune.com/queries/4768584

Image

This suggests that the initialization has not been run correctly, or that the incremental logic isn't working as expected.

@jeff-dude
Copy link
Member

tied PR to issue

@jeff-dude jeff-dude added the WIP work in progress label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working WIP work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants