mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 19:53:58 +00:00
* Update docs references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update DOCS_README to reflect current reality Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update vuepress config with current versions and updated discussions link Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update generated docs versions Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update docs build to use temp folder instead of home Signed-off-by: Thane Thomson <connect@thanethomson.com> * Document build-docs Makefile target Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add serve-docs Makefile target to serve local build of docs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Ensure 404 page is copied during docs build Signed-off-by: Thane Thomson <connect@thanethomson.com> * Redirect /master/ to /main/ Signed-off-by: Thane Thomson <connect@thanethomson.com> * Attempt to resolve #7908 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update OpenAPI references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update CHANGELOG references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update Docker readme references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update UPGRADING references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update package-specific documentation references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update spec references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update all code comment references to docs site from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Build v0.34.x as "latest" Signed-off-by: Thane Thomson <connect@thanethomson.com> * Explicitly mark v0.34 docs as latest in version selector Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update all links from docs.tendermint.com/main to docs.tendermint.com/latest Signed-off-by: Thane Thomson <connect@thanethomson.com> * ci: Redeploy docs on pushes to v0.34.x Signed-off-by: Thane Thomson <connect@thanethomson.com> * Temporarily copy spec directory into docs while building Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add nav link to main and clearly mark as unstable Signed-off-by: Thane Thomson <connect@thanethomson.com> * Revert to only publishing docs in nav for v0.34 and v0.33 with no latest Signed-off-by: Thane Thomson <connect@thanethomson.com> * Link to docs.tendermint.com/v0.34 from RFCs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Rather just use main for all docs.tendermint.com references on main branch Signed-off-by: Thane Thomson <connect@thanethomson.com> * Rename GitHub tree links from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update link for ABCI Rust client Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update github links from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update badges in root readme Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove codecov badge since we do not use it any more Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove Java and Kotlin tutorials Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove specs from docs build Signed-off-by: Thane Thomson <connect@thanethomson.com> * Migrate spec links to GitHub repo from docs site Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove references to non-existent PEX reactor spec Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix linting badge in README Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com>
53 lines
2.5 KiB
Go
53 lines
2.5 KiB
Go
/*
|
|
Package evidence handles all evidence storage and gossiping from detection to block proposal.
|
|
For the different types of evidence refer to the `evidence.go` file in the types package
|
|
or https://github.com/tendermint/tendermint/blob/main/spec/consensus/light-client/accountability.md.
|
|
|
|
# Gossiping
|
|
|
|
The core functionality begins with the evidence reactor (see reactor.
|
|
go) which operates both the sending and receiving of evidence.
|
|
|
|
The `Receive` function takes a list of evidence and does the following:
|
|
|
|
1. Checks that it does not already have the evidence stored
|
|
|
|
2. Verifies the evidence against the node's state (see state/validation.go#VerifyEvidence)
|
|
|
|
3. Stores the evidence to a db and a concurrent list
|
|
|
|
The gossiping of evidence is initiated when a peer is added which starts a go routine to broadcast currently
|
|
uncommitted evidence at intervals of 60 seconds (set by the by broadcastEvidenceIntervalS).
|
|
It uses a concurrent list to store the evidence and before sending verifies that each evidence is still valid in the
|
|
sense that it has not exceeded the max evidence age and height (see types/params.go#EvidenceParams).
|
|
|
|
There are two buckets that evidence can be stored in: Pending & Committed.
|
|
|
|
1. Pending is awaiting to be committed (evidence is usually broadcasted then)
|
|
|
|
2. Committed is for those already on the block and is to ensure that evidence isn't submitted twice
|
|
|
|
All evidence is proto encoded to disk.
|
|
|
|
# Proposing
|
|
|
|
When a new block is being proposed (in state/execution.go#CreateProposalBlock),
|
|
`PendingEvidence(maxBytes)` is called to send up to the maxBytes of uncommitted evidence, from the evidence store,
|
|
prioritized in order of age. All evidence is checked for expiration.
|
|
|
|
When a node receives evidence in a block it will use the evidence module as a cache first to see if it has
|
|
already verified the evidence before trying to verify it again.
|
|
|
|
Once the proposed evidence is submitted,
|
|
the evidence is marked as committed and is moved from the broadcasted set to the committed set.
|
|
As a result it is also removed from the concurrent list so that it is no longer gossiped.
|
|
|
|
# Minor Functionality
|
|
|
|
As all evidence (including POLC's) are bounded by an expiration date, those that exceed this are no longer needed
|
|
and hence pruned. Currently, only committed evidence in which a marker to the height that the evidence was committed
|
|
and hence very small is saved. All updates are made from the `Update(block, state)` function which should be called
|
|
when a new block is committed.
|
|
*/
|
|
package evidence
|