-
Notifications
You must be signed in to change notification settings - Fork 20
chore: improve eth_getLogs #2991
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
base: develop
Are you sure you want to change the base?
Conversation
a9a7e27
to
301365a
Compare
301365a
to
da45765
Compare
da45765
to
4160b96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the implementation and usage of the eth_getLogs functionality by refactoring transaction retrieval logic and updating cache access patterns.
- Refactored DbStorage::getTransaction to delegate transaction extraction to a new helper method.
- Updated LogFilter to use the new transaction lookup and revised the block receipt matching logic.
- Modified consensus components (FinalChain and cache) to support the new transaction API and caching patterns.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
libraries/core_libs/storage/src/storage.cpp | Refactored transaction retrieval for non-system transactions by extracting logic into a helper method. |
libraries/core_libs/storage/include/storage/storage.hpp | Added declaration for the new const helper method for transaction retrieval. |
libraries/core_libs/network/rpc/eth/LogFilter.cpp | Updated log matching to use the new transaction lookup and altered receipt processing logic. |
libraries/core_libs/consensus/include/final_chain/final_chain.hpp | Introduced a new transaction method in FinalChain that first checks the cache then falls back to DbStorage. |
libraries/core_libs/consensus/include/final_chain/cache.hpp | Changed the cache getter to return an optional value, then used it in the existing get method. |
Comments suppressed due to low confidence (2)
libraries/core_libs/network/rpc/eth/LogFilter.cpp:133
- [nitpick] Consider renaming 'ret_block' to a more descriptive name (e.g., 'indexed_log_entries') to clarify its purpose when storing pairs of transaction index and log entries.
std::vector<std::pair<uint64_t, LocalisedLogEntry>> ret_block;
libraries/core_libs/network/rpc/eth/LogFilter.cpp:132
- The original equality check 'block_receipts->size() == hashes->size()' was removed. Confirm that this change is intentional since a mismatch in sizes between receipts and transaction hashes could lead to alignment issues.
if (block_receipts && block_receipts->size()) {
No description provided.