Closed m-Peter closed 3 months ago
This update enhances the BlockChainAPI
by adding a LogsBloom
field to the block response structure, ensuring it is populated even for blocks without transactions. Additionally, a new test case is introduced to validate the retrieval of the genesis block, confirming its properties and structure. This prepares the code for future logging integration while preserving the functionality of existing features.
Files | Change Summary |
---|---|
api/api.go |
Added LogsBloom field in prepareBlockResponse method to ensure it returns an empty bloom for blocks without transactions. |
tests/web3js/eth_non_interactive_test.js |
Introduced a test for retrieving the genesis block, checking various properties for correctness and expected behavior. |
Objective | Addressed | Explanation |
---|---|---|
Populate the LogsBloom field, even for blocks without any transactions (#372) |
β |
π° In the blockchain's heart, a bloom now shines,
Even when transactions are absent, it aligns.
With tests that ensure the genesis is right,
Our code hops forward, a marvelous sight!
So letβs cheer for the logs and their future delight! π
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/372 Related: https://github.com/onflow/flow-evm-gateway/issues/371
Description
One such example is the genesis block, which does not have any transactions, but even so, the
LogsBloom
field should be the 256-byte empty bloom, instead of0x
. This breaks the serialization for many tools.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
LogsBloom
field to the blockchain response structure for future logging capabilities.Tests