Cardano-cli ledger-state

I would like to have more information about the ledger-state output.
Can anyone differentiate between the different ‘poolParams’ and ‘delegations’ keys?
here attached is the structure of the json:

Thanks!

3 Likes

Bit late, but I’m looking for this information myself. Did you find more information?

Oooh. sorry just seen this post.

These are related to the transition states, and I think the best explanation is a picture of it, what I created long long time back and can be found here:

3 Likes

A snapshot is taken, and stay in the ledger-state for 4 epoch, pstateMark is the latest snapshot, next epoch it becomes effective and called pstakeSet (makes you win blocks), then pstakeGo (calculates rewards) and finally NonMyopic (just historical).
this schema I made should clarify:

1 Like

I dumped a ledger state using cardano-cli, and then used this file to generate a JSON Schema

This is a first shot. Descriptions are missing. Please help to annotate and document this file so that the community understands its full structure and meaning.

Here is a list of (200) possible expressions that might be used to filter the ledger JSON file with jq

.blocksBefore[]
.blocksCurrent
.blocksCurrent[]
.lastEpoch
.possibleRewardUpdate.deltaF
.possibleRewardUpdate.deltaR
.possibleRewardUpdate.deltaT
.possibleRewardUpdate.nonMyopic.likelihoodsNM
.possibleRewardUpdate.nonMyopic.likelihoodsNM[]
.possibleRewardUpdate.nonMyopic.likelihoodsNM[][]
.possibleRewardUpdate.nonMyopic.rewardPotNM
.possibleRewardUpdate.rs
.possibleRewardUpdate.rs[]
.possibleRewardUpdate.rs[][]
.possibleRewardUpdate.rs[][].key hash
.possibleRewardUpdate.rs[][][]
.possibleRewardUpdate.rs[][][].rewardAmount
.possibleRewardUpdate.rs[][][].rewardPool
.stakeDistrib[]
.stakeDistrib[].individualPoolStake.denominator
.stakeDistrib[].individualPoolStake.numerator
.stateBefore.esAccountState.reserves
.stateBefore.esAccountState.treasury
.stateBefore.esLState.delegationState.dstate.delegations
.stateBefore.esLState.delegationState.dstate.delegations[]
.stateBefore.esLState.delegationState.dstate.delegations[][]
.stateBefore.esLState.delegationState.dstate.delegations[][].key hash
.stateBefore.esLState.delegationState.dstate.fGenDelegs
.stateBefore.esLState.delegationState.dstate.genDelegs
.stateBefore.esLState.delegationState.dstate.genDelegs[]
.stateBefore.esLState.delegationState.dstate.irwd.iRReserves
.stateBefore.esLState.delegationState.dstate.irwd.iRTreasury
.stateBefore.esLState.delegationState.dstate.ptrs
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[]
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[][]
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[][].key hash
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[][][]
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[][][].certIndex
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[][][].slot
.stateBefore.esLState.delegationState.dstate.ptrs.credPtrR[][][].txIndex
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds[]
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds[][]
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds[][].certIndex
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds[][].key hash
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds[][].slot
.stateBefore.esLState.delegationState.dstate.ptrs.stakedCreds[][].txIndex
.stateBefore.esLState.delegationState.dstate.rewards
.stateBefore.esLState.delegationState.dstate.rewards[]
.stateBefore.esLState.delegationState.dstate.rewards[][]
.stateBefore.esLState.delegationState.dstate.rewards[][].key hash
.stateBefore.esLState.delegationState.pstate.fPParams pState[]
.stateBefore.esLState.delegationState.pstate.fPParams pState[].cost
.stateBefore.esLState.delegationState.pstate.fPParams pState[].margin
.stateBefore.esLState.delegationState.pstate.fPParams pState[].metadata.hash
.stateBefore.esLState.delegationState.pstate.fPParams pState[].metadata.url
.stateBefore.esLState.delegationState.pstate.fPParams pState[].owners
.stateBefore.esLState.delegationState.pstate.fPParams pState[].owners[]
.stateBefore.esLState.delegationState.pstate.fPParams pState[].publicKey
.stateBefore.esLState.delegationState.pstate.fPParams pState[].relays
.stateBefore.esLState.delegationState.pstate.fPParams pState[].relays[]
.stateBefore.esLState.delegationState.pstate.fPParams pState[].rewardAccount
.stateBefore.esLState.delegationState.pstate.fPParams pState[].rewardAccount.credential
.stateBefore.esLState.delegationState.pstate.fPParams pState[].rewardAccount.credential.key hash
.stateBefore.esLState.delegationState.pstate.fPParams pState[].rewardAccount.network
.stateBefore.esLState.delegationState.pstate.pParams pState[]
.stateBefore.esLState.delegationState.pstate.pParams pState[].cost
.stateBefore.esLState.delegationState.pstate.pParams pState[].margin
.stateBefore.esLState.delegationState.pstate.pParams pState[].metadata.hash
.stateBefore.esLState.delegationState.pstate.pParams pState[].metadata.url
.stateBefore.esLState.delegationState.pstate.pParams pState[].owners
.stateBefore.esLState.delegationState.pstate.pParams pState[].owners[]
.stateBefore.esLState.delegationState.pstate.pParams pState[].publicKey
.stateBefore.esLState.delegationState.pstate.pParams pState[].relays
.stateBefore.esLState.delegationState.pstate.pParams pState[].relays[]
.stateBefore.esLState.delegationState.pstate.pParams pState[].rewardAccount
.stateBefore.esLState.delegationState.pstate.pParams pState[].rewardAccount.credential
.stateBefore.esLState.delegationState.pstate.pParams pState[].rewardAccount.credential.key hash
.stateBefore.esLState.delegationState.pstate.pParams pState[].rewardAccount.network
.stateBefore.esLState.delegationState.pstate.retiring pState[]
.stateBefore.esLState.utxoState.fees
.stateBefore.esLState.utxoState.ppups
.stateBefore.esLState.utxoState.ppups.futureProposals
.stateBefore.esLState.utxoState.ppups.proposals
.stateBefore.esLState.utxoState.utxo
.stateBefore.esLState.utxoState.utxo[]
.stateBefore.esLState.utxoState.utxo[].address
.stateBefore.esLState.utxoState.utxo[].amount
.stateBefore.esLState.utxoState.utxo[].amount.policies
.stateBefore.esLState.utxoState.utxo[].amount.policies[]
.stateBefore.esLState.utxoState.utxo[].amount.policies[].
.stateBefore.esLState.utxoState.utxo[].amount.policies[][]
.stateBefore.esNonMyopic.likelihoodsNM
.stateBefore.esNonMyopic.likelihoodsNM[]
.stateBefore.esNonMyopic.likelihoodsNM[][]
.stateBefore.esNonMyopic.rewardPotNM
.stateBefore.esPp
.stateBefore.esPp.decentralisationParam
.stateBefore.esPp.eMax
.stateBefore.esPp.extraEntropy
.stateBefore.esPp.extraEntropy.tag
.stateBefore.esPp.keyDeposit
.stateBefore.esPp.minFeeA
.stateBefore.esPp.minFeeB
.stateBefore.esPp.minPoolCost
.stateBefore.esPp.nOpt
.stateBefore.esPp.poolDeposit
.stateBefore.esPp.protocolVersion
.stateBefore.esPp.protocolVersion.major
.stateBefore.esPp.protocolVersion.minor
.stateBefore.esPp.rho
.stateBefore.esPp.tau
.stateBefore.esPrevPp
.stateBefore.esPrevPp.decentralisationParam
.stateBefore.esPrevPp.eMax
.stateBefore.esPrevPp.extraEntropy
.stateBefore.esPrevPp.extraEntropy.tag
.stateBefore.esPrevPp.keyDeposit
.stateBefore.esPrevPp.minFeeA
.stateBefore.esPrevPp.minFeeB
.stateBefore.esPrevPp.minPoolCost
.stateBefore.esPrevPp.nOpt
.stateBefore.esPrevPp.poolDeposit
.stateBefore.esPrevPp.protocolVersion
.stateBefore.esPrevPp.protocolVersion.major
.stateBefore.esPrevPp.protocolVersion.minor
.stateBefore.esPrevPp.rho
.stateBefore.esPrevPp.tau
.stateBefore.esSnapshots
.stateBefore.esSnapshots.feeSS
.stateBefore.esSnapshots.pstakeGo
.stateBefore.esSnapshots.pstakeGo.delegations
.stateBefore.esSnapshots.pstakeGo.delegations[]
.stateBefore.esSnapshots.pstakeGo.delegations[][]
.stateBefore.esSnapshots.pstakeGo.delegations[][].key hash
.stateBefore.esSnapshots.pstakeGo.poolParams
.stateBefore.esSnapshots.pstakeGo.poolParams[]
.stateBefore.esSnapshots.pstakeGo.poolParams[].cost
.stateBefore.esSnapshots.pstakeGo.poolParams[].margin
.stateBefore.esSnapshots.pstakeGo.poolParams[].metadata.hash
.stateBefore.esSnapshots.pstakeGo.poolParams[].metadata.url
.stateBefore.esSnapshots.pstakeGo.poolParams[].owners
.stateBefore.esSnapshots.pstakeGo.poolParams[].owners[]
.stateBefore.esSnapshots.pstakeGo.poolParams[].publicKey
.stateBefore.esSnapshots.pstakeGo.poolParams[].relays
.stateBefore.esSnapshots.pstakeGo.poolParams[].relays[]
.stateBefore.esSnapshots.pstakeGo.poolParams[].rewardAccount
.stateBefore.esSnapshots.pstakeGo.poolParams[].rewardAccount.credential
.stateBefore.esSnapshots.pstakeGo.poolParams[].rewardAccount.credential.key hash
.stateBefore.esSnapshots.pstakeGo.poolParams[].rewardAccount.network
.stateBefore.esSnapshots.pstakeGo.stake[]
.stateBefore.esSnapshots.pstakeGo.stake[][]
.stateBefore.esSnapshots.pstakeGo.stake[][].key hash
.stateBefore.esSnapshots.pstakeMark
.stateBefore.esSnapshots.pstakeMark.delegations
.stateBefore.esSnapshots.pstakeMark.delegations[]
.stateBefore.esSnapshots.pstakeMark.delegations[][]
.stateBefore.esSnapshots.pstakeMark.delegations[][].key hash
.stateBefore.esSnapshots.pstakeMark.poolParams
.stateBefore.esSnapshots.pstakeMark.poolParams[]
.stateBefore.esSnapshots.pstakeMark.poolParams[].cost
.stateBefore.esSnapshots.pstakeMark.poolParams[].margin
.stateBefore.esSnapshots.pstakeMark.poolParams[].metadata.hash
.stateBefore.esSnapshots.pstakeMark.poolParams[].metadata.url
.stateBefore.esSnapshots.pstakeMark.poolParams[].owners
.stateBefore.esSnapshots.pstakeMark.poolParams[].owners[]
.stateBefore.esSnapshots.pstakeMark.poolParams[].publicKey
.stateBefore.esSnapshots.pstakeMark.poolParams[].relays
.stateBefore.esSnapshots.pstakeMark.poolParams[].relays[]
.stateBefore.esSnapshots.pstakeMark.poolParams[].rewardAccount
.stateBefore.esSnapshots.pstakeMark.poolParams[].rewardAccount.credential
.stateBefore.esSnapshots.pstakeMark.poolParams[].rewardAccount.credential.key hash
.stateBefore.esSnapshots.pstakeMark.poolParams[].rewardAccount.network
.stateBefore.esSnapshots.pstakeMark.stake[]
.stateBefore.esSnapshots.pstakeMark.stake[][]
.stateBefore.esSnapshots.pstakeMark.stake[][].key hash
.stateBefore.esSnapshots.pstakeSet
.stateBefore.esSnapshots.pstakeSet.delegations
.stateBefore.esSnapshots.pstakeSet.delegations[]
.stateBefore.esSnapshots.pstakeSet.delegations[][]
.stateBefore.esSnapshots.pstakeSet.delegations[][].key hash
.stateBefore.esSnapshots.pstakeSet.poolParams
.stateBefore.esSnapshots.pstakeSet.poolParams[]
.stateBefore.esSnapshots.pstakeSet.poolParams[].cost
.stateBefore.esSnapshots.pstakeSet.poolParams[].margin
.stateBefore.esSnapshots.pstakeSet.poolParams[].metadata.hash
.stateBefore.esSnapshots.pstakeSet.poolParams[].metadata.url
.stateBefore.esSnapshots.pstakeSet.poolParams[].owners
.stateBefore.esSnapshots.pstakeSet.poolParams[].owners[]
.stateBefore.esSnapshots.pstakeSet.poolParams[].publicKey
.stateBefore.esSnapshots.pstakeSet.poolParams[].relays
.stateBefore.esSnapshots.pstakeSet.poolParams[].relays[]
.stateBefore.esSnapshots.pstakeSet.poolParams[].rewardAccount
.stateBefore.esSnapshots.pstakeSet.poolParams[].rewardAccount.credential
.stateBefore.esSnapshots.pstakeSet.poolParams[].rewardAccount.credential.key hash
.stateBefore.esSnapshots.pstakeSet.poolParams[].rewardAccount.network
.stateBefore.esSnapshots.pstakeSet.stake[]
.stateBefore.esSnapshots.pstakeSet.stake[][]
.stateBefore.esSnapshots.pstakeSet.stake[][].key hash

I still have a question. Why do we see relays listed six times in the ledger state file? @rene_securestaking can you please explain the differences?

.stateBefore.esLState.delegationState.pstate.fPParams pState[].relays[]
.stateBefore.esLState.delegationState.pstate.pParams pState[].relays[]
.stateBefore.esSnapshots.pstakeGo.poolParams[].relays[]
.stateBefore.esSnapshots.pstakeMark.poolParams[].relays[]
.stateBefore.esSnapshots.pstakeSet.poolParams[].relays[]