Closed m-Peter closed 1 month ago
The changes involve modifications to the traces ingestion process in the codebase. Key alterations include the removal of the initHeight
variable in the startIngestion
function and the corresponding adjustments in the NewTracesIngestionEngine
function. Additionally, the Notify
method now includes an early return condition for empty transaction blocks, enhancing efficiency. These updates aim to optimize how the engine handles blocks that contain no transactions.
Files | Change Summary |
---|---|
bootstrap/bootstrap.go , services/traces/engine.go |
Removed the initHeight variable in startIngestion and the initEVMHeight parameter in NewTracesIngestionEngine , streamlining block ingestion and initialization. Added early return in Notify method for empty transaction hashes. |
services/traces/engine_test.go |
Modified formatting of NewTracesIngestionEngine function calls in tests for improved readability without affecting functionality. |
Objective | Addressed | Explanation |
---|---|---|
Optimize traces engine to handle empty blocks (#464) | ✅ |
🐇 Hopping through code with glee,
Our traces engine's now so free!
No empty blocks will cause a fuss,
With tidy code, we’re safe to trust.
Let’s leap ahead, all bugs we’ll shoo,
For every hop, there’s something new! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes: https://github.com/onflow/flow-evm-gateway/issues/464
Description
The traces engine performs some unnecessary actions, now that we can have blocks with no transactions. This will avoid spawning go routines for a no-op action. We also remove the
initEVMHeight
fromNewTracesIngestionEngine
as it seems to be not used for anything.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes
Refactor
Style