-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): Fix getting pending block (#2186)
## What ❔ Fixes getting data for the pending block in `eth_getBlockByNumber` and a couple of other methods. ## Why ❔ Getting a pending block should always return `null`, but right now it actually doesn't. Caused by non-atomic reads from Postgres in the method implementation: first, a pending block number is resolved, and then a block with this number is fetched. Between these two reads, a block with this number may be inserted to Postgres. While it's somewhat unlikely that anyone will query a pending block, it's still a correctness issue. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [x] Spellcheck has been run via `zk spellcheck`.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters