Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockchain: BlockchainReactor.AddPeer doesn't add peer to its pool #666

Closed
odeke-em opened this issue Sep 19, 2017 · 2 comments
Closed

blockchain: BlockchainReactor.AddPeer doesn't add peer to its pool #666

odeke-em opened this issue Sep 19, 2017 · 2 comments
Assignees
Labels
C:docs Component: Documentation C:sync Component: Fast Sync, State Sync

Comments

@odeke-em
Copy link
Contributor

odeke-em commented Sep 19, 2017

I just hopped on to work on finishing PR #648 and while reading through the code I noticed that the code for AddPeer

func (bcR *BlockchainReactor) AddPeer(peer p2p.Peer) {
if !peer.Send(BlockchainChannel, struct{ BlockchainMessage }{&bcStatusResponseMessage{bcR.store.Height()}}) {
// doing nothing, will try later in `poolRoutine`
}
}

Just tries to send the peer our state, doesn't add the peer to the pool.

However, the code in RemovePeer pops the peer from the pool

func (bcR *BlockchainReactor) RemovePeer(peer p2p.Peer, reason interface{}) {
bcR.pool.RemovePeer(peer.Key())
}

Am I mistaken that we aren't properly adding a peer to the pool or is there some reasoning for this? Also I don't see any tests for AddPeer nor for RemovePeer.

@melekes
Copy link
Contributor

melekes commented Sep 22, 2017

We add peer to the pool upon receiving bcStatusResponseMessage https://github.com/tendermint/tendermint/blob/develop/blockchain/reactor.go#L159

but yeah, it's a bit confusing

@ebuchman
Copy link
Contributor

ebuchman commented Oct 3, 2017

We should update the comments to more clearly reflect what's going on - the peer doesnt get added to the pool until we've received a bc msg.

So this isn't really an issue as is, but we should clarify the comments and add tests

@ebuchman ebuchman added C:sync Component: Fast Sync, State Sync C:docs Component: Documentation Type: Test labels Nov 8, 2017
@ebuchman ebuchman closed this as completed Nov 8, 2017
Cashmaney pushed a commit to scrtlabs/tendermint that referenced this issue Aug 2, 2023
…tendermint#1047)

Closes tendermint#666

This PR adds double quotes to `path` param of `/abci_query` endpoint.

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments

(cherry picked from commit f6f13b1)

Co-authored-by: Steven Ferrer <steven.r.ferrer@gmail.com>
firelizzard18 pushed a commit to AccumulateNetwork/tendermint that referenced this issue Nov 24, 2023
…tendermint#1045)

Closes tendermint#666

This PR adds double quotes to `path` param of `/abci_query` endpoint.

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments

(cherry picked from commit f6f13b1)

Co-authored-by: Steven Ferrer <steven.r.ferrer@gmail.com>
firelizzard18 pushed a commit to AccumulateNetwork/tendermint that referenced this issue Feb 1, 2024
Closes tendermint#666 

This PR adds double quotes to `path` param of `/abci_query` endpoint.

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:docs Component: Documentation C:sync Component: Fast Sync, State Sync
Projects
None yet
Development

No branches or pull requests

3 participants