How to know the block reward value for a Particular block . Like the block reward has decreased from 5 to 3 to 2 ether now. So if i an given a block number what is the formula to calculate the block reward
[Note that this answer addresses the static block reward, and ignores both transaction fees paid to miners, and uncle rewards.]
So if i an given a block number what is the formula to calculate the block reward
For blocks 0 -> 4,369,999 the reward was 5 ETH.
During the Byzantium hard fork (Oct 2017) EIP-649 reduced the reward from 5 to 3.
For blocks 4,370,000 -> 7,279,999 the reward was 3 ETH.
During the Constantinople hard fork (Feb 2019) EIP-1234 reduced the reward from 3 to 2.
For blocks 7,280,000 onward the reward is 2 ETH.
There is no formula to calculate block rewards. The change in block rewards take place by virtue of hard forks. In the new fork, along with other things, the block rewards can be adjusted. These adjustments are discussed by the ethereum community via Ethereum Improvement Proposals.
Read this article about forks
Also block reward is a property of the block which means miner sets it to a particular value which will be generally the fixed reward for the block and the transaction fees for the block. Any other node that receives this block will validate the block reward as a part of block validation.
You can read about block creation and validation here
To see the reward for a particular block you can visit here. I have searched for the latest block at the time of writing as an example.