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

Optimize log filtering in blockstream #5015

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

incrypto32
Copy link
Member

No description provided.

@incrypto32 incrypto32 self-assigned this Nov 23, 2023
@incrypto32 incrypto32 force-pushed the krishna/log-filter-optimisation branch from 1b9d5ef to b1fa9ce Compare November 23, 2023 11:52
Copy link
Collaborator

@leoyvens leoyvens left a comment

Choose a reason for hiding this comment

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

Nice! We should put this through an integration cluster run.

chain/ethereum/src/trigger.rs Outdated Show resolved Hide resolved
}
}

impl PartialEq for LogRef {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this impl being relied on exactly?

Copy link
Member Author

Choose a reason for hiding this comment

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

impl PartialEq for EthereumTrigger {

Its relied in impl PartialEq for EthereumTrigger

Copy link
Collaborator

Choose a reason for hiding this comment

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

I find it weird that this compares the receipt field given that it is optional, seems wrong really. Lets not have this impl, and inline the logic into EthereumTrigger as it was before. That code is critical for correct ordering of the triggers so I find that less indirection makes it easier to read. Also lets stop comparing the receipt, because it's optional, and instead compare only on transaction_hash and log_index.

Copy link
Member Author

Choose a reason for hiding this comment

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

@leoyvens clarifying i understand this right, should we remove the previously existing comparison of the optional receipt right? Or should we just inline the logic and keep the original comparison of the optional receipt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should remove the previously existing comparison.

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

I'll run it through the integration cluster

chain/ethereum/src/trigger.rs Show resolved Hide resolved
@incrypto32 incrypto32 force-pushed the krishna/log-filter-optimisation branch 2 times, most recently from 1bd6d11 to 11a4fea Compare November 28, 2023 11:04
@incrypto32 incrypto32 force-pushed the krishna/log-filter-optimisation branch from 11a4fea to 0bb45a0 Compare December 11, 2023 05:10
@@ -399,7 +399,11 @@ impl DataSource {

fn handlers_for_log(&self, log: &Log) -> Result<Vec<MappingEventHandler>, Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this no longer return Result?

@incrypto32 incrypto32 merged commit 07f5ca6 into master Dec 12, 2023
7 checks passed
@incrypto32 incrypto32 deleted the krishna/log-filter-optimisation branch December 12, 2023 15:39
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.

2 participants