Files
tendermint/CHANGELOG_PENDING.md
mergify[bot] 5703cc3455 consensus: correctly save reference to previous height precommits (backport #9760) (#9775)
* consensus: correctly save reference to previous height precommits (#9760)

This change reduces the number of Precommit messages sent to peers by 50%.

During the `ApplyNewRoundStepMessage`, we update the known state of the peer sending us the message.

We set the value of `ps.PRS.Precommits` to nil in this method if the peer is entering a new height or round.
34ca3fb474/consensus/reactor.go (L1368)

We then assign `ps.PRS.LastCommit = ps.PRS.Precommits` if the peer is entering a new height only - this does not happen during just a round change. This therefore results in `ps.PRS.LastCommit` having the value `nil`.

When the `LastCommit` bit field is seen as `nil` in the reactor, an empty bit field is initialized.
34ca3fb474/consensus/reactor.go (L1273)

The code responsible for gossiping votes from the previous height uses this `LastCommit` value and, seeing an empty `LastCommit` will resend every `Precommit` from the previous height since it lost the information it previously had detailing which precommits from the previous height the peer had.

This can be seen in the code responsible for gossiping precommits from the previous height:
34ca3fb474/consensus/reactor.go (L773)

Where this code grabs the, previously `nil`, `LastCommit` bit field:
34ca3fb474/consensus/reactor.go (L1204-L1212)

---

#### PR checklist

- [ ] Tests written/updated, or no tests needed
- [ ] `CHANGELOG_PENDING.md` updated, or no changelog entry needed
- [ ] Updated relevant documentation (`docs/`) and code comments, or no
      documentation updates needed

(cherry picked from commit da204d371d)

# Conflicts:
#	CHANGELOG_PENDING.md

* changelog

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
Co-authored-by: William Banfield <wbanfield@gmail.com>
2022-11-28 15:26:09 -05:00

3.1 KiB

Unreleased Changes

v0.37.0

Special thanks to external contributors on this release:

Friendly reminder, we have a bug bounty program.

BREAKING CHANGES

  • CLI/RPC/Config

    • [config] #9259 Rename the fastsync section and the fast_sync key blocksync and block_sync respectively
  • Apps

    • [abci/counter] #6684 Delete counter example app
    • [abci] #5783 Make length delimiter encoding consistent (uint64) between ABCI and P2P wire-level protocols
    • [abci] #9145 Removes unused Response/Request SetOption from ABCI (@samricotta)
    • [abci/params] #9287 Deduplicate ConsensusParams and BlockParams so only types proto definitions are used (@cmwaters)
      • Remove TimeIotaMs and use a hard-coded 1 millisecond value to ensure monotonically increasing block times.
      • Rename AppVersion to App so as to not stutter.
    • [types] #9287 Reduce the use of protobuf types in core logic. (@cmwaters)
      • ConsensusParams, BlockParams, ValidatorParams, EvidenceParams, VersionParams have become native types. They still utilize protobuf when being sent over the wire or written to disk.
      • Moved ValidateConsensusParams inside (now native type) ConsensusParams, and renamed it to ValidateBasic.
    • [abci] #9301 New ABCI methods PrepareProposal and ProcessProposal which give the app control over transactions proposed and allows for verification of proposed blocks.
    • [abci] #8216 Renamed EvidenceType to MisbehaviorType and Evidence to Misbehavior as a more accurate label of their contents. (@williambanfield, @sergio-mena)
    • [abci] #9122 Renamed LastCommitInfo to CommitInfo in preparation for vote extensions. (@cmwaters)
    • [abci] #8656, #8901 Added cli commands for PrepareProposal and ProcessProposal. (@jmalicevic, @hvanz)
    • [abci] #6403 Change the key and value fields from []byte to string in the EventAttribute type. (@alexanderbez)
  • P2P Protocol

  • Go API

    • [all] #9144 Change spelling from British English to American (@cmwaters)
      • Rename "Subscription.Cancelled()" to "Subscription.Canceled()" in libs/pubsub
  • Blockchain Protocol

FEATURES

  • [abci] #9301 New ABCI methods PrepareProposal and ProcessProposal which give the app control over transactions proposed and allows for verification of proposed blocks.

IMPROVEMENTS

  • [proto] #9356 Migrate from gogo/protobuf to cosmos/gogoproto (@julienrbrt)
  • [rpc] #9276 Added header and header_by_hash queries to the RPC client (@samricotta)
  • [abci] #5706 Added AbciVersion to RequestInfo allowing applications to check ABCI version when connecting to Tendermint. (@marbar3778)
  • [consensus] #9760 Save peer LastCommit correctly to achieve 50% reduction in gossiped precommits. (@williambanfield)

BUG FIXES

  • [consensus] #9229 fix round number of enterPropose when handling RoundStepNewRound timeout. (@fatcat22)
  • [docker] #9073 enable cross platform build using docker buildx
  • [docker] #9462 ensure Docker image uses consistent version of Go
  • [blocksync] #9518 handle the case when the sending queue is full: retry block request after a timeout