State
This doc lists all the data Peggy module reads/writes to its state as KV pairs
Module Params
Params is a module-wide configuration structure that stores parameters and defines overall functioning of the peggy module. Detailed specification for each parameter can be found in the Parameters section.
key | Value | Type | Encoding |
---|---|---|---|
| Module params |
| Protobuf encoded |
Validator Info
Ethereum Address by Validator
Stores Delegate Ethereum address
indexed by the Validator
's account address
key | Value | Type | Encoding |
---|---|---|---|
| Ethereum address |
| Protobuf encoded |
Validator by Ethereum Address
Stores Validator
account address indexed by the Delegate Ethereum address
key | Value | Type | Encoding |
---|---|---|---|
| Validator address |
| Protobuf encoded |
OrchestratorValidator
When a validator would like to delegate their voting power to another key. The value is stored using the orchestrator address as the key
Key | Value | Type | Encoding |
---|---|---|---|
| Orchestrator address assigned by a validator |
| Protobuf encoded |
Valset
This is the validator set of the bridge. Created automatically by Peggy module
during EndBlocker.
Stored in two possible ways, first with a height and second without (unsafe). Unsafe is used for testing and export and import of state.
key | Value | Type | Encoding |
---|---|---|---|
| Validator set |
| Protobuf encoded |
SlashedValsetNonce
The latest validator set slash nonce. This is used to track which validator set needs to be slashed and which already has been.
Key | Value | Type | Encoding |
---|---|---|---|
| Nonce | uint64 | encoded via big endian |
ValsetNonce
Nonce of the latest validator set. Updated on each new validator set.
key | Value | Type | Encoding |
---|---|---|---|
| Nonce |
| encoded via big endian |
Valset Confirmation
Singer
confirmation for a particular validator set. See oracle messages
Key | Value | Type | Encoding |
---|---|---|---|
| Validator Confirmation |
| Protobuf encoded |
Batch Confirmation
Singer
confirmation for a particular token batch. See oracle messages
Key | Value | Type | Encoding |
---|---|---|---|
| Validator Batch Confirmation |
| Protobuf encoded |
OutgoingTransferTx
User withdrawals are pooled together in Peggy Tx Pool
ready to be batched later by a Batch Creator
.
Each withdrawal is indexed by a unique nonce set by the Peggy module
when the withdrawal was received.
Key | Value | Type | Encoding |
---|---|---|---|
| nonce of outgoing withdrawal |
| Big endian encoded |
LastTXPoolID
Monotonically increasing value for each withdrawal received by Injective
Key | Value | Type | Encoding |
---|---|---|---|
| Last used withdrawal ID |
| Big endian encoded |
OutgoingTxBatch
OutgoingTxBatch
represents a collection of withdrawals of the same token type. Created on every successful MsgRequestBatch
.
Stored in two possible ways, first with a height and second without (unsafe). Unsafe is used for testing and export and import of state. Currently Peggy.sol is hardcoded to only accept batches with a single token type and only pay rewards in that same token type.
key | Value | Type | Encoding |
---|---|---|---|
| A batch of outgoing transactions |
| Protobuf encoded |
| A batch of outgoing transactions |
| Protobuf encoded |
LastOutgoingBatchID
Monotonically increasing value for each batch created on Injective by some Batch Creator
Key | Value | Type | Encoding |
---|---|---|---|
| Last used batch ID |
| Big endian encoded |
SlashedBlockHeight
Represents the latest slashed block height. There is always only a singe value stored.
Key | Value | Type | Encoding |
---|---|---|---|
| Latest height a batch slashing occurred |
| Big endian encoded |
LastUnbondingBlockHeight
Represents the latest bloch height at which a Validator
started unbonding from the Validator Set
. Used to determine slashing conditions.
Key | Value | Type | Encoding |
---|---|---|---|
| Latest height at which a Validator started unbonding |
| Big endian encoded |
TokenContract & Denom
A denom that is originally from a counter chain will be from a contract. The token contract and denom are stored in two ways. First, the denom is used as the key and the value is the token contract. Second, the contract is used as the key, the value is the denom the token contract represents.
Key | Value | Type | Encoding |
---|---|---|---|
| Token contract address |
| stored in byte format |
| Token denom |
| stored in byte format |
LastObservedValset
This entry represents the last observed Valset that was successfully relayed to Ethereum. Updates after an attestation of ValsetUpdatedEvent
has been processed on Injective.
Key | Value | Type | Encoding |
---|---|---|---|
| Last observed Valset on Ethereum |
| Protobuf encoded |
LastEventNonce
The nonce of the last observed event on Ethereum. This is set when TryAttestation()
is called. There is always only a single value held in this store.
Key | Value | Type | Encoding |
---|---|---|---|
| Last observed event nonce |
| Big endian encoded |
LastObservedEthereumHeight
This block height of the last observed event on Ethereum. There will always only be a single value stored in this store.
Key | Value | Type | Encoding |
---|---|---|---|
| Last observed Ethereum Height |
| Protobuf encoded |
LastEventByValidator
This is the last observed event on Ethereum from a particular Validator
. Updated every time the asssociated Orchestrator
sends an event claim.
Key | Value | Type | Encoding |
---|---|---|---|
| Last observed event by some Validator |
| Protobuf encoded |
Attestation
Attestation is an aggregate of claims that eventually becomes observed by all orchestrators as more votes (claims) are coming in. Once observed the claim's particular logic gets executed.
Each attestation is bound to a unique event nonce (generated by Peggy contract
) and they must be processed in order. This is a correctness issue, if relaying out of order transaction replay attacks become possible.
Key | Value | Type | Encoding |
---|---|---|---|
| Attestation of occurred events/claims |
| Protobuf encoded |
PastEthSignatureCheckpoint
A computed hash indicating that a validator set/token batch in fact existed on Injective. This checkpoint also exists in Peggy contract
. Updated on each new valset update and token batch creation.
Key | Value | Type | Encoding |
---|---|---|---|
| Last created checkpoint hash on Injective |
| store in byte format |
EthereumBlacklist
A list of known malicious Ethereum addresses that are prevented from using the bridge.
Key | Value | Type | Encoding |
---|---|---|---|
| Empty []byte slice |
| stored in byte format] |
Last updated