1
0
mirror of https://github.com/fluencelabs/tendermint synced 2025-06-22 01:11:32 +00:00
Files
.circleci
.github
DOCKER
abci
benchmarks
blockchain
cmd
config
consensus
crypto
docs
.vuepress
app-dev
architecture
imgs
interviews
introduction
networks
research
spec
abci
blockchain
consensus
p2p
reactors
scripts
software
abci.md
wal.md
README.md
tendermint-core
tools
.python-version
.textlintrc.json
DOCS_README.md
README.md
stop-words.txt
evidence
libs
lite
mempool
networks
node
p2p
privval
proxy
rpc
scripts
state
test
tools
types
version
.editorconfig
.gitignore
.golangci.yml
CHANGELOG.md
CHANGELOG_PENDING.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Gopkg.lock
Gopkg.toml
LICENSE
Makefile
PHILOSOPHY.md
README.md
ROADMAP.md
SECURITY.md
UPGRADING.md
Vagrantfile
appveyor.yml
codecov.yml
docker-compose.yml
tendermint/docs/spec/software/wal.md

33 lines
1.3 KiB
Markdown
Raw Normal View History

2018-06-15 22:56:26 -07:00
# WAL
Consensus module writes every message to the WAL (write-ahead log).
It also issues fsync syscall through
[File#Sync](https://golang.org/pkg/os/#File.Sync) for messages signed by this
node (to prevent double signing).
Under the hood, it uses
[autofile.Group](https://godoc.org/github.com/tendermint/tmlibs/autofile#Group),
which rotates files when those get too big (> 10MB).
The total maximum size is 1GB. We only need the latest block and the block before it,
but if the former is dragging on across many rounds, we want all those rounds.
## Replay
Consensus module will replay all the messages of the last height written to WAL
before a crash (if such occurs).
The private validator may try to sign messages during replay because it runs
somewhat autonomously and does not know about replay process.
For example, if we got all the way to precommit in the WAL and then crash,
after we replay the proposal message, the private validator will try to sign a
prevote. But it will fail. That's ok because well see the prevote later in the
WAL. Then it will go to precommit, and that time it will work because the
private validator contains the `LastSignBytes` and then well replay the
precommit from the WAL.
2018-08-07 18:40:11 -04:00
Make sure to read about [WAL corruption](../../../tendermint-core/running-in-production.md#wal-corruption)
2018-06-15 22:56:26 -07:00
and recovery strategies.