Skip to main content
2 of 4
added 10 characters in body
Majd TL
  • 3.3k
  • 3
  • 18
  • 36

How to find if a block is finalized

Is there a simple way to find out if a given block is finalized in PoS Ethereum?

Currently, I'm calling the endpoint ../eth/v1/beacon/states/finalized/finality_checkpoints of the Beacon Node and it delivers me the number of latest finalized Epoch.

After that, I'm using the returned Epoch number to get all blocks using an endpoint provided by beaconcha.in https://beaconcha.in/api/v1/epoch/<epoch-number>/blocks which lists all the Blocks in that Epoch

And the last step I do is checking if the number of my block is smaller than the highest blocknumber in the Epoch.

I'm looking for a simpler way to get that information using the Beacon Node or execution Node or some API providers like Etherscan, Infura, beaconcha.in, etc...

Thanks

Majd TL
  • 3.3k
  • 3
  • 18
  • 36