eth_getEpochStats

Returns the latest epoch statistics

Parameters

QUANTITY|TAG - integer of a block number, or the string ", "latest" or "pending", as in the default block parameter.

Returns

Object - An epoch statistics object with the following fields:

  • epoch: QUANTITY - The epoch number.

  • start: QUANTITY - Unix timestamp (in nanoseconds) indicating when the epoch started.

  • end: QUANTITY - Unix timestamp (in nanoseconds) indicating when the epoch ended.

  • epochStateRoot: DATA, 32 Bytes - Hexadecimal hash of the epoch's state root.

  • hash: DATA, 32 Bytes - Hexadecimal hash identifying the epoch.

  • rules: Object - Network rules and configuration parameters for this epoch:

    • blocks: Object - Block configuration parameters:

      • maxBlockGas: QUANTITY - Maximum gas limit per block.

      • maxEmptyBlockSkipPeriod: QUANTITY - Maximum time period (in nanoseconds) to skip empty blocks.

    • dag: Object - DAG configuration parameters:

      • maxExtraData: QUANTITY - Maximum size of extra data in bytes.

      • maxFreeParents: QUANTITY - Maximum number of free parent blocks.

      • maxParents: QUANTITY - Maximum number of parent blocks.

    • economy: Object - Economic configuration parameters:

      • blockMissedSlack: QUANTITY - Tolerance for missed blocks.

      • minGasPrice: QUANTITY - Minimum gas price in wei.

      • gas: Object - Gas configuration parameters:

        • blockVoteGas: QUANTITY - Gas cost for block voting.

        • blockVotesBaseGas: QUANTITY - Base gas cost for block votes.

        • epochVoteGas: QUANTITY - Gas cost for epoch voting.

        • eventGas: QUANTITY - Gas cost for events.

        • extraDataGas: QUANTITY - Gas cost per byte of extra data.

        • maxEventGas: QUANTITY - Maximum gas per event.

        • misbehaviourProofGas: QUANTITY - Gas cost for misbehavior proofs.

        • parentGas: QUANTITY - Gas cost for parent references.

      • longGasPower: Object - Long gas power configuration:

        • allocPerSec: QUANTITY - Gas power allocation per second.

        • maxAllocPeriod: QUANTITY - Maximum allocation period in nanoseconds.

        • minStartupGas: QUANTITY - Minimum startup gas.

        • startupAllocPeriod: QUANTITY - Startup allocation period in nanoseconds.

      • shortGasPower: Object - Short gas power configuration:

        • allocPerSec: QUANTITY - Gas power allocation per second.

        • maxAllocPeriod: QUANTITY - Maximum allocation period in nanoseconds.

        • minStartupGas: QUANTITY - Minimum startup gas.

        • startupAllocPeriod: QUANTITY - Startup allocation period in nanoseconds.

    • epochs: Object - Epoch configuration parameters:

      • maxEpochDuration: QUANTITY - Maximum epoch duration in nanoseconds.

      • maxEpochGas: QUANTITY - Maximum gas per epoch.

    • name: String - Network name (e.g., "main").

    • networkID: QUANTITY - Network identifier.

    • upgrades: Object - Network upgrade status:

      • berlin: Boolean - Whether Berlin upgrade is active.

      • llr: Boolean - Whether LLR upgrade is active.

      • london: Boolean - Whether London upgrade is active.

  • validatorProfiles: Object - Detailed information about validators in this epoch, keyed by validator ID:

    • pubKey: Object - Validator's public key information:

      • raw: DATA - Hexadecimal representation of the validator's public key.

      • type: QUANTITY - Type identifier for the public key format.

    • weight: QUANTITY - Validator's weight in the network (as a string to handle large numbers).

  • validatorStates: Array - Array of validator state information:

    • gasRefund: QUANTITY - Amount of gas refunded to the validator.

    • prevEpochEvent: Object - Previous epoch event information:

      • gasPowerLeft: Object - Remaining gas power:

        • gas: Array - Array of remaining gas power values.

      • id: String - Unique identifier for the previous epoch event.

      • time: QUANTITY - Timestamp of the previous epoch event.

  • validators: Object - Validator values and weights:

    • values: Object - Mapping of validator IDs to their respective values.

Example

Request

curl --location 'https://rpc-mainnet.u2u.xyz' \
--header 'Content-Type: application/json' \
--data '{
 "jsonrpc":"2.0",
 "method":"eth_getEpochStats",
 "params":[
        "latest"
    ],
 "id":83
}'

Result

{
    "jsonrpc": "2.0",
    "id": 83,
    "result": {
        "end": 1695118619622089816,
        "epoch": 4880,
        "epochStateRoot": "0x8a7325378c271fa6b67bbc2df46b9bae9f66d3a39f7437e33f0427bde0701d1f",
        "hash": "0xfb1f5a6f07e075225911a2128ed5367108f646fa957848f3464fe5b8cd763fdb",
        "rules": {
            "blocks": {
                "maxBlockGas": 20500000,
                "maxEmptyBlockSkipPeriod": 1000000000
            },
            "dag": {
                "maxExtraData": 128,
                "maxFreeParents": 3,
                "maxParents": 10
            },
            "economy": {
                "blockMissedSlack": 50,
                "gas": {
                    "blockVoteGas": 512,
                    "blockVotesBaseGas": 1024,
                    "epochVoteGas": 1536,
                    "eventGas": 28000,
                    "extraDataGas": 25,
                    "maxEventGas": 10028000,
                    "misbehaviourProofGas": 71536,
                    "parentGas": 2400
                },
                "longGasPower": {
                    "allocPerSec": 2800000,
                    "maxAllocPeriod": 3600000000000,
                    "minStartupGas": 560000,
                    "startupAllocPeriod": 5000000000
                },
                "minGasPrice": "112492273717",
                "shortGasPower": {
                    "allocPerSec": 5600000,
                    "maxAllocPeriod": 300000000000,
                    "minStartupGas": 560000,
                    "startupAllocPeriod": 2500000000
                }
            },
            "epochs": {
                "maxEpochDuration": 420000000000,
                "maxEpochGas": 300000000
            },
            "name": "main",
            "networkID": 39,
            "upgrades": {
                "berlin": true,
                "llr": true,
                "london": true
            }
        },
        "start": 1695118198150223626,
        "validatorProfiles": {
            "1": {
                "pubKey": {
                    "raw": "0x044523eb222afcf9d734c24d11d313cd1bb01ea178c0f78067faac2af6a6f8780e3d8c507d319b5d9677c7519bb6514791a75c9ed568bf0883f56867333e34ef41",
                    "type": 192
                },
                "weight": "15011625500104973816751471"
            }
        },
        "validatorStates": [
            {
                "gasRefund": 0,
                "prevEpochEvent": {
                    "gasPowerLeft": {
                        "gas": [
                            240131300,
                            1440926000
                        ]
                    },
                    "id": "4879:3048:4b1c18",
                    "time": 1695118619622089816
                }
            }
        ],
        "validators": {
            "values": {
                "1": "208328153",
                "2": "208167136",
                "3": "208166955",
                "4": "208166817",
                "5": "208166817",
                "6": "208166817",
                "7": "208166886"
            }
        }
    }
}

Last updated