Skip to content

evidence: dont send evidence to unsynced peers#1628

Merged
ebuchman merged 13 commits intodevelopfrom
bucky/selective-evidence-broadcast
Jun 6, 2018
Merged

evidence: dont send evidence to unsynced peers#1628
ebuchman merged 13 commits intodevelopfrom
bucky/selective-evidence-broadcast

Conversation

@ebuchman
Copy link
Contributor

@ebuchman ebuchman commented May 24, 2018

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG.md

@ebuchman ebuchman requested a review from melekes as a code owner May 24, 2018 21:43
// TODO: Broadcast runs asynchronously, so this should wait on the successChan
// in another routine before marking to be proper.
// TODO: the broadcast here is just doing TrySend.
// We should make sure the send succeeds before marking broadcasted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should use Send instead of TrySend then?

// broadcast all pending evidence
msg := &EvidenceListMessage{evR.evpool.PendingEvidence()}
evR.Switch.Broadcast(EvidenceChannel, cdc.MustMarshalBinaryBare(msg))
evR.broadcastEvidenceListMsg(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we mark evidence as broadcasted here too?

}

for _, peer := range evR.Switch.Peers().List() {
ps := peer.Get(types.PeerStateKey).(PeerState)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E[05-26|15:40:21.860] Stopping peer for error module=p2p peer="Peer{MConn{13.124.200.97:37036} 0d04322b0637d8bf81c94e263ae7ea056c922d0f in}" err="Error{recovered panic in MConnection (cause: interface conversion: interface {} is nil, not *consensus.PeerState)}"

evidence/pool.go Outdated
blockEvidenceMap := make(map[string]struct{})
for _, ev := range evidence {
evpool.evidenceStore.MarkEvidenceAsCommitted(ev)
blockEvidenceMap[ev.String()] = struct{}{}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ev.Hash instead

peerHeight := peerState.GetHeight()
if peerHeight < height ||
peerHeight > height+maxAge {
time.Sleep(peerCatchupSleepIntervalMS * time.Millisecond)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only sleep if the peerHeight < height, not based on the maxAge

return ps.height
}

func TestReactorSelectiveBroadcast(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the test!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@ebuchman ebuchman force-pushed the bucky/selective-evidence-broadcast branch from d2c74fd to e5f4bed Compare June 5, 2018 04:42
@ebuchman ebuchman force-pushed the bucky/selective-evidence-broadcast branch from e5f4bed to 1b2e347 Compare June 5, 2018 06:52
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 :octocat: :shipit: 🍡

@codecov-io
Copy link

Codecov Report

Merging #1628 into develop will decrease coverage by 0.09%.
The diff coverage is 63.73%.

@@            Coverage Diff             @@
##           develop    #1628     +/-   ##
==========================================
- Coverage    62.37%   62.28%   -0.1%     
==========================================
  Files          122      123      +1     
  Lines        11073    11128     +55     
==========================================
+ Hits          6907     6931     +24     
- Misses        3551     3581     +30     
- Partials       615      616      +1
Impacted Files Coverage Δ
evidence/store.go 92.4% <ø> (ø) ⬆️
consensus/replay_file.go 0% <0%> (ø) ⬆️
rpc/core/pipe.go 28.2% <0%> (ø) ⬆️
consensus/replay.go 54.12% <100%> (ø) ⬆️
state/store.go 69.67% <100%> (ø) ⬆️
consensus/wal_generator.go 79.61% <100%> (ø) ⬆️
consensus/state.go 76.41% <100%> (-0.52%) ⬇️
evidence/pool.go 56.14% <24%> (-18.28%) ⬇️
state/services.go 38.46% <38.46%> (ø)
state/validation.go 36.36% <58.06%> (ø) ⬆️
... and 7 more

@ebuchman ebuchman merged commit 61002ad into develop Jun 6, 2018
@ebuchman ebuchman deleted the bucky/selective-evidence-broadcast branch June 6, 2018 00:07
firelizzard18 pushed a commit to AccumulateNetwork/tendermint that referenced this pull request Feb 1, 2024
…rmint#1628)

* Introduces check for FIFO ordering during gossip limitation, which fails

* Including some more tests. The `TestMempoolParallelCheckTx`  one shows that receiving the same sequence of transactions from multiple sources could cause inversion in the mempool.

* remove debug line

* fix lint error

* check the right reactor

* some extra debugging

* Rename test function and disable during CI

* satisfy linter

* Reverting the original test so it does not fail if FIFO is violated

* Update mempool/reactor_test.go

Co-authored-by: Hernán Vanzetto <15466498+hvanz@users.noreply.github.com>

* ignoring specific lint error

* Improve skip message

---------

Co-authored-by: Hernán Vanzetto <15466498+hvanz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants