Compare commits
634 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2662d1925e | ||
|
|
d961010f63 | ||
|
|
6885be06a4 | ||
|
|
aa0a703e7c | ||
|
|
748eda2aac | ||
|
|
fabec3e3f1 | ||
|
|
d688869035 | ||
|
|
90fccf9651 | ||
|
|
1b3787040b | ||
|
|
c253e1f33e | ||
|
|
5923146210 | ||
|
|
9e28241b29 | ||
|
|
f22326ef81 | ||
|
|
46f995ceb2 | ||
|
|
713fc9ff94 | ||
|
|
a9214081c0 | ||
|
|
d8a0d38229 | ||
|
|
ea8e7fcf73 | ||
|
|
73354d8d93 | ||
|
|
87e1080581 | ||
|
|
e95bbe36cb | ||
|
|
b6afc81d69 | ||
|
|
b8d9b6f826 | ||
|
|
424b38a8d7 | ||
|
|
5bd6b208af | ||
|
|
23a23e7a18 | ||
|
|
9d8e6ee4c9 | ||
|
|
280894691e | ||
|
|
b9f9d11929 | ||
|
|
860ef19e95 | ||
|
|
f8f22245ec | ||
|
|
e14d68e559 | ||
|
|
2b1d148ceb | ||
|
|
f6909d8243 | ||
|
|
fd29926a21 | ||
|
|
63535860bc | ||
|
|
6e76be7fad | ||
|
|
ae74e8df78 | ||
|
|
4fa78e0537 | ||
|
|
f1f64930cf | ||
|
|
4c6b282bee | ||
|
|
07e3a7f3d4 | ||
|
|
64295fde62 | ||
|
|
a6350c65aa | ||
|
|
36c917eb7a | ||
|
|
cfe57633fa | ||
|
|
80a83c95d3 | ||
|
|
f6c3d4c695 | ||
|
|
2895e3b2ab | ||
|
|
f2f4217e3c | ||
|
|
4c3be46f93 | ||
|
|
71f4f61146 | ||
|
|
a016dc5c6c | ||
|
|
cf2cb58e1d | ||
|
|
dcb69ba353 | ||
|
|
1b0948d9d1 | ||
|
|
6e34ee6837 | ||
|
|
1986c4ee79 | ||
|
|
df1c5ac616 | ||
|
|
c7219aae30 | ||
|
|
ee01612768 | ||
|
|
e0091c672a | ||
|
|
82c3265858 | ||
|
|
93f700d961 | ||
|
|
eb565a7e2b | ||
|
|
e194a2c6e3 | ||
|
|
db1ea1dcd8 | ||
|
|
9d55f0b4ab | ||
|
|
887aa62fdb | ||
|
|
8adde605e9 | ||
|
|
5fdf6be798 | ||
|
|
1b4d23fd20 | ||
|
|
43dc9af03b | ||
|
|
13729a0f7f | ||
|
|
80754c3426 | ||
|
|
8c2199dd2a | ||
|
|
6b17e321df | ||
|
|
f743829759 | ||
|
|
29c364be43 | ||
|
|
6993ec9531 | ||
|
|
0d3423cbe0 | ||
|
|
293e06e0f4 | ||
|
|
e0e79fdee0 | ||
|
|
2c97bcc1a4 | ||
|
|
c4ca84cdf3 | ||
|
|
ffeaee778c | ||
|
|
acf7c48d7e | ||
|
|
834585d61b | ||
|
|
81ca599f2a | ||
|
|
20bd1fa789 | ||
|
|
6960d35abb | ||
|
|
c8b4373e13 | ||
|
|
2d2513b35a | ||
|
|
3696f68626 | ||
|
|
ff697b64b3 | ||
|
|
9c8b7c23d1 | ||
|
|
f99819d326 | ||
|
|
6b57429d72 | ||
|
|
f59ed47b1b | ||
|
|
aefa8d5f59 | ||
|
|
f3015ce0c6 | ||
|
|
4f25d43516 | ||
|
|
9d313e31e6 | ||
|
|
330cdc1a4d | ||
|
|
93fbbb9aaf | ||
|
|
a404dd5415 | ||
|
|
11c447dfbe | ||
|
|
f48780c29b | ||
|
|
35513b14de | ||
|
|
63c7ae9a89 | ||
|
|
b31bff5ce2 | ||
|
|
4fd1ec643f | ||
|
|
79aeb95272 | ||
|
|
ca329078f5 | ||
|
|
acc5bdfc35 | ||
|
|
79a17dedd0 | ||
|
|
0c0f965354 | ||
|
|
0bd2979c04 | ||
|
|
f24bff5998 | ||
|
|
ad633de6d9 | ||
|
|
d243b15ae0 | ||
|
|
fcd042a487 | ||
|
|
1b1b44bb20 | ||
|
|
8471b91002 | ||
|
|
4979c62bb5 | ||
|
|
2b8b8851ab | ||
|
|
7c5fd042f3 | ||
|
|
d9201aa6f2 | ||
|
|
7f5ac8ba7a | ||
|
|
fc22c58408 | ||
|
|
2627288311 | ||
|
|
19184e8529 | ||
|
|
b6415c6196 | ||
|
|
acad59b300 | ||
|
|
0051c26acf | ||
|
|
bceb1d5691 | ||
|
|
61a7c30ed5 | ||
|
|
0659cb8592 | ||
|
|
a665116eb1 | ||
|
|
0bd2348ca1 | ||
|
|
eb81168674 | ||
|
|
ad9a53f486 | ||
|
|
5e2def1b23 | ||
|
|
240ef46c72 | ||
|
|
f4d14e271f | ||
|
|
48629c2bd4 | ||
|
|
d311bebaee | ||
|
|
fc9a2933af | ||
|
|
feb87c901e | ||
|
|
d8d7abc848 | ||
|
|
80f0e4b58f | ||
|
|
53e590f54b | ||
|
|
a4969ca498 | ||
|
|
680807e601 | ||
|
|
a89bbfe366 | ||
|
|
44c00b1f74 | ||
|
|
11d3cb3f08 | ||
|
|
8c286125e6 | ||
|
|
d193ddde19 | ||
|
|
396ccdbcc1 | ||
|
|
a9cb572238 | ||
|
|
05f9606bf2 | ||
|
|
00124b5a4b | ||
|
|
dabfa2c663 | ||
|
|
3420c2bac0 | ||
|
|
4f12d7ad12 | ||
|
|
5ce249ac64 | ||
|
|
cd26526868 | ||
|
|
974b24549b | ||
|
|
dab2a6bd4b | ||
|
|
505e284932 | ||
|
|
b1e3acaf0c | ||
|
|
fbf425c4e2 | ||
|
|
79b671f6c7 | ||
|
|
2af3140a26 | ||
|
|
efb390eb60 | ||
|
|
175051bac7 | ||
|
|
0a654afecc | ||
|
|
66e4410be7 | ||
|
|
bd1a578f93 | ||
|
|
6a9de9b11e | ||
|
|
1ba4df08f9 | ||
|
|
abb2a8c5a2 | ||
|
|
fd75491103 | ||
|
|
ef47426a93 | ||
|
|
5807402a0b | ||
|
|
e50eafe6e1 | ||
|
|
a23f5b8fd9 | ||
|
|
bd2e4f9c13 | ||
|
|
e551122ab9 | ||
|
|
73f4564b66 | ||
|
|
509fda727b | ||
|
|
ffc066e5a4 | ||
|
|
cafdfa8107 | ||
|
|
49f219451b | ||
|
|
45978bc2bd | ||
|
|
c689495826 | ||
|
|
46954527e7 | ||
|
|
72279856cd | ||
|
|
13ccb9f827 | ||
|
|
1503348782 | ||
|
|
5de32a70da | ||
|
|
8e0c522931 | ||
|
|
6c7d0fef4e | ||
|
|
12256a1e97 | ||
|
|
ec90fc47bc | ||
|
|
ee9bfac625 | ||
|
|
27786f014c | ||
|
|
8099efe215 | ||
|
|
cc796a232a | ||
|
|
d1b28bf57e | ||
|
|
acb1243214 | ||
|
|
fa1f81b5a3 | ||
|
|
1ef9d5b52f | ||
|
|
7f707fa524 | ||
|
|
c62e97d3c4 | ||
|
|
27d1c2d7d1 | ||
|
|
e3665ed9e3 | ||
|
|
14e7641835 | ||
|
|
5baa7e8fb5 | ||
|
|
cfe826fae9 | ||
|
|
5a131175e8 | ||
|
|
d850eb0dd5 | ||
|
|
34cdeac2a6 | ||
|
|
f53c3e582c | ||
|
|
fdc7b0fdaa | ||
|
|
0f337171bf | ||
|
|
073d242d1e | ||
|
|
44cc442d12 | ||
|
|
d5c19bae1c | ||
|
|
88e0cfe5ca | ||
|
|
141f6a047e | ||
|
|
fe7bc545bf | ||
|
|
c4c5d79a0f | ||
|
|
0a9095626d | ||
|
|
a6e96b052e | ||
|
|
86ef490a94 | ||
|
|
b97bf81adf | ||
|
|
d5584a01c7 | ||
|
|
d83798db62 | ||
|
|
4bb517ec94 | ||
|
|
de906d4afd | ||
|
|
fafb534cd3 | ||
|
|
a5a06e49ba | ||
|
|
9f96fa0a73 | ||
|
|
bbae075c60 | ||
|
|
bacc0f0b9a | ||
|
|
582a4ea339 | ||
|
|
09edb94d53 | ||
|
|
02e33c4f91 | ||
|
|
8d24b4e804 | ||
|
|
895574b774 | ||
|
|
b4af8df535 | ||
|
|
5f064a9076 | ||
|
|
5b30f22011 | ||
|
|
9d9e2b43f2 | ||
|
|
5dc5be1e58 | ||
|
|
306c1764eb | ||
|
|
f6a390849b | ||
|
|
cd088a4345 | ||
|
|
bd9a8aa22b | ||
|
|
8fc504eb1a | ||
|
|
c1b3d5fe1a | ||
|
|
e53bf9a95e | ||
|
|
decc9eaa85 | ||
|
|
3f61f2d8d9 | ||
|
|
7f02a08741 | ||
|
|
cff1bc88fa | ||
|
|
59f0eb7e6b | ||
|
|
a729ca3223 | ||
|
|
afe14b42e2 | ||
|
|
62832c93b0 | ||
|
|
1887080990 | ||
|
|
edc38c2cee | ||
|
|
16e0ad1288 | ||
|
|
5a561997cf | ||
|
|
413442d7be | ||
|
|
4489ca0a38 | ||
|
|
3a2c173fe1 | ||
|
|
9c051ab756 | ||
|
|
63221c5152 | ||
|
|
8714a40d84 | ||
|
|
825c7990f2 | ||
|
|
d743df549b | ||
|
|
6022c47b53 | ||
|
|
02eb046774 | ||
|
|
f2dd032884 | ||
|
|
55c046cb88 | ||
|
|
7701f73cdf | ||
|
|
213e007a4b | ||
|
|
78d0a8696f | ||
|
|
e1333ea1e9 | ||
|
|
4ee217ba7c | ||
|
|
6fc5014b4d | ||
|
|
859a41308c | ||
|
|
d2120ded56 | ||
|
|
be5db14160 | ||
|
|
1786b6eedd | ||
|
|
2d693be735 | ||
|
|
35c607f6be | ||
|
|
20248c443b | ||
|
|
bf55db4c7e | ||
|
|
dbdb57a8c0 | ||
|
|
78a1d8b7b4 | ||
|
|
1c076af5ee | ||
|
|
bf4fa658f3 | ||
|
|
5da8da68cc | ||
|
|
083dcc369b | ||
|
|
7827cc048e | ||
|
|
9de1afeeb6 | ||
|
|
eed630a002 | ||
|
|
6be45367e9 | ||
|
|
f7dae48c17 | ||
|
|
44161874ff | ||
|
|
faf6f1f9ea | ||
|
|
425dcd45c2 | ||
|
|
dae5d75dd6 | ||
|
|
33d3bfae8b | ||
|
|
7e89bab4aa | ||
|
|
9584faee55 | ||
|
|
9bbf8b6c0f | ||
|
|
bf242552f3 | ||
|
|
752031a657 | ||
|
|
d250f348a3 | ||
|
|
26d1303034 | ||
|
|
89987745f6 | ||
|
|
c31ffab22e | ||
|
|
21a27fee9f | ||
|
|
10c121a299 | ||
|
|
67e75e1da1 | ||
|
|
412e2ce3a0 | ||
|
|
73f2ff38ec | ||
|
|
981ad0bc53 | ||
|
|
5a581c1c90 | ||
|
|
87699f8de0 | ||
|
|
42268fd1ef | ||
|
|
2cf0d7d775 | ||
|
|
de91a5532d | ||
|
|
e91eb337c9 | ||
|
|
8dfa46f4f0 | ||
|
|
e04a2f926a | ||
|
|
98b89c8e4f | ||
|
|
b30b54e446 | ||
|
|
4723ea69a1 | ||
|
|
64fd64fd6b | ||
|
|
28eb05f032 | ||
|
|
969a9815e4 | ||
|
|
4cc274e75f | ||
|
|
c5fa7aab43 | ||
|
|
e7cdad6146 | ||
|
|
92e770e916 | ||
|
|
6fcd775d48 | ||
|
|
944bf6a59e | ||
|
|
90a7ca9d10 | ||
|
|
9e2b2b361c | ||
|
|
08f0573fb5 | ||
|
|
8132d38b50 | ||
|
|
10e1787ad1 | ||
|
|
69085aa282 | ||
|
|
fba63de974 | ||
|
|
288d73789a | ||
|
|
002496603c | ||
|
|
d9673b0d6b | ||
|
|
89f828be1c | ||
|
|
ec56b1f09d | ||
|
|
95236d25b2 | ||
|
|
7b2afdfc8c | ||
|
|
440e52f410 | ||
|
|
8840a293dd | ||
|
|
89d627769e | ||
|
|
4e2e88a620 | ||
|
|
ebf51c0be0 | ||
|
|
04c6867660 | ||
|
|
0199acbece | ||
|
|
e4c2fe9e72 | ||
|
|
407de5e8c4 | ||
|
|
7d26a82232 | ||
|
|
3b23817936 | ||
|
|
aa8487c1d0 | ||
|
|
9cb8606103 | ||
|
|
6cf3ba7efd | ||
|
|
023e511f83 | ||
|
|
17042e9c32 | ||
|
|
f2c34f7ca2 | ||
|
|
375a8daeb4 | ||
|
|
b700ff3501 | ||
|
|
9519493e32 | ||
|
|
037fd1b309 | ||
|
|
78a534633d | ||
|
|
effead9ba5 | ||
|
|
a8ee3c97e6 | ||
|
|
fb461659c7 | ||
|
|
a574df3132 | ||
|
|
d83143d0ba | ||
|
|
f875175325 | ||
|
|
c9db8ea21d | ||
|
|
a16bad4175 | ||
|
|
595dac6c3f | ||
|
|
82a148a99b | ||
|
|
4320c9bc4f | ||
|
|
23d977ecce | ||
|
|
ab27848dc4 | ||
|
|
742a6007fe | ||
|
|
91933d857d | ||
|
|
3e1d73126c | ||
|
|
7014642815 | ||
|
|
1bd4564216 | ||
|
|
97cb010df8 | ||
|
|
ed18c7b54c | ||
|
|
e71598d876 | ||
|
|
3d0ce10fa6 | ||
|
|
cfc8df156b | ||
|
|
94cb3b6e0e | ||
|
|
fefec000fb | ||
|
|
c7ded6a785 | ||
|
|
2fbb952cdd | ||
|
|
e2ab3e4f5b | ||
|
|
1871275ecd | ||
|
|
afc1b72611 | ||
|
|
c5c3fb6a75 | ||
|
|
bceb883d99 | ||
|
|
fcccbf3b75 | ||
|
|
9ad71b7baa | ||
|
|
4311d43497 | ||
|
|
0815cc3b83 | ||
|
|
b21844b371 | ||
|
|
f825048efa | ||
|
|
2cbffe36e2 | ||
|
|
6bb106a784 | ||
|
|
4e0ec4e66b | ||
|
|
b58a3ed0ad | ||
|
|
b803f57db6 | ||
|
|
b457f46c81 | ||
|
|
b4520c5886 | ||
|
|
ca67dc251f | ||
|
|
aea289e79e | ||
|
|
ef0eda0c39 | ||
|
|
af7dc3676b | ||
|
|
fa570f297e | ||
|
|
9cce6a47d4 | ||
|
|
bff0bedfa9 | ||
|
|
d6c80c1672 | ||
|
|
512343003d | ||
|
|
3adb640d2b | ||
|
|
ea589a17a4 | ||
|
|
a3883ca5d9 | ||
|
|
5be0163cde | ||
|
|
55454b2f2d | ||
|
|
a4dc85543b | ||
|
|
d8394bded7 | ||
|
|
d89b8d904f | ||
|
|
8e866ee551 | ||
|
|
6dfc1bd474 | ||
|
|
c84e5745fa | ||
|
|
751d15e4be | ||
|
|
8b6c5be6a9 | ||
|
|
3502b36232 | ||
|
|
046b8bbc8a | ||
|
|
6fa4b2dec5 | ||
|
|
83bcb819da | ||
|
|
b7e8621846 | ||
|
|
d5c19f8719 | ||
|
|
8fa56add47 | ||
|
|
e45ee6cd72 | ||
|
|
e344286c32 | ||
|
|
45d7c60608 | ||
|
|
a3e39c9858 | ||
|
|
8ab6d89810 | ||
|
|
1b3b9b2887 | ||
|
|
89ae0f0ea0 | ||
|
|
06cae8a535 | ||
|
|
12ac992ffb | ||
|
|
3b23c2e86d | ||
|
|
0f9b2218da | ||
|
|
12c42bce9b | ||
|
|
eb3d33ed6f | ||
|
|
a139c6d216 | ||
|
|
50f5ccc4f2 | ||
|
|
94db961975 | ||
|
|
38f3747cde | ||
|
|
4fec2f2fc2 | ||
|
|
c96d8a742b | ||
|
|
c2de31e586 | ||
|
|
4b11d79829 | ||
|
|
c35abe4196 | ||
|
|
a9a278a6e1 | ||
|
|
fb07ffa676 | ||
|
|
940a88fa4e | ||
|
|
708e495c28 | ||
|
|
460681ead9 | ||
|
|
2a7ed457dc | ||
|
|
35bbf11ba5 | ||
|
|
4f1e1e8870 | ||
|
|
cf505139f1 | ||
|
|
cdba22a2cb | ||
|
|
1df6361753 | ||
|
|
a6c6c7c070 | ||
|
|
ed6f2877d7 | ||
|
|
53c408f549 | ||
|
|
64704c456f | ||
|
|
0edf8e3f1b | ||
|
|
53a04e1686 | ||
|
|
d356c6640d | ||
|
|
e8e087fc37 | ||
|
|
181738a736 | ||
|
|
1ac1224cd3 | ||
|
|
3687df8da2 | ||
|
|
67eee6aeb7 | ||
|
|
83ba9df85b | ||
|
|
83f706186f | ||
|
|
eea5f6f232 | ||
|
|
38af7f35fc | ||
|
|
eea3de00c1 | ||
|
|
4d66e8d06d | ||
|
|
010cfb7d67 | ||
|
|
f9a8aac036 | ||
|
|
3d28823be7 | ||
|
|
492317abd7 | ||
|
|
ab22d5e278 | ||
|
|
ce5f704dd5 | ||
|
|
696dc05dda | ||
|
|
589083ad7a | ||
|
|
1fda997370 | ||
|
|
7c335e8764 | ||
|
|
5b1d33d5fa | ||
|
|
e435407080 | ||
|
|
b180be7526 | ||
|
|
90fb473d87 | ||
|
|
3650f2d51c | ||
|
|
3090324366 | ||
|
|
130901e820 | ||
|
|
801b8191ef | ||
|
|
469f9c26e7 | ||
|
|
b5f510ead7 | ||
|
|
b4f8bba843 | ||
|
|
2bb79614f6 | ||
|
|
c077dc652d | ||
|
|
1b6f2a3e92 | ||
|
|
9136c81f05 | ||
|
|
912e5599d9 | ||
|
|
ff0095ac5e | ||
|
|
bf9fedc4ee | ||
|
|
78ba54da6b | ||
|
|
c90e279ab5 | ||
|
|
215602de08 | ||
|
|
13b832f959 | ||
|
|
789bb9c852 | ||
|
|
aada1f547b | ||
|
|
60718225ac | ||
|
|
1a2fc03083 | ||
|
|
61e8baee0c | ||
|
|
dbc5f55da9 | ||
|
|
81b7698428 | ||
|
|
4ce4bad383 | ||
|
|
23d25a079b | ||
|
|
d19bdb642e | ||
|
|
2e0246a6c2 | ||
|
|
349098e7b2 | ||
|
|
dc3b1ecdd0 | ||
|
|
7fb33796b1 | ||
|
|
ec886ddefb | ||
|
|
4ded4181a6 | ||
|
|
60691d03e0 | ||
|
|
869fa399b1 | ||
|
|
7af953fd62 | ||
|
|
5acbcb0d57 | ||
|
|
7000c394b2 | ||
|
|
7c0d894ccf | ||
|
|
f092c10de5 | ||
|
|
7f5e6b3a0a | ||
|
|
5e9dc185a5 | ||
|
|
0e94ac0111 | ||
|
|
0b5bbf6048 | ||
|
|
14c9cbd40e | ||
|
|
c4466878cf | ||
|
|
c584221fa2 | ||
|
|
70ba050c06 | ||
|
|
f2281dc38a | ||
|
|
18a2e6265d | ||
|
|
0d593199d0 | ||
|
|
832c4a7565 | ||
|
|
34d22a35dd | ||
|
|
c880716f16 | ||
|
|
f20f4c74d2 | ||
|
|
1fdfa1e6c6 | ||
|
|
4ee49f03df | ||
|
|
52d5278a62 | ||
|
|
35a2b87174 | ||
|
|
664bb2becd | ||
|
|
8865b95818 | ||
|
|
03600dce97 | ||
|
|
8b607efc40 | ||
|
|
9f1af6b3e8 | ||
|
|
c0952ba44b | ||
|
|
9475a2e474 | ||
|
|
5baed0c158 | ||
|
|
97c259858c | ||
|
|
0f90696528 | ||
|
|
ac974a180d | ||
|
|
052380b8de | ||
|
|
23a29439c0 | ||
|
|
a8617e2862 | ||
|
|
6945a6b320 | ||
|
|
b375c9adbf | ||
|
|
88a727739b | ||
|
|
5f3ae4dee3 | ||
|
|
5cbe834024 | ||
|
|
eea5b86cc4 | ||
|
|
09c512abaa | ||
|
|
d42d816e7f | ||
|
|
17effd15ab | ||
|
|
9982eba188 | ||
|
|
aafe527d4a | ||
|
|
e4c53a460e | ||
|
|
ca01596a65 | ||
|
|
4f2415b483 | ||
|
|
f680eacdf2 | ||
|
|
f6dcca3ebb | ||
|
|
1a642fc624 | ||
|
|
c4469514db | ||
|
|
59daf95859 | ||
|
|
3a6e04ba15 | ||
|
|
b26f86d6ff | ||
|
|
570215acae | ||
|
|
a511264433 | ||
|
|
06f25d2b27 | ||
|
|
a3bd355b16 | ||
|
|
1c1cd8b164 | ||
|
|
a898109522 | ||
|
|
3694b10e22 | ||
|
|
39f25d20a8 | ||
|
|
61c1646b43 | ||
|
|
1b9396dcbb | ||
|
|
05be4b5b0e |
@@ -1,3 +1,27 @@
|
|||||||
|
# NOTE: if you make changes here, remember to also update:
|
||||||
|
# scripts/test-linux.sh
|
||||||
|
# scripts/build-linux.sh
|
||||||
|
# scripts/build-windows.sh
|
||||||
|
|
||||||
|
# Using 'cfg` is broken, see https://github.com/rust-lang/cargo/issues/6858
|
||||||
|
#[target.'cfg(target_arch = "x86_64")']
|
||||||
|
#rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
|
# …so instead we list all target triples (Tier 1 64-bit platforms)
|
||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
[target.x86_64-pc-windows-msvc]
|
[target.x86_64-pc-windows-msvc]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
# Link the C runtime statically ; https://github.com/paritytech/parity-ethereum/issues/6643
|
# Link the C runtime statically ; https://github.com/paritytech/parity-ethereum/issues/6643
|
||||||
rustflags = ["-Ctarget-feature=+crt-static"]
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3", "-Ctarget-feature=+crt-static"]
|
||||||
|
|
||||||
|
[target.x86_64-apple-darwin]
|
||||||
|
# Enables the aes-ni instructions for RustCrypto dependency.
|
||||||
|
rustflags = ["-Ctarget-feature=+aes,+sse2,+ssse3"]
|
||||||
|
|
||||||
|
|||||||
37
.github/CONTRIBUTING.md
vendored
37
.github/CONTRIBUTING.md
vendored
@@ -24,7 +24,42 @@ Also, try to include **steps to reproduce** the issue and expand on the **actual
|
|||||||
|
|
||||||
If you would like to contribute to Parity Ethereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/paritytech/parity-ethereum/compare).
|
If you would like to contribute to Parity Ethereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/paritytech/parity-ethereum/compare).
|
||||||
|
|
||||||
Please, refer to the [Coding Guide](https://wiki.parity.io/Coding-guide) in our wiki for more details about hacking on Parity.
|
### Labels & Milestones
|
||||||
|
|
||||||
|
We use [labels](https://github.com/paritytech/parity-ethereum/labels) to manage PRs and issues and communicate the state of a PR. Please familiarize yourself with them. Furthermore we are organizing issues in [milestones](https://github.com/paritytech/parity-ethereum/milestones). Best way to get started is to a pick a ticket from the current milestone tagged [`easy`](https://github.com/paritytech/parity-ethereum/labels/Q2-easy%20%F0%9F%92%83) and get going, or [`mentor`](https://github.com/paritytech/parity-ethereum/labels/Q1-mentor%20%F0%9F%95%BA) and get in contact with the mentor offering their support on that larger task.
|
||||||
|
|
||||||
|
### Rules
|
||||||
|
|
||||||
|
There are a few basic ground-rules for contributors (including the maintainer(s) of the project):
|
||||||
|
|
||||||
|
* **No pushing directly to the master branch**.
|
||||||
|
* **All modifications** must be made in a **pull-request** to solicit feedback from other contributors.
|
||||||
|
* Pull-requests cannot be merged before CI runs green and two reviewers have given their approval.
|
||||||
|
* Contributors should adhere to the [Parity Ethereum Style Guide](https://wiki.parity.io/Parity-Ethereum-Style-Guide).
|
||||||
|
|
||||||
|
### Recommendations
|
||||||
|
|
||||||
|
* **Non-master branch names** *should* be prefixed with a short name moniker, followed by the associated Github Issue ID (if any), and a brief description of the task using the format `<GITHUB_USERNAME>-<ISSUE_ID>-<BRIEF_DESCRIPTION>` (e.g. `gavin-123-readme`). The name moniker helps people to inquiry about their unfinished work, and the GitHub Issue ID helps your future self and other developers (particularly those who are onboarding) find out about and understand the original scope of the task, and where it fits into Parity Ethereum [Projects](https://github.com/paritytech/parity-ethereum/projects).
|
||||||
|
* **Remove stale branches periodically**
|
||||||
|
|
||||||
|
### Preparing Pull Requests
|
||||||
|
|
||||||
|
* If your PR does not alter any logic (e.g. comments, dependencies, docs), then it may be tagged [`insubstantial`](https://github.com/paritytech/parity-ethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22).
|
||||||
|
|
||||||
|
* Once a PR is ready for review please add the [`pleasereview`](https://github.com/paritytech/parity-ethereum/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3A%22A0-pleasereview+%F0%9F%A4%93%22+) label.
|
||||||
|
|
||||||
|
### Reviewing Pull Requests*:
|
||||||
|
|
||||||
|
* At least two reviewers are required to review PRs (even for PRs tagged [`insubstantial`](https://github.com/paritytech/parity-ethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22)).
|
||||||
|
|
||||||
|
When doing a review, make sure to look for any:
|
||||||
|
|
||||||
|
* Buggy behavior.
|
||||||
|
* Undue maintenance burden.
|
||||||
|
* Breaking with house coding style.
|
||||||
|
* Pessimization (i.e. reduction of speed as measured in the projects benchmarks).
|
||||||
|
* Breaking changes should be carefuly reviewed and tagged as such so they end up in the [changelog](../CHANGELOG.md).
|
||||||
|
* Uselessness (i.e. it does not strictly add a feature or fix a known issue).
|
||||||
|
|
||||||
## License.
|
## License.
|
||||||
|
|
||||||
|
|||||||
6
.github/ISSUE_TEMPLATE.md
vendored
6
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,10 +1,14 @@
|
|||||||
_Before filing a new issue, please **provide the following information**._
|
_Before filing a new issue, please **provide the following information**._
|
||||||
|
|
||||||
|
_If you think that your issue is an exploitable security vulnerability, please mail your bugreport to security@parity.io instead; your submission might be eligible for our Bug Bounty._
|
||||||
|
_You can find mode info on the reporting process in [SECURITY.md](https://github.com/paritytech/parity-ethereum/blob/master/SECURITY.md)_
|
||||||
|
|
||||||
|
|
||||||
- **Parity Ethereum version**: 0.0.0
|
- **Parity Ethereum version**: 0.0.0
|
||||||
- **Operating system**: Windows / MacOS / Linux
|
- **Operating system**: Windows / MacOS / Linux
|
||||||
- **Installation**: homebrew / one-line installer / built from source
|
- **Installation**: homebrew / one-line installer / built from source
|
||||||
- **Fully synchronized**: no / yes
|
- **Fully synchronized**: no / yes
|
||||||
- **Network**: ethereum / ropsten / kovan / ...
|
- **Network**: ethereum / ropsten / goerli / ...
|
||||||
- **Restarted**: no / yes
|
- **Restarted**: no / yes
|
||||||
|
|
||||||
_Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._
|
_Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._
|
||||||
|
|||||||
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
Thank you for your Pull Request!
|
||||||
|
|
||||||
|
Before you submitting, please check that:
|
||||||
|
|
||||||
|
- [ ] You added a brief description of the PR, e.g.:
|
||||||
|
- What does it do?
|
||||||
|
- What important points reviewers should know?
|
||||||
|
- Is there something left for follow-up PRs?
|
||||||
|
- [ ] You labeled the PR with appropriate labels if you have permissions to do so.
|
||||||
|
- [ ] You mentioned a related issue if this PR related to it, e.g. `Fixes #228` or `Related #1337`.
|
||||||
|
- [ ] You asked any particular reviewers to review. If you aren't sure, start with GH suggestions.
|
||||||
|
- [ ] Your PR adheres [the style guide](https://wiki.parity.io/Coding-guide)
|
||||||
|
- In particular, mind the maximal line length.
|
||||||
|
- There is no commented code checked in unless necessary.
|
||||||
|
- Any panickers have a proof or removed.
|
||||||
|
- [ ] You updated any rustdocs which may have changed
|
||||||
|
|
||||||
|
After you've read this notice feel free to remove it.
|
||||||
|
Thank you!
|
||||||
|
|
||||||
|
✄ -----------------------------------------------------------------------------
|
||||||
353
.gitlab-ci.yml
353
.gitlab-ci.yml
@@ -4,152 +4,353 @@ stages:
|
|||||||
- publish
|
- publish
|
||||||
- optional
|
- optional
|
||||||
|
|
||||||
image: parity/rust:gitlab-ci
|
image: ${REGISTRY}/parity-ci-linux:latest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
|
GIT_STRATEGY: fetch
|
||||||
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
|
GIT_DEPTH: 3
|
||||||
CI_SERVER_NAME: "GitLab CI"
|
CI_SERVER_NAME: "GitLab CI"
|
||||||
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
|
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
|
||||||
CARGO_TARGET: x86_64-unknown-linux-gnu
|
CARGO_TARGET: x86_64-unknown-linux-gnu
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
REGISTRY: registry.parity.io/parity/infrastructure/scripts
|
||||||
|
|
||||||
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
|
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
|
||||||
only: &releaseable_branches
|
only: &releaseable_branches
|
||||||
- stable
|
- stable
|
||||||
- beta
|
|
||||||
- tags
|
- tags
|
||||||
- schedules
|
- schedules
|
||||||
|
|
||||||
|
|
||||||
.collect_artifacts: &collect_artifacts
|
.collect_artifacts: &collect_artifacts
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
|
name: "${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}"
|
||||||
when: on_success
|
when: on_success
|
||||||
expire_in: 1 mos
|
expire_in: 1 mos
|
||||||
paths:
|
paths:
|
||||||
- artifacts/
|
- artifacts/
|
||||||
|
- tools/
|
||||||
|
|
||||||
.determine_version: &determine_version
|
.docker-cache-status: &docker-cache-status
|
||||||
- VERSION="$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' Cargo.toml)"
|
dependencies: []
|
||||||
- DATE_STR="$(date +%Y%m%d)"
|
interruptible: true
|
||||||
- ID_SHORT="$(echo ${CI_COMMIT_SHA} | cut -c 1-7)"
|
before_script:
|
||||||
- test "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" = "nightly" && VERSION="${VERSION}-${ID_SHORT}-${DATE_STR}"
|
- rustup show
|
||||||
- export VERSION
|
- cargo --version
|
||||||
- echo "Version = ${VERSION}"
|
retry:
|
||||||
|
max: 2
|
||||||
|
when:
|
||||||
|
- runner_system_failure
|
||||||
|
- unknown_failure
|
||||||
|
- api_failure
|
||||||
|
tags:
|
||||||
|
- linux-docker
|
||||||
|
|
||||||
|
.build-on-linux: &build-on-linux
|
||||||
|
stage: build
|
||||||
|
<<: *docker-cache-status
|
||||||
|
<<: *collect_artifacts
|
||||||
|
script:
|
||||||
|
- scripts/gitlab/build-linux.sh
|
||||||
|
after_script:
|
||||||
|
- mkdir -p tools
|
||||||
|
- cp -r scripts/docker/hub/* ./tools
|
||||||
|
- cp scripts/gitlab/publish-snap.sh ./tools
|
||||||
|
- cp scripts/gitlab/publish-onchain.sh ./tools
|
||||||
|
- cp scripts/gitlab/safe-curl.sh ./tools
|
||||||
|
- echo v"$(sed -r -n '1,/^version/s/^version\s*=\s*"([^"]+)".*$/\1/p' Cargo.toml)" |
|
||||||
|
tee ./tools/VERSION
|
||||||
|
- echo "$(sed -r -n '1,/^track/s/^track\s*=\s*"([^"]+)".*$/\1/p' ./util/version/Cargo.toml)" |
|
||||||
|
tee ./tools/TRACK
|
||||||
|
|
||||||
|
|
||||||
|
cargo-check 0 3:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check --target $CARGO_TARGET --locked --no-default-features --verbose --color=always
|
||||||
|
- sccache --show-stats
|
||||||
|
|
||||||
|
cargo-check 1 3:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose --color=always
|
||||||
|
- sccache --show-stats
|
||||||
|
|
||||||
|
cargo-check 2 3:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose --color=always
|
||||||
|
- sccache --show-stats
|
||||||
|
|
||||||
|
cargo-check-evmbin:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check -p evmbin --target $CARGO_TARGET --locked --verbose --color=always
|
||||||
|
- sccache --show-stats
|
||||||
|
|
||||||
|
cargo-check-benches:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- time cargo check --all --benches --target $CARGO_TARGET --locked --verbose --color=always
|
||||||
|
- sccache --show-stats
|
||||||
|
|
||||||
|
cargo-audit:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- cargo audit
|
||||||
|
allow_failure: true # failed cargo audit shouldn't prevent a PR from being merged
|
||||||
|
|
||||||
|
validate-chainspecs:
|
||||||
|
stage: test
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- ./scripts/gitlab/validate-chainspecs.sh
|
||||||
|
|
||||||
test-linux:
|
test-linux:
|
||||||
stage: test
|
stage: build
|
||||||
variables:
|
<<: *docker-cache-status
|
||||||
RUN_TESTS: all
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/test-all.sh stable
|
- ./scripts/gitlab/test-linux.sh stable
|
||||||
tags:
|
|
||||||
- rust-stable
|
|
||||||
|
|
||||||
test-audit:
|
test-linux-beta:
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/cargo-audit.sh
|
|
||||||
tags:
|
|
||||||
- rust-stable
|
|
||||||
|
|
||||||
build-linux:
|
|
||||||
stage: build
|
stage: build
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
variables:
|
<<: *docker-cache-status
|
||||||
CARGO_TARGET: x86_64-unknown-linux-gnu
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/build-unix.sh
|
- ./scripts/gitlab/test-linux.sh beta
|
||||||
<<: *collect_artifacts
|
|
||||||
tags:
|
test-linux-nightly:
|
||||||
- rust-stable
|
stage: build
|
||||||
|
only: *releaseable_branches
|
||||||
|
<<: *docker-cache-status
|
||||||
|
script:
|
||||||
|
- ./scripts/gitlab/test-linux.sh nightly
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
|
||||||
|
build-linux-i386:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
image: ${REGISTRY}/parity-ci-i386:latest
|
||||||
|
variables:
|
||||||
|
CARGO_TARGET: i686-unknown-linux-gnu
|
||||||
|
|
||||||
|
build-linux-arm64:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
image: ${REGISTRY}/parity-ci-arm64:latest
|
||||||
|
variables:
|
||||||
|
CARGO_TARGET: aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
|
build-linux-armhf:
|
||||||
|
<<: *build-on-linux
|
||||||
|
only: *releaseable_branches
|
||||||
|
image: ${REGISTRY}/parity-ci-armhf:latest
|
||||||
|
variables:
|
||||||
|
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
||||||
|
|
||||||
build-darwin:
|
build-darwin:
|
||||||
stage: build
|
stage: build
|
||||||
|
<<: *collect_artifacts
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
variables:
|
variables:
|
||||||
CARGO_TARGET: x86_64-apple-darwin
|
CARGO_TARGET: x86_64-apple-darwin
|
||||||
CC: gcc
|
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
|
||||||
CXX: g++
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/build-unix.sh
|
- scripts/gitlab/build-linux.sh
|
||||||
tags:
|
tags:
|
||||||
- rust-osx
|
- rust-osx
|
||||||
<<: *collect_artifacts
|
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
stage: build
|
stage: build
|
||||||
|
<<: *collect_artifacts
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
variables:
|
variables:
|
||||||
CARGO_TARGET: x86_64-pc-windows-msvc
|
CARGO_TARGET: x86_64-pc-windows-msvc
|
||||||
|
CARGO_HOME: "C:/ci-cache/parity-ethereum/cargo/$CI_JOB_NAME"
|
||||||
|
GIT_SUBMODULE_STRATEGY: none
|
||||||
script:
|
script:
|
||||||
- sh scripts/gitlab/build-windows.sh
|
- sh scripts/gitlab/build-windows.sh
|
||||||
tags:
|
tags:
|
||||||
- rust-windows
|
- rust-windows
|
||||||
<<: *collect_artifacts
|
|
||||||
|
|
||||||
publish-docker:
|
publish-docker:
|
||||||
stage: publish
|
stage: publish
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
cache: {}
|
except:
|
||||||
|
- nightly
|
||||||
|
when: manual
|
||||||
|
dependencies:
|
||||||
|
- build-linux
|
||||||
|
environment:
|
||||||
|
name: parity-build
|
||||||
|
cache: {}
|
||||||
|
image: docker:stable
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
DOCKER_HOST: tcp://localhost:2375
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
# DOCKERFILE: tools/Dockerfile
|
||||||
|
# CONTAINER_IMAGE: parity/parity
|
||||||
|
script:
|
||||||
|
- ./tools/publish-docker.sh
|
||||||
|
tags:
|
||||||
|
- kubernetes-parity-build
|
||||||
|
|
||||||
|
publish-snap-nightly: &publish-snap
|
||||||
|
stage: publish
|
||||||
|
only:
|
||||||
|
- nightly
|
||||||
|
image: snapcore/snapcraft
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
BUILD_ARCH: amd64
|
||||||
|
cache: {}
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-linux
|
- build-linux
|
||||||
tags:
|
tags:
|
||||||
- shell
|
- linux-docker
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/publish-docker.sh parity
|
- ./tools/publish-snap.sh
|
||||||
|
|
||||||
publish-awss3:
|
publish-snap-manually:
|
||||||
stage: publish
|
<<: *publish-snap
|
||||||
only: *releaseable_branches
|
only: *releaseable_branches
|
||||||
cache: {}
|
when: manual
|
||||||
|
|
||||||
|
publish-snap-i386-nightly: &publish-snap-i386
|
||||||
|
<<: *publish-snap
|
||||||
|
variables:
|
||||||
|
BUILD_ARCH: i386
|
||||||
|
CARGO_TARGET: i686-unknown-linux-gnu
|
||||||
|
dependencies:
|
||||||
|
- build-linux-i386
|
||||||
|
|
||||||
|
publish-snap-i386-manually:
|
||||||
|
<<: *publish-snap-i386
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-snap-arm64-nightly: &publish-snap-arm64
|
||||||
|
<<: *publish-snap
|
||||||
|
variables:
|
||||||
|
BUILD_ARCH: arm64
|
||||||
|
CARGO_TARGET: aarch64-unknown-linux-gnu
|
||||||
|
dependencies:
|
||||||
|
- build-linux-arm64
|
||||||
|
|
||||||
|
publish-snap-arm64-manually:
|
||||||
|
<<: *publish-snap-arm64
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-snap-armhf-nightly: &publish-snap-armhf
|
||||||
|
<<: *publish-snap
|
||||||
|
variables:
|
||||||
|
BUILD_ARCH: armhf
|
||||||
|
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
||||||
|
dependencies:
|
||||||
|
- build-linux-armhf
|
||||||
|
|
||||||
|
publish-snap-armhf-manually:
|
||||||
|
<<: *publish-snap-armhf
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-onchain-nightly: &publish-onchain
|
||||||
|
stage: publish
|
||||||
|
only:
|
||||||
|
- nightly
|
||||||
|
cache: {}
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-linux
|
- build-linux
|
||||||
- build-darwin
|
- build-darwin
|
||||||
- build-windows
|
- build-windows
|
||||||
before_script: *determine_version
|
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/publish-awss3.sh
|
- ./tools/publish-onchain.sh
|
||||||
tags:
|
tags:
|
||||||
- shell
|
- linux-docker
|
||||||
|
|
||||||
|
publish-onchain-manually:
|
||||||
|
<<: *publish-onchain
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
publish-release-awss3-nightly: &publish-release-awss3
|
||||||
|
image: ${REGISTRY}/awscli:latest
|
||||||
|
stage: publish
|
||||||
|
only:
|
||||||
|
- nightly
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
cache: {}
|
||||||
|
dependencies:
|
||||||
|
- build-linux
|
||||||
|
- build-darwin
|
||||||
|
- build-windows
|
||||||
|
script:
|
||||||
|
- echo "__________Push binaries to AWS S3____________"
|
||||||
|
- case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in
|
||||||
|
(stable|nightly)
|
||||||
|
export BUCKET=releases.parity.io/ethereum;
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
|
export BUCKET=builds-parity;
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
- aws s3 sync ./artifacts s3://${BUCKET}/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/
|
||||||
|
- echo "__________Read from S3____________"
|
||||||
|
- aws s3 ls s3://${BUCKET}/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}} --recursive --human-readable --summarize
|
||||||
|
tags:
|
||||||
|
- linux-docker
|
||||||
|
|
||||||
|
publish-release-awss3-manually:
|
||||||
|
<<: *publish-release-awss3
|
||||||
|
only: *releaseable_branches
|
||||||
|
when: manual
|
||||||
|
|
||||||
publish-docs:
|
publish-docs:
|
||||||
stage: publish
|
stage: publish
|
||||||
|
image: ${REGISTRY}/parity-ci-docs:latest
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
except:
|
except:
|
||||||
- nightly
|
- nightly
|
||||||
cache: {}
|
when: manual
|
||||||
|
cache: {}
|
||||||
|
dependencies: []
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/publish-docs.sh
|
- scripts/gitlab/publish-docs.sh
|
||||||
tags:
|
tags:
|
||||||
- shell
|
- linux-docker
|
||||||
|
|
||||||
build-android:
|
|
||||||
stage: optional
|
|
||||||
image: parity/rust-android:gitlab-ci
|
|
||||||
variables:
|
|
||||||
CARGO_TARGET: armv7-linux-androideabi
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/build-unix.sh
|
|
||||||
tags:
|
|
||||||
- rust-arm
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
test-beta:
|
publish-av-whitelist:
|
||||||
stage: optional
|
stage: publish
|
||||||
variables:
|
variables:
|
||||||
RUN_TESTS: cargo
|
GIT_STRATEGY: none
|
||||||
|
only: *releaseable_branches
|
||||||
|
except:
|
||||||
|
- nightly
|
||||||
|
when: manual
|
||||||
|
cache: {}
|
||||||
|
dependencies:
|
||||||
|
- build-windows
|
||||||
script:
|
script:
|
||||||
- scripts/gitlab/test-all.sh beta
|
- scripts/gitlab/publish-av-whitelists.sh
|
||||||
tags:
|
tags:
|
||||||
- rust-beta
|
- linux-docker
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
test-nightly:
|
|
||||||
stage: optional
|
|
||||||
variables:
|
|
||||||
RUN_TESTS: all
|
|
||||||
script:
|
|
||||||
- scripts/gitlab/test-all.sh nightly
|
|
||||||
tags:
|
|
||||||
- rust-nightly
|
|
||||||
allow_failure: true
|
|
||||||
|
|||||||
1250
CHANGELOG.md
1250
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
6199
Cargo.lock
generated
6199
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
139
Cargo.toml
139
Cargo.toml
@@ -2,73 +2,81 @@
|
|||||||
description = "Parity Ethereum client"
|
description = "Parity Ethereum client"
|
||||||
name = "parity-ethereum"
|
name = "parity-ethereum"
|
||||||
# NOTE Make sure to update util/version/Cargo.toml as well
|
# NOTE Make sure to update util/version/Cargo.toml as well
|
||||||
version = "2.2.2"
|
version = "2.7.2"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
blooms-db = { path = "util/blooms-db" }
|
ansi_term = "0.11"
|
||||||
log = "0.4"
|
|
||||||
env_logger = "0.5"
|
|
||||||
rustc-hex = "1.0"
|
|
||||||
docopt = "0.8"
|
|
||||||
clap = "2"
|
|
||||||
term_size = "0.3"
|
|
||||||
textwrap = "0.9"
|
|
||||||
num_cpus = "1.2"
|
|
||||||
number_prefix = "0.2"
|
|
||||||
rpassword = "1.0"
|
|
||||||
semver = "0.9"
|
|
||||||
ansi_term = "0.10"
|
|
||||||
parking_lot = "0.6"
|
|
||||||
regex = "0.2"
|
|
||||||
atty = "0.2.8"
|
atty = "0.2.8"
|
||||||
toml = "0.4"
|
blooms-db = { path = "util/blooms-db" }
|
||||||
serde = "1.0"
|
clap = "2"
|
||||||
serde_json = "1.0"
|
cli-signer= { path = "cli-signer" }
|
||||||
serde_derive = "1.0"
|
client-traits = { path = "ethcore/client-traits" }
|
||||||
futures = "0.1"
|
common-types = { path = "ethcore/types" }
|
||||||
fdlimit = "0.1"
|
|
||||||
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
|
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
|
||||||
jsonrpc-core = { git = "https://github.com/paritytech/jsonrpc.git", branch = "parity-2.2" }
|
dir = { path = "util/dir" }
|
||||||
|
docopt = "1.0"
|
||||||
|
engine = { path = "ethcore/engine" }
|
||||||
|
ethabi = { version = "9.0.1", optional = true }
|
||||||
ethcore = { path = "ethcore", features = ["parity"] }
|
ethcore = { path = "ethcore", features = ["parity"] }
|
||||||
parity-bytes = "0.1"
|
ethcore-accounts = { path = "accounts", optional = true }
|
||||||
|
ethcore-blockchain = { path = "ethcore/blockchain" }
|
||||||
|
ethcore-call-contract = { path = "ethcore/call-contract", optional = true }
|
||||||
|
ethcore-db = { path = "ethcore/db" }
|
||||||
ethcore-io = { path = "util/io" }
|
ethcore-io = { path = "util/io" }
|
||||||
ethcore-light = { path = "ethcore/light" }
|
ethcore-light = { path = "ethcore/light" }
|
||||||
ethcore-logger = { path = "logger" }
|
ethcore-logger = { path = "parity/logger" }
|
||||||
ethcore-miner = { path = "miner" }
|
ethcore-miner = { path = "miner" }
|
||||||
ethcore-network = { path = "util/network" }
|
ethcore-network = { path = "util/network" }
|
||||||
ethcore-private-tx = { path = "ethcore/private-tx" }
|
ethcore-private-tx = { path = "ethcore/private-tx" }
|
||||||
|
ethcore-secretstore = { path = "secret-store", optional = true }
|
||||||
ethcore-service = { path = "ethcore/service" }
|
ethcore-service = { path = "ethcore/service" }
|
||||||
ethcore-sync = { path = "ethcore/sync" }
|
ethcore-sync = { path = "ethcore/sync" }
|
||||||
ethcore-transaction = { path = "ethcore/transaction" }
|
ethereum-types = "0.8.0"
|
||||||
ethereum-types = "0.4"
|
ethkey = { path = "accounts/ethkey" }
|
||||||
node-filter = { path = "ethcore/node_filter" }
|
ethstore = { path = "accounts/ethstore" }
|
||||||
ethkey = { path = "ethkey" }
|
fdlimit = "0.1"
|
||||||
rlp = { version = "0.3.0", features = ["ethereum"] }
|
futures = "0.1"
|
||||||
rpc-cli = { path = "rpc_cli" }
|
|
||||||
parity-hash-fetch = { path = "hash-fetch" }
|
|
||||||
parity-ipfs-api = { path = "ipfs" }
|
|
||||||
parity-local-store = { path = "local-store" }
|
|
||||||
parity-runtime = { path = "util/runtime" }
|
|
||||||
parity-rpc = { path = "rpc" }
|
|
||||||
parity-rpc-client = { path = "rpc_client" }
|
|
||||||
parity-updater = { path = "updater" }
|
|
||||||
parity-version = { path = "util/version" }
|
|
||||||
parity-whisper = { path = "whisper" }
|
|
||||||
parity-path = "0.1"
|
|
||||||
dir = { path = "util/dir" }
|
|
||||||
panic_hook = { path = "util/panic_hook" }
|
|
||||||
keccak-hash = "0.1"
|
|
||||||
migration-rocksdb = { path = "util/migration-rocksdb" }
|
|
||||||
kvdb = "0.1"
|
|
||||||
kvdb-rocksdb = "0.1.3"
|
|
||||||
journaldb = { path = "util/journaldb" }
|
journaldb = { path = "util/journaldb" }
|
||||||
mem = { path = "util/mem" }
|
jsonrpc-core = "14.0.3"
|
||||||
|
keccak-hash = "0.4.0"
|
||||||
ethcore-secretstore = { path = "secret_store", optional = true }
|
kvdb = "0.3.1"
|
||||||
|
kvdb-rocksdb = "0.4.1"
|
||||||
registrar = { path = "registrar" }
|
log = "0.4"
|
||||||
|
migration-rocksdb = { path = "util/migration-rocksdb" }
|
||||||
|
node-filter = { path = "ethcore/node-filter" }
|
||||||
|
num_cpus = "1.2"
|
||||||
|
number_prefix = "0.2"
|
||||||
|
panic_hook = { path = "util/panic-hook" }
|
||||||
|
parity-bytes = "0.1"
|
||||||
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
||||||
|
parity-daemonize = "0.3"
|
||||||
|
parity-hash-fetch = { path = "updater/hash-fetch" }
|
||||||
|
parity-ipfs-api = { path = "ipfs" }
|
||||||
|
parity-local-store = { path = "miner/local-store" }
|
||||||
|
parity-path = "0.1"
|
||||||
|
parity-rpc = { path = "rpc" }
|
||||||
|
parity-runtime = { path = "util/runtime" }
|
||||||
|
parity-updater = { path = "updater" }
|
||||||
|
parity-util-mem = { version = "0.3.0", features = ["jemalloc-global"] }
|
||||||
|
parity-version = { path = "util/version" }
|
||||||
|
parking_lot = "0.9"
|
||||||
|
regex = "1.0"
|
||||||
|
registrar = { path = "util/registrar" }
|
||||||
|
rlp = "0.4.0"
|
||||||
|
rpassword = "1.0"
|
||||||
|
rustc-hex = "1.0"
|
||||||
|
semver = "0.9"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_derive = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
|
snapshot = { path = "ethcore/snapshot" }
|
||||||
|
spec = { path = "ethcore/spec" }
|
||||||
|
term_size = "0.3"
|
||||||
|
textwrap = "0.9"
|
||||||
|
toml = "0.4"
|
||||||
|
verification = { path = "ethcore/verification" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
rustc_version = "0.2"
|
rustc_version = "0.2"
|
||||||
@@ -82,18 +90,16 @@ fake-fetch = { path = "util/fake-fetch" }
|
|||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
|
winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
|
||||||
|
|
||||||
[target.'cfg(not(windows))'.dependencies]
|
|
||||||
daemonize = { git = "https://github.com/paritytech/daemonize" }
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = ["accounts"]
|
||||||
|
accounts = ["ethcore-accounts", "parity-rpc/accounts"]
|
||||||
miner-debug = ["ethcore/miner-debug"]
|
miner-debug = ["ethcore/miner-debug"]
|
||||||
json-tests = ["ethcore/json-tests"]
|
json-tests = ["ethcore/json-tests"]
|
||||||
ci-skip-issue = ["ethcore/ci-skip-issue"]
|
|
||||||
test-heavy = ["ethcore/test-heavy"]
|
test-heavy = ["ethcore/test-heavy"]
|
||||||
evm-debug = ["ethcore/evm-debug"]
|
evm-debug = ["ethcore/evm-debug"]
|
||||||
evm-debug-tests = ["ethcore/evm-debug-tests"]
|
evm-debug-tests = ["ethcore/evm-debug-tests"]
|
||||||
slow-blocks = ["ethcore/slow-blocks"]
|
slow-blocks = ["ethcore/slow-blocks"]
|
||||||
secretstore = ["ethcore-secretstore"]
|
secretstore = ["ethcore-secretstore", "accounts", "ethabi", "ethcore-call-contract"]
|
||||||
final = ["parity-version/final"]
|
final = ["parity-version/final"]
|
||||||
deadlock_detection = ["parking_lot/deadlock_detection"]
|
deadlock_detection = ["parking_lot/deadlock_detection"]
|
||||||
# to create a memory profile (requires nightly rust), use e.g.
|
# to create a memory profile (requires nightly rust), use e.g.
|
||||||
@@ -115,25 +121,18 @@ path = "parity/lib.rs"
|
|||||||
path = "parity/main.rs"
|
path = "parity/main.rs"
|
||||||
name = "parity"
|
name = "parity"
|
||||||
|
|
||||||
[profile.dev]
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
debug = false
|
debug = false
|
||||||
|
lto = true
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
# This should only list projects that are not
|
||||||
|
# in the dependency tree in any other way
|
||||||
|
# (i.e. pretty much only standalone CLI tools)
|
||||||
members = [
|
members = [
|
||||||
|
"accounts/ethkey/cli",
|
||||||
|
"accounts/ethstore/cli",
|
||||||
"chainspec",
|
"chainspec",
|
||||||
"ethcore/wasm/run",
|
"ethcore/wasm/run",
|
||||||
"ethcore/types",
|
|
||||||
"ethkey/cli",
|
|
||||||
"ethstore/cli",
|
|
||||||
"evmbin",
|
"evmbin",
|
||||||
"miner",
|
|
||||||
"parity-clib",
|
|
||||||
"whisper",
|
|
||||||
"whisper/cli",
|
|
||||||
"util/triehash-ethereum",
|
|
||||||
"util/keccak-hasher",
|
|
||||||
"util/patricia-trie-ethereum",
|
|
||||||
"util/fastmap",
|
|
||||||
]
|
]
|
||||||
|
|||||||
278
README.md
278
README.md
@@ -1,12 +1,31 @@
|
|||||||

|

|
||||||
|
|
||||||
## The fastest and most advanced Ethereum client.
|
<h2 align="center">The Fastest and most Advanced Ethereum Client.</h2>
|
||||||
|
|
||||||
<p align="center"><strong><a href="https://github.com/paritytech/parity-ethereum/releases/latest">» Download the latest release «</a></strong></p>
|
<p align="center"><strong><a href="https://github.com/paritytech/parity-ethereum/releases/latest">» Download the latest release «</a></strong></p>
|
||||||
|
|
||||||
<p align="center"><a href="https://gitlab.parity.io/parity/parity-ethereum/commits/master" target="_blank"><img src="https://gitlab.parity.io/parity/parity-ethereum/badges/master/build.svg" /></a>
|
<p align="center"><a href="https://gitlab.parity.io/parity/parity-ethereum/commits/master" target="_blank"><img src="https://gitlab.parity.io/parity/parity-ethereum/badges/master/build.svg" /></a>
|
||||||
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/license-GPL%20v3-green.svg" /></a></p>
|
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/license-GPL%20v3-green.svg" /></a></p>
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
1. [Description](#chapter-001)
|
||||||
|
2. [Technical Overview](#chapter-002)
|
||||||
|
3. [Building](#chapter-003)<br>
|
||||||
|
3.1 [Building Dependencies](#chapter-0031)<br>
|
||||||
|
3.2 [Building from Source Code](#chapter-0032)<br>
|
||||||
|
3.3 [Simple One-Line Installer for Mac and Linux](#chapter-0033)<br>
|
||||||
|
3.4 [Starting Parity Ethereum](#chapter-0034)
|
||||||
|
4. [Testing](#chapter-004)
|
||||||
|
5. [Documentation](#chapter-005)
|
||||||
|
6. [Toolchain](#chapter-006)
|
||||||
|
7. [Community](#chapter-007)
|
||||||
|
8. [Contributing](#chapter-008)
|
||||||
|
9. [License](#chapter-009)
|
||||||
|
|
||||||
|
|
||||||
|
## 1. Description <a id="chapter-001"></a>
|
||||||
|
|
||||||
**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Parity Ethereum provides the core infrastructure essential for speedy and reliable services.
|
**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Parity Ethereum provides the core infrastructure essential for speedy and reliable services.
|
||||||
|
|
||||||
- Clean, modular codebase for easy customisation
|
- Clean, modular codebase for easy customisation
|
||||||
@@ -15,7 +34,7 @@
|
|||||||
- Synchronise in hours, not days with Warp Sync
|
- Synchronise in hours, not days with Warp Sync
|
||||||
- Modular for light integration into your service or product
|
- Modular for light integration into your service or product
|
||||||
|
|
||||||
## Technical Overview
|
## 2. Technical Overview <a id="chapter-002"></a>
|
||||||
|
|
||||||
Parity Ethereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity Ethereum using the sophisticated and cutting-edge **Rust programming language**. Parity Ethereum is licensed under the GPLv3 and can be used for all your Ethereum needs.
|
Parity Ethereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity Ethereum using the sophisticated and cutting-edge **Rust programming language**. Parity Ethereum is licensed under the GPLv3 and can be used for all your Ethereum needs.
|
||||||
|
|
||||||
@@ -23,11 +42,13 @@ By default, Parity Ethereum runs a JSON-RPC HTTP server on port `:8545` and a We
|
|||||||
|
|
||||||
If you run into problems while using Parity Ethereum, check out the [wiki for documentation](https://wiki.parity.io/), feel free to [file an issue in this repository](https://github.com/paritytech/parity-ethereum/issues/new), or hop on our [Gitter](https://gitter.im/paritytech/parity) or [Riot](https://riot.im/app/#/group/+parity:matrix.parity.io) chat room to ask a question. We are glad to help! **For security-critical issues**, please refer to the security policy outlined in [SECURITY.md](SECURITY.md).
|
If you run into problems while using Parity Ethereum, check out the [wiki for documentation](https://wiki.parity.io/), feel free to [file an issue in this repository](https://github.com/paritytech/parity-ethereum/issues/new), or hop on our [Gitter](https://gitter.im/paritytech/parity) or [Riot](https://riot.im/app/#/group/+parity:matrix.parity.io) chat room to ask a question. We are glad to help! **For security-critical issues**, please refer to the security policy outlined in [SECURITY.md](SECURITY.md).
|
||||||
|
|
||||||
Parity Ethereum's current beta-release is 2.1. You can download it at [the releases page](https://github.com/paritytech/parity-ethereum/releases) or follow the instructions below to build from source. Please, mind the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
|
Parity Ethereum's current beta-release is 2.6. You can download it at [the releases page](https://github.com/paritytech/parity-ethereum/releases) or follow the instructions below to build from source. Please, mind the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
|
||||||
|
|
||||||
## Build Dependencies
|
## 3. Building <a id="chapter-003"></a>
|
||||||
|
|
||||||
Parity Ethereum requires **Rust version 1.29.x** to build.
|
### 3.1 Build Dependencies <a id="chapter-0031"></a>
|
||||||
|
|
||||||
|
Parity Ethereum requires **latest stable Rust version** to build.
|
||||||
|
|
||||||
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have `rustup`, you can install it like this:
|
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have `rustup`, you can install it like this:
|
||||||
|
|
||||||
@@ -36,7 +57,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do
|
|||||||
$ curl https://sh.rustup.rs -sSf | sh
|
$ curl https://sh.rustup.rs -sSf | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Parity Ethereum also requires `gcc`, `g++`, `libudev-dev`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed.
|
Parity Ethereum also requires `gcc`, `g++`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed.
|
||||||
|
|
||||||
- OSX:
|
- OSX:
|
||||||
```bash
|
```bash
|
||||||
@@ -45,7 +66,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do
|
|||||||
|
|
||||||
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
|
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
|
||||||
|
|
||||||
- Windows
|
- Windows:
|
||||||
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from
|
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from
|
||||||
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain:
|
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain:
|
||||||
```bash
|
```bash
|
||||||
@@ -58,7 +79,7 @@ Once you have `rustup` installed, then you need to install:
|
|||||||
|
|
||||||
Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source.
|
Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source.
|
||||||
|
|
||||||
## Build from Source Code
|
### 3.2 Build from Source Code <a id="chapter-0032"></a>
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# download Parity Ethereum code
|
# download Parity Ethereum code
|
||||||
@@ -95,7 +116,7 @@ or
|
|||||||
$ git checkout beta
|
$ git checkout beta
|
||||||
```
|
```
|
||||||
|
|
||||||
## Simple One-Line Installer for Mac and Linux
|
### 3.3 Simple One-Line Installer for Mac and Linux <a id="chapter-0033"></a>
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash <(curl https://get.parity.io -L)
|
bash <(curl https://get.parity.io -L)
|
||||||
@@ -107,9 +128,9 @@ The one-line installer always defaults to the latest beta release. To install a
|
|||||||
bash <(curl https://get.parity.io -L) -r stable
|
bash <(curl https://get.parity.io -L) -r stable
|
||||||
```
|
```
|
||||||
|
|
||||||
## Start Parity Ethereum
|
### 3.4 Starting Parity Ethereum <a id="chapter-0034"></a>
|
||||||
|
|
||||||
### Manually
|
#### Manually
|
||||||
|
|
||||||
To start Parity Ethereum manually, just run
|
To start Parity Ethereum manually, just run
|
||||||
|
|
||||||
@@ -119,25 +140,230 @@ $ ./target/release/parity
|
|||||||
|
|
||||||
so Parity Ethereum begins syncing the Ethereum blockchain.
|
so Parity Ethereum begins syncing the Ethereum blockchain.
|
||||||
|
|
||||||
### Using `systemd` service file
|
#### Using `systemd` service file
|
||||||
|
|
||||||
To start Parity Ethereum as a regular user using `systemd` init:
|
To start Parity Ethereum as a regular user using `systemd` init:
|
||||||
|
|
||||||
1. Copy `./scripts/parity.service` to your
|
1. Copy `./scripts/parity.service` to your
|
||||||
`systemd` user directory (usually `~/.config/systemd/user`).
|
`systemd` user directory (usually `~/.config/systemd/user`).
|
||||||
2. To configure Parity Ethereum, write a `/etc/parity/config.toml` config file, see [Configuring Parity Ethereum](https://paritytech.github.io/wiki/Configuring-Parity) for details.
|
2. Copy release to bin folder, write `sudo install ./target/release/parity /usr/bin/parity`
|
||||||
|
3. To configure Parity Ethereum, write a `/etc/parity/config.toml` config file, see [Configuring Parity Ethereum](https://paritytech.github.io/wiki/Configuring-Parity) for details.
|
||||||
|
|
||||||
## Parity Ethereum toolchain
|
## 4. Testing <a id="chapter-004"></a>
|
||||||
|
|
||||||
|
Download the required test files: `git submodule update --init --recursive`. You can run tests with the following commands:
|
||||||
|
|
||||||
|
* **All** packages
|
||||||
|
```
|
||||||
|
cargo test --all
|
||||||
|
```
|
||||||
|
|
||||||
|
* Specific package
|
||||||
|
```
|
||||||
|
cargo test --package <spec>
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `<spec>` with one of the packages from the [package list](#package-list) (e.g. `cargo test --package evmbin`).
|
||||||
|
|
||||||
|
You can show your logs in the test output by passing `--nocapture` (i.e. `cargo test --package evmbin -- --nocapture`)
|
||||||
|
|
||||||
|
## 5. Documentation <a id="chapter-005"></a>
|
||||||
|
|
||||||
|
Official website: https://parity.io
|
||||||
|
|
||||||
|
Be sure to [check out our wiki](https://wiki.parity.io) for more information.
|
||||||
|
|
||||||
|
### Viewing documentation for Parity Ethereum packages
|
||||||
|
|
||||||
|
You can generate documentation for Parity Ethereum Rust packages that automatically opens in your web browser using [rustdoc with Cargo](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html#using-rustdoc-with-cargo) (of the The Rustdoc Book), by running the the following commands:
|
||||||
|
|
||||||
|
* **All** packages
|
||||||
|
```
|
||||||
|
cargo doc --document-private-items --open
|
||||||
|
```
|
||||||
|
|
||||||
|
* Specific package
|
||||||
|
```
|
||||||
|
cargo doc --package <spec> -- --document-private-items --open
|
||||||
|
```
|
||||||
|
|
||||||
|
Use`--document-private-items` to also view private documentation and `--no-deps` to exclude building documentation for dependencies.
|
||||||
|
|
||||||
|
Replacing `<spec>` with one of the following from the details section below (i.e. `cargo doc --package parity-ethereum --open`):
|
||||||
|
|
||||||
|
<a id="package-list"></a>
|
||||||
|
**Package List**
|
||||||
|
<details><p>
|
||||||
|
|
||||||
|
* Parity Ethereum (EthCore) Client Application
|
||||||
|
```bash
|
||||||
|
parity-ethereum
|
||||||
|
```
|
||||||
|
* Parity Ethereum Account Management, Key Management Tool, and Keys Generator
|
||||||
|
```bash
|
||||||
|
ethcore-accounts, ethkey-cli, ethstore, ethstore-cli
|
||||||
|
```
|
||||||
|
* Parity Chain Specification
|
||||||
|
```bash
|
||||||
|
chainspec
|
||||||
|
```
|
||||||
|
* Parity CLI Signer Tool & RPC Client
|
||||||
|
```bash
|
||||||
|
cli-signer parity-rpc-client
|
||||||
|
```
|
||||||
|
* Parity Ethereum Ethash & ProgPoW Implementations
|
||||||
|
```bash
|
||||||
|
ethash
|
||||||
|
```
|
||||||
|
* Parity (EthCore) Library
|
||||||
|
```bash
|
||||||
|
ethcore
|
||||||
|
```
|
||||||
|
* Parity Ethereum Blockchain Database, Test Generator, Configuration,
|
||||||
|
Caching, Importing Blocks, and Block Information
|
||||||
|
```bash
|
||||||
|
ethcore-blockchain
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information
|
||||||
|
```bash
|
||||||
|
ethcore-call-contract
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Database Access & Utilities, Database Cache Manager
|
||||||
|
```bash
|
||||||
|
ethcore-db
|
||||||
|
```
|
||||||
|
* Parity Ethereum Virtual Machine (EVM) Rust Implementation
|
||||||
|
```bash
|
||||||
|
evm
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Light Client Implementation
|
||||||
|
```bash
|
||||||
|
ethcore-light
|
||||||
|
```
|
||||||
|
* Parity Smart Contract based Node Filter, Manage Permissions of Network Connections
|
||||||
|
```bash
|
||||||
|
node-filter
|
||||||
|
```
|
||||||
|
* Parity Private Transactions
|
||||||
|
```bash
|
||||||
|
ethcore-private-tx
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem
|
||||||
|
```bash
|
||||||
|
ethcore-service
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Blockchain Synchronization
|
||||||
|
```bash
|
||||||
|
ethcore-sync
|
||||||
|
```
|
||||||
|
* Parity Ethereum Common Types
|
||||||
|
```bash
|
||||||
|
common-types
|
||||||
|
```
|
||||||
|
* Parity Ethereum Virtual Machines (VM) Support Library
|
||||||
|
```bash
|
||||||
|
vm
|
||||||
|
```
|
||||||
|
* Parity Ethereum WASM Interpreter
|
||||||
|
```bash
|
||||||
|
wasm
|
||||||
|
```
|
||||||
|
* Parity Ethereum WASM Test Runner
|
||||||
|
```bash
|
||||||
|
pwasm-run-test
|
||||||
|
```
|
||||||
|
* Parity EVM Implementation
|
||||||
|
```bash
|
||||||
|
evmbin
|
||||||
|
```
|
||||||
|
* Parity Ethereum IPFS-compatible API
|
||||||
|
```bash
|
||||||
|
parity-ipfs-api
|
||||||
|
```
|
||||||
|
* Parity Ethereum JSON Deserialization
|
||||||
|
```bash
|
||||||
|
ethjson
|
||||||
|
```
|
||||||
|
* Parity Ethereum State Machine Generalization for Consensus Engines
|
||||||
|
```bash
|
||||||
|
parity-machine
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Miner Interface
|
||||||
|
```bash
|
||||||
|
ethcore-miner parity-local-store price-info ethcore-stratum using_queue
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Logger Implementation
|
||||||
|
```bash
|
||||||
|
ethcore-logger
|
||||||
|
```
|
||||||
|
* C bindings library for the Parity Ethereum client
|
||||||
|
```bash
|
||||||
|
parity-clib
|
||||||
|
```
|
||||||
|
* Parity Ethereum JSON-RPC Servers
|
||||||
|
```bash
|
||||||
|
parity-rpc
|
||||||
|
```
|
||||||
|
* Parity Ethereum (EthCore) Secret Store
|
||||||
|
```bash
|
||||||
|
ethcore-secretstore
|
||||||
|
```
|
||||||
|
* Parity Updater Service
|
||||||
|
```bash
|
||||||
|
parity-updater parity-hash-fetch
|
||||||
|
```
|
||||||
|
* Parity Core Libraries (Parity Util)
|
||||||
|
```bash
|
||||||
|
ethcore-bloom-journal blooms-db dir eip-712 fake-fetch fastmap fetch ethcore-io
|
||||||
|
journaldb keccak-hasher len-caching-lock macros memory-cache memzero
|
||||||
|
migration-rocksdb ethcore-network ethcore-network-devp2p panic_hook
|
||||||
|
patricia-trie-ethereum registrar rlp_compress rlp_derive parity-runtime stats
|
||||||
|
time-utils triehash-ethereum unexpected parity-version
|
||||||
|
```
|
||||||
|
|
||||||
|
</p></details>
|
||||||
|
|
||||||
|
### Contributing to documentation for Parity Ethereum packages
|
||||||
|
|
||||||
|
[Document source code](https://doc.rust-lang.org/1.9.0/book/documentation.html) for Parity Ethereum packages by annotating the source code with documentation comments.
|
||||||
|
|
||||||
|
Example (generic documentation comment):
|
||||||
|
```markdown
|
||||||
|
/// Summary
|
||||||
|
///
|
||||||
|
/// Description
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// Summary of Example 1
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// // insert example 1 code here for use with documentation as tests
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. Toolchain <a id="chapter-006"></a>
|
||||||
|
|
||||||
In addition to the Parity Ethereum client, there are additional tools in this repository available:
|
In addition to the Parity Ethereum client, there are additional tools in this repository available:
|
||||||
|
|
||||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
- [evmbin](./evmbin) - Parity Ethereum EVM Implementation.
|
||||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
- [ethstore](./accounts/ethstore) - Parity Ethereum Key Management.
|
||||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management.
|
- [ethkey](./accounts/ethkey) - Parity Ethereum Keys Generator.
|
||||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator.
|
|
||||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
|
||||||
|
|
||||||
## Join the chat!
|
The following tool is available in a separate repository:
|
||||||
|
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi)
|
||||||
|
- [whisper](https://github.com/paritytech/whisper) - Parity Ethereum Whisper-v2 PoC Implementation.
|
||||||
|
|
||||||
|
## 7. Community <a id="chapter-007"></a>
|
||||||
|
|
||||||
|
### Join the chat!
|
||||||
|
|
||||||
Questions? Get in touch with us on Gitter:
|
Questions? Get in touch with us on Gitter:
|
||||||
[](https://gitter.im/paritytech/parity)
|
[](https://gitter.im/paritytech/parity)
|
||||||
@@ -148,8 +374,14 @@ Questions? Get in touch with us on Gitter:
|
|||||||
Alternatively, join our community on Matrix:
|
Alternatively, join our community on Matrix:
|
||||||
[](https://riot.im/app/#/group/+parity:matrix.parity.io)
|
[](https://riot.im/app/#/group/+parity:matrix.parity.io)
|
||||||
|
|
||||||
## Documentation
|
## 8. Contributing <a id="chapter-008"></a>
|
||||||
|
|
||||||
Official website: https://parity.io
|
An introduction has been provided in the ["So You Want to be a Core Developer" presentation slides by Hernando Castano](http://tiny.cc/contrib-to-parity-eth). Additional guidelines are provided in [CONTRIBUTING](./.github/CONTRIBUTING.md).
|
||||||
|
|
||||||
Be sure to [check out our wiki](https://wiki.parity.io) for more information.
|
### Contributor Code of Conduct
|
||||||
|
|
||||||
|
[CODE_OF_CONDUCT](./.github/CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
|
## 9. License <a id="chapter-009"></a>
|
||||||
|
|
||||||
|
[LICENSE](./LICENSE)
|
||||||
|
|||||||
77
SECURITY.md
77
SECURITY.md
@@ -48,33 +48,54 @@ Our Bug Bounty Program allows us to recognise and reward members of the Parity c
|
|||||||
```
|
```
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
mQENBFlyIAwBCACe0keNPjgYzZ1Oy/8t3zj/Qw9bHHqrzx7FWy8NbXnYBM19NqOZ
|
mQINBF0vHwQBEADKui4qAo4bzdzRhMm+uhUpYGf8jjjmET3zJ8kKQIpp6JTsV+HJ
|
||||||
DIP7Oe0DvCaf/uruBskCS0iVstHlEFQ2AYe0Ei0REt9lQdy61GylU/DEB3879IG+
|
6m1We0QYeMRXoOYH1xVHBf2zNCuHS0nSQdUCQA7SHWsPB05STa2hvlR7fSdQnCCp
|
||||||
6FO0SnFeYeerv1/hFI2K6uv8v7PyyVDiiJSW0I1KIs2OBwJicTKmWxLAeQsRgx9G
|
gnLOJWXvvedlRDIAhvqI6cwLdUlXgVSKEwrwmrpiBhh4NxI3qX+LyIa+Ovkchu2S
|
||||||
yRGalrVk4KP+6pWTA7k3DxmDZKZyfYV/Ej10NtuzmsemwDbv98HKeomp/kgFOfSy
|
d/YCnE4GqojSGRfJYiGwe2N+sF7OfaoKhQuTrtdDExHrMU4cWnTXW2wyxTr4xkj9
|
||||||
3AZjeCpctlsNqpjUuXa0/HudmH2WLxZ0fz8XeoRh8XM9UudNIecjrDqmAFrt/btQ
|
jS2WeLVZWflvkDHT8JD9N6jNxBVEF/Qvjk83zI0kCOzkhek8x+YUgfLq3/rHOYbX
|
||||||
/3guvlzhFCdhYPVGsUusKMECk/JG+Xx1/1ZjABEBAAG0LFBhcml0eSBTZWN1cml0
|
3pW21ccHYPacHjHWvKE+xRebjeEhJ4KxKHfCVjQcxybwDBqDka1AniZt4CQ7UORf
|
||||||
eSBDb250YWN0IDxzZWN1cml0eUBwYXJpdHkuaW8+iQFUBBMBCAA+FiEE2uUVYCjP
|
MU/ue2oSZ9nNg0uMdb/0AbQPZ04OlMcYPAPWzFL08nVPox9wT9uqlL6JtcOeC90h
|
||||||
N6B8aTiDXQ8DAY0H3nMFAllyIAwCGwMFCQPCZwAFCwkIBwIGFQgJCgsCBBYCAwEC
|
oOeDmfgwmjMmdwWTRgt9qQjcbgXzVvuAzIGbzj1X3MdLspWdHs/d2+US4nji1TkN
|
||||||
HgECF4AACgkQXQ8DAY0H3nM60wgAkS3A36Zc+upiaxU7tumcGv+an17j7gin0sif
|
oYIW7vE+xkd3aB+NZunIlm9Rwd/0mSgDg+DaNa5KceOLhq0/qKgcXC/RRU29I8II
|
||||||
+0ELSjVfrXInM6ovai+NhUdcLkJ7tCrKS90fvlaELK5Sg9CXBWCTFccKN4A/B7ey
|
tusRoR/oesGJGYTjh4k6PJkG+nvDPsoQrwYT44bhnniS1xYkxWYXF99JFI7LgMdD
|
||||||
rOg2NPXUecnyBB/XqQgKYH7ujYlOlqBDXMfz6z8Hj6WToxg9PPMGGomyMGh8AWxM
|
e1SgKeIDVpvm873k82E6arp5655Wod1XOjaXBggCwFp84eKcEZEN+1qEWwARAQAB
|
||||||
3yRPFs5RKt0VKgN++5N00oly5Y8ri5pgCidDvCLYMGTVDHFKwkuc9w6BlWlu1R1e
|
tClQYXJpdHkgU2VjdXJpdHkgVGVhbSA8c2VjdXJpdHlAcGFyaXR5LmlvPokCVAQT
|
||||||
/hXFWUFAP1ffTAul3QwyKhjPn2iotCdxXjvt48KaU8DN4iL7aMBN/ZBKqGS7yRdF
|
AQoAPhYhBJ1LK264+XFW0ZZpqf8IEtSRuWeYBQJdLx8EAhsDBQkDwmcABQsJCAcC
|
||||||
D/JbJyaaJ0ZRvFSTSXy/sWY3z1B5mtCPBxco8hqqNfRkCwuZ6LkBDQRZciAMAQgA
|
BhUKCQgLAgQWAgMBAh4BAheAAAoJEP8IEtSRuWeYL84QAI6NwnwS561DWYYRAd4y
|
||||||
8BP8xrwe12TOUTqL/Vrbxv/FLdhKh53J6TrPKvC2TEEKOrTNo5ahRq+XOS5E7G2N
|
ocGPr3CnwFSt1GjkSkRy3B+tMhzexBg1y7EbLRUefIrO4LwOlywtRk8tTRGgEI4i
|
||||||
x3b+fq8gR9BzFcldAx0XWUtGs/Wv++ulaSNqTBxj13J3G3WGsUfMKxRgj//piCUD
|
5xRLHbOkeolfgCFSpOj5d8cMKCt5HEIv18hsv6dkrzlSYA5NLX/GRBEh3F/0sGny
|
||||||
bCFLQfGZdKk0M1o9QkPVARwwmvCNiNB/l++xGqPtfc44H5jWj3GoGvL2MkShPzrN
|
vCXapfxa1cx72sU7631JBK7t2Tf+MfwxdfyFZ9TI9WdtP5AfVjgTkIVkEDFcZPTc
|
||||||
yN/bJ+m+R5gtFGdInqa5KXBuxxuW25eDKJ+LzjbgUgeC76wNcfOiQHTdMkcupjdO
|
n3CYXqTYFIBCNUD8LP4iTi3xUt7pTGJQQoFT8l15nJCgzRYQ+tXpoTRlf+/LtXmw
|
||||||
bbGFwo10hcbRAOcZEv6//Zrlmk/6nPxEd2hN20St2bSN0+FqfZ267mWEu3ejsgF8
|
6iidPV87E06jHdK9666rBouIabAtx7i0/4kwo+bSZ8DiSKRUaehiHGd212HSEmdF
|
||||||
ArdCpv5h4fBvJyNwiTZwIQARAQABiQE8BBgBCAAmFiEE2uUVYCjPN6B8aTiDXQ8D
|
jxquWE4pEzoUowYznhSIfR+WWIqRBHxEYarP4m98Hi+VXZ7Fw1ytzO8+BAKnLXnj
|
||||||
AY0H3nMFAllyIAwCGwwFCQPCZwAACgkQXQ8DAY0H3nNisggAl4fqhRlA34wIb190
|
2W2+T9qJks5gqVEoaWNnqpvya6JA11QZvZ0w7Om2carDc2ILNm2Xx9J0mRUye8P0
|
||||||
sqXHVxiCuzPaqS6krE9xAa1+gncX485OtcJNqnjugHm2rFE48lv7oasviuPXuInE
|
KxcgqJuKNGFtugebQAsXagkxOKsdKna1PlDlxEfTf6AgI3ST8qSiMAwaaIMB/REF
|
||||||
/OgVFnXYv9d/Xx2JUeDs+bFTLouCDRY2Unh7KJZasfqnMcCHWcxHx5FvRNZRssaB
|
VKUapGoslQX4tOCjibI2pzEgE//D8NAaSVu2A9+BUcFERdZRxsI7fydIXNeZ2R46
|
||||||
WTZVo6sizPurGUtbpYe4/OLFhadBqAE0EUmVRFEUMc1YTnu4eLaRBzoWN4d2UWwi
|
N2qfW+DP3YR/14QgdRxDItEavUoE1vByRXwIufKAkVemOZzIoFXKFsDeXwqTVW5i
|
||||||
LN25RSrVSke7LTSFbgn9ntQrQ2smXSR+cdNkkfRCjFcpUaecvFl9HwIqoyVbT4Ym
|
6CXu6OddZ3QHDiT9TEbRny4QuQINBF0vKCwBEACnP5J7LEGbpxNBrPvGdxZUo0YA
|
||||||
0hbpbbX/cJdc91tKa+psa29uMeGL/cgL9fAu19yNFRyOTMxjZnvql1X/WE1pLmoP
|
U8RgeKDRPxJTvMo27V1IPZGaKRCRq8LBfg/eHhqZhQ7SLJBjBljd8kuT5dHDBTRe
|
||||||
ETBD1Q==
|
jE1UIOhmnlSlrEJjAmpVO08irlGpq1o+8mGcvkBsR0poCVjeNeSnwYfRnR+c3GK5
|
||||||
=K9Qw
|
Er6/JRqfN4mJvnEC9/Pbm6C7ql6YLKxC3yqzF97JL5brbbuozrW7nixY/yAI8619
|
||||||
|
VlBIMP7PAUbGcnSQyuV5b/Wr2Sgr6NJclnNSLjh2U9/Du6w/0tDGlMBts8HjRnWJ
|
||||||
|
BXbkTdQKCTaqgK68kTKSiN1/x+lynxHC2AavMpH/08Kopg2ZCzJowMKIgcB+4Z/I
|
||||||
|
DJKZWHWKumhaZMGXcWgzgcByog9IpamuROEZFJNEUAFf7YIncEckPSif4looiOdS
|
||||||
|
VurKZGvYXXaGSsZbGgHxI5CWu7ZxMdLBLvtOcCYmRQrG+g/h+PGU5BT0bNAfNTkm
|
||||||
|
V3/n1B/TWbpWRmB3AwT2emQivXHkaubGI0VivhaO43AuI9JWoqiMqFtxbuTeoxwD
|
||||||
|
xlu2Dzcp0v+AR4T5cIG9D5/+yiPc25aIY7cIKxuNFHIDL4td5fwSGC7vU6998PIG
|
||||||
|
2Y48TGBnw7zpEfDfMayqAeBjX0YU6PTNsvS5O6bP3j4ojTOUYD7Z8QdCvgISDID3
|
||||||
|
WMGAdmSwmCRvsQ/OJwARAQABiQI8BBgBCgAmFiEEnUsrbrj5cVbRlmmp/wgS1JG5
|
||||||
|
Z5gFAl0vKCwCGwwFCQB2pwAACgkQ/wgS1JG5Z5hdbw//ZqR+JcWm59NUIHjauETJ
|
||||||
|
sYDYhcAfa3txTacRn5uPz/TQiTd7wZ82+G8Et0ZnpEHy6eWyBqHpG0hiPhFBzxjY
|
||||||
|
nhjHl8jJeyo2mQIVJhzkL58BHBZk8WM2TlaU7VxZ6TYOmP2y3qf6FD6mCcrQ4Fml
|
||||||
|
E9f0lyVUoI/5Zs9oF0izRk8vkwaY3UvLM7XEY6nM8GnFG8kaiZMYmx26Zo7Uz31G
|
||||||
|
7EGGZFsrVDXfNhSJyz79Gyn+Lx9jOTdoR0sH/THYIIosE83awMGE6jKeuDYTbVWu
|
||||||
|
+ZtHQef+pRteki3wvNLJK+kC1y3BtHqDJS9Lqx0s8SCiVozlC+fZfC9hCtU7bXJK
|
||||||
|
0UJZ4qjSvj6whzfaNgOZAqJpmwgOnd8W/3YJk1DwUeX98FcU38MR23SOkx2EDdDE
|
||||||
|
77Kdu62vTs/tLmOTuyKBvYPaHaYulYjQTxurG+o8vhHtaL87ARvuq+83dj+nO5z3
|
||||||
|
5O9vkcVJYWjOEnJe7ZvCTxeLJehpCmHIbyUuDx5P24MWVbyXOxIlxNxTqlub5GlW
|
||||||
|
rQF6Qsa/0k9TRk7Htbct6fAA0/VahJS0g096MrTH8AxBXDNE8lIoNeGikVlaxK9Z
|
||||||
|
S+aannlWYIJymZ4FygIPPaRlzhAoXBuJd8OaR5giC7dS1xquxKOiQEXTGsLeGFaI
|
||||||
|
BZYiIhW7GG4ozvKDqyNm4eg=
|
||||||
|
=yKcB
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
```
|
```
|
||||||
|
|||||||
22
accounts/Cargo.toml
Normal file
22
accounts/Cargo.toml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
[package]
|
||||||
|
description = "Parity Ethereum Account Management"
|
||||||
|
homepage = "http://parity.io"
|
||||||
|
license = "GPL-3.0"
|
||||||
|
name = "ethcore-accounts"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethkey = { path = "ethkey" }
|
||||||
|
ethstore = { path = "ethstore" }
|
||||||
|
log = "0.4"
|
||||||
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
||||||
|
parking_lot = "0.9"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_derive = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
ethereum-types = "0.8.0"
|
||||||
|
tempdir = "0.3"
|
||||||
13
accounts/ethkey/Cargo.toml
Normal file
13
accounts/ethkey/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[package]
|
||||||
|
description = "Parity Ethereum Keys Generator"
|
||||||
|
name = "ethkey"
|
||||||
|
version = "0.4.0"
|
||||||
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
edit-distance = "2.0"
|
||||||
|
log = "0.4"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_derive = "1.0"
|
||||||
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
||||||
|
parity-wordlist = "1.3"
|
||||||
@@ -5,8 +5,8 @@ Parity Ethereum keys generator.
|
|||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
Parity Ethereum keys generator.
|
Parity Ethereum Keys Generator.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethkey info <secret-or-phrase> [options]
|
ethkey info <secret-or-phrase> [options]
|
||||||
@@ -216,6 +216,6 @@ _This project is a part of the Parity Ethereum toolchain._
|
|||||||
|
|
||||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
||||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
||||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management.
|
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
|
||||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator.
|
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.
|
||||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
- [whisper](https://github.com/paritytech/whisper) - Implementation of Whisper-v2 PoC.
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Keys Generator CLI"
|
||||||
name = "ethkey-cli"
|
name = "ethkey-cli"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
docopt = "0.8"
|
docopt = "1.0"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
ethkey = { path = "../" }
|
ethkey = { path = "../" }
|
||||||
panic_hook = { path = "../../util/panic_hook" }
|
panic_hook = { path = "../../../util/panic-hook" }
|
||||||
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
||||||
parity-wordlist="1.2"
|
parity-wordlist="1.2"
|
||||||
rustc-hex = "1.0"
|
rustc-hex = "1.0"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate docopt;
|
extern crate docopt;
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
extern crate ethkey;
|
extern crate ethkey;
|
||||||
extern crate panic_hook;
|
extern crate panic_hook;
|
||||||
extern crate parity_wordlist;
|
extern crate parity_wordlist;
|
||||||
|
extern crate parity_crypto;
|
||||||
extern crate rustc_hex;
|
extern crate rustc_hex;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate threadpool;
|
extern crate threadpool;
|
||||||
@@ -30,12 +31,13 @@ use std::num::ParseIntError;
|
|||||||
use std::{env, fmt, process, io, sync};
|
use std::{env, fmt, process, io, sync};
|
||||||
|
|
||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use ethkey::{KeyPair, Random, Brain, BrainPrefix, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address, brain_recover};
|
use ethkey::{Brain, BrainPrefix, Prefix, brain_recover};
|
||||||
|
use parity_crypto::publickey::{KeyPair, Random, Error as EthkeyError, Generator, sign, verify_public, verify_address};
|
||||||
use rustc_hex::{FromHex, FromHexError};
|
use rustc_hex::{FromHex, FromHexError};
|
||||||
|
|
||||||
const USAGE: &'static str = r#"
|
const USAGE: &'static str = r#"
|
||||||
Parity Ethereum keys generator.
|
Parity Ethereum keys generator.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethkey info <secret-or-phrase> [options]
|
ethkey info <secret-or-phrase> [options]
|
||||||
@@ -168,7 +170,7 @@ fn main() {
|
|||||||
Ok(ok) => println!("{}", ok),
|
Ok(ok) => println!("{}", ok),
|
||||||
Err(Error::Docopt(ref e)) => e.exit(),
|
Err(Error::Docopt(ref e)) => e.exit(),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("{}", err);
|
eprintln!("{}", err);
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,7 +202,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
let keypair = Brain::new(phrase).generate().expect("Brain wallet generator is infallible; qed");
|
let keypair = Brain::new(phrase).generate().expect("Brain wallet generator is infallible; qed");
|
||||||
(keypair, Some(phrase_info))
|
(keypair, Some(phrase_info))
|
||||||
} else {
|
} else {
|
||||||
let secret = args.arg_secret_or_phrase.parse().map_err(|_| EthkeyError::InvalidSecret)?;
|
let secret = args.arg_secret_or_phrase.parse().map_err(|_| EthkeyError::InvalidSecretKey)?;
|
||||||
(KeyPair::from_secret(secret)?, None)
|
(KeyPair::from_secret(secret)?, None)
|
||||||
};
|
};
|
||||||
Ok(display(result, display_mode))
|
Ok(display(result, display_mode))
|
||||||
@@ -241,7 +243,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
};
|
};
|
||||||
Ok(display(result, display_mode))
|
Ok(display(result, display_mode))
|
||||||
} else if args.cmd_sign {
|
} else if args.cmd_sign {
|
||||||
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecret)?;
|
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecretKey)?;
|
||||||
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
|
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
|
||||||
let signature = sign(&secret, &message)?;
|
let signature = sign(&secret, &message)?;
|
||||||
Ok(format!("{}", signature))
|
Ok(format!("{}", signature))
|
||||||
@@ -249,7 +251,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
let signature = args.arg_signature.parse().map_err(|_| EthkeyError::InvalidSignature)?;
|
let signature = args.arg_signature.parse().map_err(|_| EthkeyError::InvalidSignature)?;
|
||||||
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
|
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;
|
||||||
let ok = if args.cmd_public {
|
let ok = if args.cmd_public {
|
||||||
let public = args.arg_public.parse().map_err(|_| EthkeyError::InvalidPublic)?;
|
let public = args.arg_public.parse().map_err(|_| EthkeyError::InvalidPublicKey)?;
|
||||||
verify_public(&public, &signature, &message)?
|
verify_public(&public, &signature, &message)?
|
||||||
} else if args.cmd_address {
|
} else if args.cmd_address {
|
||||||
let address = args.arg_address.parse().map_err(|_| EthkeyError::InvalidAddress)?;
|
let address = args.arg_address.parse().map_err(|_| EthkeyError::InvalidAddress)?;
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use keccak::Keccak256;
|
use std::convert::Infallible;
|
||||||
use super::{KeyPair, Generator, Secret};
|
use parity_crypto::publickey::{KeyPair, Generator, Secret};
|
||||||
|
use parity_crypto::Keccak256;
|
||||||
use parity_wordlist;
|
use parity_wordlist;
|
||||||
|
|
||||||
/// Simple brainwallet.
|
/// Simple brainwallet.
|
||||||
@@ -32,7 +33,7 @@ impl Brain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Generator for Brain {
|
impl Generator for Brain {
|
||||||
type Error = ::Void;
|
type Error = Infallible;
|
||||||
|
|
||||||
fn generate(&mut self) -> Result<KeyPair, Self::Error> {
|
fn generate(&mut self) -> Result<KeyPair, Self::Error> {
|
||||||
let seed = self.0.clone();
|
let seed = self.0.clone();
|
||||||
@@ -45,7 +46,7 @@ impl Generator for Brain {
|
|||||||
match i > 16384 {
|
match i > 16384 {
|
||||||
false => i += 1,
|
false => i += 1,
|
||||||
true => {
|
true => {
|
||||||
if let Ok(pair) = Secret::from_unsafe_slice(&secret)
|
if let Ok(pair) = Secret::import_key(&secret)
|
||||||
.and_then(KeyPair::from_secret)
|
.and_then(KeyPair::from_secret)
|
||||||
{
|
{
|
||||||
if pair.address()[0] == 0 {
|
if pair.address()[0] == 0 {
|
||||||
@@ -61,7 +62,8 @@ impl Generator for Brain {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use {Brain, Generator};
|
use Brain;
|
||||||
|
use parity_crypto::publickey::Generator;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_brain() {
|
fn test_brain() {
|
||||||
@@ -1,20 +1,21 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::{Generator, KeyPair, Error, Brain};
|
use super::Brain;
|
||||||
|
use parity_crypto::publickey::{Generator, KeyPair, Error};
|
||||||
use parity_wordlist as wordlist;
|
use parity_wordlist as wordlist;
|
||||||
|
|
||||||
/// Tries to find brain-seed keypair with address starting with given prefix.
|
/// Tries to find brain-seed keypair with address starting with given prefix.
|
||||||
@@ -47,7 +48,7 @@ impl Generator for BrainPrefix {
|
|||||||
for _ in 0..self.iterations {
|
for _ in 0..self.iterations {
|
||||||
let phrase = wordlist::random_phrase(self.no_of_words);
|
let phrase = wordlist::random_phrase(self.no_of_words);
|
||||||
let keypair = Brain::new(phrase.clone()).generate().unwrap();
|
let keypair = Brain::new(phrase.clone()).generate().unwrap();
|
||||||
if keypair.address().starts_with(&self.prefix) {
|
if keypair.address().as_ref().starts_with(&self.prefix) {
|
||||||
self.last_phrase = phrase;
|
self.last_phrase = phrase;
|
||||||
return Ok(keypair)
|
return Ok(keypair)
|
||||||
}
|
}
|
||||||
@@ -59,12 +60,13 @@ impl Generator for BrainPrefix {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use {Generator, BrainPrefix};
|
use BrainPrefix;
|
||||||
|
use parity_crypto::publickey::Generator;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn prefix_generator() {
|
fn prefix_generator() {
|
||||||
let prefix = vec![0x00u8];
|
let prefix = vec![0x00u8];
|
||||||
let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12).generate().unwrap();
|
let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12).generate().unwrap();
|
||||||
assert!(keypair.address().starts_with(&prefix));
|
assert!(keypair.address().as_bytes().starts_with(&prefix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,26 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use edit_distance::edit_distance;
|
use edit_distance::edit_distance;
|
||||||
use parity_wordlist;
|
use parity_wordlist;
|
||||||
|
|
||||||
use super::{Address, Brain, Generator};
|
use super::Brain;
|
||||||
|
use parity_crypto::publickey::{Address, Generator};
|
||||||
|
|
||||||
/// Tries to find a phrase for address, given the number
|
/// Tries to find a phrase for address, given the number
|
||||||
/// of expected words and a partial phrase.
|
/// of expected words and a partial phrase.
|
||||||
40
accounts/ethkey/src/lib.rs
Normal file
40
accounts/ethkey/src/lib.rs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
|
||||||
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// #![warn(missing_docs)]
|
||||||
|
|
||||||
|
extern crate edit_distance;
|
||||||
|
extern crate parity_crypto;
|
||||||
|
extern crate parity_wordlist;
|
||||||
|
extern crate serde;
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate log;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
mod brain;
|
||||||
|
mod brain_prefix;
|
||||||
|
mod password;
|
||||||
|
mod prefix;
|
||||||
|
|
||||||
|
pub mod brain_recover;
|
||||||
|
|
||||||
|
pub use self::parity_wordlist::Error as WordlistError;
|
||||||
|
pub use self::brain::Brain;
|
||||||
|
pub use self::brain_prefix::BrainPrefix;
|
||||||
|
pub use self::password::Password;
|
||||||
|
pub use self::prefix::Prefix;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fmt, ptr};
|
use std::{fmt, ptr};
|
||||||
|
|
||||||
@@ -57,4 +57,3 @@ impl<'a> From<&'a str> for Password {
|
|||||||
Password::from(String::from(s))
|
Password::from(String::from(s))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::{Random, Generator, KeyPair, Error};
|
use parity_crypto::publickey::{Random, Generator, KeyPair, Error};
|
||||||
|
|
||||||
/// Tries to find keypair with address starting with given prefix.
|
/// Tries to find keypair with address starting with given prefix.
|
||||||
pub struct Prefix {
|
pub struct Prefix {
|
||||||
@@ -37,7 +37,7 @@ impl Generator for Prefix {
|
|||||||
fn generate(&mut self) -> Result<KeyPair, Error> {
|
fn generate(&mut self) -> Result<KeyPair, Error> {
|
||||||
for _ in 0..self.iterations {
|
for _ in 0..self.iterations {
|
||||||
let keypair = Random.generate()?;
|
let keypair = Random.generate()?;
|
||||||
if keypair.address().starts_with(&self.prefix) {
|
if keypair.address().as_ref().starts_with(&self.prefix) {
|
||||||
return Ok(keypair)
|
return Ok(keypair)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,12 +48,13 @@ impl Generator for Prefix {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use {Generator, Prefix};
|
use Prefix;
|
||||||
|
use parity_crypto::publickey::Generator;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn prefix_generator() {
|
fn prefix_generator() {
|
||||||
let prefix = vec![0xffu8];
|
let prefix = vec![0xffu8];
|
||||||
let keypair = Prefix::new(prefix.clone(), usize::max_value()).generate().unwrap();
|
let keypair = Prefix::new(prefix.clone(), usize::max_value()).generate().unwrap();
|
||||||
assert!(keypair.address().starts_with(&prefix));
|
assert!(keypair.address().as_bytes().starts_with(&prefix));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Key Management"
|
||||||
name = "ethstore"
|
name = "ethstore"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
rand = "0.4"
|
rand = "0.7"
|
||||||
ethkey = { path = "../ethkey" }
|
ethkey = { path = "../ethkey" }
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
@@ -15,10 +16,10 @@ rustc-hex = "1.0"
|
|||||||
tiny-keccak = "1.4"
|
tiny-keccak = "1.4"
|
||||||
time = "0.1.34"
|
time = "0.1.34"
|
||||||
itertools = "0.5"
|
itertools = "0.5"
|
||||||
parking_lot = "0.6"
|
parking_lot = "0.9"
|
||||||
parity-crypto = "0.2"
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
||||||
ethereum-types = "0.4"
|
ethereum-types = "0.8.0"
|
||||||
dir = { path = "../util/dir" }
|
dir = { path = "../../util/dir" }
|
||||||
smallvec = "0.6"
|
smallvec = "0.6"
|
||||||
parity-wordlist = "1.0"
|
parity-wordlist = "1.0"
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
@@ -6,7 +6,7 @@ Parity Ethereum key management.
|
|||||||
|
|
||||||
```
|
```
|
||||||
Parity Ethereum key management tool.
|
Parity Ethereum key management tool.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
@@ -335,6 +335,6 @@ _This project is a part of the Parity Ethereum toolchain._
|
|||||||
|
|
||||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
||||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
||||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management.
|
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
|
||||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator.
|
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.
|
||||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
- [whisper](https://github.com/paritytech/whisper) - Implementation of Whisper-v2 PoC.
|
||||||
27
accounts/ethstore/cli/Cargo.toml
Normal file
27
accounts/ethstore/cli/Cargo.toml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
[package]
|
||||||
|
description = "Parity Ethereum Key Management CLI"
|
||||||
|
name = "ethstore-cli"
|
||||||
|
version = "0.1.1"
|
||||||
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
docopt = "1.0"
|
||||||
|
env_logger = "0.5"
|
||||||
|
num_cpus = "1.6"
|
||||||
|
rustc-hex = "1.0"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_derive = "1.0"
|
||||||
|
parking_lot = "0.9"
|
||||||
|
ethstore = { path = "../" }
|
||||||
|
ethkey = { path = "../../ethkey" }
|
||||||
|
parity-crypto = { version = "0.4.2", features = ["publickey"] }
|
||||||
|
dir = { path = '../../../util/dir' }
|
||||||
|
panic_hook = { path = "../../../util/panic-hook" }
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "ethstore"
|
||||||
|
path = "src/main.rs"
|
||||||
|
doc = false
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
tempdir = "0.3"
|
||||||
@@ -1,25 +1,26 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{cmp, thread};
|
use std::{cmp, thread};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
|
|
||||||
use ethstore::{ethkey::Password, PresaleWallet, Error};
|
use ethstore::{PresaleWallet, Error};
|
||||||
|
use ethkey::Password;
|
||||||
use num_cpus;
|
use num_cpus;
|
||||||
|
|
||||||
pub fn run(passwords: VecDeque<Password>, wallet_path: &str) -> Result<(), Error> {
|
pub fn run(passwords: VecDeque<Password>, wallet_path: &str) -> Result<(), Error> {
|
||||||
@@ -1,28 +1,32 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate dir;
|
extern crate dir;
|
||||||
extern crate docopt;
|
extern crate docopt;
|
||||||
extern crate ethstore;
|
extern crate ethstore;
|
||||||
|
extern crate ethkey;
|
||||||
extern crate num_cpus;
|
extern crate num_cpus;
|
||||||
extern crate panic_hook;
|
extern crate panic_hook;
|
||||||
extern crate parking_lot;
|
extern crate parking_lot;
|
||||||
|
extern crate parity_crypto;
|
||||||
extern crate rustc_hex;
|
extern crate rustc_hex;
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
|
|
||||||
|
extern crate env_logger;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
@@ -32,20 +36,21 @@ use std::{env, process, fs, fmt};
|
|||||||
|
|
||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory};
|
use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory};
|
||||||
use ethstore::ethkey::{Address, Password};
|
use ethkey::Password;
|
||||||
|
use parity_crypto::publickey::Address;
|
||||||
use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, PresaleWallet, SecretVaultRef, StoreAccountRef};
|
use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, PresaleWallet, SecretVaultRef, StoreAccountRef};
|
||||||
|
|
||||||
mod crack;
|
mod crack;
|
||||||
|
|
||||||
pub const USAGE: &'static str = r#"
|
pub const USAGE: &'static str = r#"
|
||||||
Parity Ethereum key management tool.
|
Parity Ethereum key management tool.
|
||||||
Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore import [--src DIR] [--dir DIR]
|
ethstore import [<password>] [--src DIR] [--dir DIR]
|
||||||
ethstore import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
ethstore find-wallet-pass <path> <password>
|
ethstore find-wallet-pass <path> <password>
|
||||||
ethstore remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
ethstore remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
|
||||||
@@ -146,30 +151,34 @@ impl fmt::Display for Error {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
panic_hook::set_abort();
|
panic_hook::set_abort();
|
||||||
|
if env::var("RUST_LOG").is_err() {
|
||||||
|
env::set_var("RUST_LOG", "warn")
|
||||||
|
}
|
||||||
|
env_logger::try_init().expect("Logger initialized only once.");
|
||||||
|
|
||||||
match execute(env::args()) {
|
match execute(env::args()) {
|
||||||
Ok(result) => println!("{}", result),
|
Ok(result) => println!("{}", result),
|
||||||
Err(Error::Docopt(ref e)) => e.exit(),
|
Err(Error::Docopt(ref e)) => e.exit(),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("{}", err);
|
eprintln!("{}", err);
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn key_dir(location: &str) -> Result<Box<KeyDirectory>, Error> {
|
fn key_dir(location: &str, password: Option<Password>) -> Result<Box<dyn KeyDirectory>, Error> {
|
||||||
let dir: Box<KeyDirectory> = match location {
|
let dir: RootDiskDirectory = match location {
|
||||||
"geth" => Box::new(RootDiskDirectory::create(dir::geth(false))?),
|
"geth" => RootDiskDirectory::create(dir::geth(false))?,
|
||||||
"geth-test" => Box::new(RootDiskDirectory::create(dir::geth(true))?),
|
"geth-test" => RootDiskDirectory::create(dir::geth(true))?,
|
||||||
path if path.starts_with("parity") => {
|
path if path.starts_with("parity") => {
|
||||||
let chain = path.split('-').nth(1).unwrap_or("ethereum");
|
let chain = path.split('-').nth(1).unwrap_or("ethereum");
|
||||||
let path = dir::parity(chain);
|
let path = dir::parity(chain);
|
||||||
Box::new(RootDiskDirectory::create(path)?)
|
RootDiskDirectory::create(path)?
|
||||||
},
|
},
|
||||||
path => Box::new(RootDiskDirectory::create(path)?),
|
path => RootDiskDirectory::create(path)?,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(dir)
|
Ok(Box::new(dir.with_password(password)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open_args_vault(store: &EthStore, args: &Args) -> Result<SecretVaultRef, Error> {
|
fn open_args_vault(store: &EthStore, args: &Args) -> Result<SecretVaultRef, Error> {
|
||||||
@@ -202,9 +211,9 @@ fn format_vaults(vaults: &[String]) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn load_password(path: &str) -> Result<Password, Error> {
|
fn load_password(path: &str) -> Result<Password, Error> {
|
||||||
let mut file = fs::File::open(path).map_err(|e| ethstore::Error::Custom(format!("Error opening password file {}: {}", path, e)))?;
|
let mut file = fs::File::open(path).map_err(|e| ethstore::Error::Custom(format!("Error opening password file '{}': {}", path, e)))?;
|
||||||
let mut password = String::new();
|
let mut password = String::new();
|
||||||
file.read_to_string(&mut password).map_err(|e| ethstore::Error::Custom(format!("Error reading password file {}: {}", path, e)))?;
|
file.read_to_string(&mut password).map_err(|e| ethstore::Error::Custom(format!("Error reading password file '{}': {}", path, e)))?;
|
||||||
// drop EOF
|
// drop EOF
|
||||||
let _ = password.pop();
|
let _ = password.pop();
|
||||||
Ok(password.into())
|
Ok(password.into())
|
||||||
@@ -214,7 +223,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
let args: Args = Docopt::new(USAGE)
|
let args: Args = Docopt::new(USAGE)
|
||||||
.and_then(|d| d.argv(command).deserialize())?;
|
.and_then(|d| d.argv(command).deserialize())?;
|
||||||
|
|
||||||
let store = EthStore::open(key_dir(&args.flag_dir)?)?;
|
let store = EthStore::open(key_dir(&args.flag_dir, None)?)?;
|
||||||
|
|
||||||
return if args.cmd_insert {
|
return if args.cmd_insert {
|
||||||
let secret = args.arg_secret.parse().map_err(|_| ethstore::Error::InvalidSecret)?;
|
let secret = args.arg_secret.parse().map_err(|_| ethstore::Error::InvalidSecret)?;
|
||||||
@@ -239,8 +248,13 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
|||||||
.collect();
|
.collect();
|
||||||
Ok(format_accounts(&accounts))
|
Ok(format_accounts(&accounts))
|
||||||
} else if args.cmd_import {
|
} else if args.cmd_import {
|
||||||
let src = key_dir(&args.flag_src)?;
|
let password = match args.arg_password.as_ref() {
|
||||||
let dst = key_dir(&args.flag_dir)?;
|
"" => None,
|
||||||
|
_ => Some(load_password(&args.arg_password)?)
|
||||||
|
};
|
||||||
|
let src = key_dir(&args.flag_src, password)?;
|
||||||
|
let dst = key_dir(&args.flag_dir, None)?;
|
||||||
|
|
||||||
let accounts = import_accounts(&*src, &*dst)?;
|
let accounts = import_accounts(&*src, &*dst)?;
|
||||||
Ok(format_accounts(&accounts))
|
Ok(format_accounts(&accounts))
|
||||||
} else if args.cmd_import_wallet {
|
} else if args.cmd_import_wallet {
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate tempdir;
|
extern crate tempdir;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use json;
|
use json;
|
||||||
|
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::str;
|
use std::str;
|
||||||
use ethkey::{Password, Secret};
|
use crypto::publickey::Secret;
|
||||||
|
use ethkey::Password;
|
||||||
use {json, Error, crypto};
|
use {json, Error, crypto};
|
||||||
use crypto::Keccak256;
|
use crypto::Keccak256;
|
||||||
use random::Random;
|
use random::Random;
|
||||||
@@ -74,7 +75,7 @@ impl From<Crypto> for String {
|
|||||||
impl Crypto {
|
impl Crypto {
|
||||||
/// Encrypt account secret
|
/// Encrypt account secret
|
||||||
pub fn with_secret(secret: &Secret, password: &Password, iterations: u32) -> Result<Self, crypto::Error> {
|
pub fn with_secret(secret: &Secret, password: &Password, iterations: u32) -> Result<Self, crypto::Error> {
|
||||||
Crypto::with_plain(&*secret, password, iterations)
|
Crypto::with_plain(secret.as_ref(), password, iterations)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Encrypt custom plain data
|
/// Encrypt custom plain data
|
||||||
@@ -84,7 +85,8 @@ impl Crypto {
|
|||||||
|
|
||||||
// two parts of derived key
|
// two parts of derived key
|
||||||
// DK = [ DK[0..15] DK[16..31] ] = [derived_left_bits, derived_right_bits]
|
// DK = [ DK[0..15] DK[16..31] ] = [derived_left_bits, derived_right_bits]
|
||||||
let (derived_left_bits, derived_right_bits) = crypto::derive_key_iterations(password.as_bytes(), &salt, iterations);
|
let (derived_left_bits, derived_right_bits) =
|
||||||
|
crypto::derive_key_iterations(password.as_bytes(), &salt, iterations);
|
||||||
|
|
||||||
// preallocated (on-stack in case of `Secret`) buffer to hold cipher
|
// preallocated (on-stack in case of `Secret`) buffer to hold cipher
|
||||||
// length = length(plain) as we are using CTR-approach
|
// length = length(plain) as we are using CTR-approach
|
||||||
@@ -104,7 +106,7 @@ impl Crypto {
|
|||||||
ciphertext: ciphertext.into_vec(),
|
ciphertext: ciphertext.into_vec(),
|
||||||
kdf: Kdf::Pbkdf2(Pbkdf2 {
|
kdf: Kdf::Pbkdf2(Pbkdf2 {
|
||||||
dklen: crypto::KEY_LENGTH as u32,
|
dklen: crypto::KEY_LENGTH as u32,
|
||||||
salt: salt,
|
salt: salt.to_vec(),
|
||||||
c: iterations,
|
c: iterations,
|
||||||
prf: Prf::HmacSha256,
|
prf: Prf::HmacSha256,
|
||||||
}),
|
}),
|
||||||
@@ -119,7 +121,7 @@ impl Crypto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let secret = self.do_decrypt(password, 32)?;
|
let secret = self.do_decrypt(password, 32)?;
|
||||||
Ok(Secret::from_unsafe_slice(&secret)?)
|
Ok(Secret::import_key(&secret)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Try to decrypt and return result as is
|
/// Try to decrypt and return result as is
|
||||||
@@ -157,7 +159,7 @@ impl Crypto {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ethkey::{Generator, Random};
|
use crypto::publickey::{Generator, Random};
|
||||||
use super::{Crypto, Error};
|
use super::{Crypto, Error};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use json;
|
use json;
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ pub struct Pbkdf2 {
|
|||||||
pub c: u32,
|
pub c: u32,
|
||||||
pub dklen: u32,
|
pub dklen: u32,
|
||||||
pub prf: Prf,
|
pub prf: Prf,
|
||||||
pub salt: [u8; 32],
|
pub salt: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
@@ -35,7 +35,7 @@ pub struct Scrypt {
|
|||||||
pub p: u32,
|
pub p: u32,
|
||||||
pub n: u32,
|
pub n: u32,
|
||||||
pub r: u32,
|
pub r: u32,
|
||||||
pub salt: [u8; 32],
|
pub salt: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
mod cipher;
|
mod cipher;
|
||||||
mod crypto;
|
mod crypto;
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use ethkey::{self, KeyPair, sign, Address, Password, Signature, Message, Public, Secret};
|
use crypto::publickey::{KeyPair, sign, Address, Signature, Message, Public, Secret};
|
||||||
use ethkey::crypto::ecdh::agree;
|
use ethkey::Password;
|
||||||
|
use crypto::publickey::ecdh::agree;
|
||||||
use {json, Error};
|
use {json, Error};
|
||||||
use account::Version;
|
use account::Version;
|
||||||
use crypto;
|
use crypto;
|
||||||
@@ -45,7 +46,7 @@ impl Into<json::KeyFile> for SafeAccount {
|
|||||||
json::KeyFile {
|
json::KeyFile {
|
||||||
id: From::from(self.id),
|
id: From::from(self.id),
|
||||||
version: self.version.into(),
|
version: self.version.into(),
|
||||||
address: self.address.into(),
|
address: Some(self.address.into()),
|
||||||
crypto: self.crypto.into(),
|
crypto: self.crypto.into(),
|
||||||
name: Some(self.name.into()),
|
name: Some(self.name.into()),
|
||||||
meta: Some(self.meta.into()),
|
meta: Some(self.meta.into()),
|
||||||
@@ -77,16 +78,43 @@ impl SafeAccount {
|
|||||||
/// Create a new `SafeAccount` from the given `json`; if it was read from a
|
/// Create a new `SafeAccount` from the given `json`; if it was read from a
|
||||||
/// file, the `filename` should be `Some` name. If it is as yet anonymous, then it
|
/// file, the `filename` should be `Some` name. If it is as yet anonymous, then it
|
||||||
/// can be left `None`.
|
/// can be left `None`.
|
||||||
pub fn from_file(json: json::KeyFile, filename: Option<String>) -> Self {
|
/// In case `password` is provided, we will attempt to read the secret from the keyfile
|
||||||
SafeAccount {
|
/// and derive the address from it instead of reading it directly.
|
||||||
|
/// Providing password is required for `json::KeyFile`s with no address.
|
||||||
|
pub fn from_file(json: json::KeyFile, filename: Option<String>, password: &Option<Password>) -> Result<Self, Error> {
|
||||||
|
let crypto = Crypto::from(json.crypto);
|
||||||
|
let address = match (password, &json.address) {
|
||||||
|
(None, Some(json_address)) => json_address.into(),
|
||||||
|
(None, None) => Err(Error::Custom(
|
||||||
|
"This keystore does not contain address. You need to provide password to import it".into()))?,
|
||||||
|
(Some(password), json_address) => {
|
||||||
|
let derived_address = KeyPair::from_secret(
|
||||||
|
crypto.secret(&password).map_err(|_| Error::InvalidPassword)?
|
||||||
|
)?.address();
|
||||||
|
|
||||||
|
match json_address {
|
||||||
|
Some(json_address) => {
|
||||||
|
let json_address = json_address.into();
|
||||||
|
if derived_address != json_address {
|
||||||
|
warn!("Detected address mismatch when opening an account. Derived: {:?}, in json got: {:?}",
|
||||||
|
derived_address, json_address);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
derived_address
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(SafeAccount {
|
||||||
id: json.id.into(),
|
id: json.id.into(),
|
||||||
version: json.version.into(),
|
version: json.version.into(),
|
||||||
address: json.address.into(),
|
address,
|
||||||
crypto: json.crypto.into(),
|
crypto,
|
||||||
filename: filename,
|
filename,
|
||||||
name: json.name.unwrap_or(String::new()),
|
name: json.name.unwrap_or(String::new()),
|
||||||
meta: json.meta.unwrap_or("{}".to_owned()),
|
meta: json.meta.unwrap_or("{}".to_owned()),
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new `SafeAccount` from the given vault `json`; if it was read from a
|
/// Create a new `SafeAccount` from the given vault `json`; if it was read from a
|
||||||
@@ -97,14 +125,14 @@ impl SafeAccount {
|
|||||||
let meta_plain = meta_crypto.decrypt(password)?;
|
let meta_plain = meta_crypto.decrypt(password)?;
|
||||||
let meta_plain = json::VaultKeyMeta::load(&meta_plain).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
let meta_plain = json::VaultKeyMeta::load(&meta_plain).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
||||||
|
|
||||||
Ok(SafeAccount::from_file(json::KeyFile {
|
SafeAccount::from_file(json::KeyFile {
|
||||||
id: json.id,
|
id: json.id,
|
||||||
version: json.version,
|
version: json.version,
|
||||||
crypto: json.crypto,
|
crypto: json.crypto,
|
||||||
address: meta_plain.address,
|
address: Some(meta_plain.address),
|
||||||
name: meta_plain.name,
|
name: meta_plain.name,
|
||||||
meta: meta_plain.meta,
|
meta: meta_plain.meta,
|
||||||
}, filename))
|
}, filename, &None)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new `VaultKeyFile` from the given `self`
|
/// Create a new `VaultKeyFile` from the given `self`
|
||||||
@@ -134,7 +162,7 @@ impl SafeAccount {
|
|||||||
/// Decrypt a message.
|
/// Decrypt a message.
|
||||||
pub fn decrypt(&self, password: &Password, shared_mac: &[u8], message: &[u8]) -> Result<Vec<u8>, Error> {
|
pub fn decrypt(&self, password: &Password, shared_mac: &[u8], message: &[u8]) -> Result<Vec<u8>, Error> {
|
||||||
let secret = self.crypto.secret(password)?;
|
let secret = self.crypto.secret(password)?;
|
||||||
ethkey::crypto::ecies::decrypt(&secret, shared_mac, message).map_err(From::from)
|
crypto::publickey::ecies::decrypt(&secret, shared_mac, message).map_err(From::from)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Agree on shared key.
|
/// Agree on shared key.
|
||||||
@@ -172,7 +200,7 @@ impl SafeAccount {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use ethkey::{Generator, Random, verify_public, Message};
|
use crypto::publickey::{Generator, Random, verify_public, Message};
|
||||||
use super::SafeAccount;
|
use super::SafeAccount;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use json;
|
use json;
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fs, io};
|
use std::{fs, io};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@@ -23,6 +23,7 @@ use {json, SafeAccount, Error};
|
|||||||
use json::Uuid;
|
use json::Uuid;
|
||||||
use super::{KeyDirectory, VaultKeyDirectory, VaultKeyDirectoryProvider, VaultKey};
|
use super::{KeyDirectory, VaultKeyDirectory, VaultKeyDirectoryProvider, VaultKey};
|
||||||
use super::vault::{VAULT_FILE_NAME, VaultDiskDirectory};
|
use super::vault::{VAULT_FILE_NAME, VaultDiskDirectory};
|
||||||
|
use ethkey::Password;
|
||||||
|
|
||||||
const IGNORED_FILES: &'static [&'static str] = &[
|
const IGNORED_FILES: &'static [&'static str] = &[
|
||||||
"thumbs.db",
|
"thumbs.db",
|
||||||
@@ -60,7 +61,6 @@ pub fn find_unique_filename_using_random_suffix(parent_path: &Path, original_fil
|
|||||||
/// Create a new file and restrict permissions to owner only. It errors if the file already exists.
|
/// Create a new file and restrict permissions to owner only. It errors if the file already exists.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn create_new_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
pub fn create_new_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
||||||
use libc;
|
|
||||||
use std::os::unix::fs::OpenOptionsExt;
|
use std::os::unix::fs::OpenOptionsExt;
|
||||||
|
|
||||||
fs::OpenOptions::new()
|
fs::OpenOptions::new()
|
||||||
@@ -82,7 +82,6 @@ pub fn create_new_file_with_permissions_to_owner(file_path: &Path) -> io::Result
|
|||||||
/// Create a new file and restrict permissions to owner only. It replaces the existing file if it already exists.
|
/// Create a new file and restrict permissions to owner only. It replaces the existing file if it already exists.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn replace_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
pub fn replace_file_with_permissions_to_owner(file_path: &Path) -> io::Result<fs::File> {
|
||||||
use libc;
|
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
|
|
||||||
let file = fs::File::create(file_path)?;
|
let file = fs::File::create(file_path)?;
|
||||||
@@ -106,6 +105,7 @@ pub type RootDiskDirectory = DiskDirectory<DiskKeyFileManager>;
|
|||||||
pub trait KeyFileManager: Send + Sync {
|
pub trait KeyFileManager: Send + Sync {
|
||||||
/// Read `SafeAccount` from given key file stream
|
/// Read `SafeAccount` from given key file stream
|
||||||
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read;
|
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read;
|
||||||
|
|
||||||
/// Write `SafeAccount` to given key file stream
|
/// Write `SafeAccount` to given key file stream
|
||||||
fn write<T>(&self, account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write;
|
fn write<T>(&self, account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,10 @@ pub struct DiskDirectory<T> where T: KeyFileManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Keys file manager for root keys directory
|
/// Keys file manager for root keys directory
|
||||||
pub struct DiskKeyFileManager;
|
#[derive(Default)]
|
||||||
|
pub struct DiskKeyFileManager {
|
||||||
|
password: Option<Password>,
|
||||||
|
}
|
||||||
|
|
||||||
impl RootDiskDirectory {
|
impl RootDiskDirectory {
|
||||||
pub fn create<P>(path: P) -> Result<Self, Error> where P: AsRef<Path> {
|
pub fn create<P>(path: P) -> Result<Self, Error> where P: AsRef<Path> {
|
||||||
@@ -125,8 +128,13 @@ impl RootDiskDirectory {
|
|||||||
Ok(Self::at(path))
|
Ok(Self::at(path))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// allows to read keyfiles with given password (needed for keyfiles w/o address)
|
||||||
|
pub fn with_password(&self, password: Option<Password>) -> Self {
|
||||||
|
DiskDirectory::new(&self.path, DiskKeyFileManager { password })
|
||||||
|
}
|
||||||
|
|
||||||
pub fn at<P>(path: P) -> Self where P: AsRef<Path> {
|
pub fn at<P>(path: P) -> Self where P: AsRef<Path> {
|
||||||
DiskDirectory::new(path, DiskKeyFileManager)
|
DiskDirectory::new(path, DiskKeyFileManager::default())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +284,7 @@ impl<T> KeyDirectory for DiskDirectory<T> where T: KeyFileManager {
|
|||||||
|
|
||||||
fn path(&self) -> Option<&PathBuf> { Some(&self.path) }
|
fn path(&self) -> Option<&PathBuf> { Some(&self.path) }
|
||||||
|
|
||||||
fn as_vault_provider(&self) -> Option<&VaultKeyDirectoryProvider> {
|
fn as_vault_provider(&self) -> Option<&dyn VaultKeyDirectoryProvider> {
|
||||||
Some(self)
|
Some(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,12 +294,12 @@ impl<T> KeyDirectory for DiskDirectory<T> where T: KeyFileManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<T> VaultKeyDirectoryProvider for DiskDirectory<T> where T: KeyFileManager {
|
impl<T> VaultKeyDirectoryProvider for DiskDirectory<T> where T: KeyFileManager {
|
||||||
fn create(&self, name: &str, key: VaultKey) -> Result<Box<VaultKeyDirectory>, Error> {
|
fn create(&self, name: &str, key: VaultKey) -> Result<Box<dyn VaultKeyDirectory>, Error> {
|
||||||
let vault_dir = VaultDiskDirectory::create(&self.path, name, key)?;
|
let vault_dir = VaultDiskDirectory::create(&self.path, name, key)?;
|
||||||
Ok(Box::new(vault_dir))
|
Ok(Box::new(vault_dir))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open(&self, name: &str, key: VaultKey) -> Result<Box<VaultKeyDirectory>, Error> {
|
fn open(&self, name: &str, key: VaultKey) -> Result<Box<dyn VaultKeyDirectory>, Error> {
|
||||||
let vault_dir = VaultDiskDirectory::at(&self.path, name, key)?;
|
let vault_dir = VaultDiskDirectory::at(&self.path, name, key)?;
|
||||||
Ok(Box::new(vault_dir))
|
Ok(Box::new(vault_dir))
|
||||||
}
|
}
|
||||||
@@ -319,7 +327,7 @@ impl<T> VaultKeyDirectoryProvider for DiskDirectory<T> where T: KeyFileManager {
|
|||||||
impl KeyFileManager for DiskKeyFileManager {
|
impl KeyFileManager for DiskKeyFileManager {
|
||||||
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read {
|
fn read<T>(&self, filename: Option<String>, reader: T) -> Result<SafeAccount, Error> where T: io::Read {
|
||||||
let key_file = json::KeyFile::load(reader).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
let key_file = json::KeyFile::load(reader).map_err(|e| Error::Custom(format!("{:?}", e)))?;
|
||||||
Ok(SafeAccount::from_file(key_file, filename))
|
SafeAccount::from_file(key_file, filename, &self.password)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write<T>(&self, mut account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write {
|
fn write<T>(&self, mut account: SafeAccount, writer: &mut T) -> Result<(), Error> where T: io::Write {
|
||||||
@@ -348,7 +356,7 @@ mod test {
|
|||||||
use std::{env, fs};
|
use std::{env, fs};
|
||||||
use super::{KeyDirectory, RootDiskDirectory, VaultKey};
|
use super::{KeyDirectory, RootDiskDirectory, VaultKey};
|
||||||
use account::SafeAccount;
|
use account::SafeAccount;
|
||||||
use ethkey::{Random, Generator};
|
use crypto::publickey::{Random, Generator};
|
||||||
use self::tempdir::TempDir;
|
use self::tempdir::TempDir;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use itertools;
|
use itertools;
|
||||||
use ethkey::Address;
|
use crypto::publickey::Address;
|
||||||
|
|
||||||
use {SafeAccount, Error};
|
use {SafeAccount, Error};
|
||||||
use super::KeyDirectory;
|
use super::KeyDirectory;
|
||||||
@@ -68,7 +68,7 @@ impl KeyDirectory for MemoryDirectory {
|
|||||||
fn unique_repr(&self) -> Result<u64, Error> {
|
fn unique_repr(&self) -> Result<u64, Error> {
|
||||||
let mut val = 0u64;
|
let mut val = 0u64;
|
||||||
let accounts = self.accounts.read();
|
let accounts = self.accounts.read();
|
||||||
for acc in accounts.keys() { val = val ^ acc.low_u64() }
|
for acc in accounts.keys() { val = val ^ acc.to_low_u64_be() }
|
||||||
Ok(val)
|
Ok(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Accounts Directory
|
//! Accounts Directory
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ pub trait KeyDirectory: Send + Sync {
|
|||||||
/// Get directory filesystem path, if available
|
/// Get directory filesystem path, if available
|
||||||
fn path(&self) -> Option<&PathBuf> { None }
|
fn path(&self) -> Option<&PathBuf> { None }
|
||||||
/// Return vault provider, if available
|
/// Return vault provider, if available
|
||||||
fn as_vault_provider(&self) -> Option<&VaultKeyDirectoryProvider> { None }
|
fn as_vault_provider(&self) -> Option<&dyn VaultKeyDirectoryProvider> { None }
|
||||||
/// Unique representation of directory account collection
|
/// Unique representation of directory account collection
|
||||||
fn unique_repr(&self) -> Result<u64, Error>;
|
fn unique_repr(&self) -> Result<u64, Error>;
|
||||||
}
|
}
|
||||||
@@ -65,9 +65,9 @@ pub trait KeyDirectory: Send + Sync {
|
|||||||
/// Vaults provider
|
/// Vaults provider
|
||||||
pub trait VaultKeyDirectoryProvider {
|
pub trait VaultKeyDirectoryProvider {
|
||||||
/// Create new vault with given key
|
/// Create new vault with given key
|
||||||
fn create(&self, name: &str, key: VaultKey) -> Result<Box<VaultKeyDirectory>, Error>;
|
fn create(&self, name: &str, key: VaultKey) -> Result<Box<dyn VaultKeyDirectory>, Error>;
|
||||||
/// Open existing vault with given key
|
/// Open existing vault with given key
|
||||||
fn open(&self, name: &str, key: VaultKey) -> Result<Box<VaultKeyDirectory>, Error>;
|
fn open(&self, name: &str, key: VaultKey) -> Result<Box<dyn VaultKeyDirectory>, Error>;
|
||||||
/// List all vaults
|
/// List all vaults
|
||||||
fn list_vaults(&self) -> Result<Vec<String>, Error>;
|
fn list_vaults(&self) -> Result<Vec<String>, Error>;
|
||||||
/// Get vault meta
|
/// Get vault meta
|
||||||
@@ -77,7 +77,7 @@ pub trait VaultKeyDirectoryProvider {
|
|||||||
/// Vault directory
|
/// Vault directory
|
||||||
pub trait VaultKeyDirectory: KeyDirectory {
|
pub trait VaultKeyDirectory: KeyDirectory {
|
||||||
/// Cast to `KeyDirectory`
|
/// Cast to `KeyDirectory`
|
||||||
fn as_key_directory(&self) -> &KeyDirectory;
|
fn as_key_directory(&self) -> &dyn KeyDirectory;
|
||||||
/// Vault name
|
/// Vault name
|
||||||
fn name(&self) -> &str;
|
fn name(&self) -> &str;
|
||||||
/// Get vault key
|
/// Get vault key
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fs, io};
|
use std::{fs, io};
|
||||||
use std::path::{PathBuf, Path};
|
use std::path::{PathBuf, Path};
|
||||||
@@ -119,7 +119,7 @@ impl VaultDiskDirectory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl VaultKeyDirectory for VaultDiskDirectory {
|
impl VaultKeyDirectory for VaultDiskDirectory {
|
||||||
fn as_key_directory(&self) -> &KeyDirectory {
|
fn as_key_directory(&self) -> &dyn KeyDirectory {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,8 +310,10 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn make_vault_dir_path_succeeds() {
|
fn make_vault_dir_path_succeeds() {
|
||||||
assert_eq!(make_vault_dir_path("/home/user/parity", "vault", true).unwrap().to_str().unwrap(), "/home/user/parity/vault");
|
use std::path::Path;
|
||||||
assert_eq!(make_vault_dir_path("/home/user/parity", "*bad-name*", false).unwrap().to_str().unwrap(), "/home/user/parity/*bad-name*");
|
|
||||||
|
assert_eq!(&make_vault_dir_path("/home/user/parity", "vault", true).unwrap(), &Path::new("/home/user/parity/vault"));
|
||||||
|
assert_eq!(&make_vault_dir_path("/home/user/parity", "*bad-name*", false).unwrap(), &Path::new("/home/user/parity/*bad-name*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1,24 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io::Error as IoError;
|
use std::io::Error as IoError;
|
||||||
use ethkey::{self, Error as EthKeyError};
|
|
||||||
use crypto::{self, Error as EthCryptoError};
|
use crypto::{self, Error as EthCryptoError};
|
||||||
use ethkey::DerivationError;
|
use crypto::publickey::{Error as EthPublicKeyCryptoError, DerivationError};
|
||||||
|
|
||||||
/// Account-related errors.
|
/// Account-related errors.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -47,12 +46,10 @@ pub enum Error {
|
|||||||
VaultNotFound,
|
VaultNotFound,
|
||||||
/// Account creation failed.
|
/// Account creation failed.
|
||||||
CreationFailed,
|
CreationFailed,
|
||||||
/// `EthKey` error
|
|
||||||
EthKey(EthKeyError),
|
|
||||||
/// `ethkey::crypto::Error`
|
|
||||||
EthKeyCrypto(ethkey::crypto::Error),
|
|
||||||
/// `EthCrypto` error
|
/// `EthCrypto` error
|
||||||
EthCrypto(EthCryptoError),
|
EthCrypto(EthCryptoError),
|
||||||
|
/// `EthPublicKeyCryptoError` error
|
||||||
|
EthPublicKeyCrypto(EthPublicKeyCryptoError),
|
||||||
/// Derivation error
|
/// Derivation error
|
||||||
Derivation(DerivationError),
|
Derivation(DerivationError),
|
||||||
/// Custom error
|
/// Custom error
|
||||||
@@ -74,9 +71,8 @@ impl fmt::Display for Error {
|
|||||||
Error::InvalidVaultName => "Invalid vault name".into(),
|
Error::InvalidVaultName => "Invalid vault name".into(),
|
||||||
Error::VaultNotFound => "Vault not found".into(),
|
Error::VaultNotFound => "Vault not found".into(),
|
||||||
Error::CreationFailed => "Account creation failed".into(),
|
Error::CreationFailed => "Account creation failed".into(),
|
||||||
Error::EthKey(ref err) => err.to_string(),
|
|
||||||
Error::EthKeyCrypto(ref err) => err.to_string(),
|
|
||||||
Error::EthCrypto(ref err) => err.to_string(),
|
Error::EthCrypto(ref err) => err.to_string(),
|
||||||
|
Error::EthPublicKeyCrypto(ref err) => err.to_string(),
|
||||||
Error::Derivation(ref err) => format!("Derivation error: {:?}", err),
|
Error::Derivation(ref err) => format!("Derivation error: {:?}", err),
|
||||||
Error::Custom(ref s) => s.clone(),
|
Error::Custom(ref s) => s.clone(),
|
||||||
};
|
};
|
||||||
@@ -91,15 +87,9 @@ impl From<IoError> for Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<EthKeyError> for Error {
|
impl From<EthPublicKeyCryptoError> for Error {
|
||||||
fn from(err: EthKeyError) -> Self {
|
fn from(err: EthPublicKeyCryptoError) -> Self {
|
||||||
Error::EthKey(err)
|
Error::EthPublicKeyCrypto(err)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<ethkey::crypto::Error> for Error {
|
|
||||||
fn from(err: ethkey::crypto::Error) -> Self {
|
|
||||||
Error::EthKeyCrypto(err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
@@ -22,7 +22,8 @@ use std::time::{Instant, Duration};
|
|||||||
|
|
||||||
use crypto::KEY_ITERATIONS;
|
use crypto::KEY_ITERATIONS;
|
||||||
use random::Random;
|
use random::Random;
|
||||||
use ethkey::{self, Signature, Password, Address, Message, Secret, Public, KeyPair, ExtendedKeyPair};
|
use crypto::publickey::{Signature, Address, Message, Secret, Public, KeyPair, ExtendedKeyPair};
|
||||||
|
use ethkey::Password;
|
||||||
use accounts_dir::{KeyDirectory, VaultKeyDirectory, VaultKey, SetKeyError};
|
use accounts_dir::{KeyDirectory, VaultKeyDirectory, VaultKey, SetKeyError};
|
||||||
use account::SafeAccount;
|
use account::SafeAccount;
|
||||||
use presale::PresaleWallet;
|
use presale::PresaleWallet;
|
||||||
@@ -36,12 +37,12 @@ pub struct EthStore {
|
|||||||
|
|
||||||
impl EthStore {
|
impl EthStore {
|
||||||
/// Open a new accounts store with given key directory backend.
|
/// Open a new accounts store with given key directory backend.
|
||||||
pub fn open(directory: Box<KeyDirectory>) -> Result<Self, Error> {
|
pub fn open(directory: Box<dyn KeyDirectory>) -> Result<Self, Error> {
|
||||||
Self::open_with_iterations(directory, KEY_ITERATIONS as u32)
|
Self::open_with_iterations(directory, KEY_ITERATIONS as u32)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Open a new account store with given key directory backend and custom number of iterations.
|
/// Open a new account store with given key directory backend and custom number of iterations.
|
||||||
pub fn open_with_iterations(directory: Box<KeyDirectory>, iterations: u32) -> Result<Self, Error> {
|
pub fn open_with_iterations(directory: Box<dyn KeyDirectory>, iterations: u32) -> Result<Self, Error> {
|
||||||
Ok(EthStore {
|
Ok(EthStore {
|
||||||
store: EthMultiStore::open_with_iterations(directory, iterations)?,
|
store: EthMultiStore::open_with_iterations(directory, iterations)?,
|
||||||
})
|
})
|
||||||
@@ -168,7 +169,7 @@ impl SecretStore for EthStore {
|
|||||||
|
|
||||||
fn import_wallet(&self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool) -> Result<StoreAccountRef, Error> {
|
fn import_wallet(&self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool) -> Result<StoreAccountRef, Error> {
|
||||||
let json_keyfile = json::KeyFile::load(json).map_err(|_| Error::InvalidKeyFile("Invalid JSON format".to_owned()))?;
|
let json_keyfile = json::KeyFile::load(json).map_err(|_| Error::InvalidKeyFile("Invalid JSON format".to_owned()))?;
|
||||||
let mut safe_account = SafeAccount::from_file(json_keyfile, None);
|
let mut safe_account = SafeAccount::from_file(json_keyfile, None, &None)?;
|
||||||
|
|
||||||
if gen_id {
|
if gen_id {
|
||||||
safe_account.id = Random::random();
|
safe_account.id = Random::random();
|
||||||
@@ -184,7 +185,7 @@ impl SecretStore for EthStore {
|
|||||||
Ok(account.check_password(password))
|
Ok(account.check_password(password))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn copy_account(&self, new_store: &SimpleSecretStore, new_vault: SecretVaultRef, account: &StoreAccountRef, password: &Password, new_password: &Password) -> Result<(), Error> {
|
fn copy_account(&self, new_store: &dyn SimpleSecretStore, new_vault: SecretVaultRef, account: &StoreAccountRef, password: &Password, new_password: &Password) -> Result<(), Error> {
|
||||||
let account = self.get(account)?;
|
let account = self.get(account)?;
|
||||||
let secret = account.crypto.secret(password)?;
|
let secret = account.crypto.secret(password)?;
|
||||||
new_store.insert_account(new_vault, secret, new_password)?;
|
new_store.insert_account(new_vault, secret, new_password)?;
|
||||||
@@ -256,11 +257,11 @@ impl SecretStore for EthStore {
|
|||||||
|
|
||||||
/// Similar to `EthStore` but may store many accounts (with different passwords) for the same `Address`
|
/// Similar to `EthStore` but may store many accounts (with different passwords) for the same `Address`
|
||||||
pub struct EthMultiStore {
|
pub struct EthMultiStore {
|
||||||
dir: Box<KeyDirectory>,
|
dir: Box<dyn KeyDirectory>,
|
||||||
iterations: u32,
|
iterations: u32,
|
||||||
// order lock: cache, then vaults
|
// order lock: cache, then vaults
|
||||||
cache: RwLock<BTreeMap<StoreAccountRef, Vec<SafeAccount>>>,
|
cache: RwLock<BTreeMap<StoreAccountRef, Vec<SafeAccount>>>,
|
||||||
vaults: Mutex<HashMap<String, Box<VaultKeyDirectory>>>,
|
vaults: Mutex<HashMap<String, Box<dyn VaultKeyDirectory>>>,
|
||||||
timestamp: Mutex<Timestamp>,
|
timestamp: Mutex<Timestamp>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,12 +273,12 @@ struct Timestamp {
|
|||||||
|
|
||||||
impl EthMultiStore {
|
impl EthMultiStore {
|
||||||
/// Open new multi-accounts store with given key directory backend.
|
/// Open new multi-accounts store with given key directory backend.
|
||||||
pub fn open(directory: Box<KeyDirectory>) -> Result<Self, Error> {
|
pub fn open(directory: Box<dyn KeyDirectory>) -> Result<Self, Error> {
|
||||||
Self::open_with_iterations(directory, KEY_ITERATIONS as u32)
|
Self::open_with_iterations(directory, KEY_ITERATIONS as u32)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Open new multi-accounts store with given key directory backend and custom number of iterations for new keys.
|
/// Open new multi-accounts store with given key directory backend and custom number of iterations for new keys.
|
||||||
pub fn open_with_iterations(directory: Box<KeyDirectory>, iterations: u32) -> Result<Self, Error> {
|
pub fn open_with_iterations(directory: Box<dyn KeyDirectory>, iterations: u32) -> Result<Self, Error> {
|
||||||
let store = EthMultiStore {
|
let store = EthMultiStore {
|
||||||
dir: directory,
|
dir: directory,
|
||||||
vaults: Mutex::new(HashMap::new()),
|
vaults: Mutex::new(HashMap::new()),
|
||||||
@@ -442,13 +443,13 @@ impl EthMultiStore {
|
|||||||
Derivation::Hierarchical(path) => {
|
Derivation::Hierarchical(path) => {
|
||||||
for path_item in path {
|
for path_item in path {
|
||||||
extended = extended.derive(
|
extended = extended.derive(
|
||||||
if path_item.soft { ethkey::Derivation::Soft(path_item.index) }
|
if path_item.soft { crypto::publickey::Derivation::Soft(path_item.index) }
|
||||||
else { ethkey::Derivation::Hard(path_item.index) }
|
else { crypto::publickey::Derivation::Hard(path_item.index) }
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Derivation::SoftHash(h256) => { extended = extended.derive(ethkey::Derivation::Soft(h256))?; }
|
Derivation::SoftHash(h256) => { extended = extended.derive(crypto::publickey::Derivation::Soft(h256))?; }
|
||||||
Derivation::HardHash(h256) => { extended = extended.derive(ethkey::Derivation::Hard(h256))?; }
|
Derivation::HardHash(h256) => { extended = extended.derive(crypto::publickey::Derivation::Hard(h256))?; }
|
||||||
}
|
}
|
||||||
Ok(extended)
|
Ok(extended)
|
||||||
}
|
}
|
||||||
@@ -479,7 +480,7 @@ impl SimpleSecretStore for EthMultiStore {
|
|||||||
let accounts = self.get_matching(&account_ref, password)?;
|
let accounts = self.get_matching(&account_ref, password)?;
|
||||||
for account in accounts {
|
for account in accounts {
|
||||||
let extended = self.generate(account.crypto.secret(password)?, derivation)?;
|
let extended = self.generate(account.crypto.secret(password)?, derivation)?;
|
||||||
return Ok(ethkey::public_to_address(extended.public().public()));
|
return Ok(crypto::publickey::public_to_address(extended.public().public()));
|
||||||
}
|
}
|
||||||
Err(Error::InvalidPassword)
|
Err(Error::InvalidPassword)
|
||||||
}
|
}
|
||||||
@@ -491,7 +492,7 @@ impl SimpleSecretStore for EthMultiStore {
|
|||||||
for account in accounts {
|
for account in accounts {
|
||||||
let extended = self.generate(account.crypto.secret(password)?, derivation)?;
|
let extended = self.generate(account.crypto.secret(password)?, derivation)?;
|
||||||
let secret = extended.secret().as_raw();
|
let secret = extended.secret().as_raw();
|
||||||
return Ok(ethkey::sign(&secret, message)?)
|
return Ok(crypto::publickey::sign(&secret, message)?)
|
||||||
}
|
}
|
||||||
Err(Error::InvalidPassword)
|
Err(Error::InvalidPassword)
|
||||||
}
|
}
|
||||||
@@ -690,7 +691,7 @@ mod tests {
|
|||||||
extern crate tempdir;
|
extern crate tempdir;
|
||||||
|
|
||||||
use accounts_dir::{KeyDirectory, MemoryDirectory, RootDiskDirectory};
|
use accounts_dir::{KeyDirectory, MemoryDirectory, RootDiskDirectory};
|
||||||
use ethkey::{Random, Generator, KeyPair};
|
use crypto::publickey::{Random, Generator, KeyPair};
|
||||||
use secret_store::{SimpleSecretStore, SecretStore, SecretVaultRef, StoreAccountRef, Derivation};
|
use secret_store::{SimpleSecretStore, SecretStore, SecretVaultRef, StoreAccountRef, Derivation};
|
||||||
use super::{EthStore, EthMultiStore};
|
use super::{EthStore, EthMultiStore};
|
||||||
use self::tempdir::TempDir;
|
use self::tempdir::TempDir;
|
||||||
@@ -709,7 +710,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct RootDiskDirectoryGuard {
|
struct RootDiskDirectoryGuard {
|
||||||
pub key_dir: Option<Box<KeyDirectory>>,
|
pub key_dir: Option<Box<dyn KeyDirectory>>,
|
||||||
_path: TempDir,
|
_path: TempDir,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,7 +1085,7 @@ mod tests {
|
|||||||
SecretVaultRef::Root,
|
SecretVaultRef::Root,
|
||||||
&address,
|
&address,
|
||||||
&"test".into(),
|
&"test".into(),
|
||||||
Derivation::HardHash(H256::from(0)),
|
Derivation::HardHash(H256::zero()),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
// there should be 2 accounts in the store
|
// there should be 2 accounts in the store
|
||||||
@@ -1,31 +1,31 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
use ethkey::Address;
|
use crypto::publickey::Address;
|
||||||
use accounts_dir::{KeyDirectory, RootDiskDirectory, DiskKeyFileManager, KeyFileManager};
|
use accounts_dir::{KeyDirectory, RootDiskDirectory, DiskKeyFileManager, KeyFileManager};
|
||||||
use dir;
|
use dir;
|
||||||
use Error;
|
use Error;
|
||||||
|
|
||||||
/// Import an account from a file.
|
/// Import an account from a file.
|
||||||
pub fn import_account(path: &Path, dst: &KeyDirectory) -> Result<Address, Error> {
|
pub fn import_account(path: &Path, dst: &dyn KeyDirectory) -> Result<Address, Error> {
|
||||||
let key_manager = DiskKeyFileManager;
|
let key_manager = DiskKeyFileManager::default();
|
||||||
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
||||||
let filename = path.file_name().and_then(|n| n.to_str()).map(|f| f.to_owned());
|
let filename = path.file_name().and_then(|n| n.to_str()).map(|f| f.to_owned());
|
||||||
let account = fs::File::open(&path)
|
let account = fs::File::open(&path)
|
||||||
@@ -40,9 +40,11 @@ pub fn import_account(path: &Path, dst: &KeyDirectory) -> Result<Address, Error>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Import all accounts from one directory to the other.
|
/// Import all accounts from one directory to the other.
|
||||||
pub fn import_accounts(src: &KeyDirectory, dst: &KeyDirectory) -> Result<Vec<Address>, Error> {
|
pub fn import_accounts(src: &dyn KeyDirectory, dst: &dyn KeyDirectory) -> Result<Vec<Address>, Error> {
|
||||||
let accounts = src.load()?;
|
let accounts = src.load()?;
|
||||||
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
let existing_accounts = dst.load()?.into_iter()
|
||||||
|
.map(|a| a.address)
|
||||||
|
.collect::<HashSet<_>>();
|
||||||
|
|
||||||
accounts.into_iter()
|
accounts.into_iter()
|
||||||
.filter(|a| !existing_accounts.contains(&a.address))
|
.filter(|a| !existing_accounts.contains(&a.address))
|
||||||
@@ -62,7 +64,7 @@ pub fn read_geth_accounts(testnet: bool) -> Vec<Address> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Import specific `desired` accounts from the Geth keystore into `dst`.
|
/// Import specific `desired` accounts from the Geth keystore into `dst`.
|
||||||
pub fn import_geth_accounts(dst: &KeyDirectory, desired: HashSet<Address>, testnet: bool) -> Result<Vec<Address>, Error> {
|
pub fn import_geth_accounts(dst: &dyn KeyDirectory, desired: HashSet<Address>, testnet: bool) -> Result<Vec<Address>, Error> {
|
||||||
let src = RootDiskDirectory::at(dir::geth(testnet));
|
let src = RootDiskDirectory::at(dir::geth(testnet));
|
||||||
let accounts = src.load()?;
|
let accounts = src.load()?;
|
||||||
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
let existing_accounts = dst.load()?.into_iter().map(|a| a.address).collect::<HashSet<_>>();
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{ops, str};
|
use std::{ops, str};
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{fmt, str};
|
use std::{fmt, str};
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
@@ -41,7 +41,7 @@ impl str::FromStr for Crypto {
|
|||||||
|
|
||||||
impl From<Crypto> for String {
|
impl From<Crypto> for String {
|
||||||
fn from(c: Crypto) -> Self {
|
fn from(c: Crypto) -> Self {
|
||||||
serde_json::to_string(&c).expect("serialization cannot fail, cause all crypto keys are strings")
|
serde_json::to_string(&c).expect("Serialization cannot fail, because all crypto keys are strings")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ enum CryptoField {
|
|||||||
Kdf,
|
Kdf,
|
||||||
KdfParams,
|
KdfParams,
|
||||||
Mac,
|
Mac,
|
||||||
|
Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Deserialize<'a> for CryptoField {
|
impl<'a> Deserialize<'a> for CryptoField {
|
||||||
@@ -81,6 +82,7 @@ impl<'a> Visitor<'a> for CryptoFieldVisitor {
|
|||||||
"kdf" => Ok(CryptoField::Kdf),
|
"kdf" => Ok(CryptoField::Kdf),
|
||||||
"kdfparams" => Ok(CryptoField::KdfParams),
|
"kdfparams" => Ok(CryptoField::KdfParams),
|
||||||
"mac" => Ok(CryptoField::Mac),
|
"mac" => Ok(CryptoField::Mac),
|
||||||
|
"version" => Ok(CryptoField::Version),
|
||||||
_ => Err(Error::custom(format!("Unknown field: '{}'", value))),
|
_ => Err(Error::custom(format!("Unknown field: '{}'", value))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -122,6 +124,8 @@ impl<'a> Visitor<'a> for CryptoVisitor {
|
|||||||
Some(CryptoField::Kdf) => { kdf = Some(visitor.next_value()?); }
|
Some(CryptoField::Kdf) => { kdf = Some(visitor.next_value()?); }
|
||||||
Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.next_value()?); }
|
Some(CryptoField::KdfParams) => { kdfparams = Some(visitor.next_value()?); }
|
||||||
Some(CryptoField::Mac) => { mac = Some(visitor.next_value()?); }
|
Some(CryptoField::Mac) => { mac = Some(visitor.next_value()?); }
|
||||||
|
// skip not required version field (it appears in pyethereum generated keystores)
|
||||||
|
Some(CryptoField::Version) => { visitor.next_value().unwrap_or(()) }
|
||||||
None => { break; }
|
None => { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::{ops, fmt, str};
|
use std::{ops, fmt, str};
|
||||||
use rustc_hex::{FromHex, ToHex};
|
use rustc_hex::{FromHex, ToHex};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Universaly unique identifier.
|
//! Universaly unique identifier.
|
||||||
use std::{fmt, str};
|
use std::{fmt, str};
|
||||||
@@ -38,7 +38,7 @@ impl<'a> Into<String> for &'a Uuid {
|
|||||||
let d3 = &self.0[6..8];
|
let d3 = &self.0[6..8];
|
||||||
let d4 = &self.0[8..10];
|
let d4 = &self.0[8..10];
|
||||||
let d5 = &self.0[10..16];
|
let d5 = &self.0[10..16];
|
||||||
[d1, d2, d3, d4, d5].into_iter().map(|d| d.to_hex()).collect::<Vec<String>>().join("-")
|
[d1, d2, d3, d4, d5].iter().map(|d| d.to_hex()).collect::<Vec<String>>().join("-")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
||||||
use serde::de::{Visitor, Error as SerdeError};
|
use serde::de::{Visitor, Error as SerdeError};
|
||||||
use super::{Error, H256};
|
use super::{Error, Bytes};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub enum KdfSer {
|
pub enum KdfSer {
|
||||||
@@ -111,7 +111,7 @@ pub struct Pbkdf2 {
|
|||||||
pub c: u32,
|
pub c: u32,
|
||||||
pub dklen: u32,
|
pub dklen: u32,
|
||||||
pub prf: Prf,
|
pub prf: Prf,
|
||||||
pub salt: H256,
|
pub salt: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||||
@@ -120,7 +120,7 @@ pub struct Scrypt {
|
|||||||
pub p: u32,
|
pub p: u32,
|
||||||
pub n: u32,
|
pub n: u32,
|
||||||
pub r: u32,
|
pub r: u32,
|
||||||
pub salt: H256,
|
pub salt: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
@@ -46,7 +46,7 @@ pub struct KeyFile {
|
|||||||
pub id: Uuid,
|
pub id: Uuid,
|
||||||
pub version: Version,
|
pub version: Version,
|
||||||
pub crypto: Crypto,
|
pub crypto: Crypto,
|
||||||
pub address: H160,
|
pub address: Option<H160>,
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
pub meta: Option<String>,
|
pub meta: Option<String>,
|
||||||
}
|
}
|
||||||
@@ -158,11 +158,6 @@ impl<'a> Visitor<'a> for KeyFileVisitor {
|
|||||||
None => return Err(V::Error::missing_field("crypto")),
|
None => return Err(V::Error::missing_field("crypto")),
|
||||||
};
|
};
|
||||||
|
|
||||||
let address = match address {
|
|
||||||
Some(address) => address,
|
|
||||||
None => return Err(V::Error::missing_field("address")),
|
|
||||||
};
|
|
||||||
|
|
||||||
let result = KeyFile {
|
let result = KeyFile {
|
||||||
id: id,
|
id: id,
|
||||||
version: version,
|
version: version,
|
||||||
@@ -222,7 +217,7 @@ mod tests {
|
|||||||
let expected = KeyFile {
|
let expected = KeyFile {
|
||||||
id: Uuid::from_str("8777d9f6-7860-4b9b-88b7-0b57ee6b3a73").unwrap(),
|
id: Uuid::from_str("8777d9f6-7860-4b9b-88b7-0b57ee6b3a73").unwrap(),
|
||||||
version: Version::V3,
|
version: Version::V3,
|
||||||
address: "6edddfc6349aff20bc6467ccf276c5b52487f7a8".into(),
|
address: Some("6edddfc6349aff20bc6467ccf276c5b52487f7a8".into()),
|
||||||
crypto: Crypto {
|
crypto: Crypto {
|
||||||
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
||||||
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
||||||
@@ -273,7 +268,7 @@ mod tests {
|
|||||||
let expected = KeyFile {
|
let expected = KeyFile {
|
||||||
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
||||||
version: Version::V3,
|
version: Version::V3,
|
||||||
address: "6edddfc6349aff20bc6467ccf276c5b52487f7a8".into(),
|
address: Some("6edddfc6349aff20bc6467ccf276c5b52487f7a8".into()),
|
||||||
crypto: Crypto {
|
crypto: Crypto {
|
||||||
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
||||||
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
||||||
@@ -301,7 +296,7 @@ mod tests {
|
|||||||
let file = KeyFile {
|
let file = KeyFile {
|
||||||
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
id: "8777d9f6-7860-4b9b-88b7-0b57ee6b3a73".into(),
|
||||||
version: Version::V3,
|
version: Version::V3,
|
||||||
address: "6edddfc6349aff20bc6467ccf276c5b52487f7a8".into(),
|
address: Some("6edddfc6349aff20bc6467ccf276c5b52487f7a8".into()),
|
||||||
crypto: Crypto {
|
crypto: Crypto {
|
||||||
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
cipher: Cipher::Aes128Ctr(Aes128Ctr {
|
||||||
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
iv: "b5a7ec855ec9e2c405371356855fec83".into(),
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Contract interface specification.
|
//! Contract interface specification.
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use serde_json;
|
use serde_json;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use serde_json;
|
use serde_json;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer};
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Ethereum key-management.
|
//! Ethereum key-management.
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ extern crate tempdir;
|
|||||||
|
|
||||||
extern crate parity_crypto as crypto;
|
extern crate parity_crypto as crypto;
|
||||||
extern crate ethereum_types;
|
extern crate ethereum_types;
|
||||||
extern crate ethkey as _ethkey;
|
extern crate ethkey as ethkey;
|
||||||
extern crate parity_wordlist;
|
extern crate parity_wordlist;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
@@ -46,7 +46,6 @@ extern crate serde_derive;
|
|||||||
extern crate matches;
|
extern crate matches;
|
||||||
|
|
||||||
pub mod accounts_dir;
|
pub mod accounts_dir;
|
||||||
pub mod ethkey;
|
|
||||||
|
|
||||||
mod account;
|
mod account;
|
||||||
mod json;
|
mod json;
|
||||||
@@ -72,4 +71,30 @@ pub use self::random::random_string;
|
|||||||
pub use self::parity_wordlist::random_phrase;
|
pub use self::parity_wordlist::random_phrase;
|
||||||
|
|
||||||
/// An opaque wrapper for secret.
|
/// An opaque wrapper for secret.
|
||||||
pub struct OpaqueSecret(::ethkey::Secret);
|
pub struct OpaqueSecret(crypto::publickey::Secret);
|
||||||
|
|
||||||
|
// Additional converters for Address
|
||||||
|
use crypto::publickey::Address;
|
||||||
|
|
||||||
|
impl Into<json::H160> for Address {
|
||||||
|
fn into(self) -> json::H160 {
|
||||||
|
let a: [u8; 20] = self.into();
|
||||||
|
From::from(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<json::H160> for Address {
|
||||||
|
fn from(json: json::H160) -> Self {
|
||||||
|
let a: [u8; 20] = json.into();
|
||||||
|
From::from(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> From<&'a json::H160> for Address {
|
||||||
|
fn from(json: &'a json::H160) -> Self {
|
||||||
|
let mut a = [0u8; 20];
|
||||||
|
a.copy_from_slice(json);
|
||||||
|
From::from(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,23 +1,24 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use json;
|
use json;
|
||||||
use ethkey::{Address, Secret, KeyPair, Password};
|
use crypto::publickey::{Address, Secret, KeyPair};
|
||||||
|
use ethkey::Password;
|
||||||
use crypto::{Keccak256, pbkdf2};
|
use crypto::{Keccak256, pbkdf2};
|
||||||
use {crypto, Error};
|
use {crypto, Error};
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ impl PresaleWallet {
|
|||||||
.map_err(|_| Error::InvalidPassword)?;
|
.map_err(|_| Error::InvalidPassword)?;
|
||||||
let unpadded = &key[..len];
|
let unpadded = &key[..len];
|
||||||
|
|
||||||
let secret = Secret::from_unsafe_slice(&unpadded.keccak256())?;
|
let secret = Secret::import_key(&unpadded.keccak256())?;
|
||||||
if let Ok(kp) = KeyPair::from_secret(secret) {
|
if let Ok(kp) = KeyPair::from_secret(secret) {
|
||||||
if kp.address() == self.address {
|
if kp.address() == self.address {
|
||||||
return Ok(kp)
|
return Ok(kp)
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use rand::{Rng, OsRng};
|
use rand::{Rng, RngCore, rngs::OsRng, distributions::Alphanumeric};
|
||||||
|
|
||||||
pub trait Random {
|
pub trait Random {
|
||||||
fn random() -> Self where Self: Sized;
|
fn random() -> Self where Self: Sized;
|
||||||
@@ -23,7 +23,7 @@ pub trait Random {
|
|||||||
impl Random for [u8; 16] {
|
impl Random for [u8; 16] {
|
||||||
fn random() -> Self {
|
fn random() -> Self {
|
||||||
let mut result = [0u8; 16];
|
let mut result = [0u8; 16];
|
||||||
let mut rng = OsRng::new().unwrap();
|
let mut rng = OsRng;
|
||||||
rng.fill_bytes(&mut result);
|
rng.fill_bytes(&mut result);
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ impl Random for [u8; 16] {
|
|||||||
impl Random for [u8; 32] {
|
impl Random for [u8; 32] {
|
||||||
fn random() -> Self {
|
fn random() -> Self {
|
||||||
let mut result = [0u8; 32];
|
let mut result = [0u8; 32];
|
||||||
let mut rng = OsRng::new().unwrap();
|
let mut rng = OsRng;
|
||||||
rng.fill_bytes(&mut result);
|
rng.fill_bytes(&mut result);
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
@@ -40,6 +40,6 @@ impl Random for [u8; 32] {
|
|||||||
|
|
||||||
/// Generate a random string of given length.
|
/// Generate a random string of given length.
|
||||||
pub fn random_string(length: usize) -> String {
|
pub fn random_string(length: usize) -> String {
|
||||||
let mut rng = OsRng::new().expect("Not able to operate without random source.");
|
let rng = OsRng;
|
||||||
rng.gen_ascii_chars().take(length).collect()
|
rng.sample_iter(&Alphanumeric).take(length).collect()
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,24 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use ethkey::{Address, Message, Signature, Secret, Password, Public};
|
use crypto::publickey::{Address, Message, Signature, Secret, Public};
|
||||||
|
use ethkey::Password;
|
||||||
use Error;
|
use Error;
|
||||||
use json::{Uuid, OpaqueKeyFile};
|
use json::{Uuid, OpaqueKeyFile};
|
||||||
use ethereum_types::H256;
|
use ethereum_types::H256;
|
||||||
@@ -110,7 +111,7 @@ pub trait SecretStore: SimpleSecretStore {
|
|||||||
|
|
||||||
/// Signs a message with raw secret.
|
/// Signs a message with raw secret.
|
||||||
fn sign_with_secret(&self, secret: &OpaqueSecret, message: &Message) -> Result<Signature, Error> {
|
fn sign_with_secret(&self, secret: &OpaqueSecret, message: &Message) -> Result<Signature, Error> {
|
||||||
Ok(::ethkey::sign(&secret.0, message)?)
|
Ok(crypto::publickey::sign(&secret.0, message)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Imports presale wallet
|
/// Imports presale wallet
|
||||||
@@ -118,7 +119,7 @@ pub trait SecretStore: SimpleSecretStore {
|
|||||||
/// Imports existing JSON wallet
|
/// Imports existing JSON wallet
|
||||||
fn import_wallet(&self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool) -> Result<StoreAccountRef, Error>;
|
fn import_wallet(&self, vault: SecretVaultRef, json: &[u8], password: &Password, gen_id: bool) -> Result<StoreAccountRef, Error>;
|
||||||
/// Copies account between stores and vaults.
|
/// Copies account between stores and vaults.
|
||||||
fn copy_account(&self, new_store: &SimpleSecretStore, new_vault: SecretVaultRef, account: &StoreAccountRef, password: &Password, new_password: &Password) -> Result<(), Error>;
|
fn copy_account(&self, new_store: &dyn SimpleSecretStore, new_vault: SecretVaultRef, account: &StoreAccountRef, password: &Password, new_password: &Password) -> Result<(), Error>;
|
||||||
/// Checks if password matches given account.
|
/// Checks if password matches given account.
|
||||||
fn test_password(&self, account: &StoreAccountRef, password: &Password) -> Result<bool, Error>;
|
fn test_password(&self, account: &StoreAccountRef, password: &Password) -> Result<bool, Error>;
|
||||||
|
|
||||||
@@ -1,28 +1,32 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
extern crate ethstore;
|
extern crate ethstore;
|
||||||
|
extern crate ethereum_types;
|
||||||
|
extern crate parity_crypto;
|
||||||
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
use ethstore::{EthStore, SimpleSecretStore, SecretVaultRef, StoreAccountRef};
|
use ethstore::{EthStore, SimpleSecretStore, SecretVaultRef, StoreAccountRef};
|
||||||
use ethstore::ethkey::{Random, Generator, Secret, KeyPair, verify_address};
|
use parity_crypto::publickey::{Random, Generator, Secret, KeyPair, verify_address};
|
||||||
use ethstore::accounts_dir::RootDiskDirectory;
|
use ethstore::accounts_dir::RootDiskDirectory;
|
||||||
use util::TransientDir;
|
use util::TransientDir;
|
||||||
|
use ethereum_types::Address;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn secret_store_create() {
|
fn secret_store_create() {
|
||||||
@@ -114,9 +118,9 @@ fn secret_store_laod_geth_files() {
|
|||||||
let dir = RootDiskDirectory::at(test_path());
|
let dir = RootDiskDirectory::at(test_path());
|
||||||
let store = EthStore::open(Box::new(dir)).unwrap();
|
let store = EthStore::open(Box::new(dir)).unwrap();
|
||||||
assert_eq!(store.accounts().unwrap(), vec![
|
assert_eq!(store.accounts().unwrap(), vec![
|
||||||
StoreAccountRef::root("3f49624084b67849c7b4e805c5988c21a430f9d9".into()),
|
StoreAccountRef::root(Address::from_str("3f49624084b67849c7b4e805c5988c21a430f9d9").unwrap()),
|
||||||
StoreAccountRef::root("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf".into()),
|
StoreAccountRef::root(Address::from_str("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf").unwrap()),
|
||||||
StoreAccountRef::root("63121b431a52f8043c16fcf0d1df9cb7b5f66649".into()),
|
StoreAccountRef::root(Address::from_str("63121b431a52f8043c16fcf0d1df9cb7b5f66649").unwrap()),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,8 +129,8 @@ fn secret_store_load_pat_files() {
|
|||||||
let dir = RootDiskDirectory::at(pat_path());
|
let dir = RootDiskDirectory::at(pat_path());
|
||||||
let store = EthStore::open(Box::new(dir)).unwrap();
|
let store = EthStore::open(Box::new(dir)).unwrap();
|
||||||
assert_eq!(store.accounts().unwrap(), vec![
|
assert_eq!(store.accounts().unwrap(), vec![
|
||||||
StoreAccountRef::root("3f49624084b67849c7b4e805c5988c21a430f9d9".into()),
|
StoreAccountRef::root(Address::from_str("3f49624084b67849c7b4e805c5988c21a430f9d9").unwrap()),
|
||||||
StoreAccountRef::root("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf".into()),
|
StoreAccountRef::root(Address::from_str("5ba4dcf897e97c2bdf8315b9ef26c13c085988cf").unwrap()),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,8 +144,8 @@ fn test_decrypting_files_with_short_ciphertext() {
|
|||||||
let store = EthStore::open(Box::new(dir)).unwrap();
|
let store = EthStore::open(Box::new(dir)).unwrap();
|
||||||
let accounts = store.accounts().unwrap();
|
let accounts = store.accounts().unwrap();
|
||||||
assert_eq!(accounts, vec![
|
assert_eq!(accounts, vec![
|
||||||
StoreAccountRef::root("31e9d1e6d844bd3a536800ef8d8be6a9975db509".into()),
|
StoreAccountRef::root(Address::from_str("31e9d1e6d844bd3a536800ef8d8be6a9975db509").unwrap()),
|
||||||
StoreAccountRef::root("d1e64e5480bfaf733ba7d48712decb8227797a4e".into()),
|
StoreAccountRef::root(Address::from_str("d1e64e5480bfaf733ba7d48712decb8227797a4e").unwrap()),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let message = Default::default();
|
let message = Default::default();
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
mod transient_dir;
|
mod transient_dir;
|
||||||
|
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::{env, fs};
|
use std::{env, fs};
|
||||||
use rand::{Rng, OsRng};
|
use rand::{RngCore, rngs::OsRng};
|
||||||
use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory};
|
use ethstore::accounts_dir::{KeyDirectory, RootDiskDirectory};
|
||||||
use ethstore::{Error, SafeAccount};
|
use ethstore::{Error, SafeAccount};
|
||||||
|
|
||||||
pub fn random_dir() -> PathBuf {
|
pub fn random_dir() -> PathBuf {
|
||||||
let mut rng = OsRng::new().unwrap();
|
let mut rng = OsRng;
|
||||||
let mut dir = env::temp_dir();
|
let mut dir = env::temp_dir();
|
||||||
dir.push(format!("{:x}-{:x}", rng.next_u64(), rng.next_u64()));
|
dir.push(format!("{:x}-{:x}", rng.next_u64(), rng.next_u64()));
|
||||||
dir
|
dir
|
||||||
74
accounts/src/account_data.rs
Normal file
74
accounts/src/account_data.rs
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
|
||||||
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//! Account Metadata
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
collections::HashMap,
|
||||||
|
time::Instant,
|
||||||
|
};
|
||||||
|
|
||||||
|
use parity_crypto::publickey::Address;
|
||||||
|
use ethkey::Password;
|
||||||
|
use serde_derive::{Serialize, Deserialize};
|
||||||
|
use serde_json;
|
||||||
|
|
||||||
|
/// Type of unlock.
|
||||||
|
#[derive(Clone, PartialEq)]
|
||||||
|
pub enum Unlock {
|
||||||
|
/// If account is unlocked temporarily, it should be locked after first usage.
|
||||||
|
OneTime,
|
||||||
|
/// Account unlocked permanently can always sign message.
|
||||||
|
/// Use with caution.
|
||||||
|
Perm,
|
||||||
|
/// Account unlocked with a timeout
|
||||||
|
Timed(Instant),
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Data associated with account.
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct AccountData {
|
||||||
|
pub unlock: Unlock,
|
||||||
|
pub password: Password,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Collected account metadata
|
||||||
|
#[derive(Default, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct AccountMeta {
|
||||||
|
/// The name of the account.
|
||||||
|
pub name: String,
|
||||||
|
/// The rest of the metadata of the account.
|
||||||
|
pub meta: String,
|
||||||
|
/// The 128-bit Uuid of the account, if it has one (brain-wallets don't).
|
||||||
|
pub uuid: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AccountMeta {
|
||||||
|
/// Read a hash map of Address -> AccountMeta
|
||||||
|
pub fn read<R>(reader: R) -> Result<HashMap<Address, Self>, serde_json::Error> where
|
||||||
|
R: ::std::io::Read,
|
||||||
|
{
|
||||||
|
serde_json::from_reader(reader)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Write a hash map of Address -> AccountMeta
|
||||||
|
pub fn write<W>(m: &HashMap<Address, Self>, writer: &mut W) -> Result<(), serde_json::Error> where
|
||||||
|
W: ::std::io::Write,
|
||||||
|
{
|
||||||
|
serde_json::to_writer(writer, m)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity is free software: you can redistribute it and/or modify
|
||||||
@@ -16,30 +16,31 @@
|
|||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Type of EVM to use.
|
use ethstore::{Error as SSError};
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
|
||||||
pub enum VMType {
|
/// Signing error
|
||||||
/// RUST EVM
|
#[derive(Debug)]
|
||||||
Interpreter
|
pub enum SignError {
|
||||||
|
/// Account is not unlocked
|
||||||
|
NotUnlocked,
|
||||||
|
/// Account does not exist.
|
||||||
|
NotFound,
|
||||||
|
/// Low-level error from store
|
||||||
|
SStore(SSError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for VMType {
|
impl fmt::Display for SignError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
write!(f, "{}", match *self {
|
match *self {
|
||||||
VMType::Interpreter => "INT"
|
SignError::NotUnlocked => write!(f, "Account is locked"),
|
||||||
})
|
SignError::NotFound => write!(f, "Account does not exist"),
|
||||||
|
SignError::SStore(ref e) => write!(f, "{}", e),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for VMType {
|
impl From<SSError> for SignError {
|
||||||
fn default() -> Self {
|
fn from(e: SSError) -> Self {
|
||||||
VMType::Interpreter
|
SignError::SStore(e)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl VMType {
|
|
||||||
/// Return all possible VMs (Interpreter)
|
|
||||||
pub fn all() -> Vec<VMType> {
|
|
||||||
vec![VMType::Interpreter]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,107 +1,59 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
//! Account management.
|
//! Account management.
|
||||||
|
|
||||||
|
mod account_data;
|
||||||
|
mod error;
|
||||||
mod stores;
|
mod stores;
|
||||||
|
|
||||||
|
use self::account_data::{Unlock, AccountData};
|
||||||
use self::stores::AddressBook;
|
use self::stores::AddressBook;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt;
|
|
||||||
use std::time::{Instant, Duration};
|
use std::time::{Instant, Duration};
|
||||||
|
|
||||||
|
use ethkey::Password;
|
||||||
|
use parity_crypto::publickey::{Address, Message, Public, Secret, Random, Generator, Signature};
|
||||||
use ethstore::accounts_dir::MemoryDirectory;
|
use ethstore::accounts_dir::MemoryDirectory;
|
||||||
use ethstore::ethkey::{Address, Message, Public, Secret, Password, Random, Generator};
|
|
||||||
use ethjson::misc::AccountMeta;
|
|
||||||
use ethstore::{
|
use ethstore::{
|
||||||
SimpleSecretStore, SecretStore, Error as SSError, EthStore, EthMultiStore,
|
SimpleSecretStore, SecretStore, EthStore, EthMultiStore,
|
||||||
random_string, SecretVaultRef, StoreAccountRef, OpaqueSecret,
|
random_string, SecretVaultRef, StoreAccountRef, OpaqueSecret,
|
||||||
};
|
};
|
||||||
|
use log::warn;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
|
||||||
pub use ethstore::ethkey::Signature;
|
pub use ethstore::{Derivation, IndexDerivation, KeyFile, Error};
|
||||||
pub use ethstore::{Derivation, IndexDerivation, KeyFile};
|
|
||||||
pub use hardware_wallet::{Error as HardwareError, HardwareWalletManager, KeyPath, TransactionInfo};
|
|
||||||
pub use super::transaction::{Action, Transaction};
|
|
||||||
|
|
||||||
/// Type of unlock.
|
pub use self::account_data::AccountMeta;
|
||||||
#[derive(Clone, PartialEq)]
|
pub use self::error::SignError;
|
||||||
enum Unlock {
|
|
||||||
/// If account is unlocked temporarily, it should be locked after first usage.
|
|
||||||
OneTime,
|
|
||||||
/// Account unlocked permanently can always sign message.
|
|
||||||
/// Use with caution.
|
|
||||||
Perm,
|
|
||||||
/// Account unlocked with a timeout
|
|
||||||
Timed(Instant),
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Data associated with account.
|
|
||||||
#[derive(Clone)]
|
|
||||||
struct AccountData {
|
|
||||||
unlock: Unlock,
|
|
||||||
password: Password,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Signing error
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum SignError {
|
|
||||||
/// Account is not unlocked
|
|
||||||
NotUnlocked,
|
|
||||||
/// Account does not exist.
|
|
||||||
NotFound,
|
|
||||||
/// Low-level hardware device error.
|
|
||||||
Hardware(HardwareError),
|
|
||||||
/// Low-level error from store
|
|
||||||
SStore(SSError),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Display for SignError {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
|
||||||
match *self {
|
|
||||||
SignError::NotUnlocked => write!(f, "Account is locked"),
|
|
||||||
SignError::NotFound => write!(f, "Account does not exist"),
|
|
||||||
SignError::Hardware(ref e) => write!(f, "{}", e),
|
|
||||||
SignError::SStore(ref e) => write!(f, "{}", e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<HardwareError> for SignError {
|
|
||||||
fn from(e: HardwareError) -> Self {
|
|
||||||
SignError::Hardware(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<SSError> for SignError {
|
|
||||||
fn from(e: SSError) -> Self {
|
|
||||||
SignError::SStore(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `AccountProvider` errors.
|
|
||||||
pub type Error = SSError;
|
|
||||||
|
|
||||||
fn transient_sstore() -> EthMultiStore {
|
|
||||||
EthMultiStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")
|
|
||||||
}
|
|
||||||
|
|
||||||
type AccountToken = Password;
|
type AccountToken = Password;
|
||||||
|
|
||||||
|
/// Account management settings.
|
||||||
|
#[derive(Debug, Default)]
|
||||||
|
pub struct AccountProviderSettings {
|
||||||
|
/// Store raw account secret when unlocking the account permanently.
|
||||||
|
pub unlock_keep_secret: bool,
|
||||||
|
/// Disallowed accounts.
|
||||||
|
pub blacklisted_accounts: Vec<Address>,
|
||||||
|
}
|
||||||
|
|
||||||
/// Account management.
|
/// Account management.
|
||||||
/// Responsible for unlocking accounts.
|
/// Responsible for unlocking accounts.
|
||||||
pub struct AccountProvider {
|
pub struct AccountProvider {
|
||||||
@@ -112,11 +64,9 @@ pub struct AccountProvider {
|
|||||||
/// Address book.
|
/// Address book.
|
||||||
address_book: RwLock<AddressBook>,
|
address_book: RwLock<AddressBook>,
|
||||||
/// Accounts on disk
|
/// Accounts on disk
|
||||||
sstore: Box<SecretStore>,
|
sstore: Box<dyn SecretStore>,
|
||||||
/// Accounts unlocked with rolling tokens
|
/// Accounts unlocked with rolling tokens
|
||||||
transient_sstore: EthMultiStore,
|
transient_sstore: EthMultiStore,
|
||||||
/// Accounts in hardware wallets.
|
|
||||||
hardware_store: Option<HardwareWalletManager>,
|
|
||||||
/// When unlocking account permanently we additionally keep a raw secret in memory
|
/// When unlocking account permanently we additionally keep a raw secret in memory
|
||||||
/// to increase the performance of transaction signing.
|
/// to increase the performance of transaction signing.
|
||||||
unlock_keep_secret: bool,
|
unlock_keep_secret: bool,
|
||||||
@@ -124,44 +74,13 @@ pub struct AccountProvider {
|
|||||||
blacklisted_accounts: Vec<Address>,
|
blacklisted_accounts: Vec<Address>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Account management settings.
|
fn transient_sstore() -> EthMultiStore {
|
||||||
pub struct AccountProviderSettings {
|
EthMultiStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")
|
||||||
/// Enable hardware wallet support.
|
|
||||||
pub enable_hardware_wallets: bool,
|
|
||||||
/// Use the classic chain key on the hardware wallet.
|
|
||||||
pub hardware_wallet_classic_key: bool,
|
|
||||||
/// Store raw account secret when unlocking the account permanently.
|
|
||||||
pub unlock_keep_secret: bool,
|
|
||||||
/// Disallowed accounts.
|
|
||||||
pub blacklisted_accounts: Vec<Address>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for AccountProviderSettings {
|
|
||||||
fn default() -> Self {
|
|
||||||
AccountProviderSettings {
|
|
||||||
enable_hardware_wallets: false,
|
|
||||||
hardware_wallet_classic_key: false,
|
|
||||||
unlock_keep_secret: false,
|
|
||||||
blacklisted_accounts: vec![],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AccountProvider {
|
impl AccountProvider {
|
||||||
/// Creates new account provider.
|
/// Creates new account provider.
|
||||||
pub fn new(sstore: Box<SecretStore>, settings: AccountProviderSettings) -> Self {
|
pub fn new(sstore: Box<dyn SecretStore>, settings: AccountProviderSettings) -> Self {
|
||||||
let mut hardware_store = None;
|
|
||||||
|
|
||||||
if settings.enable_hardware_wallets {
|
|
||||||
match HardwareWalletManager::new() {
|
|
||||||
Ok(manager) => {
|
|
||||||
manager.set_key_path(if settings.hardware_wallet_classic_key { KeyPath::EthereumClassic } else { KeyPath::Ethereum });
|
|
||||||
hardware_store = Some(manager)
|
|
||||||
},
|
|
||||||
Err(e) => debug!("Error initializing hardware wallets: {}", e),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Ok(accounts) = sstore.accounts() {
|
if let Ok(accounts) = sstore.accounts() {
|
||||||
for account in accounts.into_iter().filter(|a| settings.blacklisted_accounts.contains(&a.address)) {
|
for account in accounts.into_iter().filter(|a| settings.blacklisted_accounts.contains(&a.address)) {
|
||||||
warn!("Local Account {} has a blacklisted (known to be weak) address and will be ignored",
|
warn!("Local Account {} has a blacklisted (known to be weak) address and will be ignored",
|
||||||
@@ -179,9 +98,8 @@ impl AccountProvider {
|
|||||||
unlocked_secrets: RwLock::new(HashMap::new()),
|
unlocked_secrets: RwLock::new(HashMap::new()),
|
||||||
unlocked: RwLock::new(HashMap::new()),
|
unlocked: RwLock::new(HashMap::new()),
|
||||||
address_book: RwLock::new(address_book),
|
address_book: RwLock::new(address_book),
|
||||||
sstore: sstore,
|
sstore,
|
||||||
transient_sstore: transient_sstore(),
|
transient_sstore: transient_sstore(),
|
||||||
hardware_store: hardware_store,
|
|
||||||
unlock_keep_secret: settings.unlock_keep_secret,
|
unlock_keep_secret: settings.unlock_keep_secret,
|
||||||
blacklisted_accounts: settings.blacklisted_accounts,
|
blacklisted_accounts: settings.blacklisted_accounts,
|
||||||
}
|
}
|
||||||
@@ -195,7 +113,6 @@ impl AccountProvider {
|
|||||||
address_book: RwLock::new(AddressBook::transient()),
|
address_book: RwLock::new(AddressBook::transient()),
|
||||||
sstore: Box::new(EthStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")),
|
sstore: Box::new(EthStore::open(Box::new(MemoryDirectory::default())).expect("MemoryDirectory load always succeeds; qed")),
|
||||||
transient_sstore: transient_sstore(),
|
transient_sstore: transient_sstore(),
|
||||||
hardware_store: None,
|
|
||||||
unlock_keep_secret: false,
|
unlock_keep_secret: false,
|
||||||
blacklisted_accounts: vec![],
|
blacklisted_accounts: vec![],
|
||||||
}
|
}
|
||||||
@@ -221,7 +138,7 @@ impl AccountProvider {
|
|||||||
let account = self.sstore.insert_account(SecretVaultRef::Root, secret, password)?;
|
let account = self.sstore.insert_account(SecretVaultRef::Root, secret, password)?;
|
||||||
if self.blacklisted_accounts.contains(&account.address) {
|
if self.blacklisted_accounts.contains(&account.address) {
|
||||||
self.sstore.remove_account(&account, password)?;
|
self.sstore.remove_account(&account, password)?;
|
||||||
return Err(SSError::InvalidAccount.into());
|
return Err(Error::InvalidAccount.into());
|
||||||
}
|
}
|
||||||
Ok(account.address)
|
Ok(account.address)
|
||||||
}
|
}
|
||||||
@@ -251,7 +168,7 @@ impl AccountProvider {
|
|||||||
let account = self.sstore.import_wallet(SecretVaultRef::Root, json, password, gen_id)?;
|
let account = self.sstore.import_wallet(SecretVaultRef::Root, json, password, gen_id)?;
|
||||||
if self.blacklisted_accounts.contains(&account.address) {
|
if self.blacklisted_accounts.contains(&account.address) {
|
||||||
self.sstore.remove_account(&account, password)?;
|
self.sstore.remove_account(&account, password)?;
|
||||||
return Err(SSError::InvalidAccount.into());
|
return Err(Error::InvalidAccount.into());
|
||||||
}
|
}
|
||||||
Ok(Address::from(account.address).into())
|
Ok(Address::from(account.address).into())
|
||||||
}
|
}
|
||||||
@@ -277,34 +194,6 @@ impl AccountProvider {
|
|||||||
Ok(self.accounts()?.first().cloned().unwrap_or_default())
|
Ok(self.accounts()?.first().cloned().unwrap_or_default())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns addresses of hardware accounts.
|
|
||||||
pub fn hardware_accounts(&self) -> Result<Vec<Address>, Error> {
|
|
||||||
if let Some(accounts) = self.hardware_store.as_ref().map(|h| h.list_wallets()) {
|
|
||||||
if !accounts.is_empty() {
|
|
||||||
return Ok(accounts.into_iter().map(|a| a.address).collect());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(SSError::Custom("No hardware wallet accounts were found".into()))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get a list of paths to locked hardware wallets
|
|
||||||
pub fn locked_hardware_accounts(&self) -> Result<Vec<String>, SignError> {
|
|
||||||
match self.hardware_store.as_ref().map(|h| h.list_locked_wallets()) {
|
|
||||||
None => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(SignError::Hardware(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Provide a pin to a locked hardware wallet on USB path to unlock it
|
|
||||||
pub fn hardware_pin_matrix_ack(&self, path: &str, pin: &str) -> Result<bool, SignError> {
|
|
||||||
match self.hardware_store.as_ref().map(|h| h.pin_matrix_ack(path, pin)) {
|
|
||||||
None => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(SignError::Hardware(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns each address along with metadata.
|
/// Returns each address along with metadata.
|
||||||
pub fn addresses_info(&self) -> HashMap<Address, AccountMeta> {
|
pub fn addresses_info(&self) -> HashMap<Address, AccountMeta> {
|
||||||
self.address_book.read().get()
|
self.address_book.read().get()
|
||||||
@@ -335,36 +224,14 @@ impl AccountProvider {
|
|||||||
Ok(r)
|
Ok(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns each hardware account along with name and meta.
|
|
||||||
pub fn hardware_accounts_info(&self) -> Result<HashMap<Address, AccountMeta>, Error> {
|
|
||||||
let r = self.hardware_accounts()?
|
|
||||||
.into_iter()
|
|
||||||
.map(|address| (address.clone(), self.account_meta(address).ok().unwrap_or_default()))
|
|
||||||
.collect();
|
|
||||||
Ok(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns each hardware account along with name and meta.
|
|
||||||
pub fn is_hardware_address(&self, address: &Address) -> bool {
|
|
||||||
self.hardware_store.as_ref().and_then(|s| s.wallet_info(address)).is_some()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns each account along with name and meta.
|
/// Returns each account along with name and meta.
|
||||||
pub fn account_meta(&self, address: Address) -> Result<AccountMeta, Error> {
|
pub fn account_meta(&self, address: Address) -> Result<AccountMeta, Error> {
|
||||||
if let Some(info) = self.hardware_store.as_ref().and_then(|s| s.wallet_info(&address)) {
|
let account = self.sstore.account_ref(&address)?;
|
||||||
Ok(AccountMeta {
|
Ok(AccountMeta {
|
||||||
name: info.name,
|
name: self.sstore.name(&account)?,
|
||||||
meta: info.manufacturer,
|
meta: self.sstore.meta(&account)?,
|
||||||
uuid: None,
|
uuid: self.sstore.uuid(&account).ok().map(Into::into), // allowed to not have a Uuid
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
let account = self.sstore.account_ref(&address)?;
|
|
||||||
Ok(AccountMeta {
|
|
||||||
name: self.sstore.name(&account)?,
|
|
||||||
meta: self.sstore.meta(&account)?,
|
|
||||||
uuid: self.sstore.uuid(&account).ok().map(Into::into), // allowed to not have a Uuid
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns account public key.
|
/// Returns account public key.
|
||||||
@@ -428,10 +295,7 @@ impl AccountProvider {
|
|||||||
let _ = self.sstore.sign(&account, &password, &Default::default())?;
|
let _ = self.sstore.sign(&account, &password, &Default::default())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = AccountData {
|
let data = AccountData { unlock, password };
|
||||||
unlock: unlock,
|
|
||||||
password: password,
|
|
||||||
};
|
|
||||||
|
|
||||||
unlocked.insert(account, data);
|
unlocked.insert(account, data);
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -633,43 +497,13 @@ impl AccountProvider {
|
|||||||
self.sstore.set_vault_meta(name, meta)
|
self.sstore.set_vault_meta(name, meta)
|
||||||
.map_err(Into::into)
|
.map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sign message with hardware wallet.
|
|
||||||
pub fn sign_message_with_hardware(&self, address: &Address, message: &[u8]) -> Result<Signature, SignError> {
|
|
||||||
match self.hardware_store.as_ref().map(|s| s.sign_message(address, message)) {
|
|
||||||
None | Some(Err(HardwareError::KeyNotFound)) => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(From::from(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sign transaction with hardware wallet.
|
|
||||||
pub fn sign_transaction_with_hardware(&self, address: &Address, transaction: &Transaction, chain_id: Option<u64>, rlp_encoded_transaction: &[u8]) -> Result<Signature, SignError> {
|
|
||||||
let t_info = TransactionInfo {
|
|
||||||
nonce: transaction.nonce,
|
|
||||||
gas_price: transaction.gas_price,
|
|
||||||
gas_limit: transaction.gas,
|
|
||||||
to: match transaction.action {
|
|
||||||
Action::Create => None,
|
|
||||||
Action::Call(ref to) => Some(to.clone()),
|
|
||||||
},
|
|
||||||
value: transaction.value,
|
|
||||||
data: transaction.data.to_vec(),
|
|
||||||
chain_id: chain_id,
|
|
||||||
};
|
|
||||||
match self.hardware_store.as_ref().map(|s| s.sign_transaction(&address, &t_info, rlp_encoded_transaction)) {
|
|
||||||
None | Some(Err(HardwareError::KeyNotFound)) => Err(SignError::NotFound),
|
|
||||||
Some(Err(e)) => Err(From::from(e)),
|
|
||||||
Some(Ok(s)) => Ok(s),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::{AccountProvider, Unlock};
|
use super::{AccountProvider, Unlock};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
use ethstore::ethkey::{Generator, Random, Address};
|
use parity_crypto::publickey::{Generator, Random, Address};
|
||||||
use ethstore::{StoreAccountRef, Derivation};
|
use ethstore::{StoreAccountRef, Derivation};
|
||||||
use ethereum_types::H256;
|
use ethereum_types::H256;
|
||||||
|
|
||||||
@@ -694,7 +528,7 @@ mod tests {
|
|||||||
let derived_addr = ap.derive_account(
|
let derived_addr = ap.derive_account(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(999)),
|
Derivation::SoftHash(H256::from_low_u64_be(999)),
|
||||||
false,
|
false,
|
||||||
).expect("Derivation should not fail");
|
).expect("Derivation should not fail");
|
||||||
|
|
||||||
@@ -712,7 +546,7 @@ mod tests {
|
|||||||
let derived_addr = ap.derive_account(
|
let derived_addr = ap.derive_account(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(999)),
|
Derivation::SoftHash(H256::from_low_u64_be(999)),
|
||||||
true,
|
true,
|
||||||
).expect("Derivation should not fail");
|
).expect("Derivation should not fail");
|
||||||
|
|
||||||
@@ -733,7 +567,7 @@ mod tests {
|
|||||||
let derived_addr = ap.derive_account(
|
let derived_addr = ap.derive_account(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(1999)),
|
Derivation::SoftHash(H256::from_low_u64_be(1999)),
|
||||||
true,
|
true,
|
||||||
).expect("Derivation should not fail");
|
).expect("Derivation should not fail");
|
||||||
ap.unlock_account_permanently(derived_addr, "base".into())
|
ap.unlock_account_permanently(derived_addr, "base".into())
|
||||||
@@ -745,7 +579,7 @@ mod tests {
|
|||||||
let signed_msg2 = ap.sign_derived(
|
let signed_msg2 = ap.sign_derived(
|
||||||
&kp.address(),
|
&kp.address(),
|
||||||
None,
|
None,
|
||||||
Derivation::SoftHash(H256::from(1999)),
|
Derivation::SoftHash(H256::from_low_u64_be(1999)),
|
||||||
msg,
|
msg,
|
||||||
).expect("Derived signing with existing unlocked account should not fail");
|
).expect("Derived signing with existing unlocked account should not fail");
|
||||||
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Address Book Store
|
//! Address Book Store
|
||||||
|
|
||||||
@@ -20,8 +20,10 @@ use std::{fs, fmt, hash, ops};
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use ethstore::ethkey::Address;
|
use parity_crypto::publickey::Address;
|
||||||
use ethjson::misc::AccountMeta;
|
use log::{trace, warn};
|
||||||
|
|
||||||
|
use crate::AccountMeta;
|
||||||
|
|
||||||
/// Disk-backed map from Address to String. Uses JSON.
|
/// Disk-backed map from Address to String. Uses JSON.
|
||||||
pub struct AddressBook {
|
pub struct AddressBook {
|
||||||
@@ -128,7 +130,7 @@ impl<K: hash::Hash + Eq, V> DiskMap<K, V> {
|
|||||||
trace!(target: "diskmap", "revert {:?}", self.path);
|
trace!(target: "diskmap", "revert {:?}", self.path);
|
||||||
let _ = fs::File::open(self.path.clone())
|
let _ = fs::File::open(self.path.clone())
|
||||||
.map_err(|e| trace!(target: "diskmap", "Couldn't open disk map: {}", e))
|
.map_err(|e| trace!(target: "diskmap", "Couldn't open disk map: {}", e))
|
||||||
.and_then(|f| read(f).map_err(|e| warn!(target: "diskmap", "Couldn't read disk map: {}", e)))
|
.and_then(|f| read(f).map_err(|e| warn!(target: "diskmap", "Couldn't read disk map at: {:?} {}", self.path, e)))
|
||||||
.and_then(|m| {
|
.and_then(|m| {
|
||||||
self.cache = m;
|
self.cache = m;
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -142,28 +144,30 @@ impl<K: hash::Hash + Eq, V> DiskMap<K, V> {
|
|||||||
if self.transient { return; }
|
if self.transient { return; }
|
||||||
trace!(target: "diskmap", "save {:?}", self.path);
|
trace!(target: "diskmap", "save {:?}", self.path);
|
||||||
let _ = fs::File::create(self.path.clone())
|
let _ = fs::File::create(self.path.clone())
|
||||||
.map_err(|e| warn!(target: "diskmap", "Couldn't open disk map for writing: {}", e))
|
.map_err(|e| warn!(target: "diskmap", "Couldn't open disk map for writing at: {:?} {}", self.path, e))
|
||||||
.and_then(|mut f| {
|
.and_then(|mut f| {
|
||||||
write(&self.cache, &mut f).map_err(|e| warn!(target: "diskmap", "Couldn't write to disk map: {}", e))
|
write(&self.cache, &mut f).map_err(|e| warn!(target: "diskmap", "Couldn't write to disk map at: {:?} {}", self.path, e))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::AddressBook;
|
use super::{AddressBook, Address};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use ethjson::misc::AccountMeta;
|
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
|
use crate::account_data::AccountMeta;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_save_and_reload_address_book() {
|
fn should_save_and_reload_address_book() {
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let mut b = AddressBook::new(tempdir.path());
|
let mut b = AddressBook::new(tempdir.path());
|
||||||
b.set_name(1.into(), "One".to_owned());
|
b.set_name(Address::from_low_u64_be(1), "One".to_owned());
|
||||||
b.set_meta(1.into(), "{1:1}".to_owned());
|
b.set_meta(Address::from_low_u64_be(1), "{1:1}".to_owned());
|
||||||
let b = AddressBook::new(tempdir.path());
|
let b = AddressBook::new(tempdir.path());
|
||||||
assert_eq!(b.get(), hash_map![1.into() => AccountMeta{name: "One".to_owned(), meta: "{1:1}".to_owned(), uuid: None}]);
|
assert_eq!(b.get(), vec![
|
||||||
|
(Address::from_low_u64_be(1), AccountMeta {name: "One".to_owned(), meta: "{1:1}".to_owned(), uuid: None})
|
||||||
|
].into_iter().collect::<HashMap<_, _>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -171,15 +175,15 @@ mod tests {
|
|||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let mut b = AddressBook::new(tempdir.path());
|
let mut b = AddressBook::new(tempdir.path());
|
||||||
|
|
||||||
b.set_name(1.into(), "One".to_owned());
|
b.set_name(Address::from_low_u64_be(1), "One".to_owned());
|
||||||
b.set_name(2.into(), "Two".to_owned());
|
b.set_name(Address::from_low_u64_be(2), "Two".to_owned());
|
||||||
b.set_name(3.into(), "Three".to_owned());
|
b.set_name(Address::from_low_u64_be(3), "Three".to_owned());
|
||||||
b.remove(2.into());
|
b.remove(Address::from_low_u64_be(2).into());
|
||||||
|
|
||||||
let b = AddressBook::new(tempdir.path());
|
let b = AddressBook::new(tempdir.path());
|
||||||
assert_eq!(b.get(), hash_map![
|
assert_eq!(b.get(), vec![
|
||||||
1.into() => AccountMeta{name: "One".to_owned(), meta: "{}".to_owned(), uuid: None},
|
(Address::from_low_u64_be(1), AccountMeta{name: "One".to_owned(), meta: "{}".to_owned(), uuid: None}),
|
||||||
3.into() => AccountMeta{name: "Three".to_owned(), meta: "{}".to_owned(), uuid: None}
|
(Address::from_low_u64_be(3), AccountMeta{name: "Three".to_owned(), meta: "{}".to_owned(), uuid: None}),
|
||||||
]);
|
].into_iter().collect::<HashMap<_, _>>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Chain Specification"
|
||||||
name = "chainspec"
|
name = "chainspec"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Marek Kotewicz <marek@parity.io>"]
|
authors = ["Marek Kotewicz <marek@parity.io>"]
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
extern crate ethjson;
|
extern crate ethjson;
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
authors = ["Parity <admin@parity.io>"]
|
description = "Parity Ethereum CLI Signer Tool"
|
||||||
description = "Parity Cli Tool"
|
|
||||||
homepage = "http://parity.io"
|
homepage = "http://parity.io"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
name = "rpc-cli"
|
name = "cli-signer"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
|
authors = ["Parity <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
ethereum-types = "0.8.0"
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
rpassword = "1.0"
|
rpassword = "1.0"
|
||||||
parity-rpc = { path = "../rpc" }
|
parity-rpc = { path = "../rpc" }
|
||||||
parity-rpc-client = { path = "../rpc_client" }
|
parity-rpc-client = { path = "rpc-client" }
|
||||||
21
cli-signer/rpc-client/Cargo.toml
Normal file
21
cli-signer/rpc-client/Cargo.toml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[package]
|
||||||
|
description = "Parity Ethereum RPC Client"
|
||||||
|
homepage = "http://parity.io"
|
||||||
|
license = "GPL-3.0"
|
||||||
|
name = "parity-rpc-client"
|
||||||
|
version = "1.4.0"
|
||||||
|
authors = ["Parity <admin@parity.io>"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
ethereum-types = "0.8.0"
|
||||||
|
futures = "0.1"
|
||||||
|
log = "0.4"
|
||||||
|
serde = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
|
url = "2.1.0"
|
||||||
|
matches = "0.1"
|
||||||
|
parking_lot = "0.9"
|
||||||
|
jsonrpc-core = "14.0.3"
|
||||||
|
jsonrpc-ws-server = "14.0.3"
|
||||||
|
parity-rpc = { path = "../../rpc" }
|
||||||
|
keccak-hash = "0.4.0"
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fmt::{Debug, Formatter, Error as FmtError};
|
use std::fmt::{Debug, Formatter, Error as FmtError};
|
||||||
use std::io::{BufReader, BufRead};
|
use std::io::{BufReader, BufRead};
|
||||||
@@ -1,22 +1,23 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pub mod client;
|
pub mod client;
|
||||||
pub mod signer_client;
|
pub mod signer_client;
|
||||||
|
|
||||||
|
extern crate ethereum_types;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate jsonrpc_core;
|
extern crate jsonrpc_core;
|
||||||
extern crate jsonrpc_ws_server as ws;
|
extern crate jsonrpc_ws_server as ws;
|
||||||
@@ -35,7 +36,7 @@ extern crate log;
|
|||||||
extern crate matches;
|
extern crate matches;
|
||||||
|
|
||||||
/// Boxed future response.
|
/// Boxed future response.
|
||||||
pub type BoxFuture<T, E> = Box<futures::Future<Item=T, Error=E> + Send>;
|
pub type BoxFuture<T, E> = Box<dyn futures::Future<Item=T, Error=E> + Send>;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use client::{Rpc, RpcError};
|
use client::{Rpc, RpcError};
|
||||||
use rpc::signer::{ConfirmationRequest, TransactionModification, U256, TransactionCondition};
|
use ethereum_types::U256;
|
||||||
|
use rpc::signer::{ConfirmationRequest, TransactionModification, TransactionCondition};
|
||||||
use serde;
|
use serde;
|
||||||
use serde_json::{Value as JsonValue, to_value};
|
use serde_json::{Value as JsonValue, to_value};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -1,26 +1,28 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
extern crate ethereum_types;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate rpassword;
|
extern crate rpassword;
|
||||||
|
|
||||||
extern crate parity_rpc as rpc;
|
extern crate parity_rpc as rpc;
|
||||||
extern crate parity_rpc_client as client;
|
extern crate parity_rpc_client as client;
|
||||||
|
|
||||||
use rpc::signer::{U256, ConfirmationRequest};
|
use ethereum_types::U256;
|
||||||
|
use rpc::signer::ConfirmationRequest;
|
||||||
use client::signer_client::SignerRpc;
|
use client::signer_client::SignerRpc;
|
||||||
use std::io::{Write, BufRead, BufReader, stdout, stdin};
|
use std::io::{Write, BufRead, BufReader, stdout, stdin};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[package]
|
|
||||||
description = "Ethcore development/test/build tools"
|
|
||||||
homepage = "http://parity.io"
|
|
||||||
license = "GPL-3.0"
|
|
||||||
name = "ethcore-devtools"
|
|
||||||
version = "1.12.0"
|
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
|
||||||
@@ -1,3 +1,26 @@
|
|||||||
|
Note: Parity Ethereum 2.0 reached End-of-Life on 2018-11-15 (EOL).
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.0.9](https://github.com/paritytech/parity-ethereum/releases/tag/v2.0.9) (2018-10-29)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.0.9-stable is a bug-fix release to improve performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backports: parity stable 2.0.9 ([#9786](https://github.com/paritytech/parity-ethereum/pull/9786))
|
||||||
|
- Version: bump parity stable to 2.0.9
|
||||||
|
- Ethcore: bump ropsten forkblock checkpoint ([#9775](https://github.com/paritytech/parity-ethereum/pull/9775))
|
||||||
|
- Ethcore: handle vm exception when estimating gas ([#9615](https://github.com/paritytech/parity-ethereum/pull/9615))
|
||||||
|
- Update jsonrpc-core to a1b2bb742ce16d1168669ffb13ffe856e8131228 ([#9780](https://github.com/paritytech/parity-ethereum/pull/9780))
|
||||||
|
- Removed "rustup" & added new runner tag ([#9731](https://github.com/paritytech/parity-ethereum/pull/9731))
|
||||||
|
- Removed "rustup" & added new runner tag
|
||||||
|
- Exchanged tag "rust-windows" with "windows"
|
||||||
|
- Revert windows tag change
|
||||||
|
- Allow zero chain id in EIP155 signing process ([#9792](https://github.com/paritytech/parity-ethereum/pull/9792))
|
||||||
|
- Allow zero chain id in EIP155 signing process
|
||||||
|
- Rename test
|
||||||
|
- Fix test failure
|
||||||
|
- Insert dev account before unlocking ([#9813](https://github.com/paritytech/parity-ethereum/pull/9813))
|
||||||
|
|
||||||
## Parity-Ethereum [v2.0.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.0.8) (2018-10-16)
|
## Parity-Ethereum [v2.0.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.0.8) (2018-10-16)
|
||||||
|
|
||||||
Parity-Ethereum 2.0.8-stable is a release that fixes a consensus issue with the recent Constantinople release. Upgrading is mandatory whatever network you are connected to that plans enabling EIP-1283, e.g., Ropsten, Kovan, Ethereum.
|
Parity-Ethereum 2.0.8-stable is a release that fixes a consensus issue with the recent Constantinople release. Upgrading is mandatory whatever network you are connected to that plans enabling EIP-1283, e.g., Ropsten, Kovan, Ethereum.
|
||||||
|
|||||||
1013
docs/CHANGELOG-2.1.md
Normal file
1013
docs/CHANGELOG-2.1.md
Normal file
File diff suppressed because it is too large
Load Diff
392
docs/CHANGELOG-2.2.md
Normal file
392
docs/CHANGELOG-2.2.md
Normal file
@@ -0,0 +1,392 @@
|
|||||||
|
Note: Parity Ethereum 2.2 reached End-of-Life on 2019-02-25 (EOL).
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.11](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.11) (2019-02-21)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.11-stable is a maintenance release that fixes snap and docker installations.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Stable: snap: release untagged versions from branches to the candidate ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357)) ([#10372](https://github.com/paritytech/parity-ethereum/pull/10372))
|
||||||
|
- Snap: release untagged versions from branches to the candidate snap channel ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357))
|
||||||
|
- Snap: add the removable-media plug ([#10377](https://github.com/paritytech/parity-ethereum/pull/10377))
|
||||||
|
- Exchanged old(azure) bootnodes with new(ovh) ones ([#10309](https://github.com/paritytech/parity-ethereum/pull/10309))
|
||||||
|
- Stable Backports ([#10353](https://github.com/paritytech/parity-ethereum/pull/10353))
|
||||||
|
- Version: bump stable to 2.2.11
|
||||||
|
- Snap: prefix version and populate candidate channel ([#10343](https://github.com/paritytech/parity-ethereum/pull/10343))
|
||||||
|
- Snap: populate candidate releases with beta snaps to avoid stale channel
|
||||||
|
- Snap: prefix version with v*
|
||||||
|
- No volumes are needed, just run -v volume:/path/in/the/container ([#10345](https://github.com/paritytech/parity-ethereum/pull/10345))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.10](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.10) (2019-02-13)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.10-stable is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||||
|
|
||||||
|
- https://www.parity.io/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities/
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Additional error for invalid gas ([#10327](https://github.com/paritytech/parity-ethereum/pull/10327)) ([#10329](https://github.com/paritytech/parity-ethereum/pull/10329))
|
||||||
|
- Backports for Stable 2.2.10 ([#10332](https://github.com/paritytech/parity-ethereum/pull/10332))
|
||||||
|
- fix(docker-aarch64) : cross-compile config ([#9798](https://github.com/paritytech/parity-ethereum/pull/9798))
|
||||||
|
- import rpc transactions sequentially ([#10051](https://github.com/paritytech/parity-ethereum/pull/10051))
|
||||||
|
- fix(docker): fix not receives SIGINT ([#10059](https://github.com/paritytech/parity-ethereum/pull/10059))
|
||||||
|
- snap: official image / test ([#10168](https://github.com/paritytech/parity-ethereum/pull/10168))
|
||||||
|
- perform stripping during build ([#10208](https://github.com/paritytech/parity-ethereum/pull/10208))
|
||||||
|
- Additional tests for uint/hash/bytes deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279))
|
||||||
|
- Don't run the CPP example on CI ([#10285](https://github.com/paritytech/parity-ethereum/pull/10285))
|
||||||
|
- CI optimizations ([#10297](https://github.com/paritytech/parity-ethereum/pull/10297))
|
||||||
|
- fix publish job ([#10317](https://github.com/paritytech/parity-ethereum/pull/10317))
|
||||||
|
- Add Statetest support for Constantinople Fix ([#10323](https://github.com/paritytech/parity-ethereum/pull/10323))
|
||||||
|
- Add helper for Timestamp overflows ([#10330](https://github.com/paritytech/parity-ethereum/pull/10330))
|
||||||
|
- Don't add discovery initiators to the node table ([#10305](https://github.com/paritytech/parity-ethereum/pull/10305))
|
||||||
|
- change docker image based on debian instead of ubuntu due to the chan ([#10336](https://github.com/paritytech/parity-ethereum/pull/10336))
|
||||||
|
- role back docker build image and docker deploy image to ubuntu:xenial based ([#10338](https://github.com/paritytech/parity-ethereum/pull/10338))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.9](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.9) (2019-02-03)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.9-stable is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||||
|
|
||||||
|
- https://www.parity.io/security-alert-parity-ethereum-03-02/
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Additional tests for uint deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279)) ([#10281](https://github.com/paritytech/parity-ethereum/pull/10281))
|
||||||
|
- Version: bump stable to 2.2.9 ([#10282](https://github.com/paritytech/parity-ethereum/pull/10282))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.8) (2019-02-01)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.8-stable is a consensus-relevant release that enables _St. Petersfork_ on:
|
||||||
|
|
||||||
|
- Ethereum Block `7280000` (along with Constantinople)
|
||||||
|
- Kovan Block `10255201`
|
||||||
|
- Ropsten Block `4939394`
|
||||||
|
- POA Sokol Block `7026400`
|
||||||
|
|
||||||
|
In addition to this, Constantinople is cancelled for the POA Core network. Upgrading is mandatory for clients on any of these chains.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backports for stable 2.2.8 ([#10224](https://github.com/paritytech/parity-ethereum/pull/10224))
|
||||||
|
- Update for Android cross-compilation. ([#10180](https://github.com/paritytech/parity-ethereum/pull/10180))
|
||||||
|
- Cancel Constantinople HF on POA Core ([#10198](https://github.com/paritytech/parity-ethereum/pull/10198))
|
||||||
|
- Add EIP-1283 disable transition ([#10214](https://github.com/paritytech/parity-ethereum/pull/10214))
|
||||||
|
- Enable St-Peters-Fork ("Constantinople Fix") ([#10223](https://github.com/paritytech/parity-ethereum/pull/10223))
|
||||||
|
- Stable: Macos heapsize force jemalloc ([#10234](https://github.com/paritytech/parity-ethereum/pull/10234)) ([#10258](https://github.com/paritytech/parity-ethereum/pull/10258))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.7) (2019-01-15)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.7-stable is a consensus-relevant security release that reverts Constantinople on the Ethereum network. Upgrading is mandatory for Ethereum, and strongly recommended for other networks.
|
||||||
|
|
||||||
|
- **Consensus** - Ethereum Network: Pull Constantinople protocol upgrade on Ethereum ([#10189](https://github.com/paritytech/parity-ethereum/pull/10189))
|
||||||
|
- Read more: [Security Alert: Ethereum Constantinople Postponement](https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/)
|
||||||
|
- **Networking** - All networks: Ping nodes from discovery ([#10167](https://github.com/paritytech/parity-ethereum/pull/10167))
|
||||||
|
- **Wasm** - Kovan Network: Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||||
|
|
||||||
|
_Note:_ This release marks Parity 2.2 as _stable_. All versions of Parity 2.1 now reached _end of life_.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backports for stable 2.2.7 ([#10163](https://github.com/paritytech/parity-ethereum/pull/10163))
|
||||||
|
- Version: bump stable to 2.2.7
|
||||||
|
- Version: mark 2.2 track stable
|
||||||
|
- Version: mark update critical on all networks
|
||||||
|
- Handle the case for contract creation on an empty but exist account with storage items ([#10065](https://github.com/paritytech/parity-ethereum/pull/10065))
|
||||||
|
- Fix _cannot recursively call into `Core`_ issue ([#10144](https://github.com/paritytech/parity-ethereum/pull/10144))
|
||||||
|
- Snap: fix path in script ([#10157](https://github.com/paritytech/parity-ethereum/pull/10157))
|
||||||
|
- Ping nodes from discovery ([#10167](https://github.com/paritytech/parity-ethereum/pull/10167))
|
||||||
|
- Version: bump fork blocks for kovan and foundation, mark releases non critical
|
||||||
|
- Pull constantinople on ethereum network ([#10189](https://github.com/paritytech/parity-ethereum/pull/10189))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.6) (2019-01-10)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.6-beta is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Beta backports v2.2.6 ([#10113](https://github.com/paritytech/parity-ethereum/pull/10113))
|
||||||
|
- Version: bump beta to v2.2.6
|
||||||
|
- Fill transaction hash on ethGetLog of light client. ([#9938](https://github.com/paritytech/parity-ethereum/pull/9938))
|
||||||
|
- Fix pubsub new_blocks notifications to include all blocks ([#9987](https://github.com/paritytech/parity-ethereum/pull/9987))
|
||||||
|
- Finality: dont require chain head to be in the chain ([#10054](https://github.com/paritytech/parity-ethereum/pull/10054))
|
||||||
|
- Handle the case for contract creation on an empty but exist account with storage items ([#10065](https://github.com/paritytech/parity-ethereum/pull/10065))
|
||||||
|
- Autogen docs for the "Configuring Parity Ethereum" wiki page. ([#10067](https://github.com/paritytech/parity-ethereum/pull/10067))
|
||||||
|
- HF in POA Sokol (2019-01-04) ([#10077](https://github.com/paritytech/parity-ethereum/pull/10077))
|
||||||
|
- Add --locked when running cargo ([#10107](https://github.com/paritytech/parity-ethereum/pull/10107))
|
||||||
|
- Ethcore: update hardcoded headers ([#10123](https://github.com/paritytech/parity-ethereum/pull/10123))
|
||||||
|
- Identity fix ([#10128](https://github.com/paritytech/parity-ethereum/pull/10128))
|
||||||
|
- Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||||
|
- Make sure parent block is not in importing queue when importing ancient blocks ([#10138](https://github.com/paritytech/parity-ethereum/pull/10138))
|
||||||
|
- CI: re-enable snap publishing ([#10142](https://github.com/paritytech/parity-ethereum/pull/10142))
|
||||||
|
- HF in POA Core (2019-01-18) - Constantinople ([#10155](https://github.com/paritytech/parity-ethereum/pull/10155))
|
||||||
|
- Version: mark upgrade critical on kovan
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.5) (2018-12-14)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.5-beta is an important release that introduces Constantinople fork at block 7080000 on Mainnet.
|
||||||
|
This release also contains a fix for chains using AuRa + EmptySteps. Read carefully if this applies to you.
|
||||||
|
If you have a chain with`empty_steps` already running, some blocks most likely contain non-strict entries (unordered or duplicated empty steps). In this release`strict_empty_steps_transition` **is enabled by default at block 0** for any chain with `empty_steps`.
|
||||||
|
If your network uses `empty_steps` you **must**:
|
||||||
|
- plan a hard fork and change `strict_empty_steps_transition` to the desire fork block
|
||||||
|
- update the clients of the whole network to 2.2.5-beta / 2.1.10-stable.
|
||||||
|
If for some reason you don't want to do this please set`strict_empty_steps_transition` to `0xfffffffff` to disable it.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- Backports for beta 2.2.5 ([#10047](https://github.com/paritytech/parity-ethereum/pull/10047))
|
||||||
|
- Bump beta to 2.2.5 ([#10047](https://github.com/paritytech/parity-ethereum/pull/10047))
|
||||||
|
- Fix empty steps ([#9939](https://github.com/paritytech/parity-ethereum/pull/9939))
|
||||||
|
- Prevent sending empty step message twice
|
||||||
|
- Prevent sending empty step and then block in the same step
|
||||||
|
- Don't accept double empty steps
|
||||||
|
- Do basic validation of self-sealed blocks
|
||||||
|
- Strict empty steps validation ([#10041](https://github.com/paritytech/parity-ethereum/pull/10041))
|
||||||
|
- Enables strict verification of empty steps - there can be no duplicates and empty steps should be ordered inside the seal.
|
||||||
|
- Note that authorities won't produce invalid seals after [#9939](https://github.com/paritytech/parity-ethereum/pull/9939), this PR just adds verification to the seal to prevent forging incorrect blocks and potentially causing consensus issues.
|
||||||
|
- This features is enabled by default so any AuRa + EmptySteps chain should set strict_empty_steps_transition fork block number in their spec and upgrade to v2.2.5-beta or v2.1.10-stable.
|
||||||
|
- ethcore: enable constantinople on ethereum ([#10031](https://github.com/paritytech/parity-ethereum/pull/10031))
|
||||||
|
- ethcore: change blockreward to 2e18 for foundation after constantinople
|
||||||
|
- ethcore: delay diff bomb by 2e6 blocks for foundation after constantinople
|
||||||
|
- ethcore: enable eip-{145,1014,1052,1283} for foundation after constantinople
|
||||||
|
- Change test miner max memory to malloc reports. ([#10024](https://github.com/paritytech/parity-ethereum/pull/10024))
|
||||||
|
- Fix: test corpus_inaccessible panic ([#10019](https://github.com/paritytech/parity-ethereum/pull/10019))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.2) (2018-11-29)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.2-beta is an exciting release. Among others, it improves sync performance, peering stability, block propagation, and transaction propagation times. Also, a warp-sync no longer removes existing blocks from the database, but rather reuses locally available information to decrease sync times and reduces required bandwidth.
|
||||||
|
|
||||||
|
Before upgrading to 2.2.2, please also verify the validity of your chain specs. Parity Ethereum now denies unknown fields in the specification. To do this, use the chainspec tool:
|
||||||
|
|
||||||
|
```
|
||||||
|
cargo build --release -p chainspec
|
||||||
|
./target/release/chainspec /path/to/spec.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Last but not least, JSONRPC APIs which are not yet accepted as an EIP in the `eth`, `personal`, or `web3` namespace, are now considere experimental as their final specification might change in future. These APIs have to be manually enabled by explicitly running `--jsonrpc-experimental`.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backports For beta 2.2.2 ([#9976](https://github.com/paritytech/parity-ethereum/pull/9976))
|
||||||
|
- Version: bump beta to 2.2.2
|
||||||
|
- Add experimental RPCs flag ([#9928](https://github.com/paritytech/parity-ethereum/pull/9928))
|
||||||
|
- Keep existing blocks when restoring a Snapshot ([#8643](https://github.com/paritytech/parity-ethereum/pull/8643))
|
||||||
|
- Rename db_restore => client
|
||||||
|
- First step: make it compile!
|
||||||
|
- Second step: working implementation!
|
||||||
|
- Refactoring
|
||||||
|
- Fix tests
|
||||||
|
- Migrate ancient blocks interacting backward
|
||||||
|
- Early return in block migration if snapshot is aborted
|
||||||
|
- Remove RwLock getter (PR Grumble I)
|
||||||
|
- Remove dependency on `Client`: only used Traits
|
||||||
|
- Add test for recovering aborted snapshot recovery
|
||||||
|
- Add test for migrating old blocks
|
||||||
|
- Release RwLock earlier
|
||||||
|
- Revert Cargo.lock
|
||||||
|
- Update _update ancient block_ logic: set local in `commit`
|
||||||
|
- Update typo in ethcore/src/snapshot/service.rs
|
||||||
|
- Adjust requests costs for light client ([#9925](https://github.com/paritytech/parity-ethereum/pull/9925))
|
||||||
|
- Pip Table Cost relative to average peers instead of max peers
|
||||||
|
- Add tracing in PIP new_cost_table
|
||||||
|
- Update stat peer_count
|
||||||
|
- Use number of leeching peers for Light serve costs
|
||||||
|
- Fix test::light_params_load_share_depends_on_max_peers (wrong type)
|
||||||
|
- Remove (now) useless test
|
||||||
|
- Remove `load_share` from LightParams.Config
|
||||||
|
- Add LEECHER_COUNT_FACTOR
|
||||||
|
- Pr Grumble: u64 to u32 for f64 casting
|
||||||
|
- Prevent u32 overflow for avg_peer_count
|
||||||
|
- Add tests for LightSync::Statistics
|
||||||
|
- Fix empty steps ([#9939](https://github.com/paritytech/parity-ethereum/pull/9939))
|
||||||
|
- Don't send empty step twice or empty step then block.
|
||||||
|
- Perform basic validation of locally sealed blocks.
|
||||||
|
- Don't include empty step twice.
|
||||||
|
- Prevent silent errors in daemon mode, closes [#9367](https://github.com/paritytech/parity-ethereum/issues/9367) ([#9946](https://github.com/paritytech/parity-ethereum/pull/9946))
|
||||||
|
- Fix a deadlock ([#9952](https://github.com/paritytech/parity-ethereum/pull/9952))
|
||||||
|
- Update informant:
|
||||||
|
- Decimal in Mgas/s
|
||||||
|
- Print every 5s (not randomly between 5s and 10s)
|
||||||
|
- Fix dead-lock in `blockchain.rs`
|
||||||
|
- Update locks ordering
|
||||||
|
- Fix light client informant while syncing ([#9932](https://github.com/paritytech/parity-ethereum/pull/9932))
|
||||||
|
- Add `is_idle` to LightSync to check importing status
|
||||||
|
- Use SyncStateWrapper to make sure is_idle gets updates
|
||||||
|
- Update is_major_import to use verified queue size as well
|
||||||
|
- Add comment for `is_idle`
|
||||||
|
- Add Debug to `SyncStateWrapper`
|
||||||
|
- `fn get` -> `fn into_inner`
|
||||||
|
- Ci: rearrange pipeline by logic ([#9970](https://github.com/paritytech/parity-ethereum/pull/9970))
|
||||||
|
- Ci: rearrange pipeline by logic
|
||||||
|
- Ci: rename docs script
|
||||||
|
- Fix docker build ([#9971](https://github.com/paritytech/parity-ethereum/pull/9971))
|
||||||
|
- Deny unknown fields for chainspec ([#9972](https://github.com/paritytech/parity-ethereum/pull/9972))
|
||||||
|
- Add deny_unknown_fields to chainspec
|
||||||
|
- Add tests and fix existing one
|
||||||
|
- Remove serde_ignored dependency for chainspec
|
||||||
|
- Fix rpc test eth chain spec
|
||||||
|
- Fix starting_nonce_test spec
|
||||||
|
- Improve block and transaction propagation ([#9954](https://github.com/paritytech/parity-ethereum/pull/9954))
|
||||||
|
- Refactor sync to add priority tasks.
|
||||||
|
- Send priority tasks notifications.
|
||||||
|
- Propagate blocks, optimize transactions.
|
||||||
|
- Implement transaction propagation. Use sync_channel.
|
||||||
|
- Tone down info.
|
||||||
|
- Prevent deadlock by not waiting forever for sync lock.
|
||||||
|
- Fix lock order.
|
||||||
|
- Don't use sync_channel to prevent deadlocks.
|
||||||
|
- Fix tests.
|
||||||
|
- Fix unstable peers and slowness in sync ([#9967](https://github.com/paritytech/parity-ethereum/pull/9967))
|
||||||
|
- Don't sync all peers after each response
|
||||||
|
- Update formating
|
||||||
|
- Fix tests: add `continue_sync` to `Sync_step`
|
||||||
|
- Update ethcore/sync/src/chain/mod.rs
|
||||||
|
- Fix rpc middlewares
|
||||||
|
- Fix Cargo.lock
|
||||||
|
- Json: resolve merge in spec
|
||||||
|
- Rpc: fix starting_nonce_test
|
||||||
|
- Ci: allow nightl job to fail
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.2.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.1) (2018-11-15)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.2.1-beta is the first v2.2 release, and might introduce features that break previous work flows, among others:
|
||||||
|
|
||||||
|
- Prevent zero network ID ([#9763](https://github.com/paritytech/parity-ethereum/pull/9763)) and drop support for Olympic testnet ([#9801](https://github.com/paritytech/parity-ethereum/pull/9801)): The Olympic test net is dead for years and never used a chain ID but network ID zero. Parity Ethereum is now preventing the network ID to be zero, thus Olympic support is dropped. Make sure to chose positive non-zero network IDs in future.
|
||||||
|
- Multithreaded snapshot creation ([#9239](https://github.com/paritytech/parity-ethereum/pull/9239)): adds a CLI argument `--snapshot-threads` which specifies the number of threads. This helps improving the performance of full nodes that wish to provide warp-snapshots for the network. The gain in performance comes with a slight drawback in increased snapshot size.
|
||||||
|
- Expose config max-round-blocks-to-import ([#9439](https://github.com/paritytech/parity-ethereum/pull/9439)): Parity Ethereum imports blocks in rounds. If at the end of any round, the queue is not empty, we consider it to be _importing_ and won't notify pubsub. On large re-orgs (10+ blocks), this is possible. The default `max_round_blocks_to_import` is increased to 12 and configurable via the `--max-round-blocks-to-import` CLI flag. With unstable network conditions, it is advised to increase the number. This shouldn't have any noticeable performance impact unless the number is set to really large.
|
||||||
|
- Increase Gas-floor-target and Gas Cap ([#9564](https://github.com/paritytech/parity-ethereum/pull/9564)): the default values for gas floor target are `8_000_000` and gas cap `10_000_000`, similar to Geth 1.8.15+.
|
||||||
|
- Produce portable binaries ([#9725](https://github.com/paritytech/parity-ethereum/pull/9725)): we now produce portable binaries, but it may incur some performance degradation. For ultimate performance it's now better to compile Parity Ethereum from source with `PORTABLE=OFF` environment variable.
|
||||||
|
- RPC: `parity_allTransactionHashes` ([#9745](https://github.com/paritytech/parity-ethereum/pull/9745)): Get all pending transactions from the queue with the high performant `parity_allTransactionHashes` RPC method.
|
||||||
|
- Support `eth_chainId` RPC method ([#9783](https://github.com/paritytech/parity-ethereum/pull/9783)): implements EIP-695 to get the chainID via RPC.
|
||||||
|
- AuRa: finalize blocks ([#9692](https://github.com/paritytech/parity-ethereum/pull/9692)): The AuRa engine was updated to emit ancestry actions to finalize blocks. The full client stores block finality in the database, the engine builds finality from an ancestry of `ExtendedHeader`; `is_epoch_end` was updated to take a vec of recently finalized headers; `is_epoch_end_light` was added which maintains the previous interface and is used by the light client since the client itself doesn't track finality.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backport to parity 2.2.1 beta ([#9905](https://github.com/paritytech/parity-ethereum/pull/9905))
|
||||||
|
- Bump version to 2.2.1
|
||||||
|
- Fix: Intermittent failing CI due to addr in use ([#9885](https://github.com/paritytech/parity-ethereum/pull/9885))
|
||||||
|
- Fix Parity not closing on Ctrl-C ([#9886](https://github.com/paritytech/parity-ethereum/pull/9886))
|
||||||
|
- Fix json tracer overflow ([#9873](https://github.com/paritytech/parity-ethereum/pull/9873))
|
||||||
|
- Fix docker script ([#9854](https://github.com/paritytech/parity-ethereum/pull/9854))
|
||||||
|
- Add hardcoded headers for light client ([#9907](https://github.com/paritytech/parity-ethereum/pull/9907))
|
||||||
|
- Gitlab-ci: make android release build succeed ([#9743](https://github.com/paritytech/parity-ethereum/pull/9743))
|
||||||
|
- Allow to seal work on latest block ([#9876](https://github.com/paritytech/parity-ethereum/pull/9876))
|
||||||
|
- Remove rust-toolchain file ([#9906](https://github.com/paritytech/parity-ethereum/pull/9906))
|
||||||
|
- Light-fetch: Differentiate between out-of-gas/manual throw and use required gas from response on failure ([#9824](https://github.com/paritytech/parity-ethereum/pull/9824))
|
||||||
|
- Eip-712 implementation ([#9631](https://github.com/paritytech/parity-ethereum/pull/9631))
|
||||||
|
- Eip-191 implementation ([#9701](https://github.com/paritytech/parity-ethereum/pull/9701))
|
||||||
|
- Simplify cargo audit ([#9918](https://github.com/paritytech/parity-ethereum/pull/9918))
|
||||||
|
- Fix performance issue importing Kovan blocks ([#9914](https://github.com/paritytech/parity-ethereum/pull/9914))
|
||||||
|
- Ci: nuke the gitlab caches ([#9855](https://github.com/paritytech/parity-ethereum/pull/9855))
|
||||||
|
- Backports to parity beta 2.2.0 ([#9820](https://github.com/paritytech/parity-ethereum/pull/9820))
|
||||||
|
- Ci: remove failing tests for android, windows, and macos ([#9788](https://github.com/paritytech/parity-ethereum/pull/9788))
|
||||||
|
- Implement NoProof for json tests and update tests reference ([#9814](https://github.com/paritytech/parity-ethereum/pull/9814))
|
||||||
|
- Move state root verification before gas used ([#9841](https://github.com/paritytech/parity-ethereum/pull/9841))
|
||||||
|
- Classic.json Bootnode Update ([#9828](https://github.com/paritytech/parity-ethereum/pull/9828))
|
||||||
|
- Rpc: parity_allTransactionHashes ([#9745](https://github.com/paritytech/parity-ethereum/pull/9745))
|
||||||
|
- Revert "prevent zero networkID ([#9763](https://github.com/paritytech/parity-ethereum/pull/9763))" ([#9815](https://github.com/paritytech/parity-ethereum/pull/9815))
|
||||||
|
- Allow zero chain id in EIP155 signing process ([#9792](https://github.com/paritytech/parity-ethereum/pull/9792))
|
||||||
|
- Add readiness check for docker container ([#9804](https://github.com/paritytech/parity-ethereum/pull/9804))
|
||||||
|
- Insert dev account before unlocking ([#9813](https://github.com/paritytech/parity-ethereum/pull/9813))
|
||||||
|
- Removed "rustup" & added new runner tag ([#9731](https://github.com/paritytech/parity-ethereum/pull/9731))
|
||||||
|
- Expose config max-round-blocks-to-import ([#9439](https://github.com/paritytech/parity-ethereum/pull/9439))
|
||||||
|
- Aura: finalize blocks ([#9692](https://github.com/paritytech/parity-ethereum/pull/9692))
|
||||||
|
- Sync: retry different peer after empty subchain heads response ([#9753](https://github.com/paritytech/parity-ethereum/pull/9753))
|
||||||
|
- Fix(light-rpc/parity) : Remove unused client ([#9802](https://github.com/paritytech/parity-ethereum/pull/9802))
|
||||||
|
- Drops support for olympic testnet, closes [#9800](https://github.com/paritytech/parity-ethereum/issues/9800) ([#9801](https://github.com/paritytech/parity-ethereum/pull/9801))
|
||||||
|
- Replace `tokio_core` with `tokio` (`ring` -> 0.13) ([#9657](https://github.com/paritytech/parity-ethereum/pull/9657))
|
||||||
|
- Support eth_chainId RPC method ([#9783](https://github.com/paritytech/parity-ethereum/pull/9783))
|
||||||
|
- Ethcore: bump ropsten forkblock checkpoint ([#9775](https://github.com/paritytech/parity-ethereum/pull/9775))
|
||||||
|
- Docs: changelogs for 2.0.8 and 2.1.3 ([#9758](https://github.com/paritytech/parity-ethereum/pull/9758))
|
||||||
|
- Prevent zero networkID ([#9763](https://github.com/paritytech/parity-ethereum/pull/9763))
|
||||||
|
- Skip seal fields count check when --no-seal-check is used ([#9757](https://github.com/paritytech/parity-ethereum/pull/9757))
|
||||||
|
- Aura: fix panic on extra_info with unsealed block ([#9755](https://github.com/paritytech/parity-ethereum/pull/9755))
|
||||||
|
- Docs: update changelogs ([#9742](https://github.com/paritytech/parity-ethereum/pull/9742))
|
||||||
|
- Removed extra assert in generation_session_is_removed_when_succeeded ([#9738](https://github.com/paritytech/parity-ethereum/pull/9738))
|
||||||
|
- Make checkpoint_storage_at use plain loop instead of recursion ([#9734](https://github.com/paritytech/parity-ethereum/pull/9734))
|
||||||
|
- Use signed 256-bit integer for sstore gas refund substate ([#9746](https://github.com/paritytech/parity-ethereum/pull/9746))
|
||||||
|
- Heads ref not present for branches beta and stable ([#9741](https://github.com/paritytech/parity-ethereum/pull/9741))
|
||||||
|
- Add Callisto support ([#9534](https://github.com/paritytech/parity-ethereum/pull/9534))
|
||||||
|
- Add --force to cargo audit install script ([#9735](https://github.com/paritytech/parity-ethereum/pull/9735))
|
||||||
|
- Remove unused expired value from Handshake ([#9732](https://github.com/paritytech/parity-ethereum/pull/9732))
|
||||||
|
- Add hardcoded headers ([#9730](https://github.com/paritytech/parity-ethereum/pull/9730))
|
||||||
|
- Produce portable binaries ([#9725](https://github.com/paritytech/parity-ethereum/pull/9725))
|
||||||
|
- Gitlab ci: releasable_branches: change variables condition to schedule ([#9729](https://github.com/paritytech/parity-ethereum/pull/9729))
|
||||||
|
- Update a few parity-common dependencies ([#9663](https://github.com/paritytech/parity-ethereum/pull/9663))
|
||||||
|
- Hf in POA Core (2018-10-22) ([#9724](https://github.com/paritytech/parity-ethereum/pull/9724))
|
||||||
|
- Schedule nightly builds ([#9717](https://github.com/paritytech/parity-ethereum/pull/9717))
|
||||||
|
- Fix ancient blocks sync ([#9531](https://github.com/paritytech/parity-ethereum/pull/9531))
|
||||||
|
- Ci: Skip docs job for nightly ([#9693](https://github.com/paritytech/parity-ethereum/pull/9693))
|
||||||
|
- Fix (light/provider) : Make `read_only executions` read-only ([#9591](https://github.com/paritytech/parity-ethereum/pull/9591))
|
||||||
|
- Ethcore: fix detection of major import ([#9552](https://github.com/paritytech/parity-ethereum/pull/9552))
|
||||||
|
- Return 0 on error ([#9705](https://github.com/paritytech/parity-ethereum/pull/9705))
|
||||||
|
- Ethcore: delay ropsten hardfork ([#9704](https://github.com/paritytech/parity-ethereum/pull/9704))
|
||||||
|
- Make instantSeal engine backwards compatible, closes [#9696](https://github.com/paritytech/parity-ethereum/issues/9696) ([#9700](https://github.com/paritytech/parity-ethereum/pull/9700))
|
||||||
|
- Implement CREATE2 gas changes and fix some potential overflowing ([#9694](https://github.com/paritytech/parity-ethereum/pull/9694))
|
||||||
|
- Don't hash the init_code of CREATE. ([#9688](https://github.com/paritytech/parity-ethereum/pull/9688))
|
||||||
|
- Ethcore: minor optimization of modexp by using LR exponentiation ([#9697](https://github.com/paritytech/parity-ethereum/pull/9697))
|
||||||
|
- Removed redundant clone before each block import ([#9683](https://github.com/paritytech/parity-ethereum/pull/9683))
|
||||||
|
- Add Foundation Bootnodes ([#9666](https://github.com/paritytech/parity-ethereum/pull/9666))
|
||||||
|
- Docker: run as parity user ([#9689](https://github.com/paritytech/parity-ethereum/pull/9689))
|
||||||
|
- Ethcore: mcip3 block reward contract ([#9605](https://github.com/paritytech/parity-ethereum/pull/9605))
|
||||||
|
- Verify block syncing responses against requests ([#9670](https://github.com/paritytech/parity-ethereum/pull/9670))
|
||||||
|
- Add a new RPC `parity_submitWorkDetail` similar `eth_submitWork` but return block hash ([#9404](https://github.com/paritytech/parity-ethereum/pull/9404))
|
||||||
|
- Resumable EVM and heap-allocated callstack ([#9360](https://github.com/paritytech/parity-ethereum/pull/9360))
|
||||||
|
- Update parity-wordlist library ([#9682](https://github.com/paritytech/parity-ethereum/pull/9682))
|
||||||
|
- Ci: Remove unnecessary pipes ([#9681](https://github.com/paritytech/parity-ethereum/pull/9681))
|
||||||
|
- Test.sh: use cargo --target for platforms other than linux, win or mac ([#9650](https://github.com/paritytech/parity-ethereum/pull/9650))
|
||||||
|
- Ci: fix push script ([#9679](https://github.com/paritytech/parity-ethereum/pull/9679))
|
||||||
|
- Hardfork the testnets ([#9562](https://github.com/paritytech/parity-ethereum/pull/9562))
|
||||||
|
- Calculate sha3 instead of sha256 for push-release. ([#9673](https://github.com/paritytech/parity-ethereum/pull/9673))
|
||||||
|
- Ethcore-io retries failed work steal ([#9651](https://github.com/paritytech/parity-ethereum/pull/9651))
|
||||||
|
- Fix(light_fetch): avoid race with BlockNumber::Latest ([#9665](https://github.com/paritytech/parity-ethereum/pull/9665))
|
||||||
|
- Test fix for windows cache name... ([#9658](https://github.com/paritytech/parity-ethereum/pull/9658))
|
||||||
|
- Refactor(fetch) : light use only one `DNS` thread ([#9647](https://github.com/paritytech/parity-ethereum/pull/9647))
|
||||||
|
- Ethereum libfuzzer integration small change ([#9547](https://github.com/paritytech/parity-ethereum/pull/9547))
|
||||||
|
- Cli: remove reference to --no-ui in --unlock flag help ([#9616](https://github.com/paritytech/parity-ethereum/pull/9616))
|
||||||
|
- Remove master from releasable branches ([#9655](https://github.com/paritytech/parity-ethereum/pull/9655))
|
||||||
|
- Ethcore/VerificationQueue don't spawn up extra `worker-threads` when explictly specified not to ([#9620](https://github.com/paritytech/parity-ethereum/pull/9620))
|
||||||
|
- Rpc: parity_getBlockReceipts ([#9527](https://github.com/paritytech/parity-ethereum/pull/9527))
|
||||||
|
- Remove unused dependencies ([#9589](https://github.com/paritytech/parity-ethereum/pull/9589))
|
||||||
|
- Ignore key_server_cluster randomly failing tests ([#9639](https://github.com/paritytech/parity-ethereum/pull/9639))
|
||||||
|
- Ethcore: handle vm exception when estimating gas ([#9615](https://github.com/paritytech/parity-ethereum/pull/9615))
|
||||||
|
- Fix bad-block reporting no reason ([#9638](https://github.com/paritytech/parity-ethereum/pull/9638))
|
||||||
|
- Use static call and apparent value transfer for block reward contract code ([#9603](https://github.com/paritytech/parity-ethereum/pull/9603))
|
||||||
|
- Hf in POA Sokol (2018-09-19) ([#9607](https://github.com/paritytech/parity-ethereum/pull/9607))
|
||||||
|
- Bump smallvec to 0.6 in ethcore-light, ethstore and whisper ([#9588](https://github.com/paritytech/parity-ethereum/pull/9588))
|
||||||
|
- Add constantinople conf to EvmTestClient. ([#9570](https://github.com/paritytech/parity-ethereum/pull/9570))
|
||||||
|
- Fix(network): don't disconnect reserved peers ([#9608](https://github.com/paritytech/parity-ethereum/pull/9608))
|
||||||
|
- Fix failing node-table tests on mac os, closes [#9632](https://github.com/paritytech/parity-ethereum/issues/9632) ([#9633](https://github.com/paritytech/parity-ethereum/pull/9633))
|
||||||
|
- Update ropsten.json ([#9602](https://github.com/paritytech/parity-ethereum/pull/9602))
|
||||||
|
- Simplify ethcore errors by removing BlockImportError ([#9593](https://github.com/paritytech/parity-ethereum/pull/9593))
|
||||||
|
- Fix windows compilation, replaces [#9561](https://github.com/paritytech/parity-ethereum/issues/9561) ([#9621](https://github.com/paritytech/parity-ethereum/pull/9621))
|
||||||
|
- Master: rpc-docs set github token ([#9610](https://github.com/paritytech/parity-ethereum/pull/9610))
|
||||||
|
- Docs: add changelogs for 1.11.10, 1.11.11, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, and 2.1.1 ([#9554](https://github.com/paritytech/parity-ethereum/pull/9554))
|
||||||
|
- Docs(rpc): annotate tag with the provided message ([#9601](https://github.com/paritytech/parity-ethereum/pull/9601))
|
||||||
|
- Ci: fix regex roll_eyes ([#9597](https://github.com/paritytech/parity-ethereum/pull/9597))
|
||||||
|
- Remove snapcraft clean ([#9585](https://github.com/paritytech/parity-ethereum/pull/9585))
|
||||||
|
- Add snapcraft package image (master) ([#9584](https://github.com/paritytech/parity-ethereum/pull/9584))
|
||||||
|
- Docs(rpc): push the branch along with tags ([#9578](https://github.com/paritytech/parity-ethereum/pull/9578))
|
||||||
|
- Fix typo for jsonrpc-threads flag ([#9574](https://github.com/paritytech/parity-ethereum/pull/9574))
|
||||||
|
- Fix informant compile ([#9571](https://github.com/paritytech/parity-ethereum/pull/9571))
|
||||||
|
- Added ropsten bootnodes ([#9569](https://github.com/paritytech/parity-ethereum/pull/9569))
|
||||||
|
- Increase Gas-floor-target and Gas Cap ([#9564](https://github.com/paritytech/parity-ethereum/pull/9564))
|
||||||
|
- While working on the platform tests make them non-breaking ([#9563](https://github.com/paritytech/parity-ethereum/pull/9563))
|
||||||
|
- Improve P2P discovery ([#9526](https://github.com/paritytech/parity-ethereum/pull/9526))
|
||||||
|
- Move dockerfile for android build container to scripts repo ([#9560](https://github.com/paritytech/parity-ethereum/pull/9560))
|
||||||
|
- Simultaneous platform tests WIP ([#9557](https://github.com/paritytech/parity-ethereum/pull/9557))
|
||||||
|
- Update ethabi-derive, serde, serde_json, serde_derive, syn && quote ([#9553](https://github.com/paritytech/parity-ethereum/pull/9553))
|
||||||
|
- Ci: fix rpc docs generation 2 ([#9550](https://github.com/paritytech/parity-ethereum/pull/9550))
|
||||||
|
- Ci: always run build pipelines for win, mac, linux, and android ([#9537](https://github.com/paritytech/parity-ethereum/pull/9537))
|
||||||
|
- Multithreaded snapshot creation ([#9239](https://github.com/paritytech/parity-ethereum/pull/9239))
|
||||||
|
- New ethabi ([#9511](https://github.com/paritytech/parity-ethereum/pull/9511))
|
||||||
|
- Remove initial token for WS. ([#9545](https://github.com/paritytech/parity-ethereum/pull/9545))
|
||||||
|
- Net_version caches network_id to avoid redundant aquire of sync readlock ([#9544](https://github.com/paritytech/parity-ethereum/pull/9544))
|
||||||
|
- Correct before_script for nightly build versions ([#9543](https://github.com/paritytech/parity-ethereum/pull/9543))
|
||||||
|
- Deps: bump kvdb-rocksdb to 0.1.4 ([#9539](https://github.com/paritytech/parity-ethereum/pull/9539))
|
||||||
|
- State: test when contract creation fails, old storage values should re-appear ([#9532](https://github.com/paritytech/parity-ethereum/pull/9532))
|
||||||
|
- Allow dropping light client RPC query with no results ([#9318](https://github.com/paritytech/parity-ethereum/pull/9318))
|
||||||
|
- Bump master to 2.2.0 ([#9517](https://github.com/paritytech/parity-ethereum/pull/9517))
|
||||||
|
- Enable all Constantinople hard fork changes in constantinople_test.json ([#9505](https://github.com/paritytech/parity-ethereum/pull/9505))
|
||||||
|
- [Light] Validate `account balance` before importing transactions ([#9417](https://github.com/paritytech/parity-ethereum/pull/9417))
|
||||||
|
- In create memory calculation is the same for create2 because the additional parameter was popped before. ([#9522](https://github.com/paritytech/parity-ethereum/pull/9522))
|
||||||
|
- Update patricia trie to 0.2.2 ([#9525](https://github.com/paritytech/parity-ethereum/pull/9525))
|
||||||
|
- Replace hardcoded JSON with serde json! macro ([#9489](https://github.com/paritytech/parity-ethereum/pull/9489))
|
||||||
|
- Fix typo in version string ([#9516](https://github.com/paritytech/parity-ethereum/pull/9516))
|
||||||
288
docs/CHANGELOG-2.3.md
Normal file
288
docs/CHANGELOG-2.3.md
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
## Parity-Ethereum [v2.3.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.8) (2019-03-22)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.8-stable is a bugfix release that improves performance and stability. This patch release contains a critical bug fix where serving light clients previously led to client crashes. Upgrading is highly recommended.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- 2.3.8 stable backports ([#10507](https://github.com/paritytech/parity-ethereum/pull/10507))
|
||||||
|
- Version: bump stable
|
||||||
|
- Add additional request tests ([#10503](https://github.com/paritytech/parity-ethereum/pull/10503))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.7) (2019-03-20)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.7-stable is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- 2.3.7 stable backports ([#10487](https://github.com/paritytech/parity-ethereum/pull/10487))
|
||||||
|
- Version: bump stable
|
||||||
|
- Сaching through docker volume ([#10477](https://github.com/paritytech/parity-ethereum/pull/10477))
|
||||||
|
- fix win&mac build ([#10486](https://github.com/paritytech/parity-ethereum/pull/10486))
|
||||||
|
- fix(extract `timestamp_checked_add` as lib) ([#10383](https://github.com/paritytech/parity-ethereum/pull/10383))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.6) (2019-03-19)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.6-stable is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- 2.3.6 stable backports ([#10470](https://github.com/paritytech/parity-ethereum/pull/10470))
|
||||||
|
- Version: bump stable
|
||||||
|
- CI publish to aws ([#10446](https://github.com/paritytech/parity-ethereum/pull/10446))
|
||||||
|
- Ensure static validator set changes are recognized ([#10467](https://github.com/paritytech/parity-ethereum/pull/10467))
|
||||||
|
- CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))
|
||||||
|
- Revert "CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))" ([#10456](https://github.com/paritytech/parity-ethereum/pull/10456))
|
||||||
|
- Tests parallelized ([#10452](https://github.com/paritytech/parity-ethereum/pull/10452))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.5) (2019-02-25)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.5-stable is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
Note, all 2.2 releases and older are now unsupported and upgrading is recommended.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- More Backports for Stable 2.3.5 ([#10430](https://github.com/paritytech/parity-ethereum/pull/10430))
|
||||||
|
- Revert some changes, could be buggy ([#10399](https://github.com/paritytech/parity-ethereum/pull/10399))
|
||||||
|
- Ci: clean up gitlab-ci.yml leftovers from previous merge ([#10429](https://github.com/paritytech/parity-ethereum/pull/10429))
|
||||||
|
- 10000 > 5000 ([#10422](https://github.com/paritytech/parity-ethereum/pull/10422))
|
||||||
|
- Fix underflow in pip, closes [#10419](https://github.com/paritytech/parity-ethereum/pull/10419) ([#10423](https://github.com/paritytech/parity-ethereum/pull/10423))
|
||||||
|
- Fix panic when logging directory does not exist, closes [#10420](https://github.com/paritytech/parity-ethereum/pull/10420) ([#10424](https://github.com/paritytech/parity-ethereum/pull/10424))
|
||||||
|
- Update hardcoded headers for Foundation, Ropsten, Kovan and Classic ([#10417](https://github.com/paritytech/parity-ethereum/pull/10417))
|
||||||
|
- Backports for Stable 2.3.5 ([#10414](https://github.com/paritytech/parity-ethereum/pull/10414))
|
||||||
|
- No-git for publish jobs, empty artifacts dir ([#10393](https://github.com/paritytech/parity-ethereum/pull/10393))
|
||||||
|
- Snap: reenable i386, arm64, armhf architecture publishing ([#10386](https://github.com/paritytech/parity-ethereum/pull/10386))
|
||||||
|
- Tx pool: always accept local transactions ([#10375](https://github.com/paritytech/parity-ethereum/pull/10375))
|
||||||
|
- Fix to_pod storage trie value decoding ([#10368)](https://github.com/paritytech/parity-ethereum/pull/10368))
|
||||||
|
- Version: mark 2.3.5 as stable
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.4) (2019-02-21)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.4-beta is a maintenance release that fixes snap and docker installations.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- Beta: snap: release untagged versions from branches to the candidate ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357)) ([#10373](https://github.com/paritytech/parity-ethereum/pull/10373))
|
||||||
|
- Snap: release untagged versions from branches to the candidate snap channel ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357))
|
||||||
|
- Snap: add the removable-media plug ([#10377](https://github.com/paritytech/parity-ethereum/pull/10377))
|
||||||
|
- Exchanged old(azure) bootnodes with new(ovh) ones ([#10309](https://github.com/paritytech/parity-ethereum/pull/10309))
|
||||||
|
- Beta Backports ([#10354](https://github.com/paritytech/parity-ethereum/pull/10354))
|
||||||
|
- Version: bump beta to 2.3.4
|
||||||
|
- Snap: prefix version and populate candidate channel ([#10343](https://github.com/paritytech/parity-ethereum/pull/10343))
|
||||||
|
- Snap: populate candidate releases with beta snaps to avoid stale channel
|
||||||
|
- Snap: prefix version with v*
|
||||||
|
- No volumes are needed, just run -v volume:/path/in/the/container ([#10345](https://github.com/paritytech/parity-ethereum/pull/10345))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.3) (2019-02-13)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.3-beta is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||||
|
|
||||||
|
- https://www.parity.io/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities/
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Additional error for invalid gas ([#10327](https://github.com/paritytech/parity-ethereum/pull/10327)) ([#10328](https://github.com/paritytech/parity-ethereum/pull/10328))
|
||||||
|
- Backports for Beta 2.3.3 ([#10333](https://github.com/paritytech/parity-ethereum/pull/10333))
|
||||||
|
- Properly handle check_epoch_end_signal errors ([#10015](https://github.com/paritytech/parity-ethereum/pull/10015))
|
||||||
|
- import rpc transactions sequentially ([#10051](https://github.com/paritytech/parity-ethereum/pull/10051))
|
||||||
|
- fix(docker): fix not receives SIGINT ([#10059](https://github.com/paritytech/parity-ethereum/pull/10059))
|
||||||
|
- snap: official image / test ([#10168](https://github.com/paritytech/parity-ethereum/pull/10168))
|
||||||
|
- Extract CallContract and RegistryInfo traits into their own crate ([#10178](https://github.com/paritytech/parity-ethereum/pull/10178))
|
||||||
|
- perform stripping during build ([#10208](https://github.com/paritytech/parity-ethereum/pull/10208))
|
||||||
|
- Remove CallContract and RegistryInfo re-exports from `ethcore/client` ([#10205](https://github.com/paritytech/parity-ethereum/pull/10205))
|
||||||
|
- fixed: types::transaction::SignedTransaction; ([#10229](https://github.com/paritytech/parity-ethereum/pull/10229))
|
||||||
|
- Additional tests for uint/hash/bytes deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279))
|
||||||
|
- Fix Windows build ([#10284](https://github.com/paritytech/parity-ethereum/pull/10284))
|
||||||
|
- Don't run the CPP example on CI ([#10285](https://github.com/paritytech/parity-ethereum/pull/10285))
|
||||||
|
- CI optimizations ([#10297](https://github.com/paritytech/parity-ethereum/pull/10297))
|
||||||
|
- fix publish job ([#10317](https://github.com/paritytech/parity-ethereum/pull/10317))
|
||||||
|
- Add Statetest support for Constantinople Fix ([#10323](https://github.com/paritytech/parity-ethereum/pull/10323))
|
||||||
|
- Add helper for Timestamp overflows ([#10330](https://github.com/paritytech/parity-ethereum/pull/10330))
|
||||||
|
- Don't add discovery initiators to the node table ([#10305](https://github.com/paritytech/parity-ethereum/pull/10305))
|
||||||
|
- change docker image based on debian instead of ubuntu due to the chan ([#10336](https://github.com/paritytech/parity-ethereum/pull/10336))
|
||||||
|
- role back docker build image and docker deploy image to ubuntu:xenial based ([#10338](https://github.com/paritytech/parity-ethereum/pull/10338))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.2) (2019-02-03)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.2-stable is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||||
|
|
||||||
|
- https://www.parity.io/security-alert-parity-ethereum-03-02/
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- Version: bump beta to 2.3.2 ([#10283](https://github.com/paritytech/parity-ethereum/pull/10283))
|
||||||
|
- Additional tests for uint deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279)) ([#10280](https://github.com/paritytech/parity-ethereum/pull/10280))
|
||||||
|
- Backport [#10285](https://github.com/paritytech/parity-ethereum/pull/10285) to beta ([#10286](https://github.com/paritytech/parity-ethereum/pull/10286))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.1) (2019-02-01)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.1-beta is a consensus-relevant release that enables _St. Petersfork_ on:
|
||||||
|
|
||||||
|
- Ethereum Block `7280000` (along with Constantinople)
|
||||||
|
- Kovan Block `10255201`
|
||||||
|
- Ropsten Block `4939394`
|
||||||
|
- POA Sokol Block `7026400`
|
||||||
|
|
||||||
|
In addition to this, Constantinople is cancelled for the POA Core network. Upgrading is mandatory for clients on any of these chains.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backports for beta 2.3.1 ([#10225](https://github.com/paritytech/parity-ethereum/pull/10225))
|
||||||
|
- Fix _cannot recursively call into `Core`_ issue ([#10144](https://github.com/paritytech/parity-ethereum/pull/10144))
|
||||||
|
- Update for Android cross-compilation. ([#10180](https://github.com/paritytech/parity-ethereum/pull/10180))
|
||||||
|
- Fix _cannot recursively call into `Core`_ - Part 2 ([#10195](https://github.com/paritytech/parity-ethereum/pull/10195))
|
||||||
|
- Cancel Constantinople HF on POA Core ([#10198](https://github.com/paritytech/parity-ethereum/pull/10198))
|
||||||
|
- Add EIP-1283 disable transition ([#10214](https://github.com/paritytech/parity-ethereum/pull/10214))
|
||||||
|
- Enable St-Peters-Fork ("Constantinople Fix") ([#10223](https://github.com/paritytech/parity-ethereum/pull/10223))
|
||||||
|
- Beta: Macos heapsize force jemalloc ([#10234](https://github.com/paritytech/parity-ethereum/pull/10234)) ([#10259](https://github.com/paritytech/parity-ethereum/pull/10259))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.3.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.0) (2019-01-16)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.3.0-beta is a consensus-relevant security release that reverts Constantinople on the Ethereum network. Upgrading is mandatory for Ethereum, and strongly recommended for other networks.
|
||||||
|
|
||||||
|
- **Consensus** - Ethereum Network: Pull Constantinople protocol upgrade on Ethereum ([#10189](https://github.com/paritytech/parity-ethereum/pull/10189))
|
||||||
|
- Read more: [Security Alert: Ethereum Constantinople Postponement](https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/)
|
||||||
|
- **Networking** - All networks: Ping nodes from discovery ([#10167](https://github.com/paritytech/parity-ethereum/pull/10167))
|
||||||
|
- **Wasm** - Kovan Network: Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||||
|
|
||||||
|
Other notable changes:
|
||||||
|
|
||||||
|
- Existing blocks in the database are now kept when restoring a Snapshot. ([#8643](https://github.com/paritytech/parity-ethereum/pull/8643))
|
||||||
|
- Block and transaction propagation is improved significantly. ([#9954](https://github.com/paritytech/parity-ethereum/pull/9954))
|
||||||
|
- The ERC-191 Signed Data Standard is now supported by `personal_sign191`. ([#9701](https://github.com/paritytech/parity-ethereum/pull/9701))
|
||||||
|
- Add support for ERC-191/712 `eth_signTypedData` as a standard for machine-verifiable and human-readable typed data signing with Ethereum keys. ([#9631](https://github.com/paritytech/parity-ethereum/pull/9631))
|
||||||
|
- Add support for ERC-1186 `eth_getProof` ([#9001](https://github.com/paritytech/parity-ethereum/pull/9001))
|
||||||
|
- Add experimental RPCs flag to enable ERC-191, ERC-712, and ERC-1186 APIs via `--jsonrpc-experimental` ([#9928](https://github.com/paritytech/parity-ethereum/pull/9928))
|
||||||
|
- Make `CALLCODE` to trace value to be the code address. ([#9881](https://github.com/paritytech/parity-ethereum/pull/9881))
|
||||||
|
|
||||||
|
Configuration changes:
|
||||||
|
|
||||||
|
- The EIP-98 transition is now disabled by default. If you previously had no `eip98transition` specified in your chain specification, you would enable this now manually on block `0x0`. ([#9955](https://github.com/paritytech/parity-ethereum/pull/9955))
|
||||||
|
- Also, unknown fields in chain specs are now rejected. ([#9972](https://github.com/paritytech/parity-ethereum/pull/9972))
|
||||||
|
- The Tendermint engine was removed from Parity Ethereum and is no longer available and maintained. ([#9980](https://github.com/paritytech/parity-ethereum/pull/9980))
|
||||||
|
- Ropsten testnet data and keys moved from `test/` to `ropsten/` subdir. To reuse your old keys and data either copy or symlink them to the new location. ([#10123](https://github.com/paritytech/parity-ethereum/pull/10123))
|
||||||
|
- Strict empty steps validation ([#10041](https://github.com/paritytech/parity-ethereum/pull/10041))
|
||||||
|
- If you have a chain with`empty_steps` already running, some blocks most likely contain non-strict entries (unordered or duplicated empty steps). In this release `strict_empty_steps_transition` is enabled by default at block `0x0` for any chain with `empty_steps`.
|
||||||
|
- If your network uses `empty_steps` you **must** (A) plan a hard fork and change `strict_empty_steps_transition` to the desired fork block and (B) update the clients of the whole network to 2.2.7-stable / 2.3.0-beta. If for some reason you don't want to do this please set`strict_empty_steps_transition` to `0xfffffffff` to disable it.
|
||||||
|
|
||||||
|
_Note:_ This release marks Parity 2.3 as _beta_. All versions of Parity 2.2 are now considered _stable_.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
- Backports for 2.3.0 beta ([#10164](https://github.com/paritytech/parity-ethereum/pull/10164))
|
||||||
|
- Snap: fix path in script ([#10157](https://github.com/paritytech/parity-ethereum/pull/10157))
|
||||||
|
- Make sure parent block is not in importing queue when importing ancient blocks ([#10138](https://github.com/paritytech/parity-ethereum/pull/10138))
|
||||||
|
- Ci: re-enable snap publishing ([#10142](https://github.com/paritytech/parity-ethereum/pull/10142))
|
||||||
|
- Hf in POA Core (2019-01-18) - Constantinople ([#10155](https://github.com/paritytech/parity-ethereum/pull/10155))
|
||||||
|
- Update EWF's tobalaba chainspec ([#10152](https://github.com/paritytech/parity-ethereum/pull/10152))
|
||||||
|
- Replace ethcore-logger with env-logger. ([#10102](https://github.com/paritytech/parity-ethereum/pull/10102))
|
||||||
|
- Finality: dont require chain head to be in the chain ([#10054](https://github.com/paritytech/parity-ethereum/pull/10054))
|
||||||
|
- Remove caching for node connections ([#10143](https://github.com/paritytech/parity-ethereum/pull/10143))
|
||||||
|
- Blooms file iterator empty on out of range position. ([#10145](https://github.com/paritytech/parity-ethereum/pull/10145))
|
||||||
|
- Autogen docs for the "Configuring Parity Ethereum" wiki page. ([#10067](https://github.com/paritytech/parity-ethereum/pull/10067))
|
||||||
|
- Misc: bump license header to 2019 ([#10135](https://github.com/paritytech/parity-ethereum/pull/10135))
|
||||||
|
- Hide most of the logs from cpp example. ([#10139](https://github.com/paritytech/parity-ethereum/pull/10139))
|
||||||
|
- Don't try to send oversized packets ([#10042](https://github.com/paritytech/parity-ethereum/pull/10042))
|
||||||
|
- Private tx enabled flag added into STATUS packet ([#9999](https://github.com/paritytech/parity-ethereum/pull/9999))
|
||||||
|
- Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||||
|
- Extract blockchain from ethcore ([#10114](https://github.com/paritytech/parity-ethereum/pull/10114))
|
||||||
|
- Ethcore: update hardcoded headers ([#10123](https://github.com/paritytech/parity-ethereum/pull/10123))
|
||||||
|
- Identity fix ([#10128](https://github.com/paritytech/parity-ethereum/pull/10128))
|
||||||
|
- Use LenCachingMutex to optimize verification. ([#10117](https://github.com/paritytech/parity-ethereum/pull/10117))
|
||||||
|
- Pyethereum keystore support ([#9710](https://github.com/paritytech/parity-ethereum/pull/9710))
|
||||||
|
- Bump rocksdb-sys to 0.5.5 ([#10124](https://github.com/paritytech/parity-ethereum/pull/10124))
|
||||||
|
- Parity-clib: `async C bindings to RPC requests` + `subscribe/unsubscribe to websocket events` ([#9920](https://github.com/paritytech/parity-ethereum/pull/9920))
|
||||||
|
- Refactor (hardware wallet) : reduce the number of threads ([#9644](https://github.com/paritytech/parity-ethereum/pull/9644))
|
||||||
|
- Hf in POA Sokol (2019-01-04) ([#10077](https://github.com/paritytech/parity-ethereum/pull/10077))
|
||||||
|
- Fix broken links ([#10119](https://github.com/paritytech/parity-ethereum/pull/10119))
|
||||||
|
- Follow-up to [#10105](https://github.com/paritytech/parity-ethereum/issues/10105) ([#10107](https://github.com/paritytech/parity-ethereum/pull/10107))
|
||||||
|
- Move EIP-712 crate back to parity-ethereum ([#10106](https://github.com/paritytech/parity-ethereum/pull/10106))
|
||||||
|
- Move a bunch of stuff around ([#10101](https://github.com/paritytech/parity-ethereum/pull/10101))
|
||||||
|
- Revert "Add --frozen when running cargo ([#10081](https://github.com/paritytech/parity-ethereum/pull/10081))" ([#10105](https://github.com/paritytech/parity-ethereum/pull/10105))
|
||||||
|
- Fix left over small grumbles on whitespaces ([#10084](https://github.com/paritytech/parity-ethereum/pull/10084))
|
||||||
|
- Add --frozen when running cargo ([#10081](https://github.com/paritytech/parity-ethereum/pull/10081))
|
||||||
|
- Fix pubsub new_blocks notifications to include all blocks ([#9987](https://github.com/paritytech/parity-ethereum/pull/9987))
|
||||||
|
- Update some dependencies for compilation with pc-windows-gnu ([#10082](https://github.com/paritytech/parity-ethereum/pull/10082))
|
||||||
|
- Fill transaction hash on ethGetLog of light client. ([#9938](https://github.com/paritytech/parity-ethereum/pull/9938))
|
||||||
|
- Update changelog update for 2.2.5-beta and 2.1.10-stable ([#10064](https://github.com/paritytech/parity-ethereum/pull/10064))
|
||||||
|
- Implement len caching for parking_lot RwLock ([#10032](https://github.com/paritytech/parity-ethereum/pull/10032))
|
||||||
|
- Update parking_lot to 0.7 ([#10050](https://github.com/paritytech/parity-ethereum/pull/10050))
|
||||||
|
- Bump crossbeam. ([#10048](https://github.com/paritytech/parity-ethereum/pull/10048))
|
||||||
|
- Ethcore: enable constantinople on ethereum ([#10031](https://github.com/paritytech/parity-ethereum/pull/10031))
|
||||||
|
- Strict empty steps validation ([#10041](https://github.com/paritytech/parity-ethereum/pull/10041))
|
||||||
|
- Center the Subtitle, use some CAPS ([#10034](https://github.com/paritytech/parity-ethereum/pull/10034))
|
||||||
|
- Change test miner max memory to malloc reports. ([#10024](https://github.com/paritytech/parity-ethereum/pull/10024))
|
||||||
|
- Sort the storage for private state ([#10018](https://github.com/paritytech/parity-ethereum/pull/10018))
|
||||||
|
- Fix: test corpus_inaccessible panic ([#10019](https://github.com/paritytech/parity-ethereum/pull/10019))
|
||||||
|
- Ci: move future releases to ethereum subdir on s3 ([#10017](https://github.com/paritytech/parity-ethereum/pull/10017))
|
||||||
|
- Light(on_demand): decrease default time window to 10 secs ([#10016](https://github.com/paritytech/parity-ethereum/pull/10016))
|
||||||
|
- Light client : failsafe crate (circuit breaker) ([#9790](https://github.com/paritytech/parity-ethereum/pull/9790))
|
||||||
|
- Lencachingmutex ([#9988](https://github.com/paritytech/parity-ethereum/pull/9988))
|
||||||
|
- Version and notification for private contract wrapper added ([#9761](https://github.com/paritytech/parity-ethereum/pull/9761))
|
||||||
|
- Handle failing case for update account cache in require ([#9989](https://github.com/paritytech/parity-ethereum/pull/9989))
|
||||||
|
- Add tokio runtime to ethcore io worker ([#9979](https://github.com/paritytech/parity-ethereum/pull/9979))
|
||||||
|
- Move daemonize before creating account provider ([#10003](https://github.com/paritytech/parity-ethereum/pull/10003))
|
||||||
|
- Docs: update changelogs ([#9990](https://github.com/paritytech/parity-ethereum/pull/9990))
|
||||||
|
- Fix daemonize ([#10000](https://github.com/paritytech/parity-ethereum/pull/10000))
|
||||||
|
- Fix Bloom migration ([#9992](https://github.com/paritytech/parity-ethereum/pull/9992))
|
||||||
|
- Remove tendermint engine support ([#9980](https://github.com/paritytech/parity-ethereum/pull/9980))
|
||||||
|
- Calculate gas for deployment transaction ([#9840](https://github.com/paritytech/parity-ethereum/pull/9840))
|
||||||
|
- Fix unstable peers and slowness in sync ([#9967](https://github.com/paritytech/parity-ethereum/pull/9967))
|
||||||
|
- Adds parity_verifySignature RPC method ([#9507](https://github.com/paritytech/parity-ethereum/pull/9507))
|
||||||
|
- Improve block and transaction propagation ([#9954](https://github.com/paritytech/parity-ethereum/pull/9954))
|
||||||
|
- Deny unknown fields for chainspec ([#9972](https://github.com/paritytech/parity-ethereum/pull/9972))
|
||||||
|
- Fix docker build ([#9971](https://github.com/paritytech/parity-ethereum/pull/9971))
|
||||||
|
- Ci: rearrange pipeline by logic ([#9970](https://github.com/paritytech/parity-ethereum/pull/9970))
|
||||||
|
- Add changelogs for 2.0.9, 2.1.4, 2.1.6, and 2.2.1 ([#9963](https://github.com/paritytech/parity-ethereum/pull/9963))
|
||||||
|
- Add Error message when sync is still in progress. ([#9475](https://github.com/paritytech/parity-ethereum/pull/9475))
|
||||||
|
- Make CALLCODE to trace value to be the code address ([#9881](https://github.com/paritytech/parity-ethereum/pull/9881))
|
||||||
|
- Fix light client informant while syncing ([#9932](https://github.com/paritytech/parity-ethereum/pull/9932))
|
||||||
|
- Add a optional json dump state to evm-bin ([#9706](https://github.com/paritytech/parity-ethereum/pull/9706))
|
||||||
|
- Disable EIP-98 transition by default ([#9955](https://github.com/paritytech/parity-ethereum/pull/9955))
|
||||||
|
- Remove secret_store runtimes. ([#9888](https://github.com/paritytech/parity-ethereum/pull/9888))
|
||||||
|
- Fix a deadlock ([#9952](https://github.com/paritytech/parity-ethereum/pull/9952))
|
||||||
|
- Chore(eip712): remove unused `failure-derive` ([#9958](https://github.com/paritytech/parity-ethereum/pull/9958))
|
||||||
|
- Do not use the home directory as the working dir in docker ([#9834](https://github.com/paritytech/parity-ethereum/pull/9834))
|
||||||
|
- Prevent silent errors in daemon mode, closes [#9367](https://github.com/paritytech/parity-ethereum/issues/9367) ([#9946](https://github.com/paritytech/parity-ethereum/pull/9946))
|
||||||
|
- Fix empty steps ([#9939](https://github.com/paritytech/parity-ethereum/pull/9939))
|
||||||
|
- Adjust requests costs for light client ([#9925](https://github.com/paritytech/parity-ethereum/pull/9925))
|
||||||
|
- Eip-1186: add `eth_getProof` RPC-Method ([#9001](https://github.com/paritytech/parity-ethereum/pull/9001))
|
||||||
|
- Missing blocks in filter_changes RPC ([#9947](https://github.com/paritytech/parity-ethereum/pull/9947))
|
||||||
|
- Allow rust-nightly builds fail in nightly builds ([#9944](https://github.com/paritytech/parity-ethereum/pull/9944))
|
||||||
|
- Update eth-secp256k1 to include fix for BSDs ([#9935](https://github.com/paritytech/parity-ethereum/pull/9935))
|
||||||
|
- Unbreak build on rust -stable ([#9934](https://github.com/paritytech/parity-ethereum/pull/9934))
|
||||||
|
- Keep existing blocks when restoring a Snapshot ([#8643](https://github.com/paritytech/parity-ethereum/pull/8643))
|
||||||
|
- Add experimental RPCs flag ([#9928](https://github.com/paritytech/parity-ethereum/pull/9928))
|
||||||
|
- Clarify poll lifetime ([#9922](https://github.com/paritytech/parity-ethereum/pull/9922))
|
||||||
|
- Docs(require rust 1.30) ([#9923](https://github.com/paritytech/parity-ethereum/pull/9923))
|
||||||
|
- Use block header for building finality ([#9914](https://github.com/paritytech/parity-ethereum/pull/9914))
|
||||||
|
- Simplify cargo audit ([#9918](https://github.com/paritytech/parity-ethereum/pull/9918))
|
||||||
|
- Light-fetch: Differentiate between out-of-gas/manual throw and use required gas from response on failure ([#9824](https://github.com/paritytech/parity-ethereum/pull/9824))
|
||||||
|
- Eip 191 ([#9701](https://github.com/paritytech/parity-ethereum/pull/9701))
|
||||||
|
- Fix(logger): `reqwest` no longer a dependency ([#9908](https://github.com/paritytech/parity-ethereum/pull/9908))
|
||||||
|
- Remove rust-toolchain file ([#9906](https://github.com/paritytech/parity-ethereum/pull/9906))
|
||||||
|
- Foundation: 6692865, ropsten: 4417537, kovan: 9363457 ([#9907](https://github.com/paritytech/parity-ethereum/pull/9907))
|
||||||
|
- Ethcore: use Machine::verify_transaction on parent block ([#9900](https://github.com/paritytech/parity-ethereum/pull/9900))
|
||||||
|
- Chore(rpc-tests): remove unused rand ([#9896](https://github.com/paritytech/parity-ethereum/pull/9896))
|
||||||
|
- Fix: Intermittent failing CI due to addr in use ([#9885](https://github.com/paritytech/parity-ethereum/pull/9885))
|
||||||
|
- Chore(bump docopt): 0.8 -> 1.0 ([#9889](https://github.com/paritytech/parity-ethereum/pull/9889))
|
||||||
|
- Use expect ([#9883](https://github.com/paritytech/parity-ethereum/pull/9883))
|
||||||
|
- Use Weak reference in PubSubClient ([#9886](https://github.com/paritytech/parity-ethereum/pull/9886))
|
||||||
|
- Ci: nuke the gitlab caches ([#9855](https://github.com/paritytech/parity-ethereum/pull/9855))
|
||||||
|
- Remove unused code ([#9884](https://github.com/paritytech/parity-ethereum/pull/9884))
|
||||||
|
- Fix json tracer overflow ([#9873](https://github.com/paritytech/parity-ethereum/pull/9873))
|
||||||
|
- Allow to seal work on latest block ([#9876](https://github.com/paritytech/parity-ethereum/pull/9876))
|
||||||
|
- Fix docker script ([#9854](https://github.com/paritytech/parity-ethereum/pull/9854))
|
||||||
|
- Health endpoint ([#9847](https://github.com/paritytech/parity-ethereum/pull/9847))
|
||||||
|
- Gitlab-ci: make android release build succeed ([#9743](https://github.com/paritytech/parity-ethereum/pull/9743))
|
||||||
|
- Clean up existing benchmarks ([#9839](https://github.com/paritytech/parity-ethereum/pull/9839))
|
||||||
|
- Update Callisto block reward code to support HF1 ([#9811](https://github.com/paritytech/parity-ethereum/pull/9811))
|
||||||
|
- Option to disable keep alive for JSON-RPC http transport ([#9848](https://github.com/paritytech/parity-ethereum/pull/9848))
|
||||||
|
- Classic.json Bootnode Update ([#9828](https://github.com/paritytech/parity-ethereum/pull/9828))
|
||||||
|
- Support MIX. ([#9767](https://github.com/paritytech/parity-ethereum/pull/9767))
|
||||||
|
- Ci: remove failing tests for android, windows, and macos ([#9788](https://github.com/paritytech/parity-ethereum/pull/9788))
|
||||||
|
- Implement NoProof for json tests and update tests reference (replaces [#9744](https://github.com/paritytech/parity-ethereum/issues/9744)) ([#9814](https://github.com/paritytech/parity-ethereum/pull/9814))
|
||||||
|
- Chore(bump regex) ([#9842](https://github.com/paritytech/parity-ethereum/pull/9842))
|
||||||
|
- Ignore global cache for patched accounts ([#9752](https://github.com/paritytech/parity-ethereum/pull/9752))
|
||||||
|
- Move state root verification before gas used ([#9841](https://github.com/paritytech/parity-ethereum/pull/9841))
|
||||||
|
- Fix(docker-aarch64) : cross-compile config ([#9798](https://github.com/paritytech/parity-ethereum/pull/9798))
|
||||||
|
- Version: bump nightly to 2.3.0 ([#9819](https://github.com/paritytech/parity-ethereum/pull/9819))
|
||||||
|
- Tests modification for windows CI ([#9671](https://github.com/paritytech/parity-ethereum/pull/9671))
|
||||||
|
- Eip-712 implementation ([#9631](https://github.com/paritytech/parity-ethereum/pull/9631))
|
||||||
|
- Fix typo ([#9826](https://github.com/paritytech/parity-ethereum/pull/9826))
|
||||||
|
- Clean up serde rename and use rename_all = camelCase when possible ([#9823](https://github.com/paritytech/parity-ethereum/pull/9823))
|
||||||
128
docs/CHANGELOG-2.4.md
Normal file
128
docs/CHANGELOG-2.4.md
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
## Parity-Ethereum [v2.4.9](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.9)
|
||||||
|
|
||||||
|
Parity Ethereum v2.4.9-stable is a security update which addresses servo/rust-smallvec#148
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* cargo update -p smallvec ([#10822](https://github.com/paritytech/parity-ethereum/pull/10822))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.8)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.8-stable is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
* Blockchain: fix reset chain
|
||||||
|
* State tests: treat empty accounts the same as non-existant accounts (EIP 1052)
|
||||||
|
* Aura: fix Timestamp Overflow
|
||||||
|
* Networking: support discovery-only peers (geth bootnodes)
|
||||||
|
* Snapshotting: fix unclean shutdown while snappshotting is under way
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* ethcore/res: activate atlantis classic hf on block 8772000 ([#10766](https://github.com/paritytech/parity-ethereum/pull/10766))
|
||||||
|
* fix docker tags for publishing ([#10741](https://github.com/paritytech/parity-ethereum/pull/10741))
|
||||||
|
* Reset blockchain properly ([#10669](https://github.com/paritytech/parity-ethereum/pull/10669))
|
||||||
|
* adds rpc error message for --no-ancient-blocks ([#10608](https://github.com/paritytech/parity-ethereum/pull/10608))
|
||||||
|
* Treat empty account the same as non-exist accounts in EIP-1052 ([#10775](https://github.com/paritytech/parity-ethereum/pull/10775))
|
||||||
|
* fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))
|
||||||
|
* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet ([#10705](https://github.com/paritytech/parity-ethereum/pull/10705))
|
||||||
|
* Revert "fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))"
|
||||||
|
* Add a way to signal shutdown to snapshotting threads ([#10744](https://github.com/paritytech/parity-ethereum/pull/10744))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.7)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.7-stable is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
Among others, it enables the _Atlantis_ hardfork on **Morden** and **Kotti** Classic networks.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* [CI] allow cargo audit to fail ([#10676](https://github.com/paritytech/parity-ethereum/pull/10676))
|
||||||
|
* new image ([#10673](https://github.com/paritytech/parity-ethereum/pull/10673))
|
||||||
|
* Update publishing ([#10644](https://github.com/paritytech/parity-ethereum/pull/10644))
|
||||||
|
* enable lto for release builds ([#10717](https://github.com/paritytech/parity-ethereum/pull/10717))
|
||||||
|
* Use RUSTFLAGS to set the optimization level ([#10719](https://github.com/paritytech/parity-ethereum/pull/10719))
|
||||||
|
* ethcore: enable ECIP-1054 for classic ([#10731](https://github.com/paritytech/parity-ethereum/pull/10731))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.6)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.6-stable is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
Among others, it enables the Petersburg hardfork on **Rinkeby** and **POA-Core** Network, as well as the **Kovan** Network community hardfork.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* ci: publish docs debug ([#10638](https://github.com/paritytech/parity-ethereum/pull/10638))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.5)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.5-stable is a bugfix release that improves performance and stability. This release improves memory optimizations around timestamp handling and stabilizes the 2.4 release branch.
|
||||||
|
|
||||||
|
As of today, Parity-Ethereum 2.3 reaches end of life and everyone is encouraged to upgrade.
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.4)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.4-beta is a bugfix release that improves performance and stability. This patch release removes the dead chain configs for Easthub and Ethereum Social.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* fix(rpc-types): replace uint and hash with `ethereum_types v0.4` ([#10217](https://github.com/paritytech/parity-ethereum/pull/10217))
|
||||||
|
* chore(bump ethereum-types) ([#10396](https://github.com/paritytech/parity-ethereum/pull/10396))
|
||||||
|
* fix(light eth_gasPrice): ask network if not in cache ([#10535](https://github.com/paritytech/parity-ethereum/pull/10535))
|
||||||
|
* fix(light account response): update `tx_queue` ([#10545](https://github.com/paritytech/parity-ethereum/pull/10545))
|
||||||
|
* fix(bump dependencies) ([#10540](https://github.com/paritytech/parity-ethereum/pull/10540))
|
||||||
|
* tx-pool: check transaction readiness before replacing ([#10526](https://github.com/paritytech/parity-ethereum/pull/10526))
|
||||||
|
* fix #10390 ([#10391](https://github.com/paritytech/parity-ethereum/pull/10391))
|
||||||
|
* private-tx: replace error_chain ([#10510](https://github.com/paritytech/parity-ethereum/pull/10510))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.3)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.3-beta is a bugfix release that improves performance and stability. This patch release contains a critical bug fix where serving light clients previously led to client crashes. Upgrading is highly recommended.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* Add additional request tests ([#10503](https://github.com/paritytech/parity-ethereum/pull/10503))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.2)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.2-beta is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* Сaching through docker volume ([#10477](https://github.com/paritytech/parity-ethereum/pull/10477))
|
||||||
|
* fix win&mac build ([#10486](https://github.com/paritytech/parity-ethereum/pull/10486))
|
||||||
|
* fix(extract `timestamp_checked_add` as lib) ([#10383](https://github.com/paritytech/parity-ethereum/pull/10383))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.1)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.1-beta is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* Implement parity_versionInfo & parity_setChain on LC; fix parity_setChain ([#10312](https://github.com/paritytech/parity-ethereum/pull/10312))
|
||||||
|
* CI publish to aws ([#10446](https://github.com/paritytech/parity-ethereum/pull/10446))
|
||||||
|
* CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))
|
||||||
|
* Revert "CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))" (#10456)
|
||||||
|
* Revert "CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))"
|
||||||
|
* Tests parallelized ([#10452](https://github.com/paritytech/parity-ethereum/pull/10452))
|
||||||
|
* Ensure static validator set changes are recognized ([#10467](https://github.com/paritytech/parity-ethereum/pull/10467))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.4.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.0)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.4.0-beta is our trifortnightly minor version release coming with a lot of new features as well as bugfixes and performance improvements.
|
||||||
|
|
||||||
|
Notable changes:
|
||||||
|
- Account management is now deprecated ([#10213](https://github.com/paritytech/parity-ethereum/pull/10213))
|
||||||
|
- Local accounts can now be specified via CLI ([#9960](https://github.com/paritytech/parity-ethereum/pull/9960))
|
||||||
|
- Chains can now be reset to a particular block via CLI ([#9782](https://github.com/paritytech/parity-ethereum/pull/9782))
|
||||||
|
- Ethash now additionally implements ProgPoW ([#9762](https://github.com/paritytech/parity-ethereum/pull/9762))
|
||||||
|
- The `eip1283DisableTransition` flag was added to revert EIP-1283 ([#10214](https://github.com/paritytech/parity-ethereum/pull/10214))
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* revert some changes, could be buggy ([#10399](https://github.com/paritytech/parity-ethereum/pull/10399))
|
||||||
|
* 10000 > 5000 ([#10422](https://github.com/paritytech/parity-ethereum/pull/10422))
|
||||||
|
* fix panic when logging directory does not exist, closes #10420 ([#10424](https://github.com/paritytech/parity-ethereum/pull/10424))
|
||||||
|
* fix underflow in pip, closes #10419 ([#10423](https://github.com/paritytech/parity-ethereum/pull/10423))
|
||||||
|
* ci: clean up gitlab-ci.yml leftovers from previous merge ([#10429](https://github.com/paritytech/parity-ethereum/pull/10429))
|
||||||
|
* Update hardcoded headers for Foundation, Ropsten, Kovan and Classic ([#10417](https://github.com/paritytech/parity-ethereum/pull/10417))
|
||||||
|
|
||||||
220
docs/CHANGELOG-2.5.md
Normal file
220
docs/CHANGELOG-2.5.md
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
## Parity-Ethereum [v2.5.13](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.13)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.13-stable is a security release. Valid blocks with manipulated transactions (added/replaced) cause the client to stall.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* Make sure to not mark block header hash as invalid if only the body is wrong (#11356)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.12](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.12)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.12-stable is a patch release that adds Istanbul hardfork
|
||||||
|
block numbers for POA and xDai networks, implements ECIP-1056 and implements
|
||||||
|
EIP-2384/2387 - Muir Glacier.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* Enable EIP-2384 for ice age hard fork (#11281)
|
||||||
|
* ethcore/res: activate agharta on classic 9573000 (#11331)
|
||||||
|
* Istanbul HF in xDai (2019-12-12) (#11299)
|
||||||
|
* Istanbul HF in POA Core (2019-12-19) (#11298)
|
||||||
|
* Istanbul HF in POA Sokol (2019-12-05) (#11282)
|
||||||
|
* Activate ecip-1061 on kotti and mordor (#11338)
|
||||||
|
* Enable basic verification of local transactions (#11332)
|
||||||
|
* Disallow EIP-86 style null signatures for transactions outside tests (#11335)
|
||||||
|
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.11](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.11)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.11-stable is an emergency patch release that adds the missing
|
||||||
|
eip1344_transition for mainnet - Users are advised to update as soon as possible
|
||||||
|
to prevent any issues with the imminent Istanbul hardfork
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
- [chainspec]: add `eip1344_transition` for istanbul (#11301)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.10](https://github.com/paritytech/parity-ethereum/releases/tag/2.5.10)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.10-stable is a patch release that adds block numbers for
|
||||||
|
activating the Istanbul hardfork on mainnet, as well as a large number of
|
||||||
|
various bugfixes, QoL changes, some code cleanup/refactoring and other
|
||||||
|
miscellaneous changes.
|
||||||
|
|
||||||
|
This release removes legacy aliases for the mainnet. If you specify `--chain homestead`, `--chain frontier` or `--chain byzantium`, this will need to be changed to one of: `--chain eth`, `--chain ethereum`, `--chain foundation` or `--chain mainnet`.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* ropsten #6631425 foundation #8798209 (#11201)
|
||||||
|
* [stable] builtin, istanbul and mordor testnet backports (#11234)
|
||||||
|
* ethcore-builtin (#10850)
|
||||||
|
* [builtin]: support `multiple prices and activations` in chain spec (#11039)
|
||||||
|
* [chain specs]: activate `Istanbul` on mainnet (#11228)
|
||||||
|
* ethcore/res: add mordor testnet configuration (#11200)
|
||||||
|
* Update list of bootnodes for xDai chain (#11236)
|
||||||
|
* ethcore: remove `test-helper feat` from build (#11047)
|
||||||
|
* Secret store: fix Instant::now() related race in net_keep_alive (#11155) (#11159)
|
||||||
|
* [stable]: backport #10691 and #10683 (#11143)
|
||||||
|
* Fix compiler warning (that will become an error) (#10683)
|
||||||
|
* Refactor Clique stepping (#10691)
|
||||||
|
* Add Constantinople eips to the dev (instant_seal) config (#10809)
|
||||||
|
* Add cargo-remote dir to .gitignore (?)
|
||||||
|
* Insert explicit warning into the panic hook (#11225)
|
||||||
|
* Fix docker centos build (#11226)
|
||||||
|
* Update MIX bootnodes. (#11203)
|
||||||
|
* Use provided usd-per-eth value if an endpoint is specified (#11209)
|
||||||
|
* Add new line after writing block to hex file. (#10984)
|
||||||
|
* Type annotation for next_key() matching of json filter options (#11192) (but no `FilterOption` in 2.5 so…)
|
||||||
|
* Upgrade jsonrpc to latest (#11206)
|
||||||
|
* [CI] check evmbin build (#11096)
|
||||||
|
* Correct EIP-712 encoding (#11092)
|
||||||
|
* [client]: Fix for incorrectly dropped consensus messages (#11086)
|
||||||
|
* Fix block detail updating (#11015)
|
||||||
|
* Switching sccache from local to Redis (#10971)
|
||||||
|
* Made ecrecover implementation trait public (#11188)
|
||||||
|
* [dependencies]: jsonrpc `14.0.1` (#11183)
|
||||||
|
* [receipt]: add `sender` & `receiver` to `RichReceipts` (#11179)
|
||||||
|
* [ethcore/builtin]: do not panic in blake2pricer on short input (#11180)
|
||||||
|
* util Host: fix a double Read Lock bug in fn Host::session_readable() (#11175)
|
||||||
|
* ethcore client: fix a double Read Lock bug in fn Client::logs() (#11172)
|
||||||
|
* Change how RPCs eth_call and eth_estimateGas handle "Pending" (#11127)
|
||||||
|
* Cleanup stratum a bit (#11161)
|
||||||
|
* Upgrade to jsonrpc v14 (#11151)
|
||||||
|
* SecretStore: expose restore_key_public in HTTP API (#10241)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.9](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.9)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.9-stable is a patch release that adds the block numbers for activating the Istanbul hardfork on test networks: Ropsten, Görli, Rinkeby and Kovan.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* ethcore/res: activate Istanbul on Ropsten, Görli, Rinkeby, Kovan (#11068)
|
||||||
|
* [json-spec] make blake2 pricing spec more readable (#11034)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.8)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.8-stable is a patch release that improves security, stability and performance.
|
||||||
|
|
||||||
|
* The most noteworthy improvement in this release is incorporating all the EIPs required for the Istanbul hard fork.
|
||||||
|
* This release also fixes certain security and performance issues, one of which was suspected to be consensus-threatening but turned out to be benign. Thanks to Martin Holst Swende and Felix Lange from the Ethereum Foundation for bringing the suspicious issue to our attention.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* add more tx tests (#11038)
|
||||||
|
* Fix parallel transactions race-condition (#10995)
|
||||||
|
* Add blake2_f precompile (#11017)
|
||||||
|
* [trace] introduce trace failed to Ext (#11019)
|
||||||
|
* Edit publish-onchain.sh to use https (#11016)
|
||||||
|
* Fix deadlock in network-devp2p (#11013)
|
||||||
|
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
|
||||||
|
* xDai chain support and nodes list update (#10989)
|
||||||
|
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
|
||||||
|
* EIP-1344 Add CHAINID op-code (#10983)
|
||||||
|
* manual publish jobs for releases, no changes for nightlies (#10977)
|
||||||
|
* [blooms-db] Fix benchmarks (#10974)
|
||||||
|
* Verify transaction against its block during import (#10954)
|
||||||
|
* Better error message for rpc gas price errors (#10931)
|
||||||
|
* tx-pool: accept local tx with higher gas price when pool full (#10901)
|
||||||
|
* Fix fork choice (#10837)
|
||||||
|
* Cleanup unused vm dependencies (#10787)
|
||||||
|
* Fix compilation on recent nightlies (#10991)
|
||||||
|
* Don't build rpc with ethcore test-helpers (#11048)
|
||||||
|
* EIP 1884 Re-pricing of trie-size dependent operations (#10992)
|
||||||
|
* Implement EIP-1283 reenable transition, EIP-1706 and EIP-2200 (#10191)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.7)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.7-stable is a bugfix release that fixes a potential DoS attack in the trace_call RPC method. This is a critical upgrade for anyone running Parity nodes with RPC exposed to the public internet (and highly recommended for anyone else). For details see this blog post.
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.6)
|
||||||
|
|
||||||
|
Parity-Ethereum v2.5.6-stable is a bugfix release that improves stability.
|
||||||
|
|
||||||
|
* Allow specifying hostnames for node URLs
|
||||||
|
* Fix a bug where archive nodes were losing peers
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* Kaspersky AV whitelisting (#10919)
|
||||||
|
* Avast whitelist script (#10900)
|
||||||
|
* Docker images renaming (#10863)
|
||||||
|
* Remove excessive warning (#10831)
|
||||||
|
* Allow --nat extip:your.host.here.org (#10830)
|
||||||
|
* When updating the client or when called from RPC, sleep should mean sleep (#10814)
|
||||||
|
* added new ropsten-bootnode and removed old one (#10794)
|
||||||
|
* ethkey no longer uses byteorder (#10786)
|
||||||
|
* Do not drop the peer with None difficulty (#10772)
|
||||||
|
* docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.5)
|
||||||
|
|
||||||
|
Parity-Ethereum v2.5.5-stable is a minor release that improves performance and stability.
|
||||||
|
This release stabilises the 2.5 branch.
|
||||||
|
|
||||||
|
As of today, Parity-Ethereum 2.4 reaches end of life and everyone is
|
||||||
|
encouraged to upgrade.
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.4)
|
||||||
|
|
||||||
|
Parity Ethereum v2.5.4-beta is a security update that addresses servo/rust-smallvec#148
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* cargo update -p smallvec ([#10822](https://github.com/paritytech/parity-ethereum/pull/10822))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.3)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.5.3-beta is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
* EthereumClassic: activate the Atlantis Hardfork
|
||||||
|
* Clique: fix time overflow
|
||||||
|
* State tests: treat empty accounts the same as non-existant accounts (EIP 1052)
|
||||||
|
* Networking: support discovery-only peers (geth bootnodes)
|
||||||
|
* Snapshotting: fix unclean shutdown while snappshotting is under way
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* ethcore/res: activate atlantis classic hf on block 8772000 ([#10766](https://github.com/paritytech/parity-ethereum/pull/10766))
|
||||||
|
* fix docker tags for publishing ([#10741](https://github.com/paritytech/parity-ethereum/pull/10741))
|
||||||
|
* fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))
|
||||||
|
* Treat empty account the same as non-exist accounts in EIP-1052 ([#10775](https://github.com/paritytech/parity-ethereum/pull/10775))
|
||||||
|
* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet ([#10705](https://github.com/paritytech/parity-ethereum/pull/10705))
|
||||||
|
* Add a way to signal shutdown to snapshotting threads ([#10744](https://github.com/paritytech/parity-ethereum/pull/10744))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.2)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.5.2-beta is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
Among others, it enables the _Atlantis_ hardfork on **Morden** and **Kotti** Classic networks.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* [CI] allow cargo audit to fail ([#10676](https://github.com/paritytech/parity-ethereum/pull/10676))
|
||||||
|
* Reset blockchain properly ([#10669](https://github.com/paritytech/parity-ethereum/pull/10669))
|
||||||
|
* new image ([#10673](https://github.com/paritytech/parity-ethereum/pull/10673))
|
||||||
|
* Update publishing ([#10644](https://github.com/paritytech/parity-ethereum/pull/10644))
|
||||||
|
* enable lto for release builds ([#10717](https://github.com/paritytech/parity-ethereum/pull/10717))
|
||||||
|
* Use RUSTFLAGS to set the optimization level ([#10719](https://github.com/paritytech/parity-ethereum/pull/10719))
|
||||||
|
* ethcore: enable ECIP-1054 for classic ([#10731](https://github.com/paritytech/parity-ethereum/pull/10731))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.1)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.5.1-beta is a bugfix release that improves performance and stability.
|
||||||
|
|
||||||
|
Among others, it enables the Petersburg hardfork on **Rinkeby** and **POA-Core** Network, as well as the **Kovan** Network community hardfork.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* ci: publish docs debug ([#10638](https://github.com/paritytech/parity-ethereum/pull/10638))
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.5.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.0)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.5.0-beta is a minor release that improves performance and stabilizes the 2.5 branch by marking it as beta release.
|
||||||
|
|
||||||
|
- This release adds support for the Clique consensus engine ([#9981](https://github.com/paritytech/parity-ethereum/pull/9981))
|
||||||
|
- This enables Parity-Ethereum users to use the Görli, the Kotti Classic, and the legacy Rinkeby testnet. To get started try `parity --chain goerli`; note that light client support is currently not yet fully functional.
|
||||||
|
- This release removes the dead chain configs for Easthub and Ethereum Social ([#10531](https://github.com/paritytech/parity-ethereum/pull/10531))
|
||||||
|
|
||||||
|
As of today, Parity-Ethereum 2.3 reaches end of life and everyone is encouraged to upgrade.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* fix(light cull): poll light cull instead of timer ([#10559](https://github.com/paritytech/parity-ethereum/pull/10559))
|
||||||
|
|
||||||
307
docs/CHANGELOG-2.6.md
Normal file
307
docs/CHANGELOG-2.6.md
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
## Parity-Ethereum [v2.6.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.8)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.8-beta is a security release. Valid blocks with manipulated transactions (added/replaced) cause the client to stall.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* Make sure to not mark block header hash as invalid if only the body is wrong (#11356)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.7)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.7-beta is a patch release that adds Istanbul hardfork
|
||||||
|
block numbers for POA and xDai networks, implements ECIP-1056 and implements
|
||||||
|
EIP-2384/2387 - Muir Glacier.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* Enable EIP-2384 for ice age hard fork (#11281)
|
||||||
|
* ethcore/res: activate agharta on classic 9573000 (#11331)
|
||||||
|
* Istanbul HF in xDai (2019-12-12) (#11299)
|
||||||
|
* Istanbul HF in POA Core (2019-12-19) (#11298)
|
||||||
|
* Istanbul HF in POA Sokol (2019-12-05) (#11282)
|
||||||
|
* Activate ecip-1061 on kotti and mordor (#11338)
|
||||||
|
* Enable basic verification of local transactions (#11332)
|
||||||
|
* Disallow EIP-86 style null signatures for transactions outside tests (#11335)
|
||||||
|
* SecretStore database migration to v4 (#11322)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.6)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.6-beta is an emergency patch release that adds the missing
|
||||||
|
eip1344_transition for mainnet - Users are advised to update as soon as possible
|
||||||
|
to prevent any issues with the imminent Istanbul hardfork
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* [chainspec]: add `eip1344_transition` for istanbul (#11301)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.5)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.5-beta is a patch release that adds block numbers for activating the Istanbul hardfork on mainnet, as well as a large number of various bugfixes, QoL changes, some code cleanup/refactoring and other miscellaneous changes.
|
||||||
|
|
||||||
|
This release removes legacy aliases for the mainnet. If you specify `--chain homestead`, `--chain frontier` or `--chain byzantium`, this will need to be changed to one of: `--chain eth`, `--chain ethereum`, `--chain foundation` or `--chain mainnet`.
|
||||||
|
|
||||||
|
This release includes important changes to how snapshots are produced. The size of the Ethereum account state means that producing a snapshot takes a long while; most nodes today are not able to finish before the relevant state is pruned. Starting with v2.6.5, pruning is paused while a snapshot is underway, hopefully fixing the current dearth of recent snapshots. The downside to this is that memory usage goes up while a snapshot is produced.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* [CI] check evmbin build (#11096)
|
||||||
|
* Correct EIP-712 encoding (#11092)
|
||||||
|
* [client]: Fix for incorrectly dropped consensus messages (#11082) (#11086)
|
||||||
|
* Update hardcoded headers (foundation, classic, kovan, xdai, ewc, ...) (#11053)
|
||||||
|
* Add cargo-remote dir to .gitignore (?)
|
||||||
|
* Update light client headers: ropsten 6631425 foundation 8798209 (#11201)
|
||||||
|
* Update list of bootnodes for xDai chain (#11236)
|
||||||
|
* ethcore/res: add mordor testnet configuration (#11200)
|
||||||
|
* [chain specs]: activate Istanbul on mainnet (#11228)
|
||||||
|
* [builtin]: support multiple prices and activations in chain spec (#11039)
|
||||||
|
* [receipt]: add sender & receiver to RichReceipts (#11179)
|
||||||
|
* [ethcore/builtin]: do not panic in blake2pricer on short input (#11180)
|
||||||
|
* Made ecrecover implementation trait public (#11188)
|
||||||
|
* Fix docker centos build (#11226)
|
||||||
|
* Update MIX bootnodes. (#11203)
|
||||||
|
* Insert explicit warning into the panic hook (#11225)
|
||||||
|
* Use provided usd-per-eth value if an endpoint is specified (#11209)
|
||||||
|
* Cleanup stratum a bit (#11161)
|
||||||
|
* Add Constantinople EIPs to the dev (instant_seal) config (#10809) (already backported)
|
||||||
|
* util Host: fix a double Read Lock bug in fn Host::session_readable() (#11175)
|
||||||
|
* ethcore client: fix a double Read Lock bug in fn Client::logs() (#11172)
|
||||||
|
* Type annotation for next_key() matching of json filter options (#11192)
|
||||||
|
* Upgrade jsonrpc to latest (#11206)
|
||||||
|
* [dependencies]: jsonrpc 14.0.1 (#11183)
|
||||||
|
* Upgrade to jsonrpc v14 (#11151)
|
||||||
|
* Switching sccache from local to Redis (#10971)
|
||||||
|
* Snapshot restoration overhaul (#11219)
|
||||||
|
* Add new line after writing block to hex file. (#10984)
|
||||||
|
* Pause pruning while snapshotting (#11178)
|
||||||
|
* Change how RPCs eth_call and eth_estimateGas handle "Pending" (#11127)
|
||||||
|
* Fix block detail updating (#11015)
|
||||||
|
* Make InstantSeal Instant again #11186
|
||||||
|
* Filter out some bad ropsten warp snapshots (#11247)
|
||||||
|
* Allow default block parameter to be blockHash (#10932)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.4)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.4-stable is a patch release that adds the block numbers for activating the Istanbul hardfork on test networks: Ropsten, Görli, Rinkeby and Kovan.
|
||||||
|
|
||||||
|
A full list of included changes:
|
||||||
|
|
||||||
|
* ethcore/res: activate Istanbul on Ropsten, Görli, Rinkeby, Kovan (#11068)
|
||||||
|
* cleanup json crate (#11027)
|
||||||
|
* [json-spec] make blake2 pricing spec more readable (#11034)
|
||||||
|
* Update JSON tests to d4f86ecf4aa7c (#11054)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.3)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.3-stable is a patch release that improves security, stability and performance.
|
||||||
|
|
||||||
|
* The most noteworthy improvement in this release is incorporating all the EIPs required for the Istanbul hard fork.
|
||||||
|
* This release also fixes certain security and performance issues, one of which was suspected to be consensus-threatening but turned out to be benign. Thanks to Martin Holst Swende and Felix Lange from the Ethereum Foundation for bringing the suspicious issue to our attention.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
|
||||||
|
* add more tx tests (#11038)
|
||||||
|
* Fix parallel transactions race-condition (#10995)
|
||||||
|
* Add blake2_f precompile (#11017)
|
||||||
|
* [trace] introduce trace failed to Ext (#11019)
|
||||||
|
* Edit publish-onchain.sh to use https (#11016)
|
||||||
|
* Fix deadlock in network-devp2p (#11013)
|
||||||
|
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
|
||||||
|
* xDai chain support and nodes list update (#10989)
|
||||||
|
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
|
||||||
|
* EIP-1344 Add CHAINID op-code (#10983)
|
||||||
|
* manual publish jobs for releases, no changes for nightlies (#10977)
|
||||||
|
* [blooms-db] Fix benchmarks (#10974)
|
||||||
|
* Verify transaction against its block during import (#10954)
|
||||||
|
* Better error message for rpc gas price errors (#10931)
|
||||||
|
* Fix fork choice (#10837)
|
||||||
|
* Fix compilation on recent nightlies (#10991)
|
||||||
|
* Don't build rpc with ethcore test-helpers (#11048)
|
||||||
|
* EIP 1884 Re-pricing of trie-size dependent operations (#10992)
|
||||||
|
* Implement EIP-1283 reenable transition, EIP-1706 and EIP-2200 (#10191)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.2)
|
||||||
|
|
||||||
|
Parity Ethereum v2.6.2-stable is a bugfix release that fixes a potential DoS attack in the trace_call RPC method. This is a critical upgrade for anyone running Parity nodes with RPC exposed to the public internet (and highly recommended for anyone else). For details see this blog post.
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.1)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.6.1-beta is a patch release that improves stability.
|
||||||
|
|
||||||
|
This release includes:
|
||||||
|
* Allow specifying hostnames for node URLs
|
||||||
|
* Fix a bug where archive nodes were losing peers
|
||||||
|
* Add support for Energy Web Foundations new chains 'Volta' and 'EWC', and remove their deprecated 'Tobalaba' chain.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* Add support for Energy Web Foundation's new chains (#10957)
|
||||||
|
* Kaspersky AV whitelisting (#10919)
|
||||||
|
* Avast whitelist script (#10900)
|
||||||
|
* Docker images renaming (#10863)
|
||||||
|
* Remove excessive warning (#10831)
|
||||||
|
* Allow --nat extip:your.host.here.org (#10830)
|
||||||
|
* When updating the client or when called from RPC, sleep should mean sleep (#10814)
|
||||||
|
* added new ropsten-bootnode and removed old one (#10794)
|
||||||
|
* ethkey no longer uses byteorder (#10786)
|
||||||
|
* docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
|
||||||
|
|
||||||
|
## Parity-Ethereum [v2.6.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.6.0)
|
||||||
|
|
||||||
|
Parity-Ethereum 2.6.0-beta is a minor release that stabilizes the 2.6 branch by
|
||||||
|
marking it as a beta release.
|
||||||
|
|
||||||
|
This release includes:
|
||||||
|
* Major refactoring of the codebase
|
||||||
|
* Many bugfixes
|
||||||
|
* Significant improvements to logging, error and warning message clarity.
|
||||||
|
* SecretStore: remove support of old database formats (#10757)
|
||||||
|
* This is a potentially breaking change if you have not upgraded for
|
||||||
|
quite some time.
|
||||||
|
|
||||||
|
As of today, Parity-Ethereum 2.4 reaches end of life, and everyone is
|
||||||
|
encouraged to upgrade.
|
||||||
|
|
||||||
|
The full list of included changes:
|
||||||
|
* update jsonrpc to 12.0 ([#10841](https://github.com/paritytech/parity-ethereum/pull/10841))
|
||||||
|
* Move more code into state-account ([#10840](https://github.com/paritytech/parity-ethereum/pull/10840))
|
||||||
|
* Extract AccountDB to account-db ([#10839](https://github.com/paritytech/parity-ethereum/pull/10839))
|
||||||
|
* Extricate PodAccount and state Account to own crates ([#10838](https://github.com/paritytech/parity-ethereum/pull/10838))
|
||||||
|
* Fix fork choice ([#10837](https://github.com/paritytech/parity-ethereum/pull/10837))
|
||||||
|
* tests: Relates to #10655: Test instructions for Readme ([#10835](https://github.com/paritytech/parity-ethereum/pull/10835))
|
||||||
|
* idiomatic changes to PodState ([#10834](https://github.com/paritytech/parity-ethereum/pull/10834))
|
||||||
|
* Break circular dependency between Client and Engine (part 1) ([#10833](https://github.com/paritytech/parity-ethereum/pull/10833))
|
||||||
|
* Remove excessive warning ([#10831](https://github.com/paritytech/parity-ethereum/pull/10831))
|
||||||
|
* Allow --nat extip:your.host.here.org ([#10830](https://github.com/paritytech/parity-ethereum/pull/10830))
|
||||||
|
* ethcore does not use byteorder ([#10829](https://github.com/paritytech/parity-ethereum/pull/10829))
|
||||||
|
* Fix typo in README.md ([#10828](https://github.com/paritytech/parity-ethereum/pull/10828))
|
||||||
|
* Update wordlist to v1.3 ([#10823](https://github.com/paritytech/parity-ethereum/pull/10823))
|
||||||
|
* bump `smallvec 0.6.10` to fix vulnerability ([#10822](https://github.com/paritytech/parity-ethereum/pull/10822))
|
||||||
|
* removed additional_params method ([#10818](https://github.com/paritytech/parity-ethereum/pull/10818))
|
||||||
|
* Improve logging when remote peer is unknown ([#10817](https://github.com/paritytech/parity-ethereum/pull/10817))
|
||||||
|
* replace memzero with zeroize crate ([#10816](https://github.com/paritytech/parity-ethereum/pull/10816))
|
||||||
|
* When updating the client or when called from RPC, sleep should mean sleep ([#10814](https://github.com/paritytech/parity-ethereum/pull/10814))
|
||||||
|
* Don't reimplement the logic from the Default impl ([#10813](https://github.com/paritytech/parity-ethereum/pull/10813))
|
||||||
|
* refactor: whisper: Add type aliases and update rustdocs in message.rs ([#10812](https://github.com/paritytech/parity-ethereum/pull/10812))
|
||||||
|
* test: whisper/cli `add invalid pool size test depending on processor` ([#10811](https://github.com/paritytech/parity-ethereum/pull/10811))
|
||||||
|
* Add Constantinople EIPs to the dev (instant_seal) config ([#10809](https://github.com/paritytech/parity-ethereum/pull/10809))
|
||||||
|
* fix spurious test failure ([#10808](https://github.com/paritytech/parity-ethereum/pull/10808))
|
||||||
|
* revert temp changes to .gitlab-ci.yml ([#10807](https://github.com/paritytech/parity-ethereum/pull/10807))
|
||||||
|
* removed redundant fmt::Display implementations ([#10806](https://github.com/paritytech/parity-ethereum/pull/10806))
|
||||||
|
* removed EthEngine alias ([#10805](https://github.com/paritytech/parity-ethereum/pull/10805))
|
||||||
|
* ethcore-bloom-journal updated to 2018 ([#10804](https://github.com/paritytech/parity-ethereum/pull/10804))
|
||||||
|
* Fix a few typos and unused warnings. ([#10803](https://github.com/paritytech/parity-ethereum/pull/10803))
|
||||||
|
* updated price-info to edition 2018 ([#10801](https://github.com/paritytech/parity-ethereum/pull/10801))
|
||||||
|
* updated parity-local-store to edition 2018 ([#10800](https://github.com/paritytech/parity-ethereum/pull/10800))
|
||||||
|
* updated project to ansi_term 0.11 ([#10799](https://github.com/paritytech/parity-ethereum/pull/10799))
|
||||||
|
* ethcore-light uses bincode 1.1 ([#10798](https://github.com/paritytech/parity-ethereum/pull/10798))
|
||||||
|
* ethcore-network-devp2p uses igd 0.9 ([#10797](https://github.com/paritytech/parity-ethereum/pull/10797))
|
||||||
|
* Better logging when backfilling ancient blocks fail ([#10796](https://github.com/paritytech/parity-ethereum/pull/10796))
|
||||||
|
* added new ropsten-bootnode and removed old one ([#10794](https://github.com/paritytech/parity-ethereum/pull/10794))
|
||||||
|
* Removed machine abstraction from ethcore ([#10791](https://github.com/paritytech/parity-ethereum/pull/10791))
|
||||||
|
* Removed redundant ethcore-service error type ([#10788](https://github.com/paritytech/parity-ethereum/pull/10788))
|
||||||
|
* Cleanup unused vm dependencies ([#10787](https://github.com/paritytech/parity-ethereum/pull/10787))
|
||||||
|
* ethkey no longer uses byteorder ([#10786](https://github.com/paritytech/parity-ethereum/pull/10786))
|
||||||
|
* Updated blooms-db to rust 2018 and removed redundant deps ([#10785](https://github.com/paritytech/parity-ethereum/pull/10785))
|
||||||
|
* Treat empty account the same as non-exist accounts in EIP-1052 ([#10775](https://github.com/paritytech/parity-ethereum/pull/10775))
|
||||||
|
* Do not drop the peer with None difficulty ([#10772](https://github.com/paritytech/parity-ethereum/pull/10772))
|
||||||
|
* EIP-1702: Generalized Account Versioning Scheme ([#10771](https://github.com/paritytech/parity-ethereum/pull/10771))
|
||||||
|
* Move Engine::register_client to be before other I/O handler registration ([#10767](https://github.com/paritytech/parity-ethereum/pull/10767))
|
||||||
|
* ethcore/res: activate atlantis classic hf on block 8772000 ([#10766](https://github.com/paritytech/parity-ethereum/pull/10766))
|
||||||
|
* Updated Bn128PairingImpl to use optimized batch pairing ([#10765](https://github.com/paritytech/parity-ethereum/pull/10765))
|
||||||
|
* Remove unused code ([#10762](https://github.com/paritytech/parity-ethereum/pull/10762))
|
||||||
|
* Initialize private tx logger only if private tx functionality is enabled ([#10758](https://github.com/paritytech/parity-ethereum/pull/10758))
|
||||||
|
* SecretStore: remove support of old database formats ([#10757](https://github.com/paritytech/parity-ethereum/pull/10757))
|
||||||
|
* Enable aesni ([#10756](https://github.com/paritytech/parity-ethereum/pull/10756))
|
||||||
|
* updater: fix static id hashes initialization ([#10755](https://github.com/paritytech/parity-ethereum/pull/10755))
|
||||||
|
* Use fewer threads for snapshotting ([#10752](https://github.com/paritytech/parity-ethereum/pull/10752))
|
||||||
|
* Die error_chain, die ([#10747](https://github.com/paritytech/parity-ethereum/pull/10747))
|
||||||
|
* Fix deprectation warnings on nightly ([#10746](https://github.com/paritytech/parity-ethereum/pull/10746))
|
||||||
|
* Improve logging and cleanup in miner around block sealing ([#10745](https://github.com/paritytech/parity-ethereum/pull/10745))
|
||||||
|
* Add a way to signal shutdown to snapshotting threads ([#10744](https://github.com/paritytech/parity-ethereum/pull/10744))
|
||||||
|
* fix docker tags for publishing ([#10741](https://github.com/paritytech/parity-ethereum/pull/10741))
|
||||||
|
* refactor: Fix indentation in ethjson ([#10740](https://github.com/paritytech/parity-ethereum/pull/10740))
|
||||||
|
* Log validator set changes in EpochManager ([#10734](https://github.com/paritytech/parity-ethereum/pull/10734))
|
||||||
|
* Print warnings when using dangerous settings for ValidatorSet ([#10733](https://github.com/paritytech/parity-ethereum/pull/10733))
|
||||||
|
* ethcore: enable ECIP-1054 for classic ([#10731](https://github.com/paritytech/parity-ethereum/pull/10731))
|
||||||
|
* Stop breaking out of loop if a non-canonical hash is found ([#10729](https://github.com/paritytech/parity-ethereum/pull/10729))
|
||||||
|
* Removed secret_store folder ([#10722](https://github.com/paritytech/parity-ethereum/pull/10722))
|
||||||
|
* Revert "enable lto for release builds (#10717)" ([#10721](https://github.com/paritytech/parity-ethereum/pull/10721))
|
||||||
|
* fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))
|
||||||
|
* Use RUSTFLAGS to set the optimization level ([#10719](https://github.com/paritytech/parity-ethereum/pull/10719))
|
||||||
|
* enable lto for release builds ([#10717](https://github.com/paritytech/parity-ethereum/pull/10717))
|
||||||
|
* [devp2p] Update to 2018 edition ([#10716](https://github.com/paritytech/parity-ethereum/pull/10716))
|
||||||
|
* [devp2p] Don't use `rust-crypto` ([#10714](https://github.com/paritytech/parity-ethereum/pull/10714))
|
||||||
|
* [devp2p] Fix warnings and re-org imports ([#10710](https://github.com/paritytech/parity-ethereum/pull/10710))
|
||||||
|
* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet ([#10705](https://github.com/paritytech/parity-ethereum/pull/10705))
|
||||||
|
* introduce MissingParent Error, fixes #10699 ([#10700](https://github.com/paritytech/parity-ethereum/pull/10700))
|
||||||
|
* Refactor Clique stepping ([#10691](https://github.com/paritytech/parity-ethereum/pull/10691))
|
||||||
|
* add_sync_notifier in EthPubSubClient holds on to a Client for too long ([#10689](https://github.com/paritytech/parity-ethereum/pull/10689))
|
||||||
|
* Fix compiler warning (that will become an error) ([#10683](https://github.com/paritytech/parity-ethereum/pull/10683))
|
||||||
|
* Don't panic if extra_data is longer than VANITY_LENGTH ([#10682](https://github.com/paritytech/parity-ethereum/pull/10682))
|
||||||
|
* Remove annoying compiler warnings ([#10679](https://github.com/paritytech/parity-ethereum/pull/10679))
|
||||||
|
* Remove support for hardware wallets ([#10678](https://github.com/paritytech/parity-ethereum/pull/10678))
|
||||||
|
* [CI] allow cargo audit to fail ([#10676](https://github.com/paritytech/parity-ethereum/pull/10676))
|
||||||
|
* new image ([#10673](https://github.com/paritytech/parity-ethereum/pull/10673))
|
||||||
|
* Upgrade ethereum types ([#10670](https://github.com/paritytech/parity-ethereum/pull/10670))
|
||||||
|
* Reset blockchain properly ([#10669](https://github.com/paritytech/parity-ethereum/pull/10669))
|
||||||
|
* fix: Move PR template into .github/ folder ([#10663](https://github.com/paritytech/parity-ethereum/pull/10663))
|
||||||
|
* docs: evmbin - Update Rust docs ([#10658](https://github.com/paritytech/parity-ethereum/pull/10658))
|
||||||
|
* refactor: Related #9459 - evmbin: replace untyped json! macro with fully typed serde serialization using Rust structs ([#10657](https://github.com/paritytech/parity-ethereum/pull/10657))
|
||||||
|
* docs: Add PR template ([#10654](https://github.com/paritytech/parity-ethereum/pull/10654))
|
||||||
|
* docs: Add ProgPoW Rust docs to ethash module ([#10653](https://github.com/paritytech/parity-ethereum/pull/10653))
|
||||||
|
* docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions ([#10652](https://github.com/paritytech/parity-ethereum/pull/10652))
|
||||||
|
* Upgrade to parity-crypto 0.4 ([#10650](https://github.com/paritytech/parity-ethereum/pull/10650))
|
||||||
|
* fix(compilation warnings) ([#10649](https://github.com/paritytech/parity-ethereum/pull/10649))
|
||||||
|
* [whisper] Move needed aes_gcm crypto in-crate ([#10647](https://github.com/paritytech/parity-ethereum/pull/10647))
|
||||||
|
* Update publishing ([#10644](https://github.com/paritytech/parity-ethereum/pull/10644))
|
||||||
|
* ci: publish docs debug ([#10638](https://github.com/paritytech/parity-ethereum/pull/10638))
|
||||||
|
* Fix publish docs ([#10635](https://github.com/paritytech/parity-ethereum/pull/10635))
|
||||||
|
* Fix rinkeby petersburg fork ([#10632](https://github.com/paritytech/parity-ethereum/pull/10632))
|
||||||
|
* Update kovan.json to switch Kovan validator set to POA Consensus Contracts ([#10628](https://github.com/paritytech/parity-ethereum/pull/10628))
|
||||||
|
* [ethcore] remove error_chain ([#10616](https://github.com/paritytech/parity-ethereum/pull/10616))
|
||||||
|
* Remove unused import ([#10615](https://github.com/paritytech/parity-ethereum/pull/10615))
|
||||||
|
* Adds parity_getRawBlockByNumber, parity_submitRawBlock ([#10609](https://github.com/paritytech/parity-ethereum/pull/10609))
|
||||||
|
* adds rpc error message for --no-ancient-blocks ([#10608](https://github.com/paritytech/parity-ethereum/pull/10608))
|
||||||
|
* Constantinople HF on POA Core ([#10606](https://github.com/paritytech/parity-ethereum/pull/10606))
|
||||||
|
* Clique: zero-fill extradata when the supplied value is less than 32 bytes in length ([#10605](https://github.com/paritytech/parity-ethereum/pull/10605))
|
||||||
|
* evm: add some mulmod benches ([#10600](https://github.com/paritytech/parity-ethereum/pull/10600))
|
||||||
|
* sccache logs to stdout ([#10596](https://github.com/paritytech/parity-ethereum/pull/10596))
|
||||||
|
* update bootnodes ([#10595](https://github.com/paritytech/parity-ethereum/pull/10595))
|
||||||
|
* Merge `Notifier` and `TransactionsPoolNotifier` ([#10591](https://github.com/paritytech/parity-ethereum/pull/10591))
|
||||||
|
* fix(whisper): change expiry `unix_time + ttl + work` ([#10587](https://github.com/paritytech/parity-ethereum/pull/10587))
|
||||||
|
* fix(evmbin): make benches compile again ([#10586](https://github.com/paritytech/parity-ethereum/pull/10586))
|
||||||
|
* fix issue with compilation when 'slow-blocks' feature enabled ([#10585](https://github.com/paritytech/parity-ethereum/pull/10585))
|
||||||
|
* Allow CORS requests in Secret Store API ([#10584](https://github.com/paritytech/parity-ethereum/pull/10584))
|
||||||
|
* CI improvements ([#10579](https://github.com/paritytech/parity-ethereum/pull/10579))
|
||||||
|
* ethcore: improve timestamp handling ([#10574](https://github.com/paritytech/parity-ethereum/pull/10574))
|
||||||
|
* Update Issue Template to direct security issue to email ([#10562](https://github.com/paritytech/parity-ethereum/pull/10562))
|
||||||
|
* version: bump master to 2.6 ([#10560](https://github.com/paritytech/parity-ethereum/pull/10560))
|
||||||
|
* fix(light cull): poll light cull instead of timer ([#10559](https://github.com/paritytech/parity-ethereum/pull/10559))
|
||||||
|
* Watch transactions pool ([#10558](https://github.com/paritytech/parity-ethereum/pull/10558))
|
||||||
|
* Add SealingState; don't prepare block when not ready. ([#10529](https://github.com/paritytech/parity-ethereum/pull/10529))
|
||||||
|
* Explicitly enable or disable Stratum in config file (Issue 9785) ([#10521](https://github.com/paritytech/parity-ethereum/pull/10521))
|
||||||
|
* Add filtering capability to `parity_pendingTransactions` (issue 8269) ([#10506](https://github.com/paritytech/parity-ethereum/pull/10506))
|
||||||
|
* Remove calls to heapsize ([#10432](https://github.com/paritytech/parity-ethereum/pull/10432))
|
||||||
|
* RPC: Implements eth_subscribe("syncing") ([#10311](https://github.com/paritytech/parity-ethereum/pull/10311))
|
||||||
|
* SecretStore: non-blocking wait of session completion ([#10303](https://github.com/paritytech/parity-ethereum/pull/10303))
|
||||||
|
* Node table limiting and cache for node filter ([#10288](https://github.com/paritytech/parity-ethereum/pull/10288))
|
||||||
|
* SecretStore: expose restore_key_public in HTTP API ([#10241](https://github.com/paritytech/parity-ethereum/pull/10241))
|
||||||
|
* Trivial journal for private transactions ([#10056](https://github.com/paritytech/parity-ethereum/pull/10056))
|
||||||
|
|
||||||
|
## Previous releases
|
||||||
|
|
||||||
|
- [CHANGELOG-2.5](docs/CHANGELOG-2.5.md) (_stable_)
|
||||||
|
- [CHANGELOG-2.4](docs/CHANGELOG-2.4.md) (EOL: 2019-07-08)
|
||||||
|
- [CHANGELOG-2.3](docs/CHANGELOG-2.3.md) (EOL: 2019-04-09)
|
||||||
|
- [CHANGELOG-2.2](docs/CHANGELOG-2.2.md) (EOL: 2019-02-25)
|
||||||
|
- [CHANGELOG-2.1](docs/CHANGELOG-2.1.md) (EOL: 2019-01-16)
|
||||||
|
- [CHANGELOG-2.0](docs/CHANGELOG-2.0.md) (EOL: 2018-11-15)
|
||||||
|
- [CHANGELOG-1.11](docs/CHANGELOG-1.11.md) (EOL: 2018-09-19)
|
||||||
|
- [CHANGELOG-1.10](docs/CHANGELOG-1.10.md) (EOL: 2018-07-18)
|
||||||
|
- [CHANGELOG-1.9](docs/CHANGELOG-1.9.md) (EOL: 2018-05-09)
|
||||||
|
- [CHANGELOG-1.8](docs/CHANGELOG-1.8.md) (EOL: 2018-03-22)
|
||||||
|
- [CHANGELOG-1.7](docs/CHANGELOG-1.7.md) (EOL: 2018-01-25)
|
||||||
|
- [CHANGELOG-1.6](docs/CHANGELOG-1.6.md) (EOL: 2017-10-15)
|
||||||
|
- [CHANGELOG-1.5](docs/CHANGELOG-1.5.md) (EOL: 2017-07-28)
|
||||||
|
- [CHANGELOG-1.4](docs/CHANGELOG-1.4.md) (EOL: 2017-03-13)
|
||||||
|
- [CHANGELOG-1.3](docs/CHANGELOG-1.3.md) (EOL: 2017-01-19)
|
||||||
|
- [CHANGELOG-1.2](docs/CHANGELOG-1.2.md) (EOL: 2016-11-07)
|
||||||
|
- [CHANGELOG-1.1](docs/CHANGELOG-1.1.md) (EOL: 2016-08-12)
|
||||||
|
- [CHANGELOG-1.0](docs/CHANGELOG-1.0.md) (EOL: 2016-06-24)
|
||||||
|
- [CHANGELOG-0.9](docs/CHANGELOG-0.9.md) (EOL: 2016-05-02)
|
||||||
@@ -1,20 +1,36 @@
|
|||||||
[package]
|
[package]
|
||||||
|
description = "Parity Ethereum Ethash & ProgPoW Implementations"
|
||||||
name = "ethash"
|
name = "ethash"
|
||||||
version = "1.12.0"
|
version = "1.12.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
crunchy = "0.1.0"
|
common-types = { path = "../ethcore/types" }
|
||||||
either = "1.0.0"
|
either = "1.0.0"
|
||||||
ethereum-types = "0.4"
|
ethereum-types = "0.8.0"
|
||||||
keccak-hash = "0.1"
|
keccak-hash = "0.4.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
memmap = "0.6"
|
memmap = "0.6"
|
||||||
parking_lot = "0.6"
|
parking_lot = "0.9"
|
||||||
primal = "0.2.3"
|
primal = "0.2.3"
|
||||||
|
static_assertions = "0.3.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
criterion = "0.3"
|
||||||
|
rustc-hex = "1.0"
|
||||||
|
serde_json = "1.0"
|
||||||
tempdir = "0.3"
|
tempdir = "0.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
benches = []
|
default = []
|
||||||
|
bench = []
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "basic"
|
||||||
|
harness = false
|
||||||
|
required-features = ['bench']
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "progpow"
|
||||||
|
harness = false
|
||||||
|
required-features = ['bench']
|
||||||
|
|||||||
152
ethash/benches/basic.rs
Normal file
152
ethash/benches/basic.rs
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
|
||||||
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
extern crate criterion;
|
||||||
|
extern crate ethash;
|
||||||
|
extern crate common_types;
|
||||||
|
|
||||||
|
use criterion::Criterion;
|
||||||
|
use ethash::{NodeCacheBuilder, keccak};
|
||||||
|
use common_types::engines::OptimizeFor;
|
||||||
|
|
||||||
|
const HASH: [u8; 32] = [
|
||||||
|
0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b,
|
||||||
|
0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, 0x35, 0x8a,
|
||||||
|
0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59,
|
||||||
|
0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72,
|
||||||
|
];
|
||||||
|
const MIX_HASH: [u8; 32] = [
|
||||||
|
0x1f, 0xff, 0x04, 0xce, 0xc9, 0x41, 0x73, 0xfd,
|
||||||
|
0x59, 0x1e, 0x3d, 0x89, 0x60, 0xce, 0x6b, 0xdf,
|
||||||
|
0x8b, 0x19, 0x71, 0x04, 0x8c, 0x71, 0xff, 0x93,
|
||||||
|
0x7b, 0xb2, 0xd3, 0x2a, 0x64, 0x31, 0xab, 0x6d,
|
||||||
|
];
|
||||||
|
const NONCE: u64 = 0xd7b3ac70a301a249;
|
||||||
|
|
||||||
|
criterion_group! {
|
||||||
|
name = basic;
|
||||||
|
config = dont_take_an_eternity_to_run();
|
||||||
|
targets = bench_keccak_512_inplace,
|
||||||
|
bench_light_compute_memmap,
|
||||||
|
bench_light_compute_memory,
|
||||||
|
bench_light_new_round_trip_memmap,
|
||||||
|
bench_light_new_round_trip_memory,
|
||||||
|
bench_light_from_file_round_trip_memory,
|
||||||
|
bench_light_from_file_round_trip_memmap,
|
||||||
|
bench_quick_get_difficulty,
|
||||||
|
}
|
||||||
|
criterion_main!(basic);
|
||||||
|
|
||||||
|
fn dont_take_an_eternity_to_run() -> Criterion {
|
||||||
|
Criterion::default().nresamples(1_000)
|
||||||
|
.without_plots()
|
||||||
|
.sample_size(10)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_keccak_512_inplace(b: &mut Criterion) {
|
||||||
|
b.bench_function("bench_keccak_512_inplace", move |b| b.iter(|| {
|
||||||
|
let mut data = [4u8; 64];
|
||||||
|
keccak::keccak_512::inplace(&mut data);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_light_compute_memmap(b: &mut Criterion) {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let light = builder.light(&env::temp_dir(), 486382);
|
||||||
|
|
||||||
|
b.bench_function("bench_light_compute_memmap", move |b| b.iter(|| light.compute(&HASH, NONCE, u64::max_value())));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_light_compute_memory(b: &mut Criterion) {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value());
|
||||||
|
let light = builder.light(&env::temp_dir(), 486382);
|
||||||
|
|
||||||
|
b.bench_function("bench_light_compute_memory", move |b| b.iter(|| light.compute(&HASH, NONCE, u64::max_value())));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_light_new_round_trip_memmap(b: &mut Criterion) {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
b.bench_function("bench_light_new_round_trip_memmap", move |b| b.iter(|| {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let light = builder.light(&env::temp_dir(), 486382);
|
||||||
|
light.compute(&HASH, NONCE, u64::max_value());
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_light_new_round_trip_memory(b: &mut Criterion) {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
b.bench_function("bench_light_new_round_trip_memory", move |b| b.iter(|| {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value());
|
||||||
|
let light = builder.light(&env::temp_dir(), 486382);
|
||||||
|
light.compute(&HASH, NONCE, u64::max_value());
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_light_from_file_round_trip_memory(b: &mut Criterion) {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
let dir = env::temp_dir();
|
||||||
|
let height = 486382;
|
||||||
|
{
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value());
|
||||||
|
let mut dummy = builder.light(&dir, height);
|
||||||
|
dummy.to_file().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
b.bench_function("bench_light_from_file_round_trip_memory", move |b| b.iter(|| {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu, u64::max_value());
|
||||||
|
let light = builder.light_from_file(&dir, 486382).unwrap();
|
||||||
|
light.compute(&HASH, NONCE, u64::max_value());
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_light_from_file_round_trip_memmap(b: &mut Criterion) {
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
let dir = env::temp_dir();
|
||||||
|
let height = 486382;
|
||||||
|
|
||||||
|
{
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let mut dummy = builder.light(&dir, height);
|
||||||
|
dummy.to_file().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
b.bench_function("bench_light_from_file_round_trip_memmap", move |b| b.iter(|| {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let light = builder.light_from_file(&dir, 486382).unwrap();
|
||||||
|
light.compute(&HASH, NONCE, u64::max_value());
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_quick_get_difficulty(b: &mut Criterion) {
|
||||||
|
b.bench_function("bench_quick_get_difficulty", move |b| b.iter(|| {
|
||||||
|
let d = ethash::quick_get_difficulty(&HASH, NONCE, &MIX_HASH, false);
|
||||||
|
let boundary_good = [
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3e, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2,
|
||||||
|
0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a,
|
||||||
|
0xe9, 0x7e, 0x53, 0x84,
|
||||||
|
];
|
||||||
|
assert_eq!(d[..], boundary_good[..]);
|
||||||
|
}));
|
||||||
|
}
|
||||||
88
ethash/benches/progpow.rs
Normal file
88
ethash/benches/progpow.rs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
#[macro_use]
|
||||||
|
extern crate criterion;
|
||||||
|
extern crate ethash;
|
||||||
|
extern crate rustc_hex;
|
||||||
|
extern crate tempdir;
|
||||||
|
extern crate common_types;
|
||||||
|
|
||||||
|
use criterion::Criterion;
|
||||||
|
use ethash::progpow;
|
||||||
|
|
||||||
|
use tempdir::TempDir;
|
||||||
|
use rustc_hex::FromHex;
|
||||||
|
use ethash::NodeCacheBuilder;
|
||||||
|
use ethash::compute::light_compute;
|
||||||
|
use common_types::engines::OptimizeFor;
|
||||||
|
|
||||||
|
fn bench_hashimoto_light(c: &mut Criterion) {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let tempdir = TempDir::new("").unwrap();
|
||||||
|
let light = builder.light(&tempdir.path(), 1);
|
||||||
|
let h = FromHex::from_hex("c9149cc0386e689d789a1c2f3d5d169a61a6218ed30e74414dc736e442ef3d1f").unwrap();
|
||||||
|
let mut hash = [0; 32];
|
||||||
|
hash.copy_from_slice(&h);
|
||||||
|
|
||||||
|
c.bench_function("hashimoto_light", move |b| {
|
||||||
|
b.iter(|| light_compute(&light, &hash, 0))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_progpow_light(c: &mut Criterion) {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let tempdir = TempDir::new("").unwrap();
|
||||||
|
let cache = builder.new_cache(tempdir.into_path(), 0);
|
||||||
|
|
||||||
|
let h = FromHex::from_hex("c9149cc0386e689d789a1c2f3d5d169a61a6218ed30e74414dc736e442ef3d1f").unwrap();
|
||||||
|
let mut hash = [0; 32];
|
||||||
|
hash.copy_from_slice(&h);
|
||||||
|
|
||||||
|
c.bench_function("progpow_light", move |b| {
|
||||||
|
b.iter(|| {
|
||||||
|
let c_dag = progpow::generate_cdag(cache.as_ref());
|
||||||
|
progpow::progpow(
|
||||||
|
hash,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
cache.as_ref(),
|
||||||
|
&c_dag,
|
||||||
|
);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_progpow_optimal_light(c: &mut Criterion) {
|
||||||
|
let builder = NodeCacheBuilder::new(OptimizeFor::Memory, u64::max_value());
|
||||||
|
let tempdir = TempDir::new("").unwrap();
|
||||||
|
let cache = builder.new_cache(tempdir.into_path(), 0);
|
||||||
|
let c_dag = progpow::generate_cdag(cache.as_ref());
|
||||||
|
|
||||||
|
let h = FromHex::from_hex("c9149cc0386e689d789a1c2f3d5d169a61a6218ed30e74414dc736e442ef3d1f").unwrap();
|
||||||
|
let mut hash = [0; 32];
|
||||||
|
hash.copy_from_slice(&h);
|
||||||
|
|
||||||
|
c.bench_function("progpow_optimal_light", move |b| {
|
||||||
|
b.iter(|| {
|
||||||
|
progpow::progpow(
|
||||||
|
hash,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
cache.as_ref(),
|
||||||
|
&c_dag,
|
||||||
|
);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn bench_keccak_f800_long(c: &mut Criterion) {
|
||||||
|
c.bench_function("keccak_f800_long(0, 0, 0)", |b| {
|
||||||
|
b.iter(|| progpow::keccak_f800_long([0; 32], 0, [0; 8]))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
criterion_group!(benches,
|
||||||
|
bench_hashimoto_light,
|
||||||
|
bench_progpow_light,
|
||||||
|
bench_progpow_optimal_light,
|
||||||
|
bench_keccak_f800_long,
|
||||||
|
);
|
||||||
|
criterion_main!(benches);
|
||||||
86
ethash/res/progpow_testvectors.json
Normal file
86
ethash/res/progpow_testvectors.json
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
[
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"0000000000000000",
|
||||||
|
"f4ac202715ded4136e72887c39e63a4738331c57fd9eb79f6ec421c281aa8743",
|
||||||
|
"b3bad9ca6f7c566cf0377d1f8cce29d6516a96562c122d924626281ec948ef02"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
49,
|
||||||
|
"b3bad9ca6f7c566cf0377d1f8cce29d6516a96562c122d924626281ec948ef02",
|
||||||
|
"0000000006ff2c47",
|
||||||
|
"7730596f128f675ef9a6bb7281f268e4077d302f2b9078da1ece4349248561dd",
|
||||||
|
"0b9ed0c11157f1365143e329a6e1cea4248d9d6cb44b9c6daf492c7a076654a4"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
50,
|
||||||
|
"0b9ed0c11157f1365143e329a6e1cea4248d9d6cb44b9c6daf492c7a076654a4",
|
||||||
|
"00000000076e482e",
|
||||||
|
"829136d4a704eb8d06da773f1a90466e7b5ed12119c44526f045bbff4475d891",
|
||||||
|
"e2e881c5b893c2f1ef06b96a10cfcbcf7255b307f0818e7d30eb12b2edfc237b"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
99,
|
||||||
|
"e2e881c5b893c2f1ef06b96a10cfcbcf7255b307f0818e7d30eb12b2edfc237b",
|
||||||
|
"000000003917afab",
|
||||||
|
"deb3d8b45bdc596c56aa37a5eba456f478c82e60e5c028ce95f2e654e4bb7b57",
|
||||||
|
"9bdc2ad2286eaa051d6ca1f5196d2dd1c9a039f1d7ce3e1c856b793deed01778"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
29950,
|
||||||
|
"9bdc2ad2286eaa051d6ca1f5196d2dd1c9a039f1d7ce3e1c856b793deed01778",
|
||||||
|
"005d409dbc23a62a",
|
||||||
|
"c01e6d339cc687c77f653b81c74cb9de8b595554f2c5db671a7dde3846d2fa01",
|
||||||
|
"de0d693e597cf2fd70a4cfaa73f6baafc29e1eee695a81295b278c1116580b72"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
29999,
|
||||||
|
"de0d693e597cf2fd70a4cfaa73f6baafc29e1eee695a81295b278c1116580b72",
|
||||||
|
"005db5fa4c2a3d03",
|
||||||
|
"8b664cdbf396a7a185446c93dddd6611f5a736b11097381ae6bea45e802cec16",
|
||||||
|
"21ec5d1984a4fd4394b042aa96365085225d964727a45def245ceab326e28128"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
30000,
|
||||||
|
"21ec5d1984a4fd4394b042aa96365085225d964727a45def245ceab326e28128",
|
||||||
|
"005db8607994ff30",
|
||||||
|
"276951d89c1ed262bcac00df4fb9bf7af36991532744a2e287b0b758a56e15aa",
|
||||||
|
"dc070b76cc311cd82267f98936acbbbd3ec1c1ab25b55e2c885af6474e1e6841"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
30049,
|
||||||
|
"dc070b76cc311cd82267f98936acbbbd3ec1c1ab25b55e2c885af6474e1e6841",
|
||||||
|
"005e2e215a8ca2e7",
|
||||||
|
"6248ba0157d0f0592dacfe2963337948fffb37f67e7451a6862c1321d894cebe",
|
||||||
|
"6fdecf719e2547f585a6ee807d8237db8e9489f63d3f259ab5236451eaded433"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
30050,
|
||||||
|
"6fdecf719e2547f585a6ee807d8237db8e9489f63d3f259ab5236451eaded433",
|
||||||
|
"005e30899481055e",
|
||||||
|
"512d8f2bb0441fcfa1764c67e8dbed2afcbe9141de4bbebc5b51e0661dede550",
|
||||||
|
"cb1587a1c372642cbd9ce4c1ba2f433985d44c571a676a032bc1e8c1ad066e24"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
30099,
|
||||||
|
"cb1587a1c372642cbd9ce4c1ba2f433985d44c571a676a032bc1e8c1ad066e24",
|
||||||
|
"005ea6aef136f88b",
|
||||||
|
"be0e7d6afa6edd483ccc304afa9bf0abaca5e0f037a4f05bf5550b9309d1d12c",
|
||||||
|
"78be18f20569a834d839dad48e0e51d6df6b6537575f0ad29898c7cf357f12cb"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
59950,
|
||||||
|
"78be18f20569a834d839dad48e0e51d6df6b6537575f0ad29898c7cf357f12cb",
|
||||||
|
"02ebe0503bd7b1da",
|
||||||
|
"b85be51fce670aa437f28c02ea4fd7995fa8b6ac224e959b8dbfb5bdbc6f77ce",
|
||||||
|
"a68a620ba17e0cf2817bc4397cf4b85f5770983aa7b7931319a7f61bd6f905b1"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
59999,
|
||||||
|
"a68a620ba17e0cf2817bc4397cf4b85f5770983aa7b7931319a7f61bd6f905b1",
|
||||||
|
"02edb6275bd221e3",
|
||||||
|
"ffe745a932c21c0704291bb416fe8bffec76621cd3434861885beab42cec1734",
|
||||||
|
"9e6667a151ac6f5186a05cb20877a2b3df02317046256a762cb8ec2d96aa34f0"
|
||||||
|
]
|
||||||
|
]
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use compute::Light;
|
use compute::Light;
|
||||||
use either::Either;
|
use either::Either;
|
||||||
@@ -21,7 +21,7 @@ use memmap::MmapMut;
|
|||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use seed_compute::SeedHashCompute;
|
use seed_compute::SeedHashCompute;
|
||||||
|
|
||||||
use shared::{ETHASH_CACHE_ROUNDS, NODE_BYTES, NODE_DWORDS, Node, epoch, get_cache_size, to_hex};
|
use shared::{ETHASH_CACHE_ROUNDS, NODE_BYTES, Node, epoch, get_cache_size, to_hex};
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
@@ -30,20 +30,10 @@ use std::path::{Path, PathBuf};
|
|||||||
use std::slice;
|
use std::slice;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use common_types::engines::OptimizeFor;
|
||||||
|
|
||||||
type Cache = Either<Vec<Node>, MmapMut>;
|
type Cache = Either<Vec<Node>, MmapMut>;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
|
|
||||||
pub enum OptimizeFor {
|
|
||||||
Cpu,
|
|
||||||
Memory,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for OptimizeFor {
|
|
||||||
fn default() -> Self {
|
|
||||||
OptimizeFor::Cpu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn byte_size(cache: &Cache) -> usize {
|
fn byte_size(cache: &Cache) -> usize {
|
||||||
use self::Either::{Left, Right};
|
use self::Either::{Left, Right};
|
||||||
|
|
||||||
@@ -69,6 +59,7 @@ pub struct NodeCacheBuilder {
|
|||||||
// TODO: Remove this locking and just use an `Rc`?
|
// TODO: Remove this locking and just use an `Rc`?
|
||||||
seedhash: Arc<Mutex<SeedHashCompute>>,
|
seedhash: Arc<Mutex<SeedHashCompute>>,
|
||||||
optimize_for: OptimizeFor,
|
optimize_for: OptimizeFor,
|
||||||
|
progpow_transition: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Abstract the "optimize for" logic
|
// TODO: Abstract the "optimize for" logic
|
||||||
@@ -82,17 +73,18 @@ pub struct NodeCache {
|
|||||||
|
|
||||||
impl NodeCacheBuilder {
|
impl NodeCacheBuilder {
|
||||||
pub fn light(&self, cache_dir: &Path, block_number: u64) -> Light {
|
pub fn light(&self, cache_dir: &Path, block_number: u64) -> Light {
|
||||||
Light::new_with_builder(self, cache_dir, block_number)
|
Light::new_with_builder(self, cache_dir, block_number, self.progpow_transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn light_from_file(&self, cache_dir: &Path, block_number: u64) -> io::Result<Light> {
|
pub fn light_from_file(&self, cache_dir: &Path, block_number: u64) -> io::Result<Light> {
|
||||||
Light::from_file_with_builder(self, cache_dir, block_number)
|
Light::from_file_with_builder(self, cache_dir, block_number, self.progpow_transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new<T: Into<Option<OptimizeFor>>>(optimize_for: T) -> Self {
|
pub fn new<T: Into<Option<OptimizeFor>>>(optimize_for: T, progpow_transition: u64) -> Self {
|
||||||
NodeCacheBuilder {
|
NodeCacheBuilder {
|
||||||
seedhash: Arc::new(Mutex::new(SeedHashCompute::default())),
|
seedhash: Arc::new(Mutex::new(SeedHashCompute::default())),
|
||||||
optimize_for: optimize_for.into().unwrap_or_default(),
|
optimize_for: optimize_for.into().unwrap_or_default(),
|
||||||
|
progpow_transition
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,11 +317,6 @@ unsafe fn initialize_memory(memory: *mut Node, num_nodes: usize, ident: &H256) {
|
|||||||
// Now this is initialized, we can treat it as a slice.
|
// Now this is initialized, we can treat it as a slice.
|
||||||
let nodes: &mut [Node] = slice::from_raw_parts_mut(memory, num_nodes);
|
let nodes: &mut [Node] = slice::from_raw_parts_mut(memory, num_nodes);
|
||||||
|
|
||||||
// For `unroll!`, see below. If the literal in `unroll!` is not the same as the RHS here then
|
|
||||||
// these have got out of sync! Don't let this happen!
|
|
||||||
debug_assert_eq!(NODE_DWORDS, 8);
|
|
||||||
|
|
||||||
// This _should_ get unrolled by the compiler, since it's not using the loop variable.
|
|
||||||
for _ in 0..ETHASH_CACHE_ROUNDS {
|
for _ in 0..ETHASH_CACHE_ROUNDS {
|
||||||
for i in 0..num_nodes {
|
for i in 0..num_nodes {
|
||||||
let data_idx = (num_nodes - 1 + i) % num_nodes;
|
let data_idx = (num_nodes - 1 + i) % num_nodes;
|
||||||
@@ -339,11 +326,8 @@ unsafe fn initialize_memory(memory: *mut Node, num_nodes: usize, ident: &H256) {
|
|||||||
let mut data: Node = nodes.get_unchecked(data_idx).clone();
|
let mut data: Node = nodes.get_unchecked(data_idx).clone();
|
||||||
let rhs: &Node = nodes.get_unchecked(idx);
|
let rhs: &Node = nodes.get_unchecked(idx);
|
||||||
|
|
||||||
unroll! {
|
for (a, b) in data.as_dwords_mut().iter_mut().zip(rhs.as_dwords()) {
|
||||||
for w in 0..8 {
|
*a ^= *b;
|
||||||
*data.as_dwords_mut().get_unchecked_mut(w) ^=
|
|
||||||
*rhs.as_dwords().get_unchecked(w);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data
|
data
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//! Ethash implementation
|
//! Ethash implementation
|
||||||
//! See https://github.com/ethereum/wiki/wiki/Ethash
|
//! See https://github.com/ethereum/wiki/wiki/Ethash
|
||||||
@@ -21,16 +21,17 @@
|
|||||||
|
|
||||||
use keccak::{keccak_512, keccak_256, H256};
|
use keccak::{keccak_512, keccak_256, H256};
|
||||||
use cache::{NodeCache, NodeCacheBuilder};
|
use cache::{NodeCache, NodeCacheBuilder};
|
||||||
|
use progpow::{CDag, generate_cdag, progpow, keccak_f800_short, keccak_f800_long};
|
||||||
use seed_compute::SeedHashCompute;
|
use seed_compute::SeedHashCompute;
|
||||||
use shared::*;
|
use shared::*;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use std::{mem, ptr};
|
use std::mem;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
const MIX_WORDS: usize = ETHASH_MIX_BYTES / 4;
|
const MIX_WORDS: usize = ETHASH_MIX_BYTES / 4;
|
||||||
const MIX_NODES: usize = MIX_WORDS / NODE_WORDS;
|
const MIX_NODES: usize = MIX_WORDS / NODE_WORDS;
|
||||||
const FNV_PRIME: u32 = 0x01000193;
|
pub const FNV_PRIME: u32 = 0x01000193;
|
||||||
|
|
||||||
/// Computation result
|
/// Computation result
|
||||||
pub struct ProofOfWork {
|
pub struct ProofOfWork {
|
||||||
@@ -40,9 +41,15 @@ pub struct ProofOfWork {
|
|||||||
pub mix_hash: H256,
|
pub mix_hash: H256,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum Algorithm {
|
||||||
|
Hashimoto,
|
||||||
|
Progpow(Box<CDag>),
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Light {
|
pub struct Light {
|
||||||
block_number: u64,
|
block_number: u64,
|
||||||
cache: NodeCache,
|
cache: NodeCache,
|
||||||
|
algorithm: Algorithm,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Light cache structure
|
/// Light cache structure
|
||||||
@@ -51,32 +58,55 @@ impl Light {
|
|||||||
builder: &NodeCacheBuilder,
|
builder: &NodeCacheBuilder,
|
||||||
cache_dir: &Path,
|
cache_dir: &Path,
|
||||||
block_number: u64,
|
block_number: u64,
|
||||||
|
progpow_transition: u64,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let cache = builder.new_cache(cache_dir.to_path_buf(), block_number);
|
let cache = builder.new_cache(cache_dir.to_path_buf(), block_number);
|
||||||
|
|
||||||
Light {
|
let algorithm = if block_number >= progpow_transition {
|
||||||
block_number: block_number,
|
Algorithm::Progpow(Box::new(generate_cdag(cache.as_ref())))
|
||||||
cache: cache,
|
} else {
|
||||||
}
|
Algorithm::Hashimoto
|
||||||
|
};
|
||||||
|
|
||||||
|
Light { block_number, cache, algorithm }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Calculate the light boundary data
|
/// Calculate the light boundary data
|
||||||
/// `header_hash` - The header hash to pack into the mix
|
/// `header_hash` - The header hash to pack into the mix
|
||||||
/// `nonce` - The nonce to pack into the mix
|
/// `nonce` - The nonce to pack into the mix
|
||||||
pub fn compute(&self, header_hash: &H256, nonce: u64) -> ProofOfWork {
|
pub fn compute(&self, header_hash: &H256, nonce: u64, block_number: u64) -> ProofOfWork {
|
||||||
light_compute(self, header_hash, nonce)
|
match self.algorithm {
|
||||||
|
Algorithm::Progpow(ref c_dag) => {
|
||||||
|
let (value, mix_hash) = progpow(
|
||||||
|
*header_hash,
|
||||||
|
nonce,
|
||||||
|
block_number,
|
||||||
|
self.cache.as_ref(),
|
||||||
|
c_dag,
|
||||||
|
);
|
||||||
|
|
||||||
|
ProofOfWork { value, mix_hash }
|
||||||
|
},
|
||||||
|
Algorithm::Hashimoto => light_compute(self, header_hash, nonce),
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_file_with_builder(
|
pub fn from_file_with_builder(
|
||||||
builder: &NodeCacheBuilder,
|
builder: &NodeCacheBuilder,
|
||||||
cache_dir: &Path,
|
cache_dir: &Path,
|
||||||
block_number: u64,
|
block_number: u64,
|
||||||
|
progpow_transition: u64,
|
||||||
) -> io::Result<Self> {
|
) -> io::Result<Self> {
|
||||||
let cache = builder.from_file(cache_dir.to_path_buf(), block_number)?;
|
let cache = builder.from_file(cache_dir.to_path_buf(), block_number)?;
|
||||||
Ok(Light {
|
|
||||||
block_number: block_number,
|
let algorithm = if block_number >= progpow_transition {
|
||||||
cache: cache,
|
Algorithm::Progpow(Box::new(generate_cdag(cache.as_ref())))
|
||||||
})
|
} else {
|
||||||
|
Algorithm::Hashimoto
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(Light { block_number, cache, algorithm })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_file(&mut self) -> io::Result<&Path> {
|
pub fn to_file(&mut self) -> io::Result<&Path> {
|
||||||
@@ -99,27 +129,26 @@ fn fnv_hash(x: u32, y: u32) -> u32 {
|
|||||||
/// `nonce` The block's nonce
|
/// `nonce` The block's nonce
|
||||||
/// `mix_hash` The mix digest hash
|
/// `mix_hash` The mix digest hash
|
||||||
/// Boundary recovered from mix hash
|
/// Boundary recovered from mix hash
|
||||||
pub fn quick_get_difficulty(header_hash: &H256, nonce: u64, mix_hash: &H256) -> H256 {
|
pub fn quick_get_difficulty(header_hash: &H256, nonce: u64, mix_hash: &H256, progpow: bool) -> H256 {
|
||||||
unsafe {
|
unsafe {
|
||||||
// This is safe - the `keccak_512` call below reads the first 40 bytes (which we explicitly set
|
if progpow {
|
||||||
// with two `copy_nonoverlapping` calls) but writes the first 64, and then we explicitly write
|
let seed = keccak_f800_short(*header_hash, nonce, [0u32; 8]);
|
||||||
// the next 32 bytes before we read the whole thing with `keccak_256`.
|
keccak_f800_long(*header_hash, seed, mem::transmute(*mix_hash))
|
||||||
//
|
} else {
|
||||||
// This cannot be elided by the compiler as it doesn't know the implementation of
|
let mut buf = [0u8; 64 + 32];
|
||||||
// `keccak_512`.
|
|
||||||
let mut buf: [u8; 64 + 32] = mem::uninitialized();
|
|
||||||
|
|
||||||
ptr::copy_nonoverlapping(header_hash.as_ptr(), buf.as_mut_ptr(), 32);
|
let hash_len = header_hash.len();
|
||||||
ptr::copy_nonoverlapping(&nonce as *const u64 as *const u8, buf[32..].as_mut_ptr(), 8);
|
buf[..hash_len].copy_from_slice(header_hash);
|
||||||
|
buf[hash_len..hash_len + mem::size_of::<u64>()].copy_from_slice(&nonce.to_ne_bytes());
|
||||||
|
|
||||||
keccak_512::unchecked(buf.as_mut_ptr(), 64, buf.as_ptr(), 40);
|
keccak_512::unchecked(buf.as_mut_ptr(), 64, buf.as_ptr(), 40);
|
||||||
ptr::copy_nonoverlapping(mix_hash.as_ptr(), buf[64..].as_mut_ptr(), 32);
|
buf[64..].copy_from_slice(mix_hash);
|
||||||
|
|
||||||
// This is initialized in `keccak_256`
|
let mut hash = [0u8; 32];
|
||||||
let mut hash: [u8; 32] = mem::uninitialized();
|
keccak_256::unchecked(hash.as_mut_ptr(), hash.len(), buf.as_ptr(), buf.len());
|
||||||
keccak_256::unchecked(hash.as_mut_ptr(), hash.len(), buf.as_ptr(), buf.len());
|
|
||||||
|
|
||||||
hash
|
hash
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,17 +199,11 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
|
|||||||
let mut buf: MixBuf = MixBuf {
|
let mut buf: MixBuf = MixBuf {
|
||||||
half_mix: unsafe {
|
half_mix: unsafe {
|
||||||
// Pack `header_hash` and `nonce` together
|
// Pack `header_hash` and `nonce` together
|
||||||
// We explicitly write the first 40 bytes, leaving the last 24 as uninitialized. Then
|
let mut out = [0u8; NODE_BYTES];
|
||||||
// `keccak_512` reads the first 40 bytes (4th parameter) and overwrites the entire array,
|
|
||||||
// leaving it fully initialized.
|
|
||||||
let mut out: [u8; NODE_BYTES] = mem::uninitialized();
|
|
||||||
|
|
||||||
ptr::copy_nonoverlapping(header_hash.as_ptr(), out.as_mut_ptr(), header_hash.len());
|
let hash_len = header_hash.len();
|
||||||
ptr::copy_nonoverlapping(
|
out[..hash_len].copy_from_slice(header_hash);
|
||||||
&nonce as *const u64 as *const u8,
|
out[hash_len..hash_len + mem::size_of::<u64>()].copy_from_slice(&nonce.to_ne_bytes());
|
||||||
out[header_hash.len()..].as_mut_ptr(),
|
|
||||||
mem::size_of::<u64>(),
|
|
||||||
);
|
|
||||||
|
|
||||||
// compute keccak-512 hash and replicate across mix
|
// compute keccak-512 hash and replicate across mix
|
||||||
keccak_512::unchecked(
|
keccak_512::unchecked(
|
||||||
@@ -192,8 +215,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
|
|||||||
|
|
||||||
Node { bytes: out }
|
Node { bytes: out }
|
||||||
},
|
},
|
||||||
// This is fully initialized before being read, see `let mut compress = ...` below
|
compress_bytes: [0u8; MIX_WORDS],
|
||||||
compress_bytes: unsafe { mem::uninitialized() },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut mix: [_; MIX_NODES] = [buf.half_mix.clone(), buf.half_mix.clone()];
|
let mut mix: [_; MIX_NODES] = [buf.half_mix.clone(), buf.half_mix.clone()];
|
||||||
@@ -217,24 +239,16 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
|
|||||||
fnv_hash(first_val ^ i, mix_words[i as usize % MIX_WORDS]) % num_full_pages
|
fnv_hash(first_val ^ i, mix_words[i as usize % MIX_WORDS]) % num_full_pages
|
||||||
};
|
};
|
||||||
|
|
||||||
unroll! {
|
// MIX_NODES
|
||||||
// MIX_NODES
|
for n in 0..2 {
|
||||||
for n in 0..2 {
|
let tmp_node = calculate_dag_item(
|
||||||
let tmp_node = calculate_dag_item(
|
index * MIX_NODES as u32 + n as u32,
|
||||||
index * MIX_NODES as u32 + n as u32,
|
cache,
|
||||||
cache,
|
);
|
||||||
);
|
|
||||||
|
|
||||||
unroll! {
|
// NODE_WORDS
|
||||||
// NODE_WORDS
|
for (a, b) in mix[n].as_words_mut().iter_mut().zip(tmp_node.as_words()) {
|
||||||
for w in 0..16 {
|
*a = fnv_hash(*a, *b);
|
||||||
mix[n].as_words_mut()[w] =
|
|
||||||
fnv_hash(
|
|
||||||
mix[n].as_words()[w],
|
|
||||||
tmp_node.as_words()[w],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,25 +256,27 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
|
|||||||
let mix_words: [u32; MIX_WORDS] = unsafe { mem::transmute(mix) };
|
let mix_words: [u32; MIX_WORDS] = unsafe { mem::transmute(mix) };
|
||||||
|
|
||||||
{
|
{
|
||||||
// This is an uninitialized buffer to begin with, but we iterate precisely `compress.len()`
|
// We iterate precisely `compress.len()` times and set each index,
|
||||||
// times and set each index, leaving the array fully initialized. THIS ONLY WORKS ON LITTLE-
|
// leaving the array fully initialized. THIS ONLY WORKS ON LITTLE-ENDIAN MACHINES.
|
||||||
// ENDIAN MACHINES. See a future PR to make this and the rest of the code work correctly on
|
// See a future PR to make this and the rest of the code work correctly on
|
||||||
// big-endian arches like mips.
|
// big-endian arches like mips.
|
||||||
let compress: &mut [u32; MIX_WORDS / 4] =
|
let compress: &mut [u32; MIX_WORDS / 4] =
|
||||||
unsafe { make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes) };
|
unsafe { make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes) };
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
{
|
||||||
|
compile_error!("parity-ethereum currently only supports little-endian targets");
|
||||||
|
}
|
||||||
|
|
||||||
// Compress mix
|
// Compress mix
|
||||||
debug_assert_eq!(MIX_WORDS / 4, 8);
|
debug_assert_eq!(MIX_WORDS / 4, 8);
|
||||||
unroll! {
|
for i in 0..8 {
|
||||||
for i in 0..8 {
|
let w = i * 4;
|
||||||
let w = i * 4;
|
|
||||||
|
|
||||||
let mut reduction = mix_words[w + 0];
|
let mut reduction = mix_words[w + 0];
|
||||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 1];
|
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 1];
|
||||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 2];
|
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 2];
|
||||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 3];
|
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 3];
|
||||||
compress[i] = reduction;
|
compress[i] = reduction;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,7 +288,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
|
|||||||
// We overwrite the second half since `keccak_256` has an internal buffer and so allows
|
// We overwrite the second half since `keccak_256` has an internal buffer and so allows
|
||||||
// overlapping arrays as input.
|
// overlapping arrays as input.
|
||||||
let write_ptr: *mut u8 = &mut buf.compress_bytes as *mut [u8; 32] as *mut u8;
|
let write_ptr: *mut u8 = &mut buf.compress_bytes as *mut [u8; 32] as *mut u8;
|
||||||
unsafe {
|
unsafe {
|
||||||
keccak_256::unchecked(
|
keccak_256::unchecked(
|
||||||
write_ptr,
|
write_ptr,
|
||||||
buf.compress_bytes.len(),
|
buf.compress_bytes.len(),
|
||||||
@@ -286,8 +302,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
|
|||||||
ProofOfWork { mix_hash: mix_hash, value: value }
|
ProofOfWork { mix_hash: mix_hash, value: value }
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Use the `simd` crate
|
pub fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node {
|
||||||
fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node {
|
|
||||||
let num_parent_nodes = cache.len();
|
let num_parent_nodes = cache.len();
|
||||||
let mut ret = cache[node_index as usize % num_parent_nodes].clone();
|
let mut ret = cache[node_index as usize % num_parent_nodes].clone();
|
||||||
ret.as_words_mut()[0] ^= node_index;
|
ret.as_words_mut()[0] ^= node_index;
|
||||||
@@ -300,10 +315,8 @@ fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node {
|
|||||||
num_parent_nodes as u32;
|
num_parent_nodes as u32;
|
||||||
let parent = &cache[parent_index as usize];
|
let parent = &cache[parent_index as usize];
|
||||||
|
|
||||||
unroll! {
|
for (a, b) in ret.as_words_mut().iter_mut().zip(parent.as_words()) {
|
||||||
for w in 0..16 {
|
*a = fnv_hash(*a, *b);
|
||||||
ret.as_words_mut()[w] = fnv_hash(ret.as_words()[w], parent.as_words()[w]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,13 +374,13 @@ mod test {
|
|||||||
0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a,
|
0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a,
|
||||||
0xe9, 0x7e, 0x53, 0x84,
|
0xe9, 0x7e, 0x53, 0x84,
|
||||||
];
|
];
|
||||||
assert_eq!(quick_get_difficulty(&hash, nonce, &mix_hash)[..], boundary_good[..]);
|
assert_eq!(quick_get_difficulty(&hash, nonce, &mix_hash, false)[..], boundary_good[..]);
|
||||||
let boundary_bad = [
|
let boundary_bad = [
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3a, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3a, 0x9b, 0x6c, 0x69, 0xbc, 0x2c, 0xe2, 0xa2,
|
||||||
0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a,
|
0x4a, 0x8e, 0x95, 0x69, 0xef, 0xc7, 0xd7, 0x1b, 0x33, 0x35, 0xdf, 0x36, 0x8c, 0x9a,
|
||||||
0xe9, 0x7e, 0x53, 0x84,
|
0xe9, 0x7e, 0x53, 0x84,
|
||||||
];
|
];
|
||||||
assert!(quick_get_difficulty(&hash, nonce, &mix_hash)[..] != boundary_bad[..]);
|
assert!(quick_get_difficulty(&hash, nonce, &mix_hash, false)[..] != boundary_bad[..]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -391,7 +404,7 @@ mod test {
|
|||||||
|
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
// difficulty = 0x085657254bd9u64;
|
// difficulty = 0x085657254bd9u64;
|
||||||
let light = NodeCacheBuilder::new(None).light(tempdir.path(), 486382);
|
let light = NodeCacheBuilder::new(None, u64::max_value()).light(tempdir.path(), 486382);
|
||||||
let result = light_compute(&light, &hash, nonce);
|
let result = light_compute(&light, &hash, nonce);
|
||||||
assert_eq!(result.mix_hash[..], mix_hash[..]);
|
assert_eq!(result.mix_hash[..], mix_hash[..]);
|
||||||
assert_eq!(result.value[..], boundary[..]);
|
assert_eq!(result.value[..], boundary[..]);
|
||||||
@@ -400,7 +413,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_drop_old_data() {
|
fn test_drop_old_data() {
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let builder = NodeCacheBuilder::new(None);
|
let builder = NodeCacheBuilder::new(None, u64::max_value());
|
||||||
let first = builder.light(tempdir.path(), 0).to_file().unwrap().to_owned();
|
let first = builder.light(tempdir.path(), 0).to_file().unwrap().to_owned();
|
||||||
|
|
||||||
let second = builder.light(tempdir.path(), ETHASH_EPOCH_LENGTH).to_file().unwrap().to_owned();
|
let second = builder.light(tempdir.path(), ETHASH_EPOCH_LENGTH).to_file().unwrap().to_owned();
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
extern crate keccak_hash as hash;
|
extern crate keccak_hash as hash;
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,72 @@
|
|||||||
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
||||||
// This file is part of Parity.
|
// This file is part of Parity Ethereum.
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#![cfg_attr(feature = "benches", feature(test))]
|
|
||||||
|
|
||||||
|
extern crate common_types;
|
||||||
extern crate either;
|
extern crate either;
|
||||||
extern crate ethereum_types;
|
extern crate ethereum_types;
|
||||||
extern crate memmap;
|
extern crate memmap;
|
||||||
extern crate parking_lot;
|
extern crate parking_lot;
|
||||||
extern crate primal;
|
extern crate primal;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate crunchy;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate static_assertions;
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
extern crate rustc_hex;
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
extern crate serde_json;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
extern crate tempdir;
|
extern crate tempdir;
|
||||||
|
|
||||||
|
#[cfg(feature = "bench")]
|
||||||
|
pub mod compute;
|
||||||
|
#[cfg(not(feature = "bench"))]
|
||||||
mod compute;
|
mod compute;
|
||||||
|
|
||||||
mod seed_compute;
|
mod seed_compute;
|
||||||
mod cache;
|
mod cache;
|
||||||
|
#[cfg(feature = "bench")]
|
||||||
|
pub mod keccak;
|
||||||
|
#[cfg(not(feature = "bench"))]
|
||||||
mod keccak;
|
mod keccak;
|
||||||
mod shared;
|
mod shared;
|
||||||
|
|
||||||
pub use cache::{NodeCacheBuilder, OptimizeFor};
|
#[cfg(feature = "bench")]
|
||||||
|
pub mod progpow;
|
||||||
|
#[cfg(not(feature = "bench"))]
|
||||||
|
mod progpow;
|
||||||
|
|
||||||
|
pub use cache::NodeCacheBuilder;
|
||||||
pub use compute::{ProofOfWork, quick_get_difficulty, slow_hash_block_number};
|
pub use compute::{ProofOfWork, quick_get_difficulty, slow_hash_block_number};
|
||||||
use compute::Light;
|
|
||||||
use ethereum_types::{U256, U512};
|
|
||||||
use keccak::H256;
|
|
||||||
use parking_lot::Mutex;
|
|
||||||
pub use seed_compute::SeedHashCompute;
|
pub use seed_compute::SeedHashCompute;
|
||||||
pub use shared::ETHASH_EPOCH_LENGTH;
|
pub use shared::ETHASH_EPOCH_LENGTH;
|
||||||
|
|
||||||
|
use common_types::engines::OptimizeFor;
|
||||||
|
use compute::Light;
|
||||||
|
use ethereum_types::{BigEndianHash, U256, U512};
|
||||||
|
use keccak::H256;
|
||||||
|
use parking_lot::Mutex;
|
||||||
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
use std::convert::TryFrom;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
struct LightCache {
|
struct LightCache {
|
||||||
@@ -61,14 +81,16 @@ pub struct EthashManager {
|
|||||||
nodecache_builder: NodeCacheBuilder,
|
nodecache_builder: NodeCacheBuilder,
|
||||||
cache: Mutex<LightCache>,
|
cache: Mutex<LightCache>,
|
||||||
cache_dir: PathBuf,
|
cache_dir: PathBuf,
|
||||||
|
progpow_transition: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EthashManager {
|
impl EthashManager {
|
||||||
/// Create a new new instance of ethash manager
|
/// Create a new new instance of ethash manager
|
||||||
pub fn new<T: Into<Option<OptimizeFor>>>(cache_dir: &Path, optimize_for: T) -> EthashManager {
|
pub fn new<T: Into<Option<OptimizeFor>>>(cache_dir: &Path, optimize_for: T, progpow_transition: u64) -> EthashManager {
|
||||||
EthashManager {
|
EthashManager {
|
||||||
cache_dir: cache_dir.to_path_buf(),
|
cache_dir: cache_dir.to_path_buf(),
|
||||||
nodecache_builder: NodeCacheBuilder::new(optimize_for.into().unwrap_or_default()),
|
nodecache_builder: NodeCacheBuilder::new(optimize_for.into().unwrap_or_default(), progpow_transition),
|
||||||
|
progpow_transition,
|
||||||
cache: Mutex::new(LightCache {
|
cache: Mutex::new(LightCache {
|
||||||
recent_epoch: None,
|
recent_epoch: None,
|
||||||
recent: None,
|
recent: None,
|
||||||
@@ -87,27 +109,33 @@ impl EthashManager {
|
|||||||
let epoch = block_number / ETHASH_EPOCH_LENGTH;
|
let epoch = block_number / ETHASH_EPOCH_LENGTH;
|
||||||
let light = {
|
let light = {
|
||||||
let mut lights = self.cache.lock();
|
let mut lights = self.cache.lock();
|
||||||
let light = match lights.recent_epoch.clone() {
|
let light = if block_number == self.progpow_transition {
|
||||||
Some(ref e) if *e == epoch => lights.recent.clone(),
|
// we need to regenerate the cache to trigger algorithm change to progpow inside `Light`
|
||||||
_ => match lights.prev_epoch.clone() {
|
None
|
||||||
Some(e) if e == epoch => {
|
} else {
|
||||||
// don't swap if recent is newer.
|
match lights.recent_epoch.clone() {
|
||||||
if lights.recent_epoch > lights.prev_epoch {
|
Some(ref e) if *e == epoch => lights.recent.clone(),
|
||||||
None
|
_ => match lights.prev_epoch.clone() {
|
||||||
} else {
|
Some(e) if e == epoch => {
|
||||||
// swap
|
// don't swap if recent is newer.
|
||||||
let t = lights.prev_epoch;
|
if lights.recent_epoch > lights.prev_epoch {
|
||||||
lights.prev_epoch = lights.recent_epoch;
|
None
|
||||||
lights.recent_epoch = t;
|
} else {
|
||||||
let t = lights.prev.clone();
|
// swap
|
||||||
lights.prev = lights.recent.clone();
|
let t = lights.prev_epoch;
|
||||||
lights.recent = t;
|
lights.prev_epoch = lights.recent_epoch;
|
||||||
lights.recent.clone()
|
lights.recent_epoch = t;
|
||||||
|
let t = lights.prev.clone();
|
||||||
|
lights.prev = lights.recent.clone();
|
||||||
|
lights.recent = t;
|
||||||
|
lights.recent.clone()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
_ => None,
|
||||||
_ => None,
|
},
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
match light {
|
match light {
|
||||||
None => {
|
None => {
|
||||||
let light = match self.nodecache_builder.light_from_file(
|
let light = match self.nodecache_builder.light_from_file(
|
||||||
@@ -134,18 +162,18 @@ impl EthashManager {
|
|||||||
Some(light) => light,
|
Some(light) => light,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
light.compute(header_hash, nonce)
|
light.compute(header_hash, nonce, block_number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert an Ethash boundary to its original difficulty. Basically just `f(x) = 2^256 / x`.
|
/// Convert an Ethash boundary to its original difficulty. Basically just `f(x) = 2^256 / x`.
|
||||||
pub fn boundary_to_difficulty(boundary: ðereum_types::H256) -> U256 {
|
pub fn boundary_to_difficulty(boundary: ðereum_types::H256) -> U256 {
|
||||||
difficulty_to_boundary_aux(&**boundary)
|
difficulty_to_boundary_aux(&boundary.into_uint())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert an Ethash difficulty to the target boundary. Basically just `f(x) = 2^256 / x`.
|
/// Convert an Ethash difficulty to the target boundary. Basically just `f(x) = 2^256 / x`.
|
||||||
pub fn difficulty_to_boundary(difficulty: &U256) -> ethereum_types::H256 {
|
pub fn difficulty_to_boundary(difficulty: &U256) -> ethereum_types::H256 {
|
||||||
difficulty_to_boundary_aux(difficulty).into()
|
BigEndianHash::from_uint(&difficulty_to_boundary_aux(difficulty))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn difficulty_to_boundary_aux<T: Into<U512>>(difficulty: T) -> ethereum_types::U256 {
|
fn difficulty_to_boundary_aux<T: Into<U512>>(difficulty: T) -> ethereum_types::U256 {
|
||||||
@@ -156,8 +184,8 @@ fn difficulty_to_boundary_aux<T: Into<U512>>(difficulty: T) -> ethereum_types::U
|
|||||||
if difficulty == U512::one() {
|
if difficulty == U512::one() {
|
||||||
U256::max_value()
|
U256::max_value()
|
||||||
} else {
|
} else {
|
||||||
// difficulty > 1, so result should never overflow 256 bits
|
const PROOF: &str = "difficulty > 1, so result never overflows 256 bits; qed";
|
||||||
U256::from((U512::one() << 256) / difficulty)
|
U256::try_from((U512::one() << 256) / difficulty).expect(PROOF)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +194,7 @@ fn test_lru() {
|
|||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
|
|
||||||
let tempdir = TempDir::new("").unwrap();
|
let tempdir = TempDir::new("").unwrap();
|
||||||
let ethash = EthashManager::new(tempdir.path(), None);
|
let ethash = EthashManager::new(tempdir.path(), None, u64::max_value());
|
||||||
let hash = [0u8; 32];
|
let hash = [0u8; 32];
|
||||||
ethash.compute_light(1, &hash, 1);
|
ethash.compute_light(1, &hash, 1);
|
||||||
ethash.compute_light(50000, &hash, 1);
|
ethash.compute_light(50000, &hash, 1);
|
||||||
@@ -182,10 +210,10 @@ fn test_lru() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_difficulty_to_boundary() {
|
fn test_difficulty_to_boundary() {
|
||||||
use ethereum_types::H256;
|
use ethereum_types::{H256, BigEndianHash};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
assert_eq!(difficulty_to_boundary(&U256::from(1)), H256::from(U256::max_value()));
|
assert_eq!(difficulty_to_boundary(&U256::from(1)), BigEndianHash::from_uint(&U256::max_value()));
|
||||||
assert_eq!(difficulty_to_boundary(&U256::from(2)), H256::from_str("8000000000000000000000000000000000000000000000000000000000000000").unwrap());
|
assert_eq!(difficulty_to_boundary(&U256::from(2)), H256::from_str("8000000000000000000000000000000000000000000000000000000000000000").unwrap());
|
||||||
assert_eq!(difficulty_to_boundary(&U256::from(4)), H256::from_str("4000000000000000000000000000000000000000000000000000000000000000").unwrap());
|
assert_eq!(difficulty_to_boundary(&U256::from(4)), H256::from_str("4000000000000000000000000000000000000000000000000000000000000000").unwrap());
|
||||||
assert_eq!(difficulty_to_boundary(&U256::from(32)), H256::from_str("0800000000000000000000000000000000000000000000000000000000000000").unwrap());
|
assert_eq!(difficulty_to_boundary(&U256::from(32)), H256::from_str("0800000000000000000000000000000000000000000000000000000000000000").unwrap());
|
||||||
@@ -199,9 +227,18 @@ fn test_difficulty_to_boundary_regression() {
|
|||||||
// https://github.com/paritytech/parity-ethereum/issues/8397
|
// https://github.com/paritytech/parity-ethereum/issues/8397
|
||||||
for difficulty in 1..9 {
|
for difficulty in 1..9 {
|
||||||
assert_eq!(U256::from(difficulty), boundary_to_difficulty(&difficulty_to_boundary(&difficulty.into())));
|
assert_eq!(U256::from(difficulty), boundary_to_difficulty(&difficulty_to_boundary(&difficulty.into())));
|
||||||
assert_eq!(H256::from(difficulty), difficulty_to_boundary(&boundary_to_difficulty(&difficulty.into())));
|
assert_eq!(
|
||||||
assert_eq!(U256::from(difficulty), boundary_to_difficulty(&boundary_to_difficulty(&difficulty.into()).into()));
|
H256::from_low_u64_be(difficulty),
|
||||||
assert_eq!(H256::from(difficulty), difficulty_to_boundary(&difficulty_to_boundary(&difficulty.into()).into()));
|
difficulty_to_boundary(&boundary_to_difficulty(&H256::from_low_u64_be(difficulty))),
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
U256::from(difficulty),
|
||||||
|
boundary_to_difficulty(&BigEndianHash::from_uint(&boundary_to_difficulty(&H256::from_low_u64_be(difficulty)))),
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
H256::from_low_u64_be(difficulty),
|
||||||
|
difficulty_to_boundary(&difficulty_to_boundary(&difficulty.into()).into_uint()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,102 +251,5 @@ fn test_difficulty_to_boundary_panics_on_zero() {
|
|||||||
#[test]
|
#[test]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_boundary_to_difficulty_panics_on_zero() {
|
fn test_boundary_to_difficulty_panics_on_zero() {
|
||||||
boundary_to_difficulty(ðereum_types::H256::from(0));
|
boundary_to_difficulty(ðereum_types::H256::zero());
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "benches")]
|
|
||||||
mod benchmarks {
|
|
||||||
extern crate test;
|
|
||||||
|
|
||||||
use self::test::Bencher;
|
|
||||||
use cache::{NodeCacheBuilder, OptimizeFor};
|
|
||||||
use compute::{Light, light_compute};
|
|
||||||
|
|
||||||
const HASH: [u8; 32] = [0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe,
|
|
||||||
0xe4, 0x0a, 0xb3, 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f,
|
|
||||||
0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72];
|
|
||||||
const NONCE: u64 = 0xd7b3ac70a301a249;
|
|
||||||
|
|
||||||
#[bench]
|
|
||||||
fn bench_light_compute_memmap(b: &mut Bencher) {
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Memory);
|
|
||||||
let light = builder.light(&env::temp_dir(), 486382);
|
|
||||||
|
|
||||||
b.iter(|| light_compute(&light, &HASH, NONCE));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[bench]
|
|
||||||
fn bench_light_compute_memory(b: &mut Bencher) {
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu);
|
|
||||||
let light = builder.light(&env::temp_dir(), 486382);
|
|
||||||
|
|
||||||
b.iter(|| light_compute(&light, &HASH, NONCE));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[bench]
|
|
||||||
#[ignore]
|
|
||||||
fn bench_light_new_round_trip_memmap(b: &mut Bencher) {
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
b.iter(|| {
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Memory);
|
|
||||||
let light = builder.light(&env::temp_dir(), 486382);
|
|
||||||
light_compute(&light, &HASH, NONCE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[bench]
|
|
||||||
#[ignore]
|
|
||||||
fn bench_light_new_round_trip_memory(b: &mut Bencher) {
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
b.iter(|| {
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu);
|
|
||||||
let light = builder.light(&env::temp_dir(), 486382);
|
|
||||||
light_compute(&light, &HASH, NONCE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[bench]
|
|
||||||
fn bench_light_from_file_round_trip_memory(b: &mut Bencher) {
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
let dir = env::temp_dir();
|
|
||||||
let height = 486382;
|
|
||||||
{
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu);
|
|
||||||
let mut dummy = builder.light(&dir, height);
|
|
||||||
dummy.to_file().unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
b.iter(|| {
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Cpu);
|
|
||||||
let light = builder.light_from_file(&dir, 486382).unwrap();
|
|
||||||
light_compute(&light, &HASH, NONCE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[bench]
|
|
||||||
fn bench_light_from_file_round_trip_memmap(b: &mut Bencher) {
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
let dir = env::temp_dir();
|
|
||||||
let height = 486382;
|
|
||||||
|
|
||||||
{
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Memory);
|
|
||||||
let mut dummy = builder.light(&dir, height);
|
|
||||||
dummy.to_file().unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
b.iter(|| {
|
|
||||||
let builder = NodeCacheBuilder::new(OptimizeFor::Memory);
|
|
||||||
let light = builder.light_from_file(&dir, 486382).unwrap();
|
|
||||||
light_compute(&light, &HASH, NONCE);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user