Fork version by state ID

The /eth/v1/beacon/states/{state_id}/fork method provides information about the fork version and epoch associated with a given state. This endpoint is essential for understanding the current and previous fork versions that the Beacon state has undergone and the epoch at which the latest fork has occurred.

๐Ÿ‘

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • state_id โ€” the identifier for the state for which fork information is being requested. The state_id can be:
    • head โ€” represents the latest canonical state in the node's view.
    • genesis โ€” refers to the state at the genesis or the start of the Beacon Chain.
    • finalized โ€” the state that is finalized and accepted by the network with minimal likelihood of reorganization.
    • justified โ€” a state that has recently achieved justification, which is a precursor to finalization in the Ethereum 2.0 proof of stake mechanism.
    • <slot> โ€” specific slot number in the Ethereum 2.0 protocol timeline.
    • <hex encoded stateroot with 0x prefix> โ€” the specific state root of interest, encoded in hexadecimal format.

Response

The response is an object containing the following fields:

  • execution_optimistic โ€” a boolean indicating if the response is based on an unverified execution payload. If trueimplies that the payload might be invalidated later. The absence of this field implies a default value of false.
  • finalized โ€” a boolean indicating if the response pertains to the finalized history of the chain. If absent, it suggests the need for additional calls to determine the epochโ€™s relation to the finalized checkpoint.
  • data โ€” an object containing:
    • previous_version โ€” a hexadecimal string representing the fork version of the state before the current fork.
    • current_version โ€” a hexadecimal string indicating the fork version of the current state.
    • epoch โ€” the epoch number at which the current version was adopted.
Language
Click Try It! to start a request and see the response here!