In the latest version of ethersjs 5.7.0 , does getBlockNumber() method return the height of the latest finalized block or the safe block?

context: https://github.com/ethers-io/ethers.js/issues/3091

1 Answer 1


getBlockNumber uses latest (neither safe nor finalized).

You can use getBlock instead of getBlockNumber. Use getBlock('finalized').number and you get the latest finalized block number.

But it seems that they plan to support tags for getBlockNumber at some point.


  • Welcome back! Nice
    – eth
    Aug 9, 2023 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.