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

add in burned event #5759

Merged
merged 7 commits into from
Apr 23, 2024

Conversation

AnonJon
Copy link
Contributor

@AnonJon AnonJon commented Apr 9, 2024

  • rename ccip_tokens_locked to ccip_tokens_transferred
  • include burned in events in ccip_tokens_transferred
  • include tx_hash in ccip_send_requested

@dune-eng
Copy link

dune-eng commented Apr 9, 2024

Workflow run id 8620763523 approved.

@dune-eng
Copy link

dune-eng commented Apr 9, 2024

Workflow run id 8620763610 approved.

Comment on lines 3 to 5

alias='ccip_tokens_transferred_logs',
materialized='view'
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can add schema in the config blocks and change the materialized strategy to incremental.

@AnonJon AnonJon force-pushed the feature/ccip-tokens-locked branch from c87dc1e to 7056864 Compare April 12, 2024 21:07
@dune-eng
Copy link

Workflow run id 8667978535 approved.

@dune-eng
Copy link

Workflow run id 8667979315 approved.

@AnonJon
Copy link
Contributor Author

AnonJon commented Apr 12, 2024

@Hosuke I added in the filter. Let me know if that looks right.

@dune-eng
Copy link

Workflow run id 8668165095 approved.

@dune-eng
Copy link

Workflow run id 8668165189 approved.

topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked
AND block_time >= CAST('2023-07-06' AS date)
{% if is_incremental() %}
AND block_time >= date_trunc('day', now() - interval '{{incremental_interval}}' day)
Copy link
Collaborator

@Hosuke Hosuke Apr 14, 2024

Choose a reason for hiding this comment

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

We can use the incremental_predicate here (and for all other incremental filters):

Suggested change
AND block_time >= date_trunc('day', now() - interval '{{incremental_interval}}' day)
AND {{ incremental_predicate('block_time') }}

@jeff-dude jeff-dude added the in review Assignee is currently reviewing the PR label Apr 15, 2024
@AnonJon AnonJon force-pushed the feature/ccip-tokens-locked branch from c3e799c to 33de368 Compare April 20, 2024 12:13
@dune-eng
Copy link

Workflow run id 8764920425 approved.

@dune-eng
Copy link

Workflow run id 8764920460 approved.

@AnonJon
Copy link
Contributor Author

AnonJon commented Apr 20, 2024

@Hosuke updated now with incremental_predicate

Copy link
Collaborator

@Hosuke Hosuke left a comment

Choose a reason for hiding this comment

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

Some adjustments needed for incremental views.

Comment on lines 2 to 4
config(
alias='ccip_tokens_transferred_logs',
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can add the schema in all config blocks now:

Suggested change
config(
alias='ccip_tokens_transferred_logs',
config(
schema='chainlink_polygon',
alias='ccip_tokens_transferred_logs',

{{ source('polygon', 'logs') }} logs
WHERE
topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked
AND block_time >= CAST('2023-07-06' AS date)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can introduce jinja var like project_start_date for the dates used in the sql:
i.e.
{% set project_start_date = '2023-07-06' %}
and
AND block_time >= TIMESTAMP '{{project_start_date}}'

Comment on lines 6 to 9
incremental_strategy='merge',
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to add the unique_key in the config blocks for incremental updates:

Suggested change
incremental_strategy='merge',
)
incremental_strategy='merge',
unique_key=['tx_hash', ...]
)

@dune-eng
Copy link

Workflow run id 8766032427 approved.

@dune-eng
Copy link

Workflow run id 8766032472 approved.

@dune-eng
Copy link

Workflow run id 8766155664 approved.

@dune-eng
Copy link

Workflow run id 8766155781 approved.

@dune-eng
Copy link

Workflow run id 8766225016 approved.

@dune-eng
Copy link

Workflow run id 8766225193 approved.

@AnonJon
Copy link
Contributor Author

AnonJon commented Apr 20, 2024

@Hosuke added in the unique tests

Copy link
Collaborator

@Hosuke Hosuke left a comment

Choose a reason for hiding this comment

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

LGTM.✅
Thank you @AnonJon

Sample chainlink_ccip_tokens_transferred_logs

Also please run git merge main to update this PR.

@Hosuke Hosuke added ready-for-final-review and removed in review Assignee is currently reviewing the PR labels Apr 22, 2024
@Hosuke Hosuke removed their assignment Apr 22, 2024
@Hosuke
Copy link
Collaborator

Hosuke commented Apr 23, 2024

Hi @AnonJon, please run git merge main to update this PR as well.

@AnonJon AnonJon force-pushed the feature/ccip-tokens-locked branch from 46eb1f3 to 5c8d061 Compare April 23, 2024 13:53
@dune-eng
Copy link

Workflow run id 8801655237 approved.

@dune-eng
Copy link

Workflow run id 8801655248 approved.

@jeff-dude jeff-dude self-assigned this Apr 23, 2024
@jeff-dude jeff-dude added in review Assignee is currently reviewing the PR and removed ready-for-final-review labels Apr 23, 2024
@jeff-dude jeff-dude added ready-for-merging and removed in review Assignee is currently reviewing the PR labels Apr 23, 2024
@jeff-dude jeff-dude merged commit 1ca66d9 into duneanalytics:main Apr 23, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2024
@AnonJon AnonJon deleted the feature/ccip-tokens-locked branch April 24, 2024 11:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants