* encoding * working on baseapp doc * baseapp work * reorg * almost there * finish first draft * remove old files * module doc start * finish intro * working * workinnn * add transactions into core * hans comments * add transactions into core * working * gautier comments * clean * working * consolidate intro * querier * workiiiing * refactor for new module interface * karoly review * working on baseapp doc * baseapp work * reorg * almost there * finish first draft * remove old files * finish intro * workinnn * initial commit after rebase * query-lifecycle and started modules-interfaces * query-lifecycle first draft done * module interfaces first draft * rest and intro skeletons * rest and intro done * small edits and links * comments * revisions * cli.md comments * comments * minor edits * better flow for query lifecycle * add transactions into core * hans comments * add transactions into core * checkout master-docs files * deleted some * remove modules readme * cli.md comments * comments * module-interfaces comments * Merge PR #4857: Add Context concept doc * working * working * finish messages and queries * handler * querier * last comments! * punctuation * querier2 * consolidate intro * querier * workiiiing * refactor for new module interface * karoly review * working on baseapp doc * baseapp work * reorg * almost there * finish first draft * remove old files * finish intro * workinnn * initial commit after rebase * query-lifecycle and started modules-interfaces * query-lifecycle first draft done * module interfaces first draft * rest and intro skeletons * rest and intro done * small edits and links * comments * revisions * cli.md comments * comments * minor edits * better flow for query lifecycle * checkout master-docs files * deleted some * remove modules readme * cli.md comments * comments * module-interfaces comments * keeper * genesis * finish * Apply suggestions from code review Co-Authored-By: Hans Schoenburg <hschoenburg@users.noreply.github.com> * hans review * Update docs/core/baseapp.md Co-Authored-By: Hans Schoenburg <hschoenburg@users.noreply.github.com> * working * last comment * workin * Apply suggestions from code review * encoding and node * almost finish store * finish docs * fixes * fede comments + permalinks * hans review * add more permalinks * update docs theme version (#5239) * R4R: Docs Cleanup (#5246) * start * work * work * work * remove table of content * links intro * fix links * remove junk * cleanup * cleanup * work * finish cleanup * addback readmes * remove nft * fix links * remove dup * remove dup * remove dup * remove dup * remove dup * fix links * add subscribe events * refine rest * index page * sidebar * theme version * theme version * testing netlify * theme version * tooltip example * version * testing code embedding * reverting back * theme version * version * version * version * readme and version * cleanup * redo app anatomy * modules readme, theme version * theme version * fix modules list * theme version * new snippets * modules readme * update docs readme * modify synopsis * version * fix yaml * version * version * version * version * version * version * version * version * version * version * add hide banner * version * version * version * small fixes * modules readme, version * remove hotkeys dep, version * version * version * version * version * version * version * version * slight notice * fix links and hide * permalinks * small clean * version * resolve conflicts, add google analytics * fix merge remants * version * changelog 1/2 * Changelog: docs UI * version * remove merge conflicts * Code: Update link for Contributing to the docs to docs_readme * HTML/CSS: Update layout of homepage footer to match new layout in Figma * version * final modifs * modules, version * modules readme * link to module list from homepage * version * building modules link * version * version * fonts * version * version * fix link * fix package.json * links in explore sdk section * core concepts * version * change delimeters for frontmatter * frontmatter in comments * version * temp add tiny-cookie * fixed link issues * fixed styling issues, copy * hide frontmatter * hide frontmatter * layout fixes, padded ascii diagram * fira sans font for code
3.0 KiB
State
Signing Info (Liveness)
Every block includes a set of precommits by the validators for the previous block,
known as the LastCommitInfo provided by Tendermint. A LastCommitInfo is valid so
long as it contains precommits from +2/3 of total voting power.
Proposers are incentivized to include precommits from all validators in the LastCommitInfo
by receiving additional fees proportional to the difference between the voting
power included in the LastCommitInfo and +2/3 (see TODO).
Validators are penalized for failing to be included in the LastCommitInfo for some
number of blocks by being automatically jailed, potentially slashed, and unbonded.
Information about validator's liveness activity is tracked through ValidatorSigningInfo.
It is indexed in the store as follows:
- ValidatorSigningInfo:
0x01 | ConsAddress -> amino(valSigningInfo) - MissedBlocksBitArray:
0x02 | ConsAddress | LittleEndianUint64(signArrayIndex) -> VarInt(didMiss)
The first mapping allows us to easily lookup the recent signing info for a
validator based on the validator's consensus address. The second mapping acts
as a bit-array of size SignedBlocksWindow that tells us if the validator missed
the block for a given index in the bit-array. The index in the bit-array is given
as little endian uint64.
The result is a varint that takes on 0 or 1, where 0 indicates the
validator did not miss (did sign) the corresponding block, and 1 indicates
they missed the block (did not sign).
Note that the MissedBlocksBitArray is not explicitly initialized up-front. Keys
are added as we progress through the first SignedBlocksWindow blocks for a newly
bonded validator. The SignedBlocksWindow parameter defines the size
(number of blocks) of the sliding window used to track validator liveness.
The information stored for tracking validator liveness is as follows:
type ValidatorSigningInfo struct {
Address sdk.ConsAddress
StartHeight int64
IndexOffset int64
JailedUntil time.Time
Tombstoned bool
MissedBlocksCounter int64
}
Where:
- Address: The validator's consensus address.
- StartHeight: The height that the candidate became an active validator (with non-zero voting power).
- IndexOffset: Index which is incremented each time the validator was a bonded
in a block and may have signed a precommit or not. This in conjunction with the
SignedBlocksWindowparam determines the index in theMissedBlocksBitArray. - JailedUntil: Time for which the validator is jailed until due to liveness downtime.
- Tombstoned: Desribes if the validator is tombstoned or not. It is set once the validator commits an equivocation or for any other configured misbehiavor.
- MissedBlocksCounter: A counter kept to avoid unnecessary array reads. Note
that
Sum(MissedBlocksBitArray)equalsMissedBlocksCounteralways.