Commit Graph

5388 Commits

Author SHA1 Message Date
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
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
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
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
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
Gustav Simonsson
e389585f1f Change default keystore dir 2015-05-12 18:33:04 +02:00
Gustav Simonsson
231fe04f03 Fix address type in js test 2015-05-12 17:48:21 +02:00
Jeffrey Wilcke
58d6ec689f Merge pull request #933 from bas-vk/issue928
replaced path with platform aware filepath module
2015-05-12 08:23:46 -07:00
Gustav Simonsson
037772fc07 fix hex conversion bug in RPC for byte slices 2015-05-12 17:22:17 +02:00
Gustav Simonsson
8001e48115 Fix natspec test (again x2) types 2015-05-12 17:22:17 +02:00
Gustav Simonsson
2c1b0ff17e Update key store to new spec but keep address field for now
* Also fix address types post-rebase
2015-05-12 17:22:17 +02:00
Gustav Simonsson
fe9e95a3fd Fix natspec e2e test accounts type (again) 2015-05-12 17:22:17 +02:00
Gustav Simonsson
940952f757 Fix HEX hack in xeth accounts() 2015-05-12 17:22:17 +02:00
Gustav Simonsson
f98e002d98 Address pull request comments; key header and hex encoding
* Remove key header from unencrypted key file format and replace
  it with a version field
* Change encoding of bytes in key files from base64 to hex
2015-05-12 17:22:17 +02:00
Gustav Simonsson
313eec33ad Revert "Add key header to unencrypted key file"
This reverts commit a94d4ba0b53c4558ab838aaed635a2ff66ddfa53.
2015-05-12 17:19:39 +02:00
Gustav Simonsson
8754f2b768 Fix common.Address / []byte type conversions 2015-05-12 17:19:39 +02:00
Gustav Simonsson
cd88295f5a Add key header to unencrypted key file 2015-05-12 17:19:39 +02:00
Gustav Simonsson
29a5a92d13 Add key header to encrypted keys
* Add key header containing key version, kdf and kdf params
* Store key header as JSON in the key file
* Read in KDF params from key header
* Include key header in MAC calculation and MAC verification
2015-05-12 17:19:39 +02:00
Gustav Simonsson
ac3371bcb6 Correct accounts hex in XETH API 2015-05-12 17:19:39 +02:00
Gustav Simonsson
da9fe951da Use common.Address type for accounts.Address 2015-05-12 17:19:39 +02:00
Gustav Simonsson
6b23094cff Improve key store passphrase crypto
* Change MAC-then-Encrypt to Encrypt-then-MAC
* Change AES256 to AES128
* Use first 16 bytes of KDF derived key for AES and
  remaining 16 for MAC
2015-05-12 17:18:30 +02:00
Gustav Simonsson
9918b6c84e Remove the awesome, ever misunderstood entropy mixing 2015-05-12 17:18:30 +02:00
Jeffrey Wilcke
f87094b660 Merge pull request #932 from obscuren/develop
xeth, rpc: implement eth_estimateGas. Closes #930
2015-05-12 07:26:38 -07:00
obscuren
dca290d525 sol: skipped source checking step 2015-05-12 16:19:14 +02:00
obscuren
ff99752ddd xeth: use same semantics as block processer for transient calls 2015-05-12 15:53:00 +02:00
Bas van Kervel
899df30c24 fixed identing 2015-05-12 15:23:19 +02:00
Bas van Kervel
95773b9673 removed redundant newlines in import block 2015-05-12 15:20:53 +02:00
obscuren
260536a729 rpc: hexData => hexNum 2015-05-12 15:02:44 +02:00
Bas van Kervel
b79dd188d9 replaced several path.* with filepath.* which is platform independent 2015-05-12 14:24:11 +02:00
obscuren
66de3f0aa8 xeth, rpc: implement eth_estimateGas. Closes #930 2015-05-12 14:21:43 +02:00
obscuren
96d4a7d087 eth, ethdb: lower the amount of open files & improve err messages for db
Closes #880
2015-05-12 14:14:56 +02:00
Jeffrey Wilcke
d82caa5ce3 Merge pull request #899 from ethersphere/solc-test-fix
compiler, cli/js: fix solidity compiler tests
2015-05-12 04:16:49 -07:00
zelig
03bf902b92 compiler, cli/js: fix solidity compiler tests failing when a different version of solc installed 2015-05-12 12:36:54 +02:00
Jeffrey Wilcke
e8d701a3b2 Merge pull request #929 from obscuren/develop
eth, ethdb: lower the amount of open files & improve err messages for db
2015-05-12 03:29:07 -07:00
obscuren
13f8f65a58 eth, ethdb: lower the amount of open files & improve err messages for db
Closes #880
2015-05-12 11:28:55 +02:00
Jeffrey Wilcke
76215ca9f3 Merge pull request #925 from obscuren/worker_owned_accounts
miner, cmd/geth: miner will not ignored owned account transactions
2015-05-11 14:23:51 -07:00
obscuren
97dd4551ef miner, cmd/geth: miner will not ignored owned account transactions
Miner does not ignore low gas txs from accounts that are owned.
2015-05-11 21:47:34 +02:00
Jeffrey Wilcke
0bedf1c376 Merge pull request #918 from obscuren/cpu_miner_fixes
cmd/geth, miner, backend, xeth: Fixed miner threads to be settable
2015-05-11 12:11:27 -07:00
obscuren
48bd48876c eth, eth/downloader: moved pending queue error message to debug 2015-05-11 17:27:34 +02:00
obscuren
21e52efdfe cmd/geth, miner, backend, xeth: Fixed miner threads to be settable
Miner threads are now settable through the admin interface (closes #897)
and specify 0 CPU worker threads when eth_getWork is called (closes #916)
2015-05-11 17:21:22 +02:00
Péter Szilágyi
064cf16099 eth/downloader: use count instead of peers, clearer 2015-05-11 17:21:22 +02:00
Péter Szilágyi
d37a2559b9 eth/downloader: revert to demotion, use harsher penalty 2015-05-11 17:21:22 +02:00
Péter Szilágyi
70c65835f4 eth/downloader: fix #910, thread safe peers & polishes 2015-05-11 17:21:22 +02:00
Jeffrey Wilcke
59bc541232 Merge pull request #915 from karalabe/downloader-threading-fixes
eth/downloader: fix #910, thread safe peers & polishes
2015-05-11 08:16:37 -07:00