Try   HackMD

Ethereum Protocol Fellowship 14th week update

Here is my mentor's (@https://github.com/MariusVanDerWijden) implementation based on the version I pushed before.

https://github.com/ethereum/go-ethereum/compare/masterMariusVanDerWijden:txpool-attacks?expand=1

The previous attack defenses are being tested on the real network and the refactor and benchmarking results are not significantly worse than the current version:

name                          old time/op    new time/op    delta
ListAdd-24                      83.5ms ± 2%   128.5ms ± 0%   ~     (p=0.333 n=2+2)
PendingDemotion100-24           85.8ns ± 0%    84.9ns ± 1%   ~     (p=0.667 n=2+2)
PendingDemotion1000-24          82.2ns ± 2%    84.1ns ± 2%   ~     (p=0.667 n=2+2)
PendingDemotion10000-24         82.3ns ± 1%    84.7ns ± 0%   ~     (p=0.333 n=2+2)
FuturePromotion100-24           1.99ns ± 1%    2.07ns ± 0%   ~     (p=0.333 n=2+2)
FuturePromotion1000-24          1.96ns ± 1%    1.96ns ± 1%   ~     (p=0.667 n=2+2)
FuturePromotion10000-24         1.99ns ± 1%    1.95ns ± 1%   ~     (p=0.667 n=2+2)
BatchInsert100-24               11.7ms ± 0%    12.0ms ± 3%   ~     (p=1.000 n=2+2)
BatchInsert1000-24              85.0ms ± 1%    83.2ms ± 3%   ~     (p=0.667 n=2+2)
BatchInsert10000-24              605ms ± 0%     615ms ± 1%   ~     (p=0.333 n=2+2)
BatchLocalInsert100-24          9.85ms ± 2%    9.84ms ± 2%   ~     (p=1.000 n=2+2)
BatchLocalInsert1000-24         86.1ms ± 3%    88.0ms ± 0%   ~     (p=1.000 n=2+2)
BatchLocalInsert10000-24         772ms ± 3%     770ms ± 0%   ~     (p=1.000 n=2+2)
InsertRemoteWithAllLocals-24    27.0ms ± 2%    26.2ms ± 1%   ~     (p=0.333 n=2+2)
MultiAccountBatchInsert-24       190µs ± 4%     182µs ± 5%   ~     (p=0.667 n=2+2)

name                          old alloc/op   new alloc/op   delta
ListAdd-24                      31.2MB ± 0%    55.2MB ± 0%   ~     (p=0.333 n=2+2)
PendingDemotion100-24            0.00B          0.00B        ~     (all equal)
PendingDemotion1000-24           0.00B          0.00B        ~     (all equal)
PendingDemotion10000-24          0.00B          0.00B        ~     (all equal)
FuturePromotion100-24            0.00B          0.00B        ~     (all equal)
FuturePromotion1000-24           0.00B          0.00B        ~     (all equal)
FuturePromotion10000-24          0.00B          0.00B        ~     (all equal)
BatchInsert100-24                299kB ± 0%     341kB ± 1%   ~     (p=0.333 n=2+2)
BatchInsert1000-24              2.98MB ± 0%    3.37MB ± 0%   ~     (p=0.333 n=2+2)
BatchInsert10000-24             24.9MB ± 0%    26.8MB ± 0%   ~     (p=0.333 n=2+2)
BatchLocalInsert100-24          2.30MB ± 3%    2.53MB ± 2%   ~     (p=0.333 n=2+2)
BatchLocalInsert1000-24         36.4MB ± 0%    38.9MB ± 5%   ~     (p=0.333 n=2+2)
BatchLocalInsert10000-24         437MB ± 0%     444MB ± 0%   ~     (p=0.333 n=2+2)
InsertRemoteWithAllLocals-24    5.93MB ± 3%    5.53MB ± 3%   ~     (p=0.333 n=2+2)
MultiAccountBatchInsert-24      14.4kB ±11%    17.2kB ± 3%   ~     (p=0.333 n=2+2)

name                          old allocs/op  new allocs/op  delta
ListAdd-24                       1.70M ± 0%     2.90M ± 0%   ~     (p=0.333 n=2+2)
PendingDemotion100-24             0.00           0.00        ~     (all equal)
PendingDemotion1000-24            0.00           0.00        ~     (all equal)
PendingDemotion10000-24           0.00           0.00        ~     (all equal)
FuturePromotion100-24             0.00           0.00        ~     (all equal)
FuturePromotion1000-24            0.00           0.00        ~     (all equal)
FuturePromotion10000-24           0.00           0.00        ~     (all equal)
BatchInsert100-24                5.92k ± 0%     7.68k ± 1%   ~     (p=0.333 n=2+2)
BatchInsert1000-24               57.7k ± 0%     74.1k ± 0%   ~     (p=0.333 n=2+2)
BatchInsert10000-24               508k ± 0%      583k ± 0%   ~     (p=0.333 n=2+2)
BatchLocalInsert100-24           6.25k ± 0%     8.88k ± 0%   ~     (p=0.333 n=2+2)
BatchLocalInsert1000-24          61.9k ± 0%     88.9k ± 0%   ~     (p=0.333 n=2+2)
BatchLocalInsert10000-24          618k ± 0%      877k ± 0%   ~     (p=0.333 n=2+2)
InsertRemoteWithAllLocals-24     46.0k ± 0%     59.8k ± 0%   ~     (p=0.333 n=2+2)
MultiAccountBatchInsert-24         104 ± 4%       118 ± 1%   ~     (p=0.333 n=2+2)

We both think the ED3 part needs more thinking and will work on it in the future.