Commit Graph

5528 Commits

Author SHA1 Message Date
Jeffrey Wilcke 90b94e64fc Merge pull request #971 from fjl/p2p-limit-tweaks
p2p: tweak connection limits
2015-05-14 08:15:51 -07:00
Felix Lange d2f119cf9b p2p/discover: limit open files for node database 2015-05-14 15:01:13 +02:00
Felix Lange 206fe25971 p2p: remove testlog 2015-05-14 14:56:34 +02:00
Felix Lange 7fa2607bd1 p2p/discover: bump maxBondingPingPongs to 16
This should increase the speed a bit because all findnode
results (up to 16) can be verified at the same time.
2015-05-14 14:53:29 +02:00
Felix Lange 691cb90284 p2p: log remote reason when disconnect is requested
The returned reason is currently not used except for the log
message. This change makes the log messages a bit more useful.
The handshake code also returns the remote reason.
2015-05-14 14:53:29 +02:00
Jeffrey Wilcke ff87c241a7 Merge pull request #973 from bas-vk/issue972
Introduced default unlock duration when an account is unlocked from t…
2015-05-14 05:48:31 -07:00
Péter Szilágyi fe87feccb1 eth/downloader: add a small additional check to the test 2015-05-14 15:44:54 +03:00
Péter Szilágyi ebf1eb9359 eth/downloader: remove a previous leftover 2015-05-14 15:40:28 +03:00
Péter Szilágyi 3eda70c64c eth, eth/downloader: remove parent verification from the downlaoder 2015-05-14 15:38:49 +03:00
Bas van Kervel 1fa48bc5e7 Introduced default unlock duration when an account is unlocked from the console 2015-05-14 14:25:48 +02:00
Péter Szilágyi a4246c2da6 eth, eth/downloader: handle a potential unknown parent attack 2015-05-14 15:24:18 +03:00
Jeffrey Wilcke 7fa740996c Merge pull request #960 from fjl/nat-fixes
p2p/nat: fix UPnP auto discovery
2015-05-14 04:06:13 -07:00
Jeffrey Wilcke c7a13c9be8 Merge pull request #969 from Gustav-Simonsson/ethash_improve_hashrate_update2
Make read of ethash hashrate atomic and update ethash godep
2015-05-14 04:05:27 -07:00
Jeffrey Wilcke 2b06fe3eff Merge pull request #950 from karalabe/downloader-cancel-sync
eth/downloader: fix deliveries to check for sync cancels
2015-05-14 04:05:13 -07:00
Jeffrey Wilcke cdeae22356 Merge pull request #949 from bas-vk/issue944
removed invalid filename characters
2015-05-14 04:04:43 -07:00
Felix Lange 5f706cd7f5 cmd/utils: print messages from package log through glog
Some of the dependencies use package log. This change ensures that the
log output looks uniform and respects glog flags.
2015-05-14 12:56:37 +02:00
Felix Lange c14de2e973 p2p/nat: tweak port mapping log messages and levels
People stil get confused about the messages. This commit changes
the levels so that the only thing printed at the default level (info)
is a successful mapping.
2015-05-14 12:54:59 +02:00
Jeffrey Wilcke e4aa011d23 Merge pull request #970 from ethereum/vitalik_quick_test
Created separate family and ancestors environment objects
2015-05-14 03:53:04 -07:00
Felix Lange e7c7b54b82 Godeps: bump github.com/huin/goupnp to c57ae84 2015-05-14 12:29:41 +02:00
Felix Lange 663d4e0aff p2p/nat: add test for UPnP auto discovery via SSDP
The test listens for multicast UDP packets on the default interface
because I couldn't get it to work reliably on loopback without massive
changes to goupnp. This means that the test might fail when there is a
UPnP-enabled router attached on that interface. I checked that locally
by looping the test and it passes reliably because the local SSDP server
always responds faster.
2015-05-14 12:13:19 +02:00
Vitalik Buterin bdec8c3e41 Combined two loops 2015-05-14 05:02:15 -04:00
Gustav Simonsson b24f16fa53 Make read of ethash hashrate atomic and update ethash godep 2015-05-14 04:05:49 +02:00
Felix Lange 983f5a717a p2p/nat: fix concurrent access to autodisc Interface
Concurrent calls to Interface methods on autodisc could return a "not
discovered" error if the discovery did not finish before the call.
autodisc.wait expected the done channel to carry the found Interface
but it was closed instead.

The fix is to use sync.Once for now, which is easier to get right.
And there is a test. Finally.

This will have to change again when we introduce re-discovery.
2015-05-14 03:53:11 +02:00
Felix Lange 7efeb4bd96 p2p: bump maxAcceptConns and defaultDialTimout
On the test network, we've seen that it becomes harder to connect
if the queues are so short.
2015-05-14 03:48:28 +02:00
Vitalik Buterin fca3333f7f Created separate family and ancestors environment objects 2015-05-13 20:46:23 -04:00
Vitalik Buterin bc83761996 Fixed max uncle count error message 2015-05-13 20:29:57 -04:00
Felix Lange f7fdb4dfbe Merge pull request #966 from fjl/fixup-discover-chunked-neighbors
p2p/discover: fix out-of-bounds slicing for chunked neighbors packets
2015-05-13 21:52:58 +02:00
Felix Lange 251846d65a p2p/discover: fix out-of-bounds slicing for chunked neighbors packets
The code assumed that Table.closest always returns at least 13 nodes.
This is not true for small tables (e.g. during bootstrap).
2015-05-13 21:49:04 +02:00
Jeffrey Wilcke fad21fb4a5 Merge pull request #963 from Gustav-Simonsson/fix_keystore_crypto_comments
Update keystore code comments
2015-05-13 11:51:02 -07:00
Felix Lange b2119d8931 Merge pull request #965 from subtly/patch-1
Better UDP & interop. Limit all received datagrams to 1280bytes.
2015-05-13 20:34:10 +02:00
subtly 8eef2b765a fix test. 2015-05-13 20:15:01 +02:00
subtly a32693770c Manual send of multiple neighbours packets. Test receiving multiple neighbours packets. 2015-05-13 20:03:17 +02:00
subtly 7473c93668 UDP Interop. Limit datagrams to 1280bytes.
We don't have a UDP which specifies any messages that will be 4KB. Aside from being implemented for months and a necessity for encryption and piggy-backing packets, 1280bytes is ideal, and, means this TODO can be completed!

Why 1280 bytes?
* It's less than the default MTU for most WAN/LAN networks. That means fewer fragmented datagrams (esp on well-connected networks).
* Fragmented datagrams and dropped packets suck and add latency while OS waits for a dropped fragment to never arrive (blocking readLoop())
* Most of our packets are < 1280 bytes.
* 1280 bytes is minimum datagram size and MTU for IPv6 -- on IPv6, a datagram < 1280bytes will *never* be fragmented.

UDP datagrams are dropped. A lot! And fragmented datagrams are worse. If a datagram has a 30% chance of being dropped, then a fragmented datagram has a 60% chance of being dropped. More importantly, we have signed packets and can't do anything with a packet unless we receive the entire datagram because the signature can't be verified. The same is true when we have encrypted packets.

So the solution here to picking an ideal buffer size for receiving datagrams is a number under 1400bytes. And the lower-bound value for IPv6 of 1280 bytes make's it a non-decision. On IPv4 most ISPs and 3g/4g/let networks have an MTU just over 1400 -- and *never* over 1500. Never -- that means packets over 1500 (in reality: ~1450) bytes are fragmented. And probably dropped a lot.

Just to prove the point, here are pings sending non-fragmented packets over wifi/ISP, and a second set of pings via cell-phone tethering. It's important to note that, if *any* router between my system and the EC2 node has a lower MTU, the message would not go through:

On wifi w/normal ISP:
localhost:Debug $ ping -D -s 1450 52.6.250.242
PING 52.6.250.242 (52.6.250.242): 1450 data bytes
1458 bytes from 52.6.250.242: icmp_seq=0 ttl=42 time=104.831 ms
1458 bytes from 52.6.250.242: icmp_seq=1 ttl=42 time=119.004 ms
^C
--- 52.6.250.242 ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 104.831/111.918/119.004/7.087 ms
localhost:Debug $ ping -D -s 1480 52.6.250.242
PING 52.6.250.242 (52.6.250.242): 1480 data bytes
ping: sendto: Message too long
ping: sendto: Message too long
Request timeout for icmp_seq 0
ping: sendto: Message too long
Request timeout for icmp_seq 1


Tethering to O2:
localhost:Debug $ ping -D -s 1480 52.6.250.242
PING 52.6.250.242 (52.6.250.242): 1480 data bytes
ping: sendto: Message too long
ping: sendto: Message too long
Request timeout for icmp_seq 0
^C
--- 52.6.250.242 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
localhost:Debug $ ping -D -s 1450 52.6.250.242
PING 52.6.250.242 (52.6.250.242): 1450 data bytes
1458 bytes from 52.6.250.242: icmp_seq=0 ttl=42 time=107.844 ms
1458 bytes from 52.6.250.242: icmp_seq=1 ttl=42 time=105.127 ms
1458 bytes from 52.6.250.242: icmp_seq=2 ttl=42 time=120.483 ms
1458 bytes from 52.6.250.242: icmp_seq=3 ttl=42 time=102.136 ms
2015-05-13 19:03:00 +02:00
Gustav Simonsson 56a5592ea0 Update keystore code comments 2015-05-13 18:33:31 +02:00
Péter Szilágyi 3edc4698fe Merge pull request #954 from karalabe/fix-downloader-nil-panic
eth/downloader: fix nil panic caused by wrong variable use
2015-05-13 18:15:18 +02:00
Péter Szilágyi 910a6d4e46 eth/downloader: fix nil panic caused by wrong variable use 2015-05-13 17:25:01 +03:00
Péter Szilágyi de3a71cafd eth/downloader: remove a redundant sync progress check 2015-05-13 16:56:01 +03:00
Péter Szilágyi 48ee0777a5 eth/downloader: add a user sync notificaton 2015-05-13 16:03:05 +03:00
Péter Szilágyi ec57aa64cd eth/downloader: sync the cancel channel during cancel too 2015-05-13 14:01:08 +03:00
Péter Szilágyi ee0c892303 eth/downloader: fix deliveries to check for sync cancels 2015-05-13 13:47:21 +03:00
Jeffrey Wilcke 7cb0e24245 Merge pull request #948 from karalabe/fix-downlaoder-activepeer-shadow
eth/downloader: fix active peer shadowing, polish func names
2015-05-13 03:46:29 -07:00
Bas van Kervel e30e9fe979 removed invalid filename characters 2015-05-13 12:38:12 +02:00
Péter Szilágyi d2d5dbc6fb eth/downloader: fix active peer shadowing, polish func names 2015-05-13 13:13:43 +03:00
Jeffrey Wilcke 6dec90464d Merge pull request #946 from Gustav-Simonsson/fix_geth_unlock_account
Fix hex conversion in --unlock and log when successful
2015-05-13 01:58:32 -07:00
Gustav Simonsson b5b53d8b32 Fix hex conversion in --unlock and log when successful 2015-05-13 01:11:17 +02:00
obscuren 28d6b30c0f Merge branch 'release/0.9.20' into develop 2015-05-12 19:05:51 +02:00
obscuren 8e24378cc1 Merge branch 'release/0.9.20' 2015-05-12 19:05:33 +02:00
obscuren 8fe01b4bfa eth: 100% tx propagation 2015-05-12 19:01:01 +02:00
obscuren 36ce54e5dc cmd/geth: bump version to 0.9.20 2015-05-12 19:01:01 +02:00
Jeffrey Wilcke d6357aa616 Merge pull request #631 from Gustav-Simonsson/improve_key_store_crypto
Improve key store crypto
2015-05-12 10:00:35 -07:00