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

Improve robustness of directed message sending #173

Open
dforsten opened this issue Jul 21, 2019 · 4 comments
Open

Improve robustness of directed message sending #173

dforsten opened this issue Jul 21, 2019 · 4 comments
Assignees

Comments

@dforsten
Copy link

In the ethcore/sync/src/api.rs file "send()" function we assume there is always a session object for members of the "connected_peers" collection.
This assumption does not hold in practice, and results in crashes at run-time.

Remove the "unwrap()" calls in the following code and replace by proper error reporting:

			let node_ids = peer_ids.iter().map(|&x|context.session_info(x).unwrap().id).collect::<Vec<Option<H512>>>();
			let index = node_ids.into_iter().position(|r| r == node_id).unwrap();

@afck
Copy link
Collaborator

afck commented Jul 22, 2019

The consensus algorithm also relies on all messages between correct nodes eventually getting delivered, so maybe we should cache the messages, and resend them once we have connected to the peer in question. If we fail to do that, we count towards the faulty nodes.

@dforsten
Copy link
Author

Good point, that was one of the tasks I prepared Vinu to be coming up.

If a validator node crashes it will lose that cache, but by definition it would then be a faulty node.

@dforsten
Copy link
Author

A new issue for caching and re-sending of messages to temporarily disconnected reserved peers had been created and assigned to Vinu here:
#175

@vgtom
Copy link

vgtom commented Jul 22, 2019

OK so basically in ChainNotify::Send...while doing context.session_info(x)...if i do not get back a valid session, then i cache this message and node_id(PeerId may not be valid at later point) and then send this message at a later point in time when the session is infact established??

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

No branches or pull requests

3 participants