Comments (5)
@DarkEld3r another solution was proposed by @defuz and @alekseysidorov : double checking the Connect
handshake logic, though it's quite complex there.
It's not hard to reproduce, when it doesn't work: A con-> B
doesn't result in B con->A
.
from exonum.
If node A missed node B's Connect, node A won't send its peers to B upon being requested.
This is an expected behavior and there is nothing to fix here. If A missed B's Connect
message, A can't connect to B to send anything. There is some possibility that some request may be ignored because the responder is not connected to the requestor yet. However, if requestor sends any message to the responder, it's guaranteed that it already send Connect
message. Thus, the connection in both directions must be established sooner or later.
@gisochre @DarkEld3r I think we need to gather more information about what actually happens and what is the state of the nodes after network partitioning. Also, perhaps it makes sense to improve the choice of time and recipient of the RequestPeers
messages.
from exonum.
@defuz ONCE AGAIN (pleaze read with attention):
It's not hard to reproduce, when handshake doesn't work: A Connect-> B
doesn't result in B Connect->A
.
And ...logging is confusing.
(there's log Send Connect message to ...
which doesn't occur AFTER message was sent, only BEFORE invoking an event on event_loop:
fn connect(&mut self, address: &SocketAddr) {
self.inner
.send(InternalEvent::Invoke(Invoke::Connect(*address)))
.log_error("Unable to connect");
}
And ....names of network-related methods are totally confusing: in events/mod.rs, events/network.rs, node/mod.rs, node/basic.rs. A lot of similar handle_connect(ed)
.
Good example is just above: it should be send_invoke_connect_event
instead of connect
.
from exonum.
@gisochre
It's not hard to reproduce, when handshake doesn't work: A Connect-> B doesn't result in B Connect->A.
OK. This looks like misbehavior. The next steps will be to understand how this should work, and why this does not work as expected. So, how this should work:
- Once the TCP connection is established, the client sends
Connect
message immediately: https://github.com/exonum/exonum-core/blob/master/exonum/src/node/basic.rs#L37 - When the server receives
Connect
message, it tries to establish the backward TCP connection if it is not already open:
https://github.com/exonum/exonum-core/blob/master/exonum/src/node/basic.rs#L75
It is easy to conclude that if A send Connect
to B then B should send Connect
to A or has done this before. If this does not happen, we need to understand why.
logging is confusing
names of network-related methods are totally confusing
It's great that you've noticed it. Here are the next steps you can take:
- Create an issue about this.
- Suggest PR.
Anyway, the logs and method names are not relevant to code misbehavior, so let's go back to the main discussion.
from exonum.
@defuz i'll start with a separate pr for logging and renaming, that'll help a lot to debug this.
from exonum.
Related Issues (20)
- Dependabot can't resolve your Rust dependency files
- Hash of the proof is not equal to the trusted hash of the index after committing new block with at least 50% probability HOT 13
- Dependabot can't resolve your Rust dependency files
- Propose message HOT 1
- exonum_merkledb crate uses rocksdb 0.13.0, is there a plan to upgrade to rocksdb 0.15.0 HOT 2
- Performance degradation on a long running network HOT 41
- Concerns About Actix For a Security Oriented Software Project HOT 5
- Accept extra args in exonum build HOT 4
- Errors when targeting webassembly HOT 4
- crates.io version of exonum contains multiple severe vulnerabilities HOT 3
- error: failed to run custom build command for `librocksdb-sys v6.20.3` HOT 1
- Can no longer compile Crypto Currency Advanced - weird error doesn't make sense to me HOT 2
- Support Asymmetric Encryption on exonum-crypto
- Weed Coin
- Windows support problem: Couldn't compile the test.
- actix-http error
- Creating a distributed network
- Please update linux dependencies in the Installation Guide
- error: failed to run custom build command for `exonum-proto v1.0.0` HOT 2
- failed to run custom build command for `protobuf-convert v0.4.0` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exonum.