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

Improve CCIP Contract Reader Querying #267

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

ilija42
Copy link
Collaborator

@ilija42 ilija42 commented Oct 24, 2024

related core PR smartcontractkit/chainlink#14935

Also relates to
CCIP-3866
and
CCIP-3865

@mateusz-sekara
Copy link
Contributor

Nice, not sure if you've seen this, but we actually have tickets to fix that for this sprint :D
https://smartcontract-it.atlassian.net/browse/CCIP-3865
https://smartcontract-it.atlassian.net/browse/CCIP-3866

@ilija42
Copy link
Collaborator Author

ilija42 commented Oct 24, 2024

Nice, not sure if you've seen this, but we actually have tickets to fix that for this sprint :D https://smartcontract-it.atlassian.net/browse/CCIP-3865 https://smartcontract-it.atlassian.net/browse/CCIP-3866

Well, a few tickets less for your sprint lol, I wanted to help with this and modifiers to see how is it to use the interface in practice

@ilija42 ilija42 marked this pull request as draft October 24, 2024 15:31
@ilija42 ilija42 force-pushed the CCIP-2896-contract-reader-querying-improvements branch from d12f8fd to 1048b34 Compare October 29, 2024 11:05
@ilija42 ilija42 marked this pull request as ready for review October 29, 2024 11:11
@ilija42 ilija42 force-pushed the CCIP-2896-contract-reader-querying-improvements branch from 1048b34 to 816f0fb Compare October 29, 2024 12:54
query.Comparator(consts.EventAttributeState, primitives.ValueComparator{
Value: 0,
Operator: primitives.Gt,
}),

Choose a reason for hiding this comment

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

Do we need to add postgres indexes for any of these datawords? If not, this could be very slow.

If we do need to add them, I wonder if there's a way we could add them only to chainlink-ccip's fork but not to chainlink?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, probably will require some kind of detailed indexing. We have a task planned as performance work to go over all the DB queries we make from the ccipreader to better understand where we miss indexing/limits/paging etc
https://smartcontract-it.atlassian.net/browse/CCIP-3870

Copy link
Contributor

@mateusz-sekara mateusz-sekara Oct 30, 2024

Choose a reason for hiding this comment

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

However, in the long term we will probably need ChainReader's tables to be optimized for the specific products, for instance by

  • by having custom indexes per product
  • or having custom indexers and tables per product (for instance, the ability to dynamically index events in dedicated tables to limit the scans sizes)

Copy link

@patrick-dowell patrick-dowell left a comment

Choose a reason for hiding this comment

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

LGTM

@ilija42 ilija42 force-pushed the CCIP-2896-contract-reader-querying-improvements branch from 816f0fb to 9d45bb2 Compare November 1, 2024 15:56
@ilija42 ilija42 force-pushed the CCIP-2896-contract-reader-querying-improvements branch from 9d45bb2 to 0cf44c0 Compare November 1, 2024 15:59
Copy link

@silaslenihan silaslenihan left a comment

Choose a reason for hiding this comment

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

LGTM

@makramkd
Copy link
Collaborator

makramkd commented Nov 5, 2024

Integration tests are failing, that's because we need a updates to the contract reader config right? @ilija42

@ilija42
Copy link
Collaborator Author

ilija42 commented Nov 5, 2024

Integration tests are failing, that's because we need a updates to the contract reader config right? @ilija42

Have to merge core first

Copy link

github-actions bot commented Nov 5, 2024

Metric CCIP-2896-contract-reader-querying-improvements main
Coverage 73.0% 72.9%

@ilija42 ilija42 merged commit fa3a001 into main Nov 5, 2024
3 of 4 checks passed
@mateusz-sekara mateusz-sekara deleted the CCIP-2896-contract-reader-querying-improvements branch November 8, 2024 09:18
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.

7 participants