Catchup API

Serves recent consensus state to allow peers to catch up with the network

The primary customer of this API is peer consensus nodes who may have recently joined the network or were temporarily disconnected. These nodes need the very latest state, one which hasn't even been finalized yet, in order to start voting and proposing in consensus.

In HotShot, all state required to participate is represented in the form of Merkle trees or Merkle tries, so this API is able to provide select segments of the state with a proof that will convince the client that the returned segment is accurate, as long as they know the corresponding state commitment.

Types

Account

{
    // Account balance in WEI. Serialized as a hex string so as not to exceed the
    // range of JSON integers.
    "balance": hex,
    // Merkle proof justifying "balance" relative to the state commitment.
    "proof": {
        "account": hex,
        "proof":
            { "Presence": MerkleProof },
          | { "Absence": MerkleProof }
        }
    }       
}

Endpoints

GET /catchup/account/:address

Get the balance of the requested fee account in the latest finalized state.

Parameters

NameTypeDescription

address

hex

The account (Ethereum address) to look up

Returns Account

GET /catchup/:view/account/:address

Get the balance of the requested fee account in the state from the requested consensus view. This is used to fetch the state for unfinalized views, to facilitate rapid catchup. If :view has already been finalized, this endpoint may fail with error 404.

Parameters

NameTypeDescription

view

integer

The view from which to look up the account balance

address

hex

The account (Ethereum address) to look up

Returns Account

GET /catchup/blocks

Get the Merkle frontier (path to most recently inserted element) of the accumulator of blocks, from the most recently finalized state. This frontier is sufficient to append new blocks, so it is all that is needed for state catchup.

Returns MerkleProof

GET /catchup/:view/blocks

Get the Merkle frontier (path to most recently inserted element) of the accumulator of blocks, from the requested consensus view. This is used to fetch the state for unfinalized views, to facilitate rapid catchup. If :view has already been finalized, this endpoint may fail with error 404.

Parameters

NameTypeDescription

view

integer

The view from which to look up the frontier

Returns MerkleProof

Last updated