Closed m-Peter closed 2 months ago
The modifications enhance the synchronization status handling in the Ethereum API by optimizing context management and introducing an early return mechanism in the Syncing
method. Additionally, the test suite expands its coverage to validate synchronization scenarios more effectively, ensuring that the API adheres to the specifications outlined in the linked issues.
Files | Change Summary |
---|---|
api/api.go | Updated Syncing method to use provided context and added condition to return false if currentBlock equals highestBlock . |
tests/e2e_web3js_test.go | Added a new test case for retrieving syncing status, enhancing coverage of Web3 functionality. |
tests/web3js/eth_non_interactive_test.js | Simplified syncing status test to assert only if the node is syncing, removing detailed block comparisons. |
tests/web3js/eth_syncing_status_test.js | Introduced to verify Ethereum node synchronization status through transactions, ensuring expected behavior under load. |
sequenceDiagram
participant Client
participant API
participant Blockchain
Client->>API: Call eth_syncing()
API->>Blockchain: Get latest EVM height with context
Blockchain-->>API: Latest height data
API->>API: Check if currentBlock == highestBlock
alt Syncing Required
API-->>Client: Return syncing info
else No Syncing
API-->>Client: Return false
end
Objective | Addressed | Explanation |
---|---|---|
Update eth_syncing call to match JSON-RPC API specification (376) |
✅ | |
Return false when currentBlock equals highestBlock |
✅ |
🐰 In the land where data streams flow,
A rabbit hops where the blocks brightly glow.
With context in hand, syncing's now swift,
No more delays, just a seamless uplift!
In tests, we dance, checking status with glee,
Ethereum's pulse is as smooth as can be! 🐇✨
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/376
Description
As per the JSON-RPC API Specification, when the current indexed block and the highest network block are equal,
eth_syncing
should returnfalse
, instead of the syncing status object.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes