Search code examples
blockchainsolanasolana-web3jssolana-program-library

What is an epoch in solana?


I am new to the solana and exploring the web3js part for solana. I came across the term "epoch". I know what the epoch is which we normally use for timestamp. But in solana, the definition of epoch is quite different. I read the official documentation but could not properly understood the meaning of epoch. Can anyone please explain what exactly the epoch is in solana?


Solution

  • An epoch is a length of a certain amount of blocks (in Solana: “slots”) in which the validator schedule of Solana’s consensus algorithm is defined. To stakers this means that beginning and stopping to stake, as well as reward distribution, always happen when epochs switch over. An epoch is 432,000 slots, each of which should at a minimum take 400ms. Since block times are variable this means epochs effectively last somewhere between 2–3 days.

    Source