mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-24 08:41:59 +00:00
Compare commits
733 Commits
jae/genera
...
v0.22.3
Author | SHA1 | Date | |
---|---|---|---|
|
2aa2b63cad | ||
|
17c924de7e | ||
|
ebe97d3956 | ||
|
9d81a74429 | ||
|
5ff65274b8 | ||
|
ac3b764b52 | ||
|
223095d12f | ||
|
af697d3c4a | ||
|
7c06a98b71 | ||
|
ce824d0b70 | ||
|
4de9d42e4c | ||
|
ce33914f70 | ||
|
1cd7d862fa | ||
|
22133ef97a | ||
|
0030a8e697 | ||
|
a19e857f2e | ||
|
9120fd5d14 | ||
|
523d29256e | ||
|
397d89e40b | ||
|
ed01638076 | ||
|
7b153bde31 | ||
|
f93798f72d | ||
|
8d2d94c1c0 | ||
|
bef04114ef | ||
|
0e85ae6179 | ||
|
539722c02d | ||
|
8544e18eaf | ||
|
379e5a15cc | ||
|
bd47ed989f | ||
|
d336cfe5d3 | ||
|
e54c0f804f | ||
|
79d6bd8ce0 | ||
|
14b6010240 | ||
|
2fa9962835 | ||
|
64bae01d00 | ||
|
e282b3d761 | ||
|
07747de305 | ||
|
030c782e6f | ||
|
1f215eb875 | ||
|
82a5e9604c | ||
|
962bb3f969 | ||
|
f7156afee3 | ||
|
bc010ab5fa | ||
|
0c393b5c62 | ||
|
cf9d63628b | ||
|
f9c39740cd | ||
|
59f624043c | ||
|
e786d3feca | ||
|
82a43593ab | ||
|
ccaad06eb5 | ||
|
5cfd8ebaa2 | ||
|
99e982669e | ||
|
48a1f6f9b3 | ||
|
e565e348d5 | ||
|
b242b15d40 | ||
|
c1aeb08e4b | ||
|
dda8b67f37 | ||
|
bff68abe04 | ||
|
19662ac8a1 | ||
|
fa05b03956 | ||
|
fcf8bd94c2 | ||
|
087d3e54d2 | ||
|
0821ccb603 | ||
|
7a61e8cf9d | ||
|
4c373a6e78 | ||
|
2f29aa9605 | ||
|
eb77f662f2 | ||
|
277e323d4a | ||
|
8e4b803161 | ||
|
5fb3955c93 | ||
|
26a7d757cb | ||
|
a42c58604d | ||
|
489f2525bd | ||
|
931b465a05 | ||
|
dfa9a9a30a | ||
|
5923b6288f | ||
|
0f6f6bd3c0 | ||
|
ca3e337ef9 | ||
|
ec710395b7 | ||
|
d47b4ef12d | ||
|
72475c800b | ||
|
c3504c111e | ||
|
737c5c065d | ||
|
1c018d3fd2 | ||
|
60f233a4bc | ||
|
eccdce11c5 | ||
|
3f4847331f | ||
|
ff73e0aa55 | ||
|
965a55d2a8 | ||
|
d55243f0e6 | ||
|
233b35a2a9 | ||
|
ae3bf81833 | ||
|
2d7ffdd72b | ||
|
2902ab1a14 | ||
|
9ff99114b1 | ||
|
af703620d4 | ||
|
3a0dff7db2 | ||
|
59145eca62 | ||
|
d6394bcbfd | ||
|
2d98899b9b | ||
|
da4632c651 | ||
|
f35ebd5cf7 | ||
|
6e5a01ccec | ||
|
b2c3f6f737 | ||
|
bb0313d060 | ||
|
71da5e128a | ||
|
9752e059e1 | ||
|
399e2fbdac | ||
|
61c5791fa3 | ||
|
ab04201c3d | ||
|
297cd4cfe8 | ||
|
f760c24ff0 | ||
|
2a7602c4ed | ||
|
9563927bbd | ||
|
ac12432603 | ||
|
ada5ef0669 | ||
|
58acbf5ee3 | ||
|
41733b46b9 | ||
|
e26d6ed448 | ||
|
e556e3336e | ||
|
69356a60b5 | ||
|
b1d6deaf0b | ||
|
aa20c45ae9 | ||
|
70d314312c | ||
|
fa3bd05d44 | ||
|
f0e5332b1f | ||
|
231812c875 | ||
|
e6abdb8b9d | ||
|
8412b75b10 | ||
|
9f656e1239 | ||
|
c6626f94de | ||
|
fd55ccdd99 | ||
|
516b3399f3 | ||
|
e09e3a56f3 | ||
|
49596e0a1f | ||
|
cb08d28d40 | ||
|
835af6fcb9 | ||
|
6c92a6f99a | ||
|
003d8956a5 | ||
|
c1548c7861 | ||
|
8ff95bf32c | ||
|
fb7ec62b29 | ||
|
21726a6853 | ||
|
1b1c4cd94d | ||
|
0c98d10b4f | ||
|
1d66e34dc8 | ||
|
640af0205d | ||
|
f0c44d1bd0 | ||
|
8bbe43aa33 | ||
|
a7e049a228 | ||
|
692f1d86a6 | ||
|
22541b881d | ||
|
e0985bf566 | ||
|
44f1bdb0d5 | ||
|
e0acf357bb | ||
|
d24a30858e | ||
|
c3b72ea708 | ||
|
d468cee107 | ||
|
d970af8724 | ||
|
06cffa6acb | ||
|
d72de8ba68 | ||
|
d82699bf43 | ||
|
4fb515fa08 | ||
|
f27c358a8a | ||
|
31c0c9555e | ||
|
4a77eda368 | ||
|
468be0f8d6 | ||
|
45caff1a20 | ||
|
a8fcf45624 | ||
|
2e41756b55 | ||
|
67faf556ed | ||
|
20be8c75e5 | ||
|
0b6d101c77 | ||
|
45514a6013 | ||
|
39e1567d0a | ||
|
55f4ccd4fc | ||
|
2cca5a7a4c | ||
|
bf16d6453c | ||
|
5d12e1eb46 | ||
|
1260b75f63 | ||
|
11bee6194a | ||
|
cc5f287c47 | ||
|
9b2a8f07a3 | ||
|
d94e312673 | ||
|
8fa4211bbd | ||
|
e328006bfe | ||
|
357648b8d6 | ||
|
50ad19541d | ||
|
0f92a01737 | ||
|
75345c2046 | ||
|
a807b5db57 | ||
|
40a73fa75c | ||
|
50c521e706 | ||
|
2861f795f5 | ||
|
2e24b64fc1 | ||
|
fb7bde9c24 | ||
|
390de81bbc | ||
|
5c3d3f0875 | ||
|
74486f7f93 | ||
|
d66d43d2ea | ||
|
f457435199 | ||
|
3cd4dcf13b | ||
|
b5e6f8a446 | ||
|
f664b020cd | ||
|
3375dac049 | ||
|
b221ca0efa | ||
|
ee67e34519 | ||
|
29a8cb8d87 | ||
|
2fbd9f15fa | ||
|
a557bb4d0b | ||
|
382e99d06e | ||
|
41302c206a | ||
|
898216d419 | ||
|
0f2811441f | ||
|
6e26392209 | ||
|
e9cf47606c | ||
|
87c0473730 | ||
|
24da7009c3 | ||
|
db3d1cb7fa | ||
|
d46b9afb79 | ||
|
97bdad8262 | ||
|
c0549ec943 | ||
|
dc1042eb5f | ||
|
b6400af7ac | ||
|
a86b1d8f75 | ||
|
4e5c655944 | ||
|
4caf943f49 | ||
|
db48010e81 | ||
|
bf24f2dcc5 | ||
|
bb65f097fd | ||
|
4b0058dd64 | ||
|
b1c9b82531 | ||
|
b0e0dc5de3 | ||
|
3412587036 | ||
|
9b9a9e7f8c | ||
|
99437a96fb | ||
|
bb875303c2 | ||
|
de36bfe31c | ||
|
90cd89eab0 | ||
|
6d61ca3bb5 | ||
|
536c27de8e | ||
|
d289c9286e | ||
|
b1cc688a61 | ||
|
066fe82a92 | ||
|
26f2ab65f8 | ||
|
1b9b5652a1 | ||
|
3e79f9e198 | ||
|
c6163bdab2 | ||
|
a0f652dc2e | ||
|
737c30c19d | ||
|
c858b3ba78 | ||
|
a57340ffb5 | ||
|
52ce4c20f8 | ||
|
82ab92da9a | ||
|
35bb398b1f | ||
|
763dc21393 | ||
|
19e818fdf7 | ||
|
91b41ddd59 | ||
|
deaaf014d8 | ||
|
951333ecb0 | ||
|
d6d97889f2 | ||
|
1d7fc78ea1 | ||
|
690d6c6070 | ||
|
027c37281d | ||
|
1b5176003a | ||
|
cbc63518e5 | ||
|
2e76546223 | ||
|
95b53c80e1 | ||
|
9ccfe161ad | ||
|
f6dbe9ba05 | ||
|
b95cac5f4f | ||
|
c75298e359 | ||
|
580c3db8f9 | ||
|
7ef6d4b813 | ||
|
ff230682d1 | ||
|
cfbb9338bd | ||
|
6637c202bf | ||
|
4e2a275a67 | ||
|
bcd8d403dc | ||
|
13f009bf68 | ||
|
85be26c675 | ||
|
84afef20f5 | ||
|
fa8c374aff | ||
|
1afc034006 | ||
|
2bb538b150 | ||
|
1460540acd | ||
|
1838db2880 | ||
|
7fe3d5dac2 | ||
|
a991e2fe9c | ||
|
f2bfa83b42 | ||
|
a84bc2f5b2 | ||
|
9f72e25b23 | ||
|
91b4b534ad | ||
|
35e6f11ad4 | ||
|
b54da51c0c | ||
|
92c17f3f25 | ||
|
71f13cc071 | ||
|
a171d90611 | ||
|
558f8e7769 | ||
|
76433d9040 | ||
|
6b5d08f7da | ||
|
6372c415a5 | ||
|
b31397aff5 | ||
|
e47ce81422 | ||
|
93c05aa8c0 | ||
|
b25df389db | ||
|
bf644b0984 | ||
|
6ec8c1602f | ||
|
0f8ebd024d | ||
|
2fd8f35b74 | ||
|
797bcdd9e0 | ||
|
f2a8e95248 | ||
|
218acc2224 | ||
|
e2d7f1aa41 | ||
|
b0b740210c | ||
|
a25ed5ba1b | ||
|
b70ae4919b | ||
|
ca56a274bd | ||
|
c8ddf156a7 | ||
|
e17e8e425f | ||
|
be2b0fa31e | ||
|
70e30f74e6 | ||
|
4ddf212286 | ||
|
4ce8448d7f | ||
|
aab2d70dd3 | ||
|
8638961f02 | ||
|
e3bffd8fbd | ||
|
9226659413 | ||
|
66b0e8fa2d | ||
|
225eace316 | ||
|
a7b20d4e46 | ||
|
cdc7988823 | ||
|
b5f465b4ec | ||
|
29471d75cb | ||
|
a2f7898b6d | ||
|
d4aeca8ce3 | ||
|
318982c0ba | ||
|
a80b66268f | ||
|
541780c6df | ||
|
5636a02d03 | ||
|
edf07760d6 | ||
|
bcacaf164b | ||
|
3e5dbef6a2 | ||
|
39e40ff5ce | ||
|
bb115d4d61 | ||
|
ba8c5045b5 | ||
|
c547caf04f | ||
|
5b7f90dfb2 | ||
|
781f6c5d22 | ||
|
7f650cea86 | ||
|
0d03cd9e31 | ||
|
50a30aafc1 | ||
|
f39b575503 | ||
|
d836ee056d | ||
|
a0b692c86d | ||
|
03dfb724c7 | ||
|
e4ef2835f0 | ||
|
cb4ba522ef | ||
|
988e190ef7 | ||
|
b49bce2bc3 | ||
|
ff2fd63bf7 | ||
|
ec4adf21e0 | ||
|
cc7a87e27c | ||
|
8797197cdf | ||
|
887d766c86 | ||
|
daa6c39dcb | ||
|
3779310c72 | ||
|
8b518fadb2 | ||
|
e430d3f844 | ||
|
1ac4c5dd6d | ||
|
0a8721113a | ||
|
4ec7883891 | ||
|
dcb4395604 | ||
|
3d9113c16e | ||
|
bfcc0217f1 | ||
|
e6be03db31 | ||
|
b166d627f3 | ||
|
303b6df812 | ||
|
283462dfe4 | ||
|
c325ce2182 | ||
|
27ab1f6bd9 | ||
|
26abd65e34 | ||
|
53cdb6cf82 | ||
|
4769719a4b | ||
|
d625020c90 | ||
|
3af6044fdf | ||
|
17dc8a7449 | ||
|
ebc543ebe3 | ||
|
21fb781989 | ||
|
c9694b1ba1 | ||
|
3822727981 | ||
|
850fd24ee9 | ||
|
33abe87c5b | ||
|
1e12754b3a | ||
|
4d991acae0 | ||
|
ddd141c1c5 | ||
|
57fea1335a | ||
|
c2fcc093b2 | ||
|
f75339264f | ||
|
e07ad01f62 | ||
|
eb31c04f47 | ||
|
b854baa1fc | ||
|
3244f73f32 | ||
|
4e705a3157 | ||
|
d3bac7a6fe | ||
|
135a1a7cd7 | ||
|
56e51bc113 | ||
|
2442a0a698 | ||
|
4ea6340f1a | ||
|
8481c49c82 | ||
|
176c2ceed6 | ||
|
798848320f | ||
|
69447564b8 | ||
|
4b989151ed | ||
|
e6164d4052 | ||
|
4123d54bf6 | ||
|
ac0cf0b2e2 | ||
|
49d75e223e | ||
|
b658294a13 | ||
|
88481fc363 | ||
|
0f555f8d2c | ||
|
d8dd497069 | ||
|
668698584d | ||
|
d9525c0fb6 | ||
|
b14c996698 | ||
|
092eb701c7 | ||
|
42145a82bd | ||
|
b30e3ba26d | ||
|
0a652499ea | ||
|
bcf15e527d | ||
|
93bd2081dd | ||
|
f99c73502c | ||
|
103fee6192 | ||
|
81591e288e | ||
|
d4c6a68e58 | ||
|
0eff425bc7 | ||
|
21b2c26fb1 | ||
|
c75ddd0fa3 | ||
|
35e81018e9 | ||
|
aace56018a | ||
|
45095e83e7 | ||
|
498fb1134a | ||
|
8e5266a9ef | ||
|
1f15ade60d | ||
|
0b22b27bbb | ||
|
cd2ad19db4 | ||
|
6b1e3bcee3 | ||
|
7166252a52 | ||
|
35e38e8932 | ||
|
7dd6b3d3f8 | ||
|
c8805fd7de | ||
|
cf49ba876f | ||
|
096dcb90e6 | ||
|
e9c83b3005 | ||
|
a55ec427bd | ||
|
0948343a6f | ||
|
e9e6ec3a2c | ||
|
219d4e8427 | ||
|
296d223545 | ||
|
8be8127351 | ||
|
9997e3a3b4 | ||
|
35838b6af8 | ||
|
3d98504c4c | ||
|
2681f32bdd | ||
|
3c57c24921 | ||
|
d6e03d2368 | ||
|
2130c329eb | ||
|
bffe6744ec | ||
|
c3108f14c8 | ||
|
d71d1394ec | ||
|
246082368a | ||
|
65a07b80a3 | ||
|
9a2438e0dc | ||
|
4e955434aa | ||
|
3a36776d4a | ||
|
bfec1ff1cd | ||
|
bdfd978b68 | ||
|
8f1dea89f5 | ||
|
fe08fc00c8 | ||
|
271145ee72 | ||
|
956966e658 | ||
|
20c7a8f035 | ||
|
fa990f0803 | ||
|
b4a51871b9 | ||
|
75372988e7 | ||
|
d67a621715 | ||
|
d1ca2c6f83 | ||
|
b25aa3b472 | ||
|
8a51210efc | ||
|
a6a06f820f | ||
|
2f6f3e6aa7 | ||
|
77f6febb03 | ||
|
3c6c1b7d33 | ||
|
992c54253f | ||
|
17d6091ef4 | ||
|
e664f9c688 | ||
|
0006bfc359 | ||
|
13207a5927 | ||
|
4aa024d843 | ||
|
e4f3f9d9bf | ||
|
8062ade787 | ||
|
a99b8a6210 | ||
|
efb56aaea7 | ||
|
a28e35fd98 | ||
|
bf55624f75 | ||
|
7fbe6adf24 | ||
|
cc364b14e2 | ||
|
f3eaf9b870 | ||
|
34bcb30f1c | ||
|
0a3a08a3bc | ||
|
7ce4da1eee | ||
|
bd9d0d1637 | ||
|
3400cee845 | ||
|
59a77e7bef | ||
|
0ecb38c6da | ||
|
c5644aad31 | ||
|
c332a21fb2 | ||
|
94c0172618 | ||
|
33d0dd0bfc | ||
|
c76dca0456 | ||
|
f913ed8134 | ||
|
304be4ec2f | ||
|
462243e31a | ||
|
925f2b3350 | ||
|
295f6c2cc6 | ||
|
a24a0ff003 | ||
|
6b619742ac | ||
|
4ef77c008c | ||
|
8c0959604c | ||
|
5f20b3323e | ||
|
b36203bb02 | ||
|
ddaa4d9b4c | ||
|
de02488778 | ||
|
b5c57967b7 | ||
|
6b10432463 | ||
|
5032b224bc | ||
|
306795ae1d | ||
|
2733f5a738 | ||
|
8af1c70a8b | ||
|
67f558cff0 | ||
|
d0cae7b6ed | ||
|
761b1553aa | ||
|
812d9f9b84 | ||
|
da68014a50 | ||
|
74a7f8c92b | ||
|
4fdeaa70af | ||
|
a5fcc94a3b | ||
|
8f5a175ff4 | ||
|
dd3e433d32 | ||
|
9e1852c08d | ||
|
3007668274 | ||
|
dd592a21b9 | ||
|
f202d02d0d | ||
|
b2a116863c | ||
|
25a5bc2697 | ||
|
bc6baf6774 | ||
|
d72136da0d | ||
|
240215f2aa | ||
|
f4be75cb1e | ||
|
2bf6ebf379 | ||
|
ea01d003d1 | ||
|
b2bd039923 | ||
|
6ff7b4395d | ||
|
3420b389e9 | ||
|
520561e94a | ||
|
66c9401c07 | ||
|
ed76afd409 | ||
|
706b9fbd67 | ||
|
2f02ed18e9 | ||
|
d0132b0fff | ||
|
3585a542a0 | ||
|
ee45dbdc8b | ||
|
8efeeb5f38 | ||
|
ef3b9610a1 | ||
|
d05b8131a3 | ||
|
5637a78854 | ||
|
62427adbec | ||
|
435fd0ece7 | ||
|
7becd35126 | ||
|
a95a60cb0b | ||
|
d4ab9679d7 | ||
|
b92bd8f6a8 | ||
|
f7c872981f | ||
|
af637abf12 | ||
|
df250b6941 | ||
|
1ea866fd69 | ||
|
56d36c8f25 | ||
|
fd296811df | ||
|
2f8551d3b6 | ||
|
900be74e8f | ||
|
6f49ba4c3e | ||
|
5b4dcddb59 | ||
|
024fcb4fdb | ||
|
e8ab6b7496 | ||
|
44274eeb58 | ||
|
125e25a929 | ||
|
fe92e62a19 | ||
|
3e8b7df789 | ||
|
fdbb10827d | ||
|
d234a164f7 | ||
|
acbd7caaf8 | ||
|
7ed7422e7f | ||
|
a893bb119b | ||
|
e01445ea94 | ||
|
356657a37b | ||
|
5aecd32554 | ||
|
9643f60bc2 | ||
|
f9e3db0373 | ||
|
714fdaee3b | ||
|
2feff1ea16 | ||
|
4fdcf51467 | ||
|
34e2d6638d | ||
|
dec518eb06 | ||
|
6af2364fa9 | ||
|
7a12594edb | ||
|
c46ffe39a8 | ||
|
75a539ae3d | ||
|
097e0abca9 | ||
|
6064c80250 | ||
|
d6205eb4ca | ||
|
bb8104b624 | ||
|
dcb015dff6 | ||
|
eac3f2bc14 | ||
|
286cbbd99d | ||
|
ab0cca734a | ||
|
6141dc6eed | ||
|
959efd3127 | ||
|
95c14fbd65 | ||
|
f8ffbfb2be | ||
|
a816ff0bab | ||
|
48b17de829 | ||
|
1c977f78fd | ||
|
c3b8006166 | ||
|
339e135776 | ||
|
72f6dacd22 | ||
|
b27edfd189 | ||
|
fddee66d90 | ||
|
996c483f23 | ||
|
e289af53b6 | ||
|
2337086736 | ||
|
2645626c33 | ||
|
33e35c4732 | ||
|
a552e49b50 | ||
|
7f507d69fa | ||
|
0416e0aa9c | ||
|
70e694ee76 | ||
|
5e2a1d3e30 | ||
|
5ab5538d6c | ||
|
226eb6554f | ||
|
9f81134388 | ||
|
63186e34b3 | ||
|
2a306419c8 | ||
|
f40b1b65f8 | ||
|
890e240730 | ||
|
25dc9ae345 | ||
|
a6a67ea9b2 | ||
|
6b4160f2a5 | ||
|
dd12bd8f1b | ||
|
a528af55d3 | ||
|
d1848762cf | ||
|
dc8fa06e64 | ||
|
a20c98e619 | ||
|
1261fca160 | ||
|
916f3d789b | ||
|
5e9c5dc413 | ||
|
fa3daa7abc | ||
|
2781df39e5 | ||
|
0311042336 | ||
|
d741b81ab5 | ||
|
44f2818a3d | ||
|
c26b857900 | ||
|
1859c4d5fe | ||
|
28b3d52948 | ||
|
1c85cb98a4 | ||
|
1c62bb6dad | ||
|
1a24e6e237 | ||
|
2e424ee663 | ||
|
1652dc8b3f | ||
|
47e06734f6 | ||
|
930880f574 | ||
|
9dc4dc1960 | ||
|
3baa390bba | ||
|
b0c0631468 | ||
|
3dabf304a1 | ||
|
cefb3a45c0 | ||
|
48fa21511b | ||
|
c15bcd487f | ||
|
acabc4d3bb | ||
|
529efe50ea | ||
|
31fdd21c7e | ||
|
dcfa46af13 | ||
|
461c3b9785 | ||
|
84391b36d3 | ||
|
1559ae1ac9 | ||
|
4901b71ade | ||
|
9364accf1f | ||
|
02022e356a | ||
|
19f5a93cff | ||
|
7b75ca7bb5 | ||
|
a7878f1d0d | ||
|
e8ffe6bb4c | ||
|
a5f26a8999 | ||
|
089435d31b | ||
|
e85e2842a0 | ||
|
8dacd4172e | ||
|
c58b1cbf8a | ||
|
ba01cfbb58 | ||
|
980f02a500 | ||
|
634527f5b6 | ||
|
b24269fefc | ||
|
f592570310 | ||
|
acdbd88e88 | ||
|
3b50efbe02 | ||
|
4b6741ca3b | ||
|
e3d88d2d79 | ||
|
dbd04eadeb | ||
|
d939cd964b | ||
|
80c7e26bee | ||
|
76189fde0d | ||
|
c65e9e7d91 | ||
|
0424228e97 | ||
|
70b9a368ca | ||
|
db87630689 | ||
|
b072ed3173 | ||
|
28d39f8726 | ||
|
6b54e7b8d9 | ||
|
cfeac977fd | ||
|
16372365c4 | ||
|
cca7078d47 | ||
|
3524264add | ||
|
6a20af8766 | ||
|
10e10fd81d | ||
|
bec34fc8d7 |
@@ -31,8 +31,7 @@ jobs:
|
||||
name: binaries
|
||||
command: |
|
||||
export PATH="$GOBIN:$PATH"
|
||||
make install
|
||||
cd abci && make install
|
||||
make install install_abci
|
||||
- persist_to_workspace:
|
||||
root: /tmp/workspace
|
||||
paths:
|
||||
|
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@@ -2,3 +2,6 @@
|
||||
|
||||
# Everything goes through Bucky, Anton, Alex. For now.
|
||||
* @ebuchman @melekes @xla
|
||||
|
||||
# Precious documentation
|
||||
/docs/ @zramsay @jolesbi
|
||||
|
2
.github/ISSUE_TEMPLATE
vendored
2
.github/ISSUE_TEMPLATE
vendored
@@ -33,7 +33,7 @@ in a case of bug.
|
||||
|
||||
**How to reproduce it** (as minimally and precisely as possible):
|
||||
|
||||
**Logs (you can paste a part showing an error or attach the whole file)**:
|
||||
**Logs (you can paste a small part showing an error or link a pastebin, gist, etc. containing more of the log file)**:
|
||||
|
||||
**Config (you can paste only the changes you've made)**:
|
||||
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -14,10 +14,10 @@ test/p2p/data/
|
||||
test/logs
|
||||
coverage.txt
|
||||
docs/_build
|
||||
docs/tools
|
||||
*.log
|
||||
abci-cli
|
||||
abci/types/types.pb.go
|
||||
docs/node_modules/
|
||||
|
||||
scripts/wal2json/wal2json
|
||||
scripts/cutWALUntil/cutWALUntil
|
||||
@@ -27,5 +27,3 @@ scripts/cutWALUntil/cutWALUntil
|
||||
|
||||
libs/pubsub/query/fuzz_test/output
|
||||
shunit2
|
||||
.tendermint-lite
|
||||
addrbook.json
|
||||
|
99
CHANGELOG.md
99
CHANGELOG.md
@@ -1,14 +1,94 @@
|
||||
# Changelog
|
||||
|
||||
## TBD
|
||||
## 0.22.3
|
||||
|
||||
IMPROVEMENTS
|
||||
- Update dependencies
|
||||
* pin all values in Gopkg.toml to version or commit
|
||||
* update golang/protobuf to v1.1.0
|
||||
|
||||
## 0.22.2
|
||||
|
||||
*July 10th, 2018*
|
||||
|
||||
IMPROVEMENTS
|
||||
- More cleanup post repo merge!
|
||||
- [docs] Include `ecosystem.json` and `tendermint-bft.md` from deprecated `aib-data` repository.
|
||||
- [config] Add `instrumentation.max_open_connections`, which limits the number
|
||||
of requests in flight to Prometheus server (if enabled). Default: 3.
|
||||
|
||||
|
||||
BUG FIXES
|
||||
- [rpc] Allow unquoted integers in requests
|
||||
- NOTE: this is only for URI requests. JSONRPC requests and all responses
|
||||
will use quoted integers (the proto3 JSON standard).
|
||||
- [consensus] Fix halt on shutdown
|
||||
|
||||
## 0.22.1
|
||||
|
||||
*July 5th, 2018*
|
||||
|
||||
IMPROVEMENTS
|
||||
|
||||
* Cleanup post repo-merge.
|
||||
* [docs] Various improvements.
|
||||
|
||||
BUG FIXES
|
||||
|
||||
* [state] Return error when EndBlock returns a 0-power validator that isn't
|
||||
already in the validator set.
|
||||
* [consensus] Shut down WAL properly.
|
||||
|
||||
## 0.22.0
|
||||
|
||||
*July 2nd, 2018*
|
||||
|
||||
BREAKING CHANGES:
|
||||
- [config]
|
||||
* Remove `max_block_size_txs` and `max_block_size_bytes` in favor of
|
||||
consensus params from the genesis file.
|
||||
* Rename `skip_upnp` to `upnp`, and turn it off by default.
|
||||
* Change `max_packet_msg_size` back to `max_packet_msg_payload_size`
|
||||
- [rpc]
|
||||
* All integers are encoded as strings (part of the update for Amino v0.10.1)
|
||||
* `syncing` is now called `catching_up`
|
||||
- [types] Update Amino to v0.10.1
|
||||
* Amino is now fully proto3 compatible for the basic types
|
||||
* JSON-encoded types now use the type name instead of the prefix bytes
|
||||
* Integers are encoded as strings
|
||||
- [crypto] Update go-crypto to v0.10.0 and merge into `crypto`
|
||||
* privKey.Sign returns error.
|
||||
* ed25519 address changed to the first 20-bytes of the SHA256 of the raw pubkey bytes
|
||||
* `tmlibs/merkle` -> `crypto/merkle`. Uses SHA256 instead of RIPEMD160
|
||||
- [tmlibs] Update to v0.9.0 and merge into `libs`
|
||||
* remove `merkle` package (moved to `crypto/merkle`)
|
||||
|
||||
FEATURES
|
||||
- [cmd] Added metrics (served under `/metrics` using a Prometheus client;
|
||||
disabled by default). See the new `instrumentation` section in the config and
|
||||
[metrics](https://tendermint.readthedocs.io/projects/tools/en/develop/metrics.html)
|
||||
guide.
|
||||
- [p2p] Add IPv6 support to peering.
|
||||
- [p2p] Add `external_address` to config to allow specifying the address for
|
||||
peers to dial
|
||||
|
||||
IMPROVEMENT
|
||||
- [rpc/client] Supports https and wss now.
|
||||
- [crypto] Make public key size into public constants
|
||||
- [mempool] Log tx hash, not entire tx
|
||||
- [abci] Merged in github.com/tendermint/abci
|
||||
- [crypto] Merged in github.com/tendermint/go-crypto
|
||||
- [libs] Merged in github.com/tendermint/tmlibs
|
||||
- [docs] Move from .rst to .md
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
- [rpc] limited number of HTTP/WebSocket connections
|
||||
- [rpc] Limit maximum number of HTTP/WebSocket connections
|
||||
(`rpc.max_open_connections`) and gRPC connections
|
||||
(`rpc.grpc_max_open_connections`). Check out [Running In
|
||||
Production](https://tendermint.readthedocs.io/en/master/running-in-production.html)
|
||||
guide if you want to increase them.
|
||||
(`rpc.grpc_max_open_connections`). Check out "Running In Production" guide if
|
||||
you want to increase them.
|
||||
- [rpc] Limit maximum request body size to 1MB (header is limited to 1MB).
|
||||
- [consensus] Fix a halting bug where `create_empty_blocks=false`
|
||||
- [p2p] Fix panic in seed mode
|
||||
|
||||
## 0.21.0
|
||||
|
||||
@@ -25,13 +105,6 @@ IMPROVEMENT
|
||||
- [pubsub] Set default capacity to 0
|
||||
- [docs] Various improvements
|
||||
|
||||
FEATURES
|
||||
|
||||
- [main] added metrics (served under `/metrics` using a Prometheus client;
|
||||
disabled by default). See the new `instrumentation` section in the config and
|
||||
[metrics](https://tendermint.readthedocs.io/projects/tools/en/v0.21.0/metrics.html)
|
||||
guide.
|
||||
|
||||
BUG FIXES
|
||||
|
||||
- [consensus] Fix an issue where we don't make blocks after `fast_sync` when `create_empty_blocks=false`
|
||||
|
@@ -17,7 +17,7 @@ Instead, we use `git remote` to add the fork as a new remote for the original re
|
||||
For instance, to create a fork and work on a branch of it, I would:
|
||||
|
||||
* Create the fork on github, using the fork button.
|
||||
* Go to the original repo checked out locally (ie. `$GOPATH/src/github.com/tendermint/tendermint`)
|
||||
* Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/tendermint/tendermint`)
|
||||
* `git remote rename origin upstream`
|
||||
* `git remote add origin git@github.com:ebuchman/basecoin.git`
|
||||
|
||||
@@ -47,7 +47,7 @@ get_vendor_deps`). Even for dependencies under our control, dep helps us to
|
||||
keep multiple repos in sync as they evolve. Anything with an executable, such
|
||||
as apps, tools, and the core, should use dep.
|
||||
|
||||
Run `dep status` to get a list of vendored dependencies that may not be
|
||||
Run `dep status` to get a list of vendor dependencies that may not be
|
||||
up-to-date.
|
||||
|
||||
## Vagrant
|
||||
@@ -85,7 +85,7 @@ especially `go-p2p` and `go-rpc`, as their versions are referenced in tendermint
|
||||
- the latest state of development is on `develop`
|
||||
- `develop` must never fail `make test`
|
||||
- no --force onto `develop` (except when reverting a broken commit, which should seldom happen)
|
||||
- create a development branch either on github.com/tendermint/tendermint, or your fork (using `git add origin`)
|
||||
- create a development branch either on github.com/tendermint/tendermint, or your fork (using `git remote add origin`)
|
||||
- before submitting a pull request, begin `git rebase` on top of `develop`
|
||||
|
||||
### Pull Merge Procedure:
|
||||
@@ -110,7 +110,7 @@ especially `go-p2p` and `go-rpc`, as their versions are referenced in tendermint
|
||||
- make the required changes
|
||||
- these changes should be small and an absolute necessity
|
||||
- add a note to CHANGELOG.md
|
||||
- bumb versions
|
||||
- bump versions
|
||||
- push to hotfix-vX.X.X to run the extended integration tests on the CI
|
||||
- merge hotfix-vX.X.X to master
|
||||
- merge hotfix-vX.X.X to develop
|
||||
|
81
Gopkg.lock
generated
81
Gopkg.lock
generated
@@ -11,12 +11,14 @@
|
||||
branch = "master"
|
||||
name = "github.com/btcsuite/btcd"
|
||||
packages = ["btcec"]
|
||||
revision = "86fed781132ac890ee03e906e4ecd5d6fa180c64"
|
||||
revision = "fdfc19097e7ac6b57035062056f5b7b4638b8898"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/btcsuite/btcutil"
|
||||
packages = ["base58"]
|
||||
packages = [
|
||||
"base58",
|
||||
"bech32"
|
||||
]
|
||||
revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4"
|
||||
|
||||
[[projects]]
|
||||
@@ -26,16 +28,15 @@
|
||||
version = "v1.1.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/ebuchman/fail-test"
|
||||
packages = ["."]
|
||||
revision = "95f809107225be108efcf10a3509e4ea6ceef3c4"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/fortytw2/leaktest"
|
||||
packages = ["."]
|
||||
revision = "b008db64ef8daabb22ff6daa557f33b41d8f6ccd"
|
||||
revision = "a5ef70473c97b71626b9abeda80ee92ba2a7de9e"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/fsnotify/fsnotify"
|
||||
@@ -113,7 +114,6 @@
|
||||
".",
|
||||
"hcl/ast",
|
||||
"hcl/parser",
|
||||
"hcl/printer",
|
||||
"hcl/scanner",
|
||||
"hcl/strconv",
|
||||
"hcl/token",
|
||||
@@ -183,8 +183,7 @@
|
||||
"prometheus",
|
||||
"prometheus/promhttp"
|
||||
]
|
||||
revision = "c5b7fccd204277076155f10851dad72b76a49317"
|
||||
version = "v0.8.0"
|
||||
revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -211,10 +210,9 @@
|
||||
"nfs",
|
||||
"xfs"
|
||||
]
|
||||
revision = "94663424ae5ae9856b40a9f170762b4197024661"
|
||||
revision = "ae68e2d4c00fed4943b5f6698d504a5fe083da8a"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/rcrowley/go-metrics"
|
||||
packages = ["."]
|
||||
revision = "e2704e165165ec55d062f5919b4b29494e9fa790"
|
||||
@@ -237,8 +235,8 @@
|
||||
[[projects]]
|
||||
name = "github.com/spf13/cobra"
|
||||
packages = ["."]
|
||||
revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385"
|
||||
version = "v0.0.3"
|
||||
revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b"
|
||||
version = "v0.0.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -255,8 +253,8 @@
|
||||
[[projects]]
|
||||
name = "github.com/spf13/viper"
|
||||
packages = ["."]
|
||||
revision = "b5e8006cbee93ec955a89ab31e0e3ce3204f3736"
|
||||
version = "v1.0.2"
|
||||
revision = "25b30aa063fc18e48662b86996252eabdcf2f0c7"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/stretchr/testify"
|
||||
@@ -264,8 +262,8 @@
|
||||
"assert",
|
||||
"require"
|
||||
]
|
||||
revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
|
||||
version = "v1.2.2"
|
||||
revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71"
|
||||
version = "v1.2.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -284,7 +282,7 @@
|
||||
"leveldb/table",
|
||||
"leveldb/util"
|
||||
]
|
||||
revision = "0d5a0ceb10cf9ab89fdd744cc8c50a83134f6697"
|
||||
revision = "c4c61651e9e37fa117f53c5a906d3b63090d8445"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -302,33 +300,6 @@
|
||||
revision = "2106ca61d91029c931fd54968c2bb02dc96b1412"
|
||||
version = "0.10.1"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/tendermint/iavl"
|
||||
packages = [
|
||||
".",
|
||||
"sha256truncated"
|
||||
]
|
||||
revision = "866a229a90d86b07af23ffa156c3fa1396416574"
|
||||
version = "v0.10.0-rc1"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/tendermint/tmlibs"
|
||||
packages = [
|
||||
"autofile",
|
||||
"cli",
|
||||
"cli/flags",
|
||||
"clist",
|
||||
"common",
|
||||
"db",
|
||||
"flowrate",
|
||||
"log",
|
||||
"merkle",
|
||||
"merkle/tmhash",
|
||||
"test"
|
||||
]
|
||||
revision = "49596e0a1f48866603813df843c9409fc19805c6"
|
||||
version = "v0.9.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/crypto"
|
||||
@@ -339,6 +310,7 @@
|
||||
"curve25519",
|
||||
"hkdf",
|
||||
"internal/chacha20",
|
||||
"internal/subtle",
|
||||
"nacl/box",
|
||||
"nacl/secretbox",
|
||||
"openpgp/armor",
|
||||
@@ -347,10 +319,9 @@
|
||||
"ripemd160",
|
||||
"salsa20/salsa"
|
||||
]
|
||||
revision = "8ac0e0d97ce45cd83d1d7243c060cb8461dda5e9"
|
||||
revision = "a49355c7e3f8fe157a85be2f77e6e269a0f89602"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/net"
|
||||
packages = [
|
||||
"context",
|
||||
@@ -362,7 +333,7 @@
|
||||
"netutil",
|
||||
"trace"
|
||||
]
|
||||
revision = "afe8f62b1d6bbd81f31868121a50b06d8188e1f9"
|
||||
revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -371,7 +342,7 @@
|
||||
"cpu",
|
||||
"unix"
|
||||
]
|
||||
revision = "a9e25c09b96b8870693763211309e213c6ef299d"
|
||||
revision = "1b2967e3c290b7c545b3db0deeda16e9be4f98a2"
|
||||
|
||||
[[projects]]
|
||||
name = "golang.org/x/text"
|
||||
@@ -404,9 +375,13 @@
|
||||
packages = [
|
||||
".",
|
||||
"balancer",
|
||||
"balancer/base",
|
||||
"balancer/roundrobin",
|
||||
"codes",
|
||||
"connectivity",
|
||||
"credentials",
|
||||
"encoding",
|
||||
"encoding/proto",
|
||||
"grpclb/grpc_lb_v1/messages",
|
||||
"grpclog",
|
||||
"internal",
|
||||
@@ -415,13 +390,15 @@
|
||||
"naming",
|
||||
"peer",
|
||||
"resolver",
|
||||
"resolver/dns",
|
||||
"resolver/passthrough",
|
||||
"stats",
|
||||
"status",
|
||||
"tap",
|
||||
"transport"
|
||||
]
|
||||
revision = "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e"
|
||||
version = "v1.7.5"
|
||||
revision = "d11072e7ca9811b1100b80ca0269ac831f06d024"
|
||||
version = "v1.11.3"
|
||||
|
||||
[[projects]]
|
||||
name = "gopkg.in/yaml.v2"
|
||||
@@ -432,6 +409,6 @@
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "ece6ed2d29c510b27b489c93a94e68e4aa5db840c16c6b8b7563d81fed4072fe"
|
||||
inputs-digest = "b0718135d5ade0a75c6b8fe703f70eb9d8064ba871ec31abd9ace3c4ab944100"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
|
93
Gopkg.toml
93
Gopkg.toml
@@ -23,81 +23,96 @@
|
||||
# non-go = false
|
||||
# go-tests = true
|
||||
# unused-packages = true
|
||||
#
|
||||
###########################################################
|
||||
# NOTE: All packages should be pinned to specific versions.
|
||||
# Packages without releases must pin to a commit.
|
||||
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/ebuchman/fail-test"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/fortytw2/leaktest"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/go-kit/kit"
|
||||
version = "~0.6.0"
|
||||
version = "=0.6.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/gogo/protobuf"
|
||||
version = "~1.0.0"
|
||||
version = "=1.0.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/golang/protobuf"
|
||||
version = "~1.0.0"
|
||||
version = "=1.0.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/gorilla/websocket"
|
||||
version = "~1.2.0"
|
||||
version = "=1.2.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/pkg/errors"
|
||||
version = "~0.8.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/rcrowley/go-metrics"
|
||||
branch = "master"
|
||||
version = "=0.8.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/spf13/cobra"
|
||||
version = "~0.0.1"
|
||||
version = "=0.0.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/spf13/viper"
|
||||
version = "~1.0.0"
|
||||
version = "=1.0.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/stretchr/testify"
|
||||
version = "~1.2.1"
|
||||
version = "=1.2.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/tendermint/go-amino"
|
||||
version = "~0.10.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/tendermint/iavl"
|
||||
version = "0.10.0-rc1"
|
||||
|
||||
[[override]]
|
||||
name = "github.com/tendermint/tmlibs"
|
||||
version = "~0.9.0"
|
||||
version = "=0.10.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "google.golang.org/grpc"
|
||||
version = "~1.7.3"
|
||||
version = "=1.11.3"
|
||||
|
||||
# this got updated and broke, so locked to an old working commit ...
|
||||
[[constraint]]
|
||||
name = "github.com/fortytw2/leaktest"
|
||||
version = "=1.2.0"
|
||||
|
||||
###################################
|
||||
## Some repos dont have releases.
|
||||
## Pin to revision
|
||||
|
||||
## We can remove this one by updating protobuf to v1.1.0
|
||||
## but then the grpc tests break with
|
||||
#--- FAIL: TestBroadcastTx (0.01s)
|
||||
#panic: message/group field common.KVPair:bytes without pointer [recovered]
|
||||
# panic: message/group field common.KVPair:bytes without pointer
|
||||
#
|
||||
# ...
|
||||
#
|
||||
# github.com/tendermint/tendermint/rpc/grpc_test.TestBroadcastTx(0xc420a5ab40)
|
||||
# /go/src/github.com/tendermint/tendermint/rpc/grpc/grpc_test.go:29 +0x141
|
||||
[[override]]
|
||||
name = "google.golang.org/genproto"
|
||||
revision = "7fd901a49ba6a7f87732eb344f6e3c5b19d1b200"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/ebuchman/fail-test"
|
||||
revision = "95f809107225be108efcf10a3509e4ea6ceef3c4"
|
||||
|
||||
# last revision used by go-crypto
|
||||
[[constraint]]
|
||||
name = "github.com/btcsuite/btcutil"
|
||||
revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4"
|
||||
|
||||
# Haven't made a release since 2016.
|
||||
[[constraint]]
|
||||
name = "github.com/prometheus/client_golang"
|
||||
revision = "ae27198cdd90bf12cd134ad79d1366a6cf49f632"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/rcrowley/go-metrics"
|
||||
revision = "e2704e165165ec55d062f5919b4b29494e9fa790"
|
||||
|
||||
[[constraint]]
|
||||
name = "golang.org/x/net"
|
||||
revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f"
|
||||
|
||||
[prune]
|
||||
go-tests = true
|
||||
unused-packages = true
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/prometheus/client_golang"
|
||||
version = "0.8.0"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/net"
|
||||
|
92
Makefile
92
Makefile
@@ -1,7 +1,12 @@
|
||||
GOTOOLS = \
|
||||
github.com/mitchellh/gox \
|
||||
github.com/golang/dep/cmd/dep \
|
||||
gopkg.in/alecthomas/gometalinter.v2
|
||||
gopkg.in/alecthomas/gometalinter.v2 \
|
||||
github.com/gogo/protobuf/protoc-gen-gogo \
|
||||
github.com/gogo/protobuf/gogoproto \
|
||||
github.com/square/certstrap
|
||||
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
||||
INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf
|
||||
BUILD_TAGS?=tendermint
|
||||
BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`"
|
||||
|
||||
@@ -11,7 +16,7 @@ check: check_tools ensure_deps
|
||||
|
||||
|
||||
########################################
|
||||
### Build
|
||||
### Build Tendermint
|
||||
|
||||
build:
|
||||
CGO_ENABLED=0 go build $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' -o build/tendermint ./cmd/tendermint/
|
||||
@@ -22,10 +27,29 @@ build_race:
|
||||
install:
|
||||
CGO_ENABLED=0 go install $(BUILD_FLAGS) -tags '$(BUILD_TAGS)' ./cmd/tendermint
|
||||
|
||||
########################################
|
||||
### Build ABCI
|
||||
|
||||
protoc_abci:
|
||||
## If you get the following error,
|
||||
## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
|
||||
## See https://stackoverflow.com/a/25518702
|
||||
protoc $(INCLUDE) --gogo_out=plugins=grpc:. abci/types/*.proto
|
||||
@echo "--> adding nolint declarations to protobuf generated files"
|
||||
@awk '/package abci/types/ { print "//nolint: gas"; print; next }1' abci/types/types.pb.go > abci/types/types.pb.go.new
|
||||
@mv abci/types/types.pb.go.new abci/types/types.pb.go
|
||||
|
||||
build_abci:
|
||||
@go build -i ./abci/cmd/...
|
||||
|
||||
install_abci:
|
||||
@go install ./abci/cmd/...
|
||||
|
||||
########################################
|
||||
### Distribution
|
||||
|
||||
# dist builds binaries for all platforms and packages them for distribution
|
||||
# TODO add abci to these scripts
|
||||
dist:
|
||||
@BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"
|
||||
|
||||
@@ -59,6 +83,17 @@ ensure_deps:
|
||||
@echo "--> Running dep"
|
||||
@dep ensure
|
||||
|
||||
#For ABCI and libs
|
||||
get_protoc:
|
||||
@# https://github.com/google/protobuf/releases
|
||||
curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \
|
||||
cd protobuf-3.4.1 && \
|
||||
DIST_LANG=cpp ./configure && \
|
||||
make && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf protobuf-3.4.1
|
||||
|
||||
draw_deps:
|
||||
@# requires brew install graphviz or apt-get install graphviz
|
||||
go get github.com/RobotsAndPencils/goviz
|
||||
@@ -70,6 +105,37 @@ get_deps_bin_size:
|
||||
@find $(WORK) -type f -name "*.a" | xargs -I{} du -hxs "{}" | sort -rh | sed -e s:${WORK}/::g > deps_bin_size.log
|
||||
@echo "Results can be found here: $(CURDIR)/deps_bin_size.log"
|
||||
|
||||
########################################
|
||||
### Libs
|
||||
|
||||
protoc_libs:
|
||||
## If you get the following error,
|
||||
## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
|
||||
## See https://stackoverflow.com/a/25518702
|
||||
protoc $(INCLUDE) --go_out=plugins=grpc:. libs/common/*.proto
|
||||
@echo "--> adding nolint declarations to protobuf generated files"
|
||||
@awk '/package libs/common/ { print "//nolint: gas"; print; next }1' libs/common/types.pb.go > libs/common/types.pb.go.new
|
||||
@mv libs/common/types.pb.go.new libs/common/types.pb.go
|
||||
|
||||
gen_certs: clean_certs
|
||||
## Generating certificates for TLS testing...
|
||||
certstrap init --common-name "tendermint.com" --passphrase ""
|
||||
certstrap request-cert -ip "::" --passphrase ""
|
||||
certstrap sign "::" --CA "tendermint.com" --passphrase ""
|
||||
mv out/::.crt out/::.key db/remotedb
|
||||
|
||||
clean_certs:
|
||||
## Cleaning TLS testing certificates...
|
||||
rm -rf out
|
||||
rm -f db/remotedb/::.crt db/remotedb/::.key
|
||||
|
||||
test_libs: gen_certs
|
||||
GOCACHE=off go test -tags gcc $(shell go list ./... | grep -v vendor)
|
||||
make clean_certs
|
||||
|
||||
grpc_dbserver:
|
||||
protoc -I db/remotedb/proto/ db/remotedb/proto/defs.proto --go_out=plugins=grpc:db/remotedb/proto
|
||||
|
||||
########################################
|
||||
### Testing
|
||||
|
||||
@@ -87,6 +153,15 @@ test_apps:
|
||||
# requires `abci-cli` and `tendermint` binaries installed
|
||||
bash test/app/test.sh
|
||||
|
||||
test_abci_apps:
|
||||
bash abci/tests/test_app/test.sh
|
||||
|
||||
test_abci_cli:
|
||||
# test the cli against the examples in the tutorial at:
|
||||
# ./docs/abci-cli.md
|
||||
# if test fails, update the docs ^
|
||||
@ bash abci/tests/test_cli/test.sh
|
||||
|
||||
test_persistence:
|
||||
# run the persistence tests using bash
|
||||
# requires `abci-cli` installed
|
||||
@@ -105,17 +180,16 @@ test_p2p:
|
||||
# requires 'tester' the image from above
|
||||
bash test/p2p/test.sh tester
|
||||
|
||||
need_abci:
|
||||
bash scripts/install_abci_apps.sh
|
||||
|
||||
test_integrations:
|
||||
make build_docker_test_image
|
||||
make get_tools
|
||||
make get_vendor_deps
|
||||
make install
|
||||
make need_abci
|
||||
make test_cover
|
||||
make test_apps
|
||||
make test_abci_apps
|
||||
make test_abci_cli
|
||||
make test_libs
|
||||
make test_persistence
|
||||
make test_p2p
|
||||
|
||||
@@ -132,11 +206,11 @@ vagrant_test:
|
||||
### go tests
|
||||
test:
|
||||
@echo "--> Running go test"
|
||||
@GOCACHE=off go test -p 1 $(PACKAGES)
|
||||
@go test $(PACKAGES)
|
||||
|
||||
test_race:
|
||||
@echo "--> Running go test --race"
|
||||
@GOCACHE=off go test -p 1 -v -race $(PACKAGES)
|
||||
@go test -v -race $(PACKAGES)
|
||||
|
||||
|
||||
########################################
|
||||
@@ -233,4 +307,4 @@ build-slate:
|
||||
# To avoid unintended conflicts with file names, always add to .PHONY
|
||||
# unless there is a reason not to.
|
||||
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
||||
.PHONY: check build build_race dist install check_tools get_tools update_tools get_vendor_deps draw_deps test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt build-linux localnet-start localnet-stop build-docker build-docker-localnode sentry-start sentry-config sentry-stop build-slate
|
||||
.PHONY: check build build_race build_abci dist install install_abci check_tools get_tools update_tools get_vendor_deps draw_deps get_protoc protoc_abci protoc_libs gen_certs clean_certs grpc_dbserver test_cover test_apps test_persistence test_p2p test test_race test_integrations test_release test100 vagrant_test fmt build-linux localnet-start localnet-stop build-docker build-docker-localnode sentry-start sentry-config sentry-stop build-slate
|
||||
|
15
README.md
15
README.md
@@ -50,13 +50,13 @@ Go version | Go1.9 or higher
|
||||
|
||||
## Install
|
||||
|
||||
See the [install instructions](/docs/install.rst)
|
||||
See the [install instructions](/docs/install.md)
|
||||
|
||||
## Quick Start
|
||||
|
||||
- [Single node](/docs/using-tendermint.rst)
|
||||
- [Single node](/docs/using-tendermint.md)
|
||||
- [Local cluster using docker-compose](/networks/local)
|
||||
- [Remote cluster using terraform and ansible](/docs/terraform-and-ansible.rst)
|
||||
- [Remote cluster using terraform and ansible](/docs/terraform-and-ansible.md)
|
||||
- [Join the public testnet](https://cosmos.network/testnet)
|
||||
|
||||
## Resources
|
||||
@@ -72,10 +72,7 @@ Additional information about some - and eventually all - of the sub-projects bel
|
||||
|
||||
### Sub-projects
|
||||
|
||||
* [ABCI](http://github.com/tendermint/abci), the Application Blockchain Interface
|
||||
* [Go-Wire](http://github.com/tendermint/go-wire), a deterministic serialization library
|
||||
* [Go-Crypto](http://github.com/tendermint/tendermint/crypto), an elliptic curve cryptography library
|
||||
* [TmLibs](http://github.com/tendermint/tmlibs), an assortment of Go libraries used internally
|
||||
* [Amino](http://github.com/tendermint/go-amino), a reflection-based improvement on proto3
|
||||
* [IAVL](http://github.com/tendermint/iavl), Merkleized IAVL+ Tree implementation
|
||||
|
||||
### Tools
|
||||
@@ -119,8 +116,8 @@ CHANGELOG even if they don't lead to MINOR version bumps:
|
||||
- node
|
||||
|
||||
Exported objects in these packages that are not covered by the versioning scheme
|
||||
are explicitly marked by `// UNSTABLE` in their go doc comment and may change at any time.
|
||||
Functions, types, and values in any other package may also change at any time.
|
||||
are explicitly marked by `// UNSTABLE` in their go doc comment and may change at any
|
||||
time without notice. Functions, types, and values in any other package may also change at any time.
|
||||
|
||||
### Upgrades
|
||||
|
||||
|
174
abci/Makefile
174
abci/Makefile
@@ -1,174 +0,0 @@
|
||||
GOTOOLS = \
|
||||
github.com/mitchellh/gox \
|
||||
github.com/golang/dep/cmd/dep \
|
||||
gopkg.in/alecthomas/gometalinter.v2 \
|
||||
github.com/gogo/protobuf/protoc-gen-gogo \
|
||||
github.com/gogo/protobuf/gogoproto
|
||||
GOTOOLS_CHECK = gox dep gometalinter.v2 protoc protoc-gen-gogo
|
||||
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
||||
INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf
|
||||
|
||||
all: check get_vendor_deps protoc build test install metalinter
|
||||
|
||||
check: check_tools
|
||||
|
||||
|
||||
########################################
|
||||
### Build
|
||||
|
||||
protoc:
|
||||
## If you get the following error,
|
||||
## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
|
||||
## See https://stackoverflow.com/a/25518702
|
||||
protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto
|
||||
@echo "--> adding nolint declarations to protobuf generated files"
|
||||
@awk '/package types/ { print "//nolint: gas"; print; next }1' types/types.pb.go > types/types.pb.go.new
|
||||
@mv types/types.pb.go.new types/types.pb.go
|
||||
|
||||
build:
|
||||
@go build -i ./cmd/...
|
||||
|
||||
dist:
|
||||
@bash scripts/dist.sh
|
||||
@bash scripts/publish.sh
|
||||
|
||||
install:
|
||||
@go install ./cmd/...
|
||||
|
||||
|
||||
########################################
|
||||
### Tools & dependencies
|
||||
|
||||
check_tools:
|
||||
@# https://stackoverflow.com/a/25668869
|
||||
@echo "Found tools: $(foreach tool,$(GOTOOLS_CHECK),\
|
||||
$(if $(shell which $(tool)),$(tool),$(error "No $(tool) in PATH")))"
|
||||
|
||||
get_tools:
|
||||
@echo "--> Installing tools"
|
||||
go get -u -v $(GOTOOLS)
|
||||
@gometalinter.v2 --install
|
||||
|
||||
get_protoc:
|
||||
@# https://github.com/google/protobuf/releases
|
||||
curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \
|
||||
cd protobuf-3.4.1 && \
|
||||
DIST_LANG=cpp ./configure && \
|
||||
make && \
|
||||
make install && \
|
||||
cd .. && \
|
||||
rm -rf protobuf-3.4.1
|
||||
|
||||
update_tools:
|
||||
@echo "--> Updating tools"
|
||||
@go get -u $(GOTOOLS)
|
||||
|
||||
get_vendor_deps:
|
||||
@rm -rf vendor/
|
||||
@echo "--> Running dep ensure"
|
||||
@dep ensure
|
||||
|
||||
|
||||
########################################
|
||||
### Testing
|
||||
|
||||
test:
|
||||
@find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
|
||||
@echo "==> Running go test"
|
||||
@go test $(PACKAGES)
|
||||
|
||||
test_race:
|
||||
@find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
|
||||
@echo "==> Running go test --race"
|
||||
@go test -v -race $(PACKAGES)
|
||||
|
||||
### three tests tested by Jenkins
|
||||
test_cover:
|
||||
@ bash tests/test_cover.sh
|
||||
|
||||
test_apps:
|
||||
# test the counter using a go test script
|
||||
@ bash tests/test_app/test.sh
|
||||
|
||||
test_cli:
|
||||
# test the cli against the examples in the tutorial at:
|
||||
# http://tendermint.readthedocs.io/projects/tools/en/master/abci-cli.html
|
||||
#
|
||||
# XXX: if this test fails, fix it and update the docs at:
|
||||
# https://github.com/tendermint/tendermint/blob/develop/docs/abci-cli.rst
|
||||
@ bash tests/test_cli/test.sh
|
||||
|
||||
########################################
|
||||
### Formatting, linting, and vetting
|
||||
|
||||
fmt:
|
||||
@go fmt ./...
|
||||
|
||||
metalinter:
|
||||
@echo "==> Running linter"
|
||||
gometalinter.v2 --vendor --deadline=600s --disable-all \
|
||||
--enable=maligned \
|
||||
--enable=deadcode \
|
||||
--enable=goconst \
|
||||
--enable=goimports \
|
||||
--enable=gosimple \
|
||||
--enable=ineffassign \
|
||||
--enable=megacheck \
|
||||
--enable=misspell \
|
||||
--enable=staticcheck \
|
||||
--enable=safesql \
|
||||
--enable=structcheck \
|
||||
--enable=unconvert \
|
||||
--enable=unused \
|
||||
--enable=varcheck \
|
||||
--enable=vetshadow \
|
||||
./...
|
||||
#--enable=gas \
|
||||
#--enable=dupl \
|
||||
#--enable=errcheck \
|
||||
#--enable=gocyclo \
|
||||
#--enable=golint \ <== comments on anything exported
|
||||
#--enable=gotype \
|
||||
#--enable=interfacer \
|
||||
#--enable=unparam \
|
||||
#--enable=vet \
|
||||
|
||||
metalinter_all:
|
||||
protoc $(INCLUDE) --lint_out=. types/*.proto
|
||||
gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
|
||||
|
||||
|
||||
########################################
|
||||
### Docker
|
||||
|
||||
DEVDOC_SAVE = docker commit `docker ps -a -n 1 -q` devdoc:local
|
||||
|
||||
docker_build:
|
||||
docker build -t "tendermint/abci-dev" -f Dockerfile.develop .
|
||||
|
||||
docker_run:
|
||||
docker run -it -v "$(CURDIR):/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash
|
||||
|
||||
docker_run_rm:
|
||||
docker run -it --rm -v "$(CURDIR):/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash
|
||||
|
||||
devdoc_init:
|
||||
docker run -it -v "$(CURDIR):/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" tendermint/devdoc echo
|
||||
# TODO make this safer
|
||||
$(call DEVDOC_SAVE)
|
||||
|
||||
devdoc:
|
||||
docker run -it -v "$(CURDIR):/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" devdoc:local bash
|
||||
|
||||
devdoc_save:
|
||||
# TODO make this safer
|
||||
$(call DEVDOC_SAVE)
|
||||
|
||||
devdoc_clean:
|
||||
docker rmi $$(docker images -f "dangling=true" -q)
|
||||
|
||||
|
||||
# To avoid unintended conflicts with file names, always add to .PHONY
|
||||
# unless there is a reason not to.
|
||||
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
||||
.PHONY: check protoc build dist install check_tools get_tools get_protoc update_tools get_vendor_deps test test_race fmt metalinter metalinter_all docker_build docker_run docker_run_rm devdoc_init devdoc devdoc_save devdoc_clean
|
@@ -5,7 +5,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
grpc "google.golang.org/grpc"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
var _ Client = (*grpcClient)(nil)
|
||||
|
@@ -4,7 +4,7 @@ import (
|
||||
"sync"
|
||||
|
||||
types "github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
var _ Client = (*localClient)(nil)
|
||||
|
@@ -11,7 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
const reqQueueSize = 256 // TODO make configurable
|
||||
|
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
abcicli "github.com/tendermint/tendermint/abci/client"
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
servertest "github.com/tendermint/tendermint/abci/tests/server"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/abci/version"
|
||||
"github.com/tendermint/tendermint/crypto/merkle"
|
||||
)
|
||||
|
||||
// client is a global variable so it can be reused by the console
|
||||
@@ -101,7 +100,7 @@ type queryResponse struct {
|
||||
Key []byte
|
||||
Value []byte
|
||||
Height int64
|
||||
Proof *merkle.Proof
|
||||
Proof []byte
|
||||
}
|
||||
|
||||
func Execute() error {
|
||||
@@ -741,7 +740,7 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) {
|
||||
fmt.Printf("-> value.hex: %X\n", rsp.Query.Value)
|
||||
}
|
||||
if rsp.Query.Proof != nil {
|
||||
fmt.Printf("-> proof: %#v\n", rsp.Query.Proof)
|
||||
fmt.Printf("-> proof: %X\n", rsp.Query.Proof)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,5 +6,4 @@ const (
|
||||
CodeTypeEncodingError uint32 = 1
|
||||
CodeTypeBadNonce uint32 = 2
|
||||
CodeTypeUnauthorized uint32 = 3
|
||||
CodeTypeUnknownError uint32 = 4
|
||||
)
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
type CounterApplication struct {
|
||||
|
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
abcicli "github.com/tendermint/tendermint/abci/client"
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
|
@@ -2,7 +2,7 @@ package kvstore
|
||||
|
||||
import (
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
// RandVal creates one random validator, with a key derived
|
||||
|
@@ -2,33 +2,31 @@ package kvstore
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/iavl"
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tendermint/crypto/merkle"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
)
|
||||
|
||||
var (
|
||||
stateKey = []byte("stateKey")
|
||||
stateKey = []byte("stateKey")
|
||||
kvPairPrefixKey = []byte("kvPairKey:")
|
||||
)
|
||||
|
||||
type State struct {
|
||||
db dbm.DB
|
||||
tree *iavl.VersionedTree
|
||||
|
||||
db dbm.DB
|
||||
Size int64 `json:"size"`
|
||||
Height int64 `json:"height"`
|
||||
AppHash []byte `json:"app_hash"`
|
||||
}
|
||||
|
||||
func loadState(db dbm.DB) *State {
|
||||
func loadState(db dbm.DB) State {
|
||||
stateBytes := db.Get(stateKey)
|
||||
var state = new(State)
|
||||
var state State
|
||||
if len(stateBytes) != 0 {
|
||||
err := json.Unmarshal(stateBytes, &state)
|
||||
if err != nil {
|
||||
@@ -36,22 +34,10 @@ func loadState(db dbm.DB) *State {
|
||||
}
|
||||
}
|
||||
state.db = db
|
||||
state.tree = iavl.NewVersionedTree(db, 0)
|
||||
state.tree.LoadVersion(state.Height)
|
||||
return state
|
||||
}
|
||||
|
||||
func saveState(state *State) {
|
||||
hash, version, err := state.tree.SaveVersion()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
state.AppHash = hash
|
||||
if state.Height+1 != version {
|
||||
panic("should not happen, expected version to be 1+state.Height.")
|
||||
}
|
||||
state.Height = version
|
||||
|
||||
func saveState(state State) {
|
||||
stateBytes, err := json.Marshal(state)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -59,6 +45,10 @@ func saveState(state *State) {
|
||||
state.db.Set(stateKey, stateBytes)
|
||||
}
|
||||
|
||||
func prefixKey(key []byte) []byte {
|
||||
return append(kvPairPrefixKey, key...)
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
var _ types.Application = (*KVStoreApplication)(nil)
|
||||
@@ -66,7 +56,7 @@ var _ types.Application = (*KVStoreApplication)(nil)
|
||||
type KVStoreApplication struct {
|
||||
types.BaseApplication
|
||||
|
||||
state *State
|
||||
state State
|
||||
}
|
||||
|
||||
func NewKVStoreApplication() *KVStoreApplication {
|
||||
@@ -87,11 +77,11 @@ func (app *KVStoreApplication) DeliverTx(tx []byte) types.ResponseDeliverTx {
|
||||
} else {
|
||||
key, value = tx, tx
|
||||
}
|
||||
app.state.tree.Set(key, value)
|
||||
app.state.db.Set(prefixKey(key), value)
|
||||
app.state.Size += 1
|
||||
|
||||
tags := []cmn.KVPair{
|
||||
{[]byte("app.creator"), []byte("Cosmoshi Netowoko")},
|
||||
{[]byte("app.creator"), []byte("jae")},
|
||||
{[]byte("app.key"), key},
|
||||
}
|
||||
return types.ResponseDeliverTx{Code: code.CodeTypeOK, Tags: tags}
|
||||
@@ -102,48 +92,30 @@ func (app *KVStoreApplication) CheckTx(tx []byte) types.ResponseCheckTx {
|
||||
}
|
||||
|
||||
func (app *KVStoreApplication) Commit() types.ResponseCommit {
|
||||
// Using a memdb - just return the big endian size of the db
|
||||
appHash := make([]byte, 8)
|
||||
binary.PutVarint(appHash, app.state.Size)
|
||||
app.state.AppHash = appHash
|
||||
app.state.Height += 1
|
||||
saveState(app.state)
|
||||
return types.ResponseCommit{Data: app.state.AppHash}
|
||||
return types.ResponseCommit{Data: appHash}
|
||||
}
|
||||
|
||||
func (app *KVStoreApplication) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery) {
|
||||
key := reqQuery.Data
|
||||
height := app.state.Height
|
||||
if reqQuery.Height != 0 {
|
||||
height = reqQuery.Height
|
||||
}
|
||||
if reqQuery.Prove {
|
||||
value, proof, err := app.state.tree.GetVersionedWithProof(key, height)
|
||||
if err != nil {
|
||||
resQuery.Code = code.CodeTypeUnknownError
|
||||
resQuery.Log = err.Error()
|
||||
return
|
||||
}
|
||||
resQuery.Height = height
|
||||
resQuery.Index = proof.LeftIndex() // TODO make Proof return index
|
||||
resQuery.Key = key
|
||||
value := app.state.db.Get(prefixKey(reqQuery.Data))
|
||||
resQuery.Index = -1 // TODO make Proof return index
|
||||
resQuery.Key = reqQuery.Data
|
||||
resQuery.Value = value
|
||||
if value != nil {
|
||||
resQuery.Proof = &merkle.Proof{
|
||||
// XXX key encoding
|
||||
Ops: []merkle.ProofOp{iavl.NewIAVLValueOp(string(key), proof).ProofOp()},
|
||||
}
|
||||
resQuery.Log = "exists"
|
||||
} else {
|
||||
resQuery.Proof = &merkle.Proof{
|
||||
// XXX key encoding
|
||||
Ops: []merkle.ProofOp{iavl.NewIAVLAbsenceOp(string(key), proof).ProofOp()},
|
||||
}
|
||||
resQuery.Log = "does not exist"
|
||||
}
|
||||
return
|
||||
} else {
|
||||
index, value := app.state.tree.GetVersioned(key, height)
|
||||
resQuery.Height = height
|
||||
resQuery.Index = int64(index) // TODO GetVersioned64?
|
||||
resQuery.Key = key
|
||||
value := app.state.db.Get(prefixKey(reqQuery.Data))
|
||||
resQuery.Value = value
|
||||
resQuery.Proof = nil
|
||||
if value != nil {
|
||||
resQuery.Log = "exists"
|
||||
} else {
|
||||
|
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
abcicli "github.com/tendermint/tendermint/abci/client"
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
@@ -18,13 +18,11 @@ import (
|
||||
)
|
||||
|
||||
func testKVStore(t *testing.T, app types.Application, tx []byte, key, value string) {
|
||||
rdtx := app.DeliverTx(tx)
|
||||
require.False(t, rdtx.IsErr(), rdtx)
|
||||
ar := app.DeliverTx(tx)
|
||||
require.False(t, ar.IsErr(), ar)
|
||||
// repeating tx doesn't raise error
|
||||
rdtx = app.DeliverTx(tx)
|
||||
require.False(t, rdtx.IsErr(), rdtx)
|
||||
rc := app.Commit()
|
||||
require.NotNil(t, rc.Data)
|
||||
ar = app.DeliverTx(tx)
|
||||
require.False(t, ar.IsErr(), ar)
|
||||
|
||||
// make sure query is fine
|
||||
resQuery := app.Query(types.RequestQuery{
|
||||
@@ -254,7 +252,7 @@ func TestClientServer(t *testing.T) {
|
||||
// set up socket app
|
||||
kvstore := NewKVStoreApplication()
|
||||
client, server, err := makeSocketClientServer(kvstore, "kvstore-socket")
|
||||
require.Nil(t, err, "%+v", err)
|
||||
require.Nil(t, err)
|
||||
defer server.Stop()
|
||||
defer client.Stop()
|
||||
|
||||
@@ -283,16 +281,13 @@ func runClientTests(t *testing.T, client abcicli.Client) {
|
||||
}
|
||||
|
||||
func testClient(t *testing.T, app abcicli.Client, tx []byte, key, value string) {
|
||||
rdtx, err := app.DeliverTxSync(tx)
|
||||
ar, err := app.DeliverTxSync(tx)
|
||||
require.NoError(t, err)
|
||||
require.False(t, rdtx.IsErr(), rdtx)
|
||||
require.False(t, ar.IsErr(), ar)
|
||||
// repeating tx doesn't raise error
|
||||
rdtx, err = app.DeliverTxSync(tx)
|
||||
ar, err = app.DeliverTxSync(tx)
|
||||
require.NoError(t, err)
|
||||
require.False(t, rdtx.IsErr(), rdtx)
|
||||
rc, err := app.CommitSync()
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, rc.Data)
|
||||
require.False(t, ar.IsErr(), ar)
|
||||
|
||||
// make sure query is fine
|
||||
resQuery, err := app.QuerySync(types.RequestQuery{
|
||||
|
@@ -9,9 +9,9 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -168,7 +168,7 @@ func (app *PersistentKVStoreApplication) execValidatorTx(tx []byte) types.Respon
|
||||
}
|
||||
|
||||
// update
|
||||
return app.updateValidator(types.Ed25519Validator(pubkey, power))
|
||||
return app.updateValidator(types.Ed25519Validator(pubkey, int64(power)))
|
||||
}
|
||||
|
||||
// add, update, or remove a validator
|
||||
|
@@ -1,12 +0,0 @@
|
||||
FROM golang:1.9.2
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
zip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# We want to ensure that release builds never have any cgo dependencies so we
|
||||
# switch that off at the highest level.
|
||||
ENV CGO_ENABLED 0
|
||||
|
||||
RUN mkdir -p $GOPATH/src/github.com/tendermint/abci
|
||||
WORKDIR $GOPATH/src/github.com/tendermint/abci
|
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
REPO_NAME="abci"
|
||||
|
||||
# Get the version from the environment, or try to figure it out.
|
||||
if [ -z $VERSION ]; then
|
||||
VERSION=$(awk -F\" '/Version =/ { print $2; exit }' < version/version.go)
|
||||
fi
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Please specify a version."
|
||||
exit 1
|
||||
fi
|
||||
echo "==> Building version $VERSION..."
|
||||
|
||||
# Get the parent directory of where this script is.
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||
|
||||
# Change into that dir because we expect that.
|
||||
cd "$DIR"
|
||||
|
||||
# Delete the old dir
|
||||
echo "==> Removing old directory..."
|
||||
rm -rf build/pkg
|
||||
mkdir -p build/pkg
|
||||
|
||||
|
||||
# Do a hermetic build inside a Docker container.
|
||||
docker build -t tendermint/${REPO_NAME}-builder scripts/${REPO_NAME}-builder/
|
||||
docker run --rm -e "BUILD_TAGS=$BUILD_TAGS" -v "$(pwd)":/go/src/github.com/tendermint/${REPO_NAME} tendermint/${REPO_NAME}-builder ./scripts/dist_build.sh
|
||||
|
||||
# Add $REPO_NAME and $VERSION prefix to package name.
|
||||
rm -rf ./build/dist
|
||||
mkdir -p ./build/dist
|
||||
for FILENAME in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type f); do
|
||||
FILENAME=$(basename "$FILENAME")
|
||||
cp "./build/pkg/${FILENAME}" "./build/dist/${REPO_NAME}_${VERSION}_${FILENAME}"
|
||||
done
|
||||
|
||||
# Make the checksums.
|
||||
pushd ./build/dist
|
||||
shasum -a256 ./* > "./${REPO_NAME}_${VERSION}_SHA256SUMS"
|
||||
popd
|
||||
|
||||
# Done
|
||||
echo
|
||||
echo "==> Results:"
|
||||
ls -hl ./build/dist
|
||||
|
||||
exit 0
|
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Get the parent directory of where this script is.
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||
|
||||
# Change into that dir because we expect that.
|
||||
cd "$DIR"
|
||||
|
||||
# Get the git commit
|
||||
GIT_COMMIT="$(git rev-parse --short HEAD)"
|
||||
GIT_DESCRIBE="$(git describe --tags --always)"
|
||||
GIT_IMPORT="github.com/tendermint/abci/version"
|
||||
|
||||
# Determine the arch/os combos we're building for
|
||||
XC_ARCH=${XC_ARCH:-"386 amd64 arm"}
|
||||
XC_OS=${XC_OS:-"solaris darwin freebsd linux windows"}
|
||||
|
||||
# Make sure build tools are available.
|
||||
make get_tools
|
||||
|
||||
# Get VENDORED dependencies
|
||||
make get_vendor_deps
|
||||
|
||||
BINARY="abci-cli"
|
||||
|
||||
# Build!
|
||||
echo "==> Building..."
|
||||
"$(which gox)" \
|
||||
-os="${XC_OS}" \
|
||||
-arch="${XC_ARCH}" \
|
||||
-osarch="!darwin/arm !solaris/amd64 !freebsd/amd64" \
|
||||
-ldflags "-X ${GIT_IMPORT}.GitCommit='${GIT_COMMIT}' -X ${GIT_IMPORT}.GitDescribe='${GIT_DESCRIBE}'" \
|
||||
-output "build/pkg/{{.OS}}_{{.Arch}}/$BINARY" \
|
||||
-tags="${BUILD_TAGS}" \
|
||||
github.com/tendermint/abci/cmd/$BINARY
|
||||
|
||||
# Zip all the files.
|
||||
echo "==> Packaging..."
|
||||
for PLATFORM in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type d); do
|
||||
OSARCH=$(basename "${PLATFORM}")
|
||||
echo "--> ${OSARCH}"
|
||||
|
||||
pushd "$PLATFORM" >/dev/null 2>&1
|
||||
zip "../${OSARCH}.zip" ./*
|
||||
popd >/dev/null 2>&1
|
||||
done
|
||||
|
||||
|
||||
|
||||
exit 0
|
@@ -1,7 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Get the version from the environment, or try to figure it out.
|
||||
if [ -z $VERSION ]; then
|
||||
VERSION=$(awk -F\" '/Version =/ { print $2; exit }' < version/version.go)
|
||||
fi
|
||||
aws s3 cp --recursive build/dist s3://tendermint/binaries/abci/v${VERSION} --acl public-read
|
@@ -6,7 +6,7 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
type GRPCServer struct {
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func NewServer(protoAddr, transport string, app types.Application) (cmn.Service, error) {
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
// var maxNumberConnections = 2
|
||||
|
@@ -1,294 +0,0 @@
|
||||
ABCI Specification
|
||||
==================
|
||||
|
||||
NOTE: this file has moved to `specification.md <./specification.md>`__. It is left to prevent link breakages for the forseable future. It can safely be deleted in a few months.
|
||||
|
||||
Message Types
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
ABCI requests/responses are defined as simple Protobuf messages in `this
|
||||
schema
|
||||
file <https://github.com/tendermint/abci/blob/master/types/types.proto>`__.
|
||||
TendermintCore sends the requests, and the ABCI application sends the
|
||||
responses. Here, we provide an overview of the messages types and how they
|
||||
are used by Tendermint. Then we describe each request-response pair as a
|
||||
function with arguments and return values, and add some notes on usage.
|
||||
|
||||
Some messages (``Echo, Info, InitChain, BeginBlock, EndBlock, Commit``), don't
|
||||
return errors because an error would indicate a critical failure in the
|
||||
application and there's nothing Tendermint can do. The problem should be
|
||||
addressed and both Tendermint and the application restarted. All other
|
||||
messages (``SetOption, Query, CheckTx, DeliverTx``) return an
|
||||
application-specific response ``Code uint32``, where only ``0`` is reserved for
|
||||
``OK``.
|
||||
|
||||
Some messages (``SetOption, Query, CheckTx, DeliverTx``) return
|
||||
non-deterministic data in the form of ``Info`` and ``Log``. The ``Log`` is
|
||||
intended for the literal output from the application's logger, while the
|
||||
``Info`` is any additional info that should be returned.
|
||||
|
||||
The first time a new blockchain is started, Tendermint calls ``InitChain``.
|
||||
From then on, the Block Execution Sequence that causes the committed state to
|
||||
be updated is as follows:
|
||||
|
||||
``BeginBlock, [DeliverTx], EndBlock, Commit``
|
||||
|
||||
where one ``DeliverTx`` is called for each transaction in the block.
|
||||
Cryptographic commitments to the results of DeliverTx, EndBlock, and
|
||||
Commit are included in the header of the next block.
|
||||
|
||||
Tendermint opens three connections to the application to handle the different message
|
||||
types:
|
||||
|
||||
- ``Consensus Connection - InitChain, BeginBlock, DeliverTx, EndBlock, Commit``
|
||||
|
||||
- ``Mempool Connection - CheckTx``
|
||||
|
||||
- ``Info Connection - Info, SetOption, Query``
|
||||
|
||||
The ``Flush`` message is used on every connection, and the ``Echo`` message
|
||||
is only used for debugging.
|
||||
|
||||
Note that messages may be sent concurrently across all connections -
|
||||
a typical application will thus maintain a distinct state for each
|
||||
connection. They may be referred to as the ``DeliverTx state``, the
|
||||
``CheckTx state``, and the ``Commit state`` respectively.
|
||||
|
||||
See below for more details on the message types and how they are used.
|
||||
|
||||
Echo
|
||||
^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Message (string)``: A string to echo back
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Message (string)``: The input string
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Echo a string to test an abci client/server implementation
|
||||
|
||||
Flush
|
||||
^^^^^
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Signals that messages queued on the client should be flushed to
|
||||
the server. It is called periodically by the client implementation
|
||||
to ensure asynchronous requests are actually sent, and is called
|
||||
immediately to make a synchronous request, which returns when the
|
||||
Flush response comes back.
|
||||
|
||||
Info
|
||||
^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Version (string)``: The Tendermint version
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Data (string)``: Some arbitrary information
|
||||
- ``Version (Version)``: Version information
|
||||
- ``LastBlockHeight (int64)``: Latest block for which the app has
|
||||
called Commit
|
||||
- ``LastBlockAppHash ([]byte)``: Latest result of Commit
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Return information about the application state.
|
||||
- Used to sync Tendermint with the application during a handshake that
|
||||
happens on startup.
|
||||
- Tendermint expects ``LastBlockAppHash`` and ``LastBlockHeight`` to be
|
||||
updated during ``Commit``, ensuring that ``Commit`` is never called twice
|
||||
for the same block height.
|
||||
|
||||
SetOption
|
||||
^^^^^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Key (string)``: Key to set
|
||||
- ``Value (string)``: Value to set for key
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Code (uint32)``: Response code
|
||||
- ``Log (string)``: The output of the application's logger. May be non-deterministic.
|
||||
- ``Info (string)``: Additional information. May be non-deterministic.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Set non-consensus critical application specific options.
|
||||
- e.g. Key="min-fee", Value="100fermion" could set the minimum fee required for CheckTx
|
||||
(but not DeliverTx - that would be consensus critical).
|
||||
|
||||
InitChain
|
||||
^^^^^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Validators ([]Validator)``: Initial genesis validators
|
||||
- ``AppStateBytes ([]byte)``: Serialized initial application state
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Called once upon genesis.
|
||||
|
||||
Query
|
||||
^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Data ([]byte)``: Raw query bytes. Can be used with or in lieu of
|
||||
Path.
|
||||
- ``Path (string)``: Path of request, like an HTTP GET path. Can be
|
||||
used with or in liue of Data.
|
||||
- Apps MUST interpret '/store' as a query by key on the underlying
|
||||
store. The key SHOULD be specified in the Data field.
|
||||
- Apps SHOULD allow queries over specific types like '/accounts/...'
|
||||
or '/votes/...'
|
||||
- ``Height (int64)``: The block height for which you want the query
|
||||
(default=0 returns data for the latest committed block). Note that
|
||||
this is the height of the block containing the application's
|
||||
Merkle root hash, which represents the state as it was after
|
||||
committing the block at Height-1
|
||||
- ``Prove (bool)``: Return Merkle proof with response if possible
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Code (uint32)``: Response code.
|
||||
- ``Log (string)``: The output of the application's logger. May be non-deterministic.
|
||||
- ``Info (string)``: Additional information. May be non-deterministic.
|
||||
- ``Index (int64)``: The index of the key in the tree.
|
||||
- ``Key ([]byte)``: The key of the matching data.
|
||||
- ``Value ([]byte)``: The value of the matching data.
|
||||
- ``Proof ([]byte)``: Proof for the data, if requested.
|
||||
- ``Height (int64)``: The block height from which data was derived.
|
||||
Note that this is the height of the block containing the
|
||||
application's Merkle root hash, which represents the state as it
|
||||
was after committing the block at Height-1
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Query for data from the application at current or past height.
|
||||
- Optionally return Merkle proof.
|
||||
|
||||
BeginBlock
|
||||
^^^^^^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Hash ([]byte)``: The block's hash. This can be derived from the
|
||||
block header.
|
||||
- ``Header (struct{})``: The block header
|
||||
- ``AbsentValidators ([]int32)``: List of indices of validators not
|
||||
included in the LastCommit
|
||||
- ``ByzantineValidators ([]Evidence)``: List of evidence of
|
||||
validators that acted maliciously
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Signals the beginning of a new block. Called prior to any DeliverTxs.
|
||||
- The header is expected to at least contain the Height.
|
||||
- The ``AbsentValidators`` and ``ByzantineValidators`` can be used to
|
||||
determine rewards and punishments for the validators.
|
||||
|
||||
CheckTx
|
||||
^^^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Tx ([]byte)``: The request transaction bytes
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Code (uint32)``: Response code
|
||||
- ``Data ([]byte)``: Result bytes, if any.
|
||||
- ``Log (string)``: The output of the application's logger. May be non-deterministic.
|
||||
- ``Info (string)``: Additional information. May be non-deterministic.
|
||||
- ``GasWanted (int64)``: Amount of gas request for transaction.
|
||||
- ``GasUsed (int64)``: Amount of gas consumed by transaction.
|
||||
- ``Tags ([]cmn.KVPair)``: Key-Value tags for filtering and indexing transactions (eg. by account).
|
||||
- ``Fee (cmn.KI64Pair)``: Fee paid for the transaction.
|
||||
|
||||
- **Usage**: Validate a mempool transaction, prior to broadcasting or
|
||||
proposing. CheckTx should perform stateful but light-weight checks
|
||||
of the validity of the transaction (like checking signatures and account balances),
|
||||
but need not execute in full (like running a smart contract).
|
||||
|
||||
Tendermint runs CheckTx and DeliverTx concurrently with eachother,
|
||||
though on distinct ABCI connections - the mempool connection and the consensus
|
||||
connection, respectively.
|
||||
|
||||
The application should maintain a separate state to support CheckTx.
|
||||
This state can be reset to the latest committed state during ``Commit``,
|
||||
where Tendermint ensures the mempool is locked and not sending new ``CheckTx``.
|
||||
After ``Commit``, the mempool will rerun CheckTx on all remaining
|
||||
transactions, throwing out any that are no longer valid.
|
||||
|
||||
Keys and values in Tags must be UTF-8 encoded strings (e.g. "account.owner": "Bob", "balance": "100.0", "date": "2018-01-02")
|
||||
|
||||
|
||||
DeliverTx
|
||||
^^^^^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Tx ([]byte)``: The request transaction bytes.
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Code (uint32)``: Response code.
|
||||
- ``Data ([]byte)``: Result bytes, if any.
|
||||
- ``Log (string)``: The output of the application's logger. May be non-deterministic.
|
||||
- ``Info (string)``: Additional information. May be non-deterministic.
|
||||
- ``GasWanted (int64)``: Amount of gas requested for transaction.
|
||||
- ``GasUsed (int64)``: Amount of gas consumed by transaction.
|
||||
- ``Tags ([]cmn.KVPair)``: Key-Value tags for filtering and indexing transactions (eg. by account).
|
||||
- ``Fee (cmn.KI64Pair)``: Fee paid for the transaction.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Deliver a transaction to be executed in full by the application. If the transaction is valid,
|
||||
returns CodeType.OK.
|
||||
- Keys and values in Tags must be UTF-8 encoded strings (e.g. "account.owner": "Bob", "balance": "100.0", "time": "2018-01-02T12:30:00Z")
|
||||
|
||||
EndBlock
|
||||
^^^^^^^^
|
||||
|
||||
- **Arguments**:
|
||||
|
||||
- ``Height (int64)``: Height of the block just executed.
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``ValidatorUpdates ([]Validator)``: Changes to validator set (set
|
||||
voting power to 0 to remove).
|
||||
- ``ConsensusParamUpdates (ConsensusParams)``: Changes to
|
||||
consensus-critical time, size, and other parameters.
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Signals the end of a block.
|
||||
- Called prior to each Commit, after all transactions.
|
||||
- Validator set and consensus params are updated with the result.
|
||||
- Validator pubkeys are expected to be go-wire encoded.
|
||||
|
||||
Commit
|
||||
^^^^^^
|
||||
|
||||
- **Returns**:
|
||||
|
||||
- ``Data ([]byte)``: The Merkle root hash
|
||||
|
||||
- **Usage**:
|
||||
|
||||
- Persist the application state.
|
||||
- Return a Merkle root hash of the application state.
|
||||
- It's critical that all application instances return the same hash. If not,
|
||||
they will not be able to agree on the next block, because the hash is
|
||||
included in the next block!
|
@@ -6,7 +6,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"reflect"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
abcicli "github.com/tendermint/tendermint/abci/client"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func InitChain(client abcicli.Client) error {
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
abcicli "github.com/tendermint/tendermint/abci/client"
|
||||
"github.com/tendermint/tendermint/abci/types"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
func startClient(abciType string) abcicli.Client {
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
echo "" > coverage.txt
|
||||
|
||||
echo "==> Running unit tests"
|
||||
for d in $(go list ./... | grep -v vendor); do
|
||||
go test -race -coverprofile=profile.out -covermode=atomic "$d"
|
||||
if [ -f profile.out ]; then
|
||||
cat profile.out >> coverage.txt
|
||||
rm profile.out
|
||||
fi
|
||||
done
|
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func TestMarshalJSON(t *testing.T) {
|
||||
|
@@ -50,8 +50,7 @@ import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
import common "github.com/tendermint/tmlibs/common"
|
||||
import merkle "github.com/tendermint/tendermint/crypto/merkle"
|
||||
import common "github.com/tendermint/tendermint/libs/common"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
@@ -1289,13 +1288,13 @@ func (m *ResponseInitChain) GetValidators() []Validator {
|
||||
type ResponseQuery struct {
|
||||
Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
// bytes data = 2; // use "value" instead.
|
||||
Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"`
|
||||
Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"`
|
||||
Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"`
|
||||
Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Proof *merkle.Proof `protobuf:"bytes,8,opt,name=proof" json:"proof,omitempty"`
|
||||
Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"`
|
||||
Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"`
|
||||
Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"`
|
||||
Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"`
|
||||
Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Proof []byte `protobuf:"bytes,8,opt,name=proof,proto3" json:"proof,omitempty"`
|
||||
Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ResponseQuery) Reset() { *m = ResponseQuery{} }
|
||||
@@ -1345,7 +1344,7 @@ func (m *ResponseQuery) GetValue() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ResponseQuery) GetProof() *merkle.Proof {
|
||||
func (m *ResponseQuery) GetProof() []byte {
|
||||
if m != nil {
|
||||
return m.Proof
|
||||
}
|
||||
@@ -2336,123 +2335,121 @@ var _ABCIApplication_serviceDesc = grpc.ServiceDesc{
|
||||
func init() { proto.RegisterFile("types/types.proto", fileDescriptorTypes) }
|
||||
|
||||
var fileDescriptorTypes = []byte{
|
||||
// 1874 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4b, 0x93, 0x1b, 0x49,
|
||||
0x11, 0x1e, 0xbd, 0xd5, 0x39, 0x0f, 0xc9, 0x35, 0xb6, 0x47, 0xd6, 0x06, 0x61, 0x47, 0x43, 0x78,
|
||||
0xc7, 0xec, 0xec, 0x08, 0x66, 0xd7, 0x0e, 0x7b, 0x0d, 0x1b, 0xcc, 0xcc, 0x9a, 0xd5, 0xc4, 0xf2,
|
||||
0x18, 0xda, 0x5e, 0x13, 0xc1, 0x45, 0x51, 0x52, 0xd7, 0xb4, 0x3a, 0xac, 0x7e, 0x6c, 0x57, 0x69,
|
||||
0x56, 0xf2, 0x8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||||
0xde, 0xb2, 0x94, 0x8c, 0x3c, 0xd6, 0xf5, 0xaf, 0x82, 0x41, 0xb3, 0xec, 0xd8, 0x0b, 0xff, 0x0a,
|
||||
0x8f, 0x95, 0x12, 0xe4, 0x31, 0x00, 0x67, 0x62, 0x12, 0x84, 0xc2, 0x0d, 0xfc, 0x41, 0x0b, 0xe5,
|
||||
0x0f, 0xf2, 0xf2, 0xcf, 0x99, 0xf8, 0x25, 0xb2, 0xc7, 0x5b, 0x96, 0xc1, 0x63, 0x42, 0x6a, 0xba,
|
||||
0xbe, 0x2b, 0x26, 0xb3, 0x39, 0x75, 0xfd, 0x41, 0xbb, 0x4c, 0xf3, 0xc2, 0x77, 0xc5, 0xb9, 0x64,
|
||||
0x4b, 0x4d, 0x37, 0x26, 0xa4, 0x29, 0x5f, 0x2d, 0x59, 0xb4, 0x1e, 0x74, 0xca, 0x4c, 0xf9, 0x95,
|
||||
0x64, 0x49, 0x53, 0x50, 0x86, 0x3c, 0x85, 0xed, 0x29, 0x73, 0x5c, 0x7f, 0x32, 0x5d, 0x04, 0xb3,
|
||||
0x57, 0x83, 0x2e, 0xaa, 0x0c, 0xf2, 0x2a, 0x67, 0x52, 0xe0, 0x4c, 0xf2, 0xc7, 0x5b, 0x16, 0x4c,
|
||||
0x13, 0x8a, 0x9c, 0x40, 0x77, 0x36, 0x67, 0xb3, 0x57, 0x13, 0xb1, 0x1a, 0x18, 0xa8, 0x79, 0x2b,
|
||||
0xaf, 0x79, 0x2e, 0xb9, 0x2f, 0x56, 0xe3, 0x2d, 0xab, 0x33, 0x53, 0x4b, 0x69, 0x97, 0xcd, 0x16,
|
||||
0xee, 0x35, 0x8b, 0xa4, 0xd6, 0x7e, 0x99, 0x5d, 0x9f, 0x29, 0x3e, 0xea, 0x19, 0x76, 0x4c, 0x90,
|
||||
0x87, 0x60, 0x30, 0xdf, 0xd6, 0x17, 0xdd, 0x46, 0xc5, 0xdb, 0x85, 0x5f, 0xd4, 0xb7, 0xe3, 0x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0x59, 0xc9, 0x27, 0xd0, 0x14, 0xd4, 0x91, 0xbe, 0x94, 0xee,
|
||||
0xd8, 0x3b, 0x56, 0x1d, 0xf4, 0xf1, 0x17, 0x2f, 0x2f, 0xa9, 0x1b, 0x9d, 0xdd, 0x96, 0xce, 0xf8,
|
||||
0xd7, 0x9b, 0xbb, 0x7b, 0x52, 0xe6, 0x28, 0xf0, 0x5c, 0xc1, 0xbc, 0x50, 0xac, 0x2d, 0xd4, 0x31,
|
||||
0xff, 0x5d, 0x93, 0x20, 0x9e, 0x4b, 0xe2, 0x52, 0xd7, 0xc4, 0x91, 0x5a, 0xcf, 0xd4, 0xd9, 0x77,
|
||||
0x73, 0xd7, 0x77, 0x00, 0x1c, 0xca, 0x27, 0x5f, 0x53, 0x5f, 0x30, 0x5b, 0xfb, 0xcc, 0x70, 0x28,
|
||||
0xff, 0x35, 0x6e, 0xc8, 0x76, 0x44, 0xb2, 0x97, 0x9c, 0xd9, 0xe8, 0xbc, 0x86, 0xd5, 0x71, 0x28,
|
||||
0xff, 0x92, 0x33, 0x3b, 0xb1, 0xab, 0xf3, 0xdf, 0xdb, 0x45, 0x0e, 0xa1, 0x71, 0xc5, 0x98, 0x76,
|
||||
0x72, 0x3f, 0x51, 0xbd, 0x78, 0xf4, 0x31, 0x2a, 0xab, 0x08, 0x91, 0x22, 0xe6, 0x6f, 0xeb, 0x69,
|
||||
0xac, 0xa6, 0xb5, 0xee, 0xff, 0xcb, 0x07, 0xff, 0xc0, 0xe6, 0x31, 0x8f, 0xac, 0xe4, 0x1c, 0x6e,
|
||||
0x24, 0x19, 0x34, 0x59, 0x86, 0x36, 0x95, 0x4d, 0x59, 0xed, 0xad, 0x29, 0xd7, 0x4f, 0x14, 0xbe,
|
||||
0x54, 0xf2, 0xe4, 0x17, 0x70, 0x50, 0xc8, 0xf9, 0xe4, 0xa8, 0xfa, 0x5b, 0x53, 0xff, 0x56, 0x3e,
|
||||
0xf5, 0xe3, 0xf3, 0x62, 0x7f, 0x34, 0xbe, 0x45, 0xac, 0x7f, 0x4f, 0x76, 0x3d, 0xd9, 0x4a, 0x50,
|
||||
0xf6, 0x8b, 0x9a, 0x7f, 0xa8, 0x41, 0xaf, 0x70, 0x19, 0x32, 0x02, 0x50, 0x40, 0xca, 0xdd, 0xd7,
|
||||
0x4c, 0x63, 0x56, 0xec, 0x03, 0x74, 0xd6, 0x73, 0xf7, 0x35, 0xb3, 0x8c, 0x69, 0xbc, 0x24, 0xf7,
|
||||
0xa1, 0x23, 0x56, 0x4a, 0x3a, 0xdf, 0x17, 0xbe, 0x58, 0xa1, 0x68, 0x5b, 0xe0, 0x7f, 0xf2, 0x10,
|
||||
0x76, 0xd4, 0xc1, 0x4e, 0xc0, 0xb9, 0x1b, 0xea, 0xde, 0x84, 0x64, 0x8f, 0xfe, 0x1c, 0x39, 0xd6,
|
||||
0xf6, 0x34, 0x25, 0xcc, 0xdf, 0x80, 0x91, 0x7c, 0x96, 0xbc, 0x07, 0x86, 0x47, 0x57, 0xba, 0x69,
|
||||
0x96, 0x77, 0x6b, 0x59, 0x5d, 0x8f, 0xae, 0xb0, 0x5f, 0x26, 0x07, 0xd0, 0x91, 0x4c, 0xb1, 0x52,
|
||||
0xfe, 0x6e, 0x59, 0x6d, 0x8f, 0xae, 0x5e, 0xac, 0x12, 0x86, 0x43, 0x79, 0xdc, 0x11, 0x7b, 0x74,
|
||||
0xf5, 0x39, 0xe5, 0xe6, 0xa7, 0xd0, 0x56, 0x97, 0x7c, 0xa7, 0x83, 0xa5, 0x7e, 0x3d, 0xa7, 0xff,
|
||||
0x13, 0xd8, 0xce, 0xdc, 0x9b, 0xfc, 0x10, 0x6e, 0x29, 0x0b, 0x43, 0x1a, 0x09, 0xf4, 0x48, 0xee,
|
||||
0x40, 0x82, 0xcc, 0x4b, 0x1a, 0x09, 0xf9, 0x49, 0xd5, 0xe3, 0xff, 0xa9, 0x0e, 0x6d, 0xd5, 0x3f,
|
||||
0x93, 0xfb, 0x99, 0x61, 0x05, 0x8b, 0xe4, 0xd9, 0xf6, 0xdf, 0xdf, 0xdc, 0xed, 0x60, 0x3d, 0xb9,
|
||||
0xf8, 0x2c, 0x9d, 0x5c, 0x52, 0xc0, 0xac, 0xe7, 0xda, 0xfb, 0x78, 0x00, 0x6a, 0x64, 0x06, 0xa0,
|
||||
0x03, 0xe8, 0xf8, 0x4b, 0x0f, 0x5d, 0xd2, 0x54, 0x2e, 0xf1, 0x97, 0x9e, 0x74, 0xc9, 0x7b, 0x60,
|
||||
0x88, 0x40, 0xd0, 0x05, 0xb2, 0x54, 0x92, 0x76, 0x71, 0x43, 0x32, 0xef, 0x43, 0x2f, 0x5b, 0x7c,
|
||||
0x65, 0x31, 0x55, 0x58, 0xbf, 0x9b, 0x96, 0x5e, 0x39, 0x10, 0xbc, 0x0f, 0xbd, 0xb4, 0xee, 0x28,
|
||||
0x39, 0x85, 0xff, 0x7b, 0xe9, 0x36, 0x0a, 0xde, 0x81, 0x6e, 0x52, 0x96, 0xbb, 0x28, 0xd1, 0xa1,
|
||||
0xaa, 0x1a, 0xcb, 0x39, 0x3a, 0x8c, 0x82, 0x30, 0xe0, 0x2c, 0xd2, 0xfd, 0x56, 0x55, 0xc2, 0x25,
|
||||
0x72, 0xa6, 0x0b, 0x46, 0xc2, 0x94, 0x3d, 0x04, 0xb5, 0xed, 0x88, 0x71, 0xae, 0xdb, 0xf5, 0x98,
|
||||
0x24, 0x47, 0xd0, 0x09, 0x97, 0xd3, 0x89, 0x2c, 0x55, 0xf9, 0xc0, 0xbc, 0x5c, 0x4e, 0xbf, 0x60,
|
||||
0xeb, 0x78, 0x60, 0x09, 0x91, 0xc2, 0xe9, 0x28, 0xf8, 0x9a, 0x45, 0xda, 0x7f, 0x8a, 0x30, 0x05,
|
||||
0xf4, 0x8b, 0xd3, 0x0a, 0xf9, 0x18, 0x8c, 0xc4, 0xbe, 0x42, 0x82, 0x14, 0xef, 0x9c, 0x0a, 0xca,
|
||||
0x8e, 0x86, 0xbb, 0x8e, 0xcf, 0xec, 0x49, 0xea, 0x5b, 0xbc, 0x57, 0xd7, 0xea, 0x29, 0xc6, 0xcf,
|
||||
0x62, 0xe7, 0x9a, 0x3f, 0x80, 0xb6, 0xba, 0x23, 0xfe, 0xa8, 0xeb, 0x30, 0x6e, 0xb7, 0x70, 0x5d,
|
||||
0x9a, 0xc9, 0x7f, 0xac, 0x41, 0x37, 0x9e, 0x86, 0x4a, 0x95, 0x72, 0x97, 0xae, 0xbf, 0xeb, 0xa5,
|
||||
0xab, 0x46, 0xc9, 0x38, 0xd6, 0x9a, 0x99, 0x58, 0x3b, 0x02, 0xa2, 0x42, 0xea, 0x3a, 0x10, 0xae,
|
||||
0xef, 0x4c, 0x94, 0x37, 0x55, 0x6c, 0xf5, 0x91, 0xf3, 0x12, 0x19, 0x97, 0x72, 0xff, 0xe4, 0x9b,
|
||||
0x16, 0xf4, 0x4e, 0xcf, 0xce, 0x2f, 0x4e, 0xc3, 0x70, 0xe1, 0xce, 0x28, 0x36, 0x61, 0x23, 0x68,
|
||||
0x62, 0x9b, 0x59, 0xf2, 0x58, 0x35, 0x2c, 0x9b, 0x77, 0xc8, 0x09, 0xb4, 0xb0, 0xdb, 0x24, 0x65,
|
||||
0x6f, 0x56, 0xc3, 0xd2, 0xb1, 0x47, 0x7e, 0x44, 0xf5, 0xa3, 0x9b, 0x4f, 0x57, 0xc3, 0xb2, 0xd9,
|
||||
0x87, 0x7c, 0x0a, 0x46, 0xda, 0x27, 0x56, 0x3d, 0x60, 0x0d, 0x2b, 0xa7, 0x20, 0xa9, 0x9f, 0xd6,
|
||||
0xda, 0xaa, 0xe7, 0x9e, 0x61, 0xe5, 0xb8, 0x40, 0x1e, 0x43, 0x27, 0xee, 0x56, 0xca, 0x9f, 0x98,
|
||||
0x86, 0x15, 0x13, 0x8a, 0x74, 0x8f, 0x6a, 0x00, 0xcb, 0xde, 0xc1, 0x86, 0xa5, 0x63, 0x14, 0x79,
|
||||
0x08, 0x6d, 0x5d, 0x30, 0x4a, 0x1f, 0x8b, 0x86, 0xe5, 0x73, 0x86, 0x34, 0x32, 0x6d, 0x7e, 0xab,
|
||||
0xde, 0xea, 0x86, 0x95, 0xf3, 0x1e, 0x39, 0x05, 0xc8, 0x74, 0x79, 0x95, 0x8f, 0x70, 0xc3, 0xea,
|
||||
0x39, 0x8e, 0x3c, 0x85, 0x6e, 0x3a, 0x9b, 0x97, 0x3f, 0x8e, 0x0d, 0xab, 0x46, 0xab, 0x69, 0x1b,
|
||||
0x1f, 0x50, 0x3f, 0xfa, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x11, 0x49, 0xc5, 0xab, 0xf9, 0x15,
|
||||
0x00, 0x00,
|
||||
// 1846 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcd, 0x6e, 0x1b, 0xc9,
|
||||
0x11, 0x16, 0xff, 0x39, 0xa5, 0x1f, 0xd2, 0x2d, 0xdb, 0xa2, 0xb9, 0x08, 0x6c, 0x0c, 0x02, 0xaf,
|
||||
0x9c, 0xd5, 0x8a, 0x89, 0x76, 0x6d, 0xd8, 0xbb, 0xc9, 0x22, 0x92, 0xd6, 0x59, 0x0a, 0x9b, 0x1f,
|
||||
0x65, 0xec, 0x75, 0x80, 0x5c, 0x88, 0x26, 0xa7, 0x45, 0x0e, 0x4c, 0xce, 0xcc, 0x4e, 0x37, 0xb5,
|
||||
0x94, 0x6f, 0xb9, 0x2f, 0x72, 0xcd, 0x39, 0x2f, 0x90, 0x43, 0x80, 0xbc, 0x42, 0x90, 0x97, 0x88,
|
||||
0x0f, 0x49, 0x4e, 0x79, 0x89, 0x04, 0x55, 0xdd, 0xf3, 0xab, 0xa1, 0xe1, 0x38, 0xc7, 0xbd, 0x48,
|
||||
0x5d, 0x5d, 0x55, 0x3d, 0x5d, 0xc5, 0xaa, 0xaf, 0xaa, 0x1a, 0x6e, 0xa8, 0xab, 0x50, 0xc8, 0x01,
|
||||
0xfd, 0x3d, 0x0c, 0xa3, 0x40, 0x05, 0xac, 0x41, 0x44, 0xff, 0xc3, 0xa9, 0xa7, 0x66, 0xcb, 0xf1,
|
||||
0xe1, 0x24, 0x58, 0x0c, 0xa6, 0xc1, 0x34, 0x18, 0x10, 0x77, 0xbc, 0xbc, 0x20, 0x8a, 0x08, 0x5a,
|
||||
0x69, 0xad, 0xfe, 0x20, 0x23, 0xae, 0x84, 0xef, 0x8a, 0x68, 0xe1, 0xf9, 0x6a, 0xa0, 0x16, 0x73,
|
||||
0x6f, 0x2c, 0x07, 0x93, 0x60, 0xb1, 0x08, 0xfc, 0xec, 0x67, 0xec, 0xbf, 0xd6, 0xa1, 0xe5, 0x88,
|
||||
0xaf, 0x97, 0x42, 0x2a, 0xb6, 0x0f, 0x75, 0x31, 0x99, 0x05, 0xbd, 0xea, 0xbd, 0xca, 0xfe, 0xe6,
|
||||
0x11, 0x3b, 0xd4, 0x72, 0x86, 0xfb, 0x74, 0x32, 0x0b, 0x86, 0x1b, 0x0e, 0x49, 0xb0, 0x0f, 0xa0,
|
||||
0x71, 0x31, 0x5f, 0xca, 0x59, 0xaf, 0x46, 0xa2, 0xbb, 0x79, 0xd1, 0x9f, 0x21, 0x6b, 0xb8, 0xe1,
|
||||
0x68, 0x19, 0x3c, 0xd6, 0xf3, 0x2f, 0x82, 0x5e, 0xbd, 0xec, 0xd8, 0x33, 0xff, 0x82, 0x8e, 0x45,
|
||||
0x09, 0xf6, 0x18, 0x40, 0x0a, 0x35, 0x0a, 0x42, 0xe5, 0x05, 0x7e, 0xaf, 0x41, 0xf2, 0x7b, 0x79,
|
||||
0xf9, 0x67, 0x42, 0xfd, 0x8a, 0xd8, 0xc3, 0x0d, 0xc7, 0x92, 0x31, 0x81, 0x9a, 0x9e, 0xef, 0xa9,
|
||||
0xd1, 0x64, 0xc6, 0x3d, 0xbf, 0xd7, 0x2c, 0xd3, 0x3c, 0xf3, 0x3d, 0x75, 0x8a, 0x6c, 0xd4, 0xf4,
|
||||
0x62, 0x02, 0x4d, 0xf9, 0x7a, 0x29, 0xa2, 0xab, 0x5e, 0xab, 0xcc, 0x94, 0x5f, 0x23, 0x0b, 0x4d,
|
||||
0x21, 0x19, 0xf6, 0x29, 0x6c, 0x8e, 0xc5, 0xd4, 0xf3, 0x47, 0xe3, 0x79, 0x30, 0x79, 0xd9, 0x6b,
|
||||
0x93, 0x4a, 0x2f, 0xaf, 0x72, 0x82, 0x02, 0x27, 0xc8, 0x1f, 0x6e, 0x38, 0x30, 0x4e, 0x28, 0x76,
|
||||
0x04, 0xed, 0xc9, 0x4c, 0x4c, 0x5e, 0x8e, 0xd4, 0xaa, 0x67, 0x91, 0xe6, 0xad, 0xbc, 0xe6, 0x29,
|
||||
0x72, 0x9f, 0xaf, 0x86, 0x1b, 0x4e, 0x6b, 0xa2, 0x97, 0x68, 0x97, 0x2b, 0xe6, 0xde, 0xa5, 0x88,
|
||||
0x50, 0x6b, 0xb7, 0xcc, 0xae, 0xcf, 0x35, 0x9f, 0xf4, 0x2c, 0x37, 0x26, 0xd8, 0x43, 0xb0, 0x84,
|
||||
0xef, 0x9a, 0x8b, 0x6e, 0x92, 0xe2, 0xed, 0xc2, 0x2f, 0xea, 0xbb, 0xf1, 0x35, 0xdb, 0xc2, 0xac,
|
||||
0xd9, 0x21, 0x34, 0x31, 0x4a, 0x3c, 0xd5, 0xdb, 0x22, 0x9d, 0x9b, 0x85, 0x2b, 0x12, 0x6f, 0xb8,
|
||||
0xe1, 0x18, 0xa9, 0x93, 0x16, 0x34, 0x2e, 0xf9, 0x7c, 0x29, 0xec, 0xf7, 0x61, 0x33, 0x13, 0x29,
|
||||
0xac, 0x07, 0xad, 0x85, 0x90, 0x92, 0x4f, 0x45, 0xaf, 0x72, 0xaf, 0xb2, 0x6f, 0x39, 0x31, 0x69,
|
||||
0xef, 0xc0, 0x56, 0x36, 0x4e, 0x32, 0x8a, 0x18, 0x0b, 0xa8, 0x78, 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0, 0x7d, 0xe8,
|
||||
0xa4, 0x85, 0x46, 0xcb, 0x69, 0xc0, 0xdf, 0x49, 0xb7, 0x49, 0xf0, 0x0e, 0xb4, 0x93, 0x3a, 0xac,
|
||||
0xc1, 0xbf, 0xc5, 0x75, 0xf9, 0xc5, 0xc1, 0x39, 0x8c, 0x82, 0x30, 0x90, 0x22, 0x32, 0x0d, 0xd6,
|
||||
0xba, 0x84, 0x4b, 0xe4, 0x6c, 0x0f, 0xac, 0x84, 0x89, 0x4d, 0x03, 0x77, 0xdd, 0x48, 0x48, 0x69,
|
||||
0xfa, 0xf3, 0x98, 0x64, 0x07, 0xd0, 0x0a, 0x97, 0xe3, 0x11, 0xd6, 0xa6, 0x7c, 0x60, 0x9e, 0x2f,
|
||||
0xc7, 0x5f, 0x8a, 0xab, 0x78, 0x42, 0x09, 0x89, 0xa2, 0xea, 0x14, 0x7c, 0x23, 0x22, 0xe3, 0x3f,
|
||||
0x4d, 0xd8, 0x0a, 0xba, 0xc5, 0xf1, 0x84, 0x7d, 0x0c, 0x56, 0x62, 0x5f, 0x21, 0x41, 0x8a, 0x77,
|
||||
0x4e, 0x05, 0xb1, 0x85, 0x91, 0xde, 0xd4, 0x17, 0xee, 0x28, 0xf5, 0x2d, 0xdd, 0xab, 0xed, 0x74,
|
||||
0x34, 0xe3, 0xe7, 0xb1, 0x73, 0xed, 0x1f, 0x42, 0x53, 0xdf, 0x91, 0x7e, 0xd4, 0xab, 0x30, 0xee,
|
||||
0xaf, 0x68, 0x5d, 0x9a, 0xc9, 0x7f, 0xaa, 0x40, 0x3b, 0x1e, 0x7f, 0x4a, 0x95, 0x72, 0x97, 0xae,
|
||||
0xbe, 0xed, 0xa5, 0xd7, 0xcd, 0x8e, 0x71, 0xac, 0xd5, 0x33, 0xb1, 0x76, 0x00, 0x4c, 0x87, 0xd4,
|
||||
0x65, 0xa0, 0x3c, 0x7f, 0x3a, 0xd2, 0xde, 0xd4, 0xb1, 0xd5, 0x25, 0xce, 0x0b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-5,7 +5,6 @@ package types;
|
||||
// https://github.com/gogo/protobuf/blob/master/extensions.md
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
import "github.com/tendermint/tmlibs/common/types.proto";
|
||||
import "github.com/tendermint/tendermint/crypto/merkle/merkle.proto";
|
||||
|
||||
// This file is copied from http://github.com/tendermint/abci
|
||||
// NOTE: When using custom types, mind the warnings.
|
||||
@@ -144,7 +143,7 @@ message ResponseQuery {
|
||||
int64 index = 5;
|
||||
bytes key = 6;
|
||||
bytes value = 7;
|
||||
merkle.Proof proof = 8;
|
||||
bytes proof = 8;
|
||||
int64 height = 9;
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"sort"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/tendermint/go-amino"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
proto "github.com/tendermint/tendermint/benchmarks/proto"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
)
|
||||
|
@@ -3,7 +3,7 @@ package benchmarks
|
||||
import (
|
||||
"testing"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func BenchmarkSomething(b *testing.B) {
|
||||
|
@@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func BenchmarkFileWrite(b *testing.B) {
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/lib/client"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -8,9 +8,9 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
flow "github.com/tendermint/tmlibs/flowrate"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
flow "github.com/tendermint/tendermint/libs/flowrate"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
|
@@ -5,12 +5,13 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/go-amino"
|
||||
amino "github.com/tendermint/go-amino"
|
||||
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -174,7 +175,7 @@ func (bcR *BlockchainReactor) respondToPeer(msg *bcBlockRequestMessage,
|
||||
|
||||
// Receive implements Reactor by handling 4 types of messages (look below).
|
||||
func (bcR *BlockchainReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
|
||||
msg, err := DecodeMessage(msgBytes)
|
||||
msg, err := decodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
bcR.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
|
||||
bcR.Switch.StopPeerForError(src, err)
|
||||
@@ -342,17 +343,11 @@ func RegisterBlockchainMessages(cdc *amino.Codec) {
|
||||
cdc.RegisterConcrete(&bcStatusRequestMessage{}, "tendermint/mempool/StatusRequest", nil)
|
||||
}
|
||||
|
||||
// DecodeMessage decodes BlockchainMessage.
|
||||
// TODO: ensure that bz is completely read.
|
||||
func DecodeMessage(bz []byte) (msg BlockchainMessage, err error) {
|
||||
func decodeMsg(bz []byte) (msg BlockchainMessage, err error) {
|
||||
if len(bz) > maxMsgSize {
|
||||
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
|
||||
len(bz), maxMsgSize)
|
||||
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
|
||||
}
|
||||
err = cdc.UnmarshalBinaryBare(bz, &msg)
|
||||
if err != nil {
|
||||
err = cmn.ErrorWrap(err, "DecodeMessage() had bytes left over")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -4,9 +4,9 @@ import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
|
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
"github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
@@ -49,7 +49,7 @@ func TestNewBlockStore(t *testing.T) {
|
||||
return nil, nil
|
||||
})
|
||||
require.NotNil(t, panicErr, "#%d panicCauser: %q expected a panic", i, tt.data)
|
||||
assert.Contains(t, fmt.Sprintf("%#v", panicErr), tt.wantErr, "#%d data: %q", i, tt.data)
|
||||
assert.Contains(t, panicErr.Error(), tt.wantErr, "#%d data: %q", i, tt.data)
|
||||
}
|
||||
|
||||
db.Set(blockStoreKey, nil)
|
||||
@@ -153,14 +153,14 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
||||
parts: validPartSet,
|
||||
seenCommit: seenCommit1,
|
||||
corruptCommitInDB: true, // Corrupt the DB's commit entry
|
||||
wantPanic: "Error reading block commit",
|
||||
wantPanic: "unmarshal to types.Commit failed",
|
||||
},
|
||||
|
||||
{
|
||||
block: newBlock(&header1, commitAtH10),
|
||||
parts: validPartSet,
|
||||
seenCommit: seenCommit1,
|
||||
wantPanic: "Error reading block",
|
||||
wantPanic: "unmarshal to types.BlockMeta failed",
|
||||
corruptBlockInDB: true, // Corrupt the DB's block entry
|
||||
},
|
||||
|
||||
@@ -179,7 +179,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
||||
seenCommit: seenCommit1,
|
||||
|
||||
corruptSeenCommitInDB: true,
|
||||
wantPanic: "Error reading block seen commit",
|
||||
wantPanic: "unmarshal to types.Commit failed",
|
||||
},
|
||||
|
||||
{
|
||||
@@ -238,7 +238,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
||||
if subStr := tuple.wantPanic; subStr != "" {
|
||||
if panicErr == nil {
|
||||
t.Errorf("#%d: want a non-nil panic", i)
|
||||
} else if got := fmt.Sprintf("%#v", panicErr); !strings.Contains(got, subStr) {
|
||||
} else if got := panicErr.Error(); !strings.Contains(got, subStr) {
|
||||
t.Errorf("#%d:\n\tgotErr: %q\nwant substring: %q", i, got, subStr)
|
||||
}
|
||||
continue
|
||||
@@ -287,7 +287,7 @@ func TestLoadBlockPart(t *testing.T) {
|
||||
db.Set(calcBlockPartKey(height, index), []byte("Tendermint"))
|
||||
res, _, panicErr = doFn(loadPart)
|
||||
require.NotNil(t, panicErr, "expecting a non-nil panic")
|
||||
require.Contains(t, fmt.Sprintf("%#v", panicErr), "Error reading block part")
|
||||
require.Contains(t, panicErr.Error(), "unmarshal to types.Part failed")
|
||||
|
||||
// 3. A good block serialized and saved to the DB should be retrievable
|
||||
db.Set(calcBlockPartKey(height, index), cdc.MustMarshalBinaryBare(part1))
|
||||
@@ -316,7 +316,7 @@ func TestLoadBlockMeta(t *testing.T) {
|
||||
db.Set(calcBlockMetaKey(height), []byte("Tendermint-Meta"))
|
||||
res, _, panicErr = doFn(loadMeta)
|
||||
require.NotNil(t, panicErr, "expecting a non-nil panic")
|
||||
require.Contains(t, fmt.Sprintf("%#v", panicErr), "Error reading block meta")
|
||||
require.Contains(t, panicErr.Error(), "unmarshal to types.BlockMeta")
|
||||
|
||||
// 3. A good blockMeta serialized and saved to the DB should be retrievable
|
||||
meta := &types.BlockMeta{}
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
|
||||
crypto "github.com/tendermint/tendermint/crypto"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
)
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
// GenNodeKeyCmd allows the generation of a node key. It prints node's ID to
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
// InitFilesCmd initialises a fresh Tendermint Core instance.
|
||||
@@ -52,8 +52,9 @@ func initFilesWithConfig(config *cfg.Config) error {
|
||||
logger.Info("Found genesis file", "path", genFile)
|
||||
} else {
|
||||
genDoc := types.GenesisDoc{
|
||||
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
|
||||
GenesisTime: time.Now(),
|
||||
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
|
||||
GenesisTime: time.Now(),
|
||||
ConsensusParams: types.DefaultConsensusParams(),
|
||||
}
|
||||
genDoc.Validators = []types.GenesisValidator{{
|
||||
PubKey: pv.GetPubKey(),
|
||||
|
@@ -6,9 +6,10 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
|
||||
"github.com/tendermint/tendermint/lite/proxy"
|
||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
// LiteCmd represents the base command when called without any subcommands
|
||||
@@ -65,21 +66,17 @@ func runProxy(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
|
||||
// First, connect a client
|
||||
logger.Info("Connecting to source HTTP client...")
|
||||
node := rpcclient.NewHTTP(nodeAddr, "/websocket")
|
||||
|
||||
logger.Info("Constructing certifier...")
|
||||
cert, err := proxy.NewCertifier(chainID, home, node, logger)
|
||||
cert, err := proxy.GetCertifier(chainID, home, nodeAddr)
|
||||
if err != nil {
|
||||
return cmn.ErrorWrap(err, "constructing certifier")
|
||||
return err
|
||||
}
|
||||
cert.SetLogger(logger)
|
||||
sc := proxy.SecureClient(node, cert)
|
||||
|
||||
logger.Info("Starting proxy...")
|
||||
err = proxy.StartProxy(sc, listenAddr, logger)
|
||||
if err != nil {
|
||||
return cmn.ErrorWrap(err, "starting proxy")
|
||||
return err
|
||||
}
|
||||
|
||||
cmn.TrapSignal(func() {
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
// ResetAllCmd removes the database of this Tendermint core
|
||||
|
@@ -7,9 +7,9 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tmlibs/cli"
|
||||
tmflags "github.com/tendermint/tmlibs/cli/flags"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
tmflags "github.com/tendermint/tendermint/libs/cli/flags"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tmlibs/cli"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -33,7 +33,7 @@ func AddNodeFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().String("p2p.laddr", config.P2P.ListenAddress, "Node listen address. (0.0.0.0:0 means any interface, any port)")
|
||||
cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "Comma-delimited ID@host:port seed nodes")
|
||||
cmd.Flags().String("p2p.persistent_peers", config.P2P.PersistentPeers, "Comma-delimited ID@host:port persistent peers")
|
||||
cmd.Flags().Bool("p2p.skip_upnp", config.P2P.SkipUPNP, "Skip UPNP configuration")
|
||||
cmd.Flags().Bool("p2p.upnp", config.P2P.UPNP, "Enable/disable UPNP port forwarding")
|
||||
cmd.Flags().Bool("p2p.pex", config.P2P.PexReactor, "Enable/disable Peer-Exchange")
|
||||
cmd.Flags().Bool("p2p.seed_mode", config.P2P.SeedMode, "Enable/disable seed mode")
|
||||
cmd.Flags().String("p2p.private_peer_ids", config.P2P.PrivatePeerIDs, "Comma-delimited private peer IDs")
|
||||
|
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/tendermint/tmlibs/cli"
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
|
||||
cmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
|
@@ -276,6 +276,9 @@ type P2PConfig struct {
|
||||
// Address to listen for incoming connections
|
||||
ListenAddress string `mapstructure:"laddr"`
|
||||
|
||||
// Address to advertise to peers for them to dial
|
||||
ExternalAddress string `mapstructure:"external_address"`
|
||||
|
||||
// Comma separated list of seed nodes to connect to
|
||||
// We only use these if we can’t connect to peers in the addrbook
|
||||
Seeds string `mapstructure:"seeds"`
|
||||
@@ -284,8 +287,8 @@ type P2PConfig struct {
|
||||
// Do not add private peers to this list if you don't want them advertised
|
||||
PersistentPeers string `mapstructure:"persistent_peers"`
|
||||
|
||||
// Skip UPNP port forwarding
|
||||
SkipUPNP bool `mapstructure:"skip_upnp"`
|
||||
// UPNP port forwarding
|
||||
UPNP bool `mapstructure:"upnp"`
|
||||
|
||||
// Path to address book
|
||||
AddrBook string `mapstructure:"addr_book_file"`
|
||||
@@ -299,9 +302,8 @@ type P2PConfig struct {
|
||||
// Time to wait before flushing messages out on the connection, in ms
|
||||
FlushThrottleTimeout int `mapstructure:"flush_throttle_timeout"`
|
||||
|
||||
// Maximum size of a message packet, in bytes
|
||||
// Includes a header, which is ~13 bytes
|
||||
MaxPacketMsgSize int `mapstructure:"max_packet_msg_size"`
|
||||
// Maximum size of a message packet payload, in bytes
|
||||
MaxPacketMsgPayloadSize int `mapstructure:"max_packet_msg_payload_size"`
|
||||
|
||||
// Rate at which packets can be sent, in bytes/second
|
||||
SendRate int64 `mapstructure:"send_rate"`
|
||||
@@ -340,22 +342,24 @@ type P2PConfig struct {
|
||||
// DefaultP2PConfig returns a default configuration for the peer-to-peer layer
|
||||
func DefaultP2PConfig() *P2PConfig {
|
||||
return &P2PConfig{
|
||||
ListenAddress: "tcp://0.0.0.0:26656",
|
||||
AddrBook: defaultAddrBookPath,
|
||||
AddrBookStrict: true,
|
||||
MaxNumPeers: 50,
|
||||
FlushThrottleTimeout: 100,
|
||||
MaxPacketMsgSize: 1024, // 1 kB
|
||||
SendRate: 512000, // 500 kB/s
|
||||
RecvRate: 512000, // 500 kB/s
|
||||
PexReactor: true,
|
||||
SeedMode: false,
|
||||
AllowDuplicateIP: true, // so non-breaking yet
|
||||
HandshakeTimeout: 20 * time.Second,
|
||||
DialTimeout: 3 * time.Second,
|
||||
TestDialFail: false,
|
||||
TestFuzz: false,
|
||||
TestFuzzConfig: DefaultFuzzConnConfig(),
|
||||
ListenAddress: "tcp://0.0.0.0:26656",
|
||||
ExternalAddress: "",
|
||||
UPNP: false,
|
||||
AddrBook: defaultAddrBookPath,
|
||||
AddrBookStrict: true,
|
||||
MaxNumPeers: 50,
|
||||
FlushThrottleTimeout: 100,
|
||||
MaxPacketMsgPayloadSize: 1024, // 1 kB
|
||||
SendRate: 512000, // 500 kB/s
|
||||
RecvRate: 512000, // 500 kB/s
|
||||
PexReactor: true,
|
||||
SeedMode: false,
|
||||
AllowDuplicateIP: true, // so non-breaking yet
|
||||
HandshakeTimeout: 20 * time.Second,
|
||||
DialTimeout: 3 * time.Second,
|
||||
TestDialFail: false,
|
||||
TestFuzz: false,
|
||||
TestFuzzConfig: DefaultFuzzConnConfig(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +367,6 @@ func DefaultP2PConfig() *P2PConfig {
|
||||
func TestP2PConfig() *P2PConfig {
|
||||
cfg := DefaultP2PConfig()
|
||||
cfg.ListenAddress = "tcp://0.0.0.0:36656"
|
||||
cfg.SkipUPNP = true
|
||||
cfg.FlushThrottleTimeout = 10
|
||||
cfg.AllowDuplicateIP = true
|
||||
return cfg
|
||||
@@ -454,10 +457,6 @@ type ConsensusConfig struct {
|
||||
// Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
|
||||
SkipTimeoutCommit bool `mapstructure:"skip_timeout_commit"`
|
||||
|
||||
// BlockSize
|
||||
MaxBlockSizeTxs int `mapstructure:"max_block_size_txs"`
|
||||
MaxBlockSizeBytes int `mapstructure:"max_block_size_bytes"`
|
||||
|
||||
// EmptyBlocks mode and possible interval between empty blocks in seconds
|
||||
CreateEmptyBlocks bool `mapstructure:"create_empty_blocks"`
|
||||
CreateEmptyBlocksInterval int `mapstructure:"create_empty_blocks_interval"`
|
||||
@@ -479,8 +478,6 @@ func DefaultConsensusConfig() *ConsensusConfig {
|
||||
TimeoutPrecommitDelta: 500,
|
||||
TimeoutCommit: 1000,
|
||||
SkipTimeoutCommit: false,
|
||||
MaxBlockSizeTxs: 10000,
|
||||
MaxBlockSizeBytes: 1, // TODO
|
||||
CreateEmptyBlocks: true,
|
||||
CreateEmptyBlocksInterval: 0,
|
||||
PeerGossipSleepDuration: 100,
|
||||
@@ -609,6 +606,12 @@ type InstrumentationConfig struct {
|
||||
|
||||
// Address to listen for Prometheus collector(s) connections.
|
||||
PrometheusListenAddr string `mapstructure:"prometheus_listen_addr"`
|
||||
|
||||
// Maximum number of simultaneous connections.
|
||||
// If you want to accept more significant number than the default, make sure
|
||||
// you increase your OS limits.
|
||||
// 0 - unlimited.
|
||||
MaxOpenConnections int `mapstructure:"max_open_connections"`
|
||||
}
|
||||
|
||||
// DefaultInstrumentationConfig returns a default configuration for metrics
|
||||
@@ -617,6 +620,7 @@ func DefaultInstrumentationConfig() *InstrumentationConfig {
|
||||
return &InstrumentationConfig{
|
||||
Prometheus: false,
|
||||
PrometheusListenAddr: ":26660",
|
||||
MaxOpenConnections: 3,
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
var configTemplate *template.Template
|
||||
@@ -142,6 +142,12 @@ max_open_connections = {{ .RPC.MaxOpenConnections }}
|
||||
# Address to listen for incoming connections
|
||||
laddr = "{{ .P2P.ListenAddress }}"
|
||||
|
||||
# Address to advertise to peers for them to dial
|
||||
# If empty, will use the same port as the laddr,
|
||||
# and will introspect on the listener or use UPnP
|
||||
# to figure out the address.
|
||||
external_address = "{{ .P2P.ExternalAddress }}"
|
||||
|
||||
# Comma separated list of seed nodes to connect to
|
||||
seeds = "{{ .P2P.Seeds }}"
|
||||
|
||||
@@ -149,6 +155,9 @@ seeds = "{{ .P2P.Seeds }}"
|
||||
# Do not add private peers to this list if you don't want them advertised
|
||||
persistent_peers = "{{ .P2P.PersistentPeers }}"
|
||||
|
||||
# UPNP port forwarding
|
||||
upnp = {{ .P2P.UPNP }}
|
||||
|
||||
# Path to address book
|
||||
addr_book_file = "{{ js .P2P.AddrBook }}"
|
||||
|
||||
@@ -161,9 +170,8 @@ flush_throttle_timeout = {{ .P2P.FlushThrottleTimeout }}
|
||||
# Maximum number of peers to connect to
|
||||
max_num_peers = {{ .P2P.MaxNumPeers }}
|
||||
|
||||
# Maximum size of a message packet, in bytes
|
||||
# Includes a header, which is ~13 bytes
|
||||
max_packet_msg_size = {{ .P2P.MaxPacketMsgSize }}
|
||||
# Maximum size of a message packet payload, in bytes
|
||||
max_packet_msg_payload_size = {{ .P2P.MaxPacketMsgPayloadSize }}
|
||||
|
||||
# Rate at which packets can be sent, in bytes/second
|
||||
send_rate = {{ .P2P.SendRate }}
|
||||
@@ -214,10 +222,6 @@ timeout_commit = {{ .Consensus.TimeoutCommit }}
|
||||
# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
|
||||
skip_timeout_commit = {{ .Consensus.SkipTimeoutCommit }}
|
||||
|
||||
# BlockSize
|
||||
max_block_size_txs = {{ .Consensus.MaxBlockSizeTxs }}
|
||||
max_block_size_bytes = {{ .Consensus.MaxBlockSizeBytes }}
|
||||
|
||||
# EmptyBlocks mode and possible interval between empty blocks in seconds
|
||||
create_empty_blocks = {{ .Consensus.CreateEmptyBlocks }}
|
||||
create_empty_blocks_interval = {{ .Consensus.CreateEmptyBlocksInterval }}
|
||||
@@ -258,6 +262,12 @@ prometheus = {{ .Instrumentation.Prometheus }}
|
||||
|
||||
# Address to listen for Prometheus collector(s) connections
|
||||
prometheus_listen_addr = "{{ .Instrumentation.PrometheusListenAddr }}"
|
||||
|
||||
# Maximum number of simultaneous connections.
|
||||
# If you want to accept more significant number than the default, make sure
|
||||
# you increase your OS limits.
|
||||
# 0 - unlimited.
|
||||
max_open_connections = {{ .Instrumentation.MaxOpenConnections }}
|
||||
`
|
||||
|
||||
/****** these are for test settings ***********/
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@@ -7,7 +7,6 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
"sort"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -23,9 +22,9 @@ import (
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/example/counter"
|
||||
"github.com/tendermint/tendermint/abci/example/kvstore"
|
||||
@@ -39,7 +38,7 @@ const (
|
||||
|
||||
// genesis, chain_id, priv_val
|
||||
var config *cfg.Config // NOTE: must be reset for each _test.go file
|
||||
var ensureTimeout = time.Second * 5 // must be in seconds because CreateEmptyBlocksInterval is
|
||||
var ensureTimeout = time.Second * 1 // must be in seconds because CreateEmptyBlocksInterval is
|
||||
|
||||
func ensureDir(dir string, mode os.FileMode) {
|
||||
if err := cmn.EnsureDir(dir, mode); err != nil {
|
||||
@@ -326,30 +325,6 @@ func ensureNewStep(stepCh <-chan interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
func ensureVote(voteCh chan interface{}, height int64, round int, voteType byte) {
|
||||
timer := time.NewTimer(ensureTimeout)
|
||||
select {
|
||||
case <-timer.C:
|
||||
break
|
||||
case v := <-voteCh:
|
||||
edv, ok := v.(types.EventDataVote)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("expected a *types.Vote, got %v. wrong subscription channel?",
|
||||
reflect.TypeOf(v)))
|
||||
}
|
||||
vote := edv.Vote
|
||||
if vote.Height != height {
|
||||
panic(fmt.Sprintf("expected height %v, got %v", height, vote.Height))
|
||||
}
|
||||
if vote.Round != round {
|
||||
panic(fmt.Sprintf("expected round %v, got %v", round, vote.Round))
|
||||
}
|
||||
if vote.Type != voteType {
|
||||
panic(fmt.Sprintf("expected type %v, got %v", voteType, vote.Type))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
// consensus nets
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/abci/example/code"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
@@ -9,11 +9,11 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
amino "github.com/tendermint/go-amino"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
|
||||
cstypes "github.com/tendermint/tendermint/consensus/types"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
tmevents "github.com/tendermint/tendermint/libs/events"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
@@ -183,7 +183,7 @@ func (conR *ConsensusReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)
|
||||
return
|
||||
}
|
||||
|
||||
msg, err := DecodeMessage(msgBytes)
|
||||
msg, err := decodeMsg(msgBytes)
|
||||
if err != nil {
|
||||
conR.Logger.Error("Error decoding message", "src", src, "chId", chID, "msg", msg, "err", err, "bytes", msgBytes)
|
||||
conR.Switch.StopPeerForError(src, err)
|
||||
@@ -1306,11 +1306,9 @@ func RegisterConsensusMessages(cdc *amino.Codec) {
|
||||
cdc.RegisterConcrete(&ProposalHeartbeatMessage{}, "tendermint/ProposalHeartbeat", nil)
|
||||
}
|
||||
|
||||
// DecodeMessage decodes the given bytes into a ConsensusMessage.
|
||||
func DecodeMessage(bz []byte) (msg ConsensusMessage, err error) {
|
||||
func decodeMsg(bz []byte) (msg ConsensusMessage, err error) {
|
||||
if len(bz) > maxMsgSize {
|
||||
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)",
|
||||
len(bz), maxMsgSize)
|
||||
return msg, fmt.Errorf("Msg exceeds max size (%d > %d)", len(bz), maxMsgSize)
|
||||
}
|
||||
err = cdc.UnmarshalBinaryBare(bz, &msg)
|
||||
return
|
||||
|
@@ -11,8 +11,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/abci/example/kvstore"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
@@ -174,14 +174,14 @@ func TestReactorRecordsBlockParts(t *testing.T) {
|
||||
require.Equal(t, 1, ps.BlockPartsSent(), "number of block parts sent should stay the same")
|
||||
}
|
||||
|
||||
// Test we record votes from other peers.
|
||||
// Test we record votes from other peers
|
||||
func TestReactorRecordsVotes(t *testing.T) {
|
||||
// Create dummy peer.
|
||||
// create dummy peer
|
||||
peer := p2pdummy.NewPeer()
|
||||
ps := NewPeerState(peer).SetLogger(log.TestingLogger())
|
||||
peer.Set(types.PeerStateKey, ps)
|
||||
|
||||
// Create reactor.
|
||||
// create reactor
|
||||
css := randConsensusNet(1, "consensus_reactor_records_votes_test", newMockTickerFunc(true), newPersistentKVStore)
|
||||
reactor := NewConsensusReactor(css[0], false) // so we dont start the consensus states
|
||||
reactor.SetEventBus(css[0].eventBus)
|
||||
@@ -419,7 +419,7 @@ func waitForAndValidateBlock(t *testing.T, n int, activeVals map[string]struct{}
|
||||
err := validateBlock(newBlock, activeVals)
|
||||
assert.Nil(t, err)
|
||||
for _, tx := range txs {
|
||||
err := css[j].mempool.CheckTx(tx, nil)
|
||||
css[j].mempool.CheckTx(tx, nil)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
}, css)
|
||||
|
@@ -11,10 +11,10 @@ import (
|
||||
"time"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
//auto "github.com/tendermint/tmlibs/autofile"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
//auto "github.com/tendermint/tendermint/libs/autofile"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
@@ -264,15 +264,15 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight
|
||||
stateBlockHeight := state.LastBlockHeight
|
||||
h.logger.Info("ABCI Replay Blocks", "appHeight", appBlockHeight, "storeHeight", storeBlockHeight, "stateHeight", stateBlockHeight)
|
||||
|
||||
// If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain.
|
||||
// If appBlockHeight == 0 it means that we are at genesis and hence should send InitChain
|
||||
if appBlockHeight == 0 {
|
||||
nextVals := types.TM2PB.Validators(state.NextValidators) // state.Validators would work too.
|
||||
validators := types.TM2PB.Validators(state.Validators)
|
||||
csParams := types.TM2PB.ConsensusParams(h.genDoc.ConsensusParams)
|
||||
req := abci.RequestInitChain{
|
||||
Time: h.genDoc.GenesisTime.Unix(), // TODO
|
||||
ChainId: h.genDoc.ChainID,
|
||||
ConsensusParams: csParams,
|
||||
Validators: nextVals,
|
||||
Validators: validators,
|
||||
AppStateBytes: h.genDoc.AppStateJSON,
|
||||
}
|
||||
res, err := proxyApp.Consensus().InitChainSync(req)
|
||||
@@ -280,7 +280,9 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If the app returned validators or consensus params, update the state.
|
||||
// if the app returned validators
|
||||
// or consensus params, update the state
|
||||
// with the them
|
||||
if len(res.Validators) > 0 {
|
||||
vals, err := types.PB2TM.Validators(res.Validators)
|
||||
if err != nil {
|
||||
@@ -294,7 +296,7 @@ func (h *Handshaker) ReplayBlocks(state sm.State, appHash []byte, appBlockHeight
|
||||
sm.SaveState(h.stateDB, state)
|
||||
}
|
||||
|
||||
// First handle edge cases and constraints on the storeBlockHeight.
|
||||
// First handle edge cases and constraints on the storeBlockHeight
|
||||
if storeBlockHeight == 0 {
|
||||
return appHash, checkAppHash(state, appHash)
|
||||
|
||||
|
@@ -16,9 +16,9 @@ import (
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -19,16 +19,16 @@ import (
|
||||
"github.com/tendermint/tendermint/abci/example/kvstore"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
crypto "github.com/tendermint/tendermint/crypto"
|
||||
auto "github.com/tendermint/tmlibs/autofile"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
dbm "github.com/tendermint/tmlibs/db"
|
||||
auto "github.com/tendermint/tendermint/libs/autofile"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
var consensusReplayConfig *cfg.Config
|
||||
|
@@ -10,8 +10,8 @@ import (
|
||||
"time"
|
||||
|
||||
fail "github.com/ebuchman/fail-test"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
cstypes "github.com/tendermint/tendermint/consensus/types"
|
||||
@@ -74,6 +74,7 @@ type ConsensusState struct {
|
||||
privValidator types.PrivValidator // for signing votes
|
||||
|
||||
// services for creating and executing blocks
|
||||
// TODO: encapsulate all of this in one "BlockManager"
|
||||
blockExec *sm.BlockExecutor
|
||||
blockStore sm.BlockStore
|
||||
mempool sm.Mempool
|
||||
@@ -196,15 +197,6 @@ func (cs *ConsensusState) GetState() sm.State {
|
||||
return cs.state.Copy()
|
||||
}
|
||||
|
||||
// GetLastHeight returns the last height committed.
|
||||
// If there were no blocks, returns 0.
|
||||
func (cs *ConsensusState) GetLastHeight() int64 {
|
||||
cs.mtx.Lock()
|
||||
defer cs.mtx.Unlock()
|
||||
|
||||
return cs.RoundState.Height - 1
|
||||
}
|
||||
|
||||
// GetRoundState returns a shallow copy of the internal consensus state.
|
||||
func (cs *ConsensusState) GetRoundState() *cstypes.RoundState {
|
||||
cs.mtx.Lock()
|
||||
@@ -322,16 +314,8 @@ func (cs *ConsensusState) startRoutines(maxSteps int) {
|
||||
|
||||
// OnStop implements cmn.Service. It stops all routines and waits for the WAL to finish.
|
||||
func (cs *ConsensusState) OnStop() {
|
||||
cs.BaseService.OnStop()
|
||||
|
||||
cs.evsw.Stop()
|
||||
|
||||
cs.timeoutTicker.Stop()
|
||||
|
||||
// Make BaseService.Wait() wait until cs.wal.Wait()
|
||||
if cs.IsRunning() {
|
||||
cs.wal.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
// Wait waits for the the main routine to return.
|
||||
@@ -611,6 +595,7 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) {
|
||||
|
||||
// close wal now that we're done writing to it
|
||||
cs.wal.Stop()
|
||||
cs.wal.Wait()
|
||||
|
||||
close(cs.done)
|
||||
return
|
||||
@@ -632,7 +617,7 @@ func (cs *ConsensusState) handleMsg(mi msgInfo) {
|
||||
err = cs.setProposal(msg.Proposal)
|
||||
case *BlockPartMessage:
|
||||
// if the proposal is complete, we'll enterPrevote or tryFinalizeCommit
|
||||
_, err = cs.addProposalBlockPart(msg.Height, msg.Part)
|
||||
_, err = cs.addProposalBlockPart(msg, peerID)
|
||||
if err != nil && msg.Round != cs.Round {
|
||||
cs.Logger.Debug("Received block part from wrong round", "height", cs.Height, "csRound", cs.Round, "blockRound", msg.Round)
|
||||
err = nil
|
||||
@@ -940,7 +925,7 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts
|
||||
}
|
||||
|
||||
// Mempool validated transactions
|
||||
txs := cs.mempool.Reap(cs.config.MaxBlockSizeTxs)
|
||||
txs := cs.mempool.Reap(cs.state.ConsensusParams.BlockSize.MaxTxs)
|
||||
block, parts := cs.state.MakeBlock(cs.Height, txs, commit)
|
||||
evidence := cs.evpool.PendingEvidence()
|
||||
block.AddEvidence(evidence)
|
||||
@@ -1021,11 +1006,9 @@ func (cs *ConsensusState) enterPrevoteWait(height int64, round int) {
|
||||
logger.Debug(cmn.Fmt("enterPrevoteWait(%v/%v): Invalid args. Current step: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step))
|
||||
return
|
||||
}
|
||||
/*
|
||||
if !cs.Votes.Prevotes(round).HasTwoThirdsAny() {
|
||||
cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round))
|
||||
}
|
||||
*/
|
||||
if !cs.Votes.Prevotes(round).HasTwoThirdsAny() {
|
||||
cmn.PanicSanity(cmn.Fmt("enterPrevoteWait(%v/%v), but Prevotes does not have any +2/3 votes", height, round))
|
||||
}
|
||||
logger.Info(cmn.Fmt("enterPrevoteWait(%v/%v). Current: %v/%v/%v", height, round, cs.Height, cs.Round, cs.Step))
|
||||
|
||||
defer func() {
|
||||
@@ -1409,17 +1392,22 @@ func (cs *ConsensusState) defaultSetProposal(proposal *types.Proposal) error {
|
||||
|
||||
// NOTE: block is not necessarily valid.
|
||||
// Asynchronously triggers either enterPrevote (before we timeout of propose) or tryFinalizeCommit, once we have the full block.
|
||||
func (cs *ConsensusState) addProposalBlockPart(height int64, part *types.Part) (added bool, err error) {
|
||||
func (cs *ConsensusState) addProposalBlockPart(msg *BlockPartMessage, peerID p2p.ID) (added bool, err error) {
|
||||
height, round, part := msg.Height, msg.Round, msg.Part
|
||||
|
||||
// Blocks might be reused, so round mismatch is OK
|
||||
if cs.Height != height {
|
||||
cs.Logger.Debug("Received block part from wrong height", "height", height)
|
||||
cs.Logger.Debug("Received block part from wrong height", "height", height, "round", round)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// We're not expecting a block part.
|
||||
if cs.ProposalBlockParts == nil {
|
||||
cs.Logger.Info("Received a block part when we're not expecting any", "height", height)
|
||||
return false, nil // TODO: bad peer? Return error?
|
||||
// NOTE: this can happen when we've gone to a higher round and
|
||||
// then receive parts from the previous round - not necessarily a bad peer.
|
||||
cs.Logger.Info("Received a block part when we're not expecting any",
|
||||
"height", height, "round", round, "index", part.Index, "peer", peerID)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
added, err = cs.ProposalBlockParts.AddPart(part)
|
||||
@@ -1453,7 +1441,7 @@ func (cs *ConsensusState) addProposalBlockPart(height int64, part *types.Part) (
|
||||
// procedure at this point.
|
||||
}
|
||||
|
||||
if cs.Step == cstypes.RoundStepPropose && cs.isProposalComplete() {
|
||||
if cs.Step <= cstypes.RoundStepPropose && cs.isProposalComplete() {
|
||||
// Move onto the next step
|
||||
cs.enterPrevote(height, cs.Round)
|
||||
} else if cs.Step == cstypes.RoundStepCommit {
|
||||
@@ -1589,7 +1577,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool,
|
||||
if prevotes.HasTwoThirdsMajority() {
|
||||
cs.enterPrecommit(height, vote.Round)
|
||||
} else {
|
||||
cs.enterPropose(height, vote.Round) // we can't prevote until we wait for the proposal.
|
||||
cs.enterPrevote(height, vote.Round) // if the vote is ahead of us
|
||||
cs.enterPrevoteWait(height, vote.Round)
|
||||
}
|
||||
} else if cs.Proposal != nil && 0 <= cs.Proposal.POLRound && cs.Proposal.POLRound == vote.Round {
|
||||
@@ -1605,9 +1593,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool,
|
||||
blockID, ok := precommits.TwoThirdsMajority()
|
||||
if ok {
|
||||
if len(blockID.Hash) == 0 {
|
||||
cs.enterNewRound(height, vote.Round)
|
||||
cs.enterPrecommit(height, vote.Round)
|
||||
cs.enterPrecommitWait(height, vote.Round)
|
||||
cs.enterNewRound(height, vote.Round+1)
|
||||
} else {
|
||||
cs.enterNewRound(height, vote.Round)
|
||||
cs.enterPrecommit(height, vote.Round)
|
||||
@@ -1623,8 +1609,7 @@ func (cs *ConsensusState) addVote(vote *types.Vote, peerID p2p.ID) (added bool,
|
||||
}
|
||||
} else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() {
|
||||
cs.enterNewRound(height, vote.Round)
|
||||
cs.enterPropose(height, vote.Round)
|
||||
cs.enterPrevoteWait(height, vote.Round)
|
||||
cs.enterPrecommit(height, vote.Round)
|
||||
cs.enterPrecommitWait(height, vote.Round)
|
||||
}
|
||||
default:
|
||||
|
@@ -10,8 +10,8 @@ import (
|
||||
cstypes "github.com/tendermint/tendermint/consensus/types"
|
||||
tmpubsub "github.com/tendermint/tendermint/libs/pubsub"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -64,22 +64,22 @@ func TestStateProposerSelection0(t *testing.T) {
|
||||
|
||||
startTestRound(cs1, height, round)
|
||||
|
||||
// Wait for new round so proposer is set.
|
||||
// wait for new round so proposer is set
|
||||
<-newRoundCh
|
||||
|
||||
// Commit a block and ensure proposer for the next height is correct.
|
||||
// lets commit a block and ensure proposer for the next height is correct
|
||||
prop := cs1.GetRoundState().Validators.GetProposer()
|
||||
if !bytes.Equal(prop.Address, cs1.privValidator.GetAddress()) {
|
||||
t.Fatalf("expected proposer to be validator %d. Got %X", 0, prop.Address)
|
||||
}
|
||||
|
||||
// Wait for complete proposal.
|
||||
// wait for complete proposal
|
||||
<-proposalCh
|
||||
|
||||
rs := cs1.GetRoundState()
|
||||
signAddVotes(cs1, types.VoteTypePrecommit, rs.ProposalBlock.Hash(), rs.ProposalBlockParts.Header(), vss[1:]...)
|
||||
|
||||
// Wait for new round so next validator is set.
|
||||
// wait for new round so next validator is set
|
||||
<-newRoundCh
|
||||
|
||||
prop = cs1.GetRoundState().Validators.GetProposer()
|
||||
@@ -718,8 +718,6 @@ func TestStateLockPOLUnlock(t *testing.T) {
|
||||
func TestStateLockPOLSafety1(t *testing.T) {
|
||||
cs1, vss := randConsensusState(4)
|
||||
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
|
||||
h := cs1.GetRoundState().Height
|
||||
r := cs1.GetRoundState().Round
|
||||
|
||||
partSize := cs1.state.ConsensusParams.BlockPartSizeBytes
|
||||
|
||||
@@ -736,7 +734,7 @@ func TestStateLockPOLSafety1(t *testing.T) {
|
||||
rs := re.(types.EventDataRoundState).RoundState.(*cstypes.RoundState)
|
||||
propBlock := rs.ProposalBlock
|
||||
|
||||
ensureVote(voteCh, h, r, types.VoteTypePrevote)
|
||||
<-voteCh // prevote
|
||||
|
||||
validatePrevote(t, cs1, 0, vss[0], propBlock.Hash())
|
||||
|
||||
@@ -757,11 +755,6 @@ func TestStateLockPOLSafety1(t *testing.T) {
|
||||
// we do see them precommit nil
|
||||
signAddVotes(cs1, types.VoteTypePrecommit, nil, types.PartSetHeader{}, vs2, vs3, vs4)
|
||||
|
||||
ensureVote(voteCh, h, r, types.VoteTypePrecommit)
|
||||
|
||||
<-newRoundCh
|
||||
t.Log("### ONTO ROUND 1")
|
||||
|
||||
prop, propBlock := decideProposal(cs1, vs2, vs2.Height, vs2.Round+1)
|
||||
propBlockHash := propBlock.Hash()
|
||||
propBlockParts := propBlock.MakePartSet(partSize)
|
||||
@@ -772,6 +765,9 @@ func TestStateLockPOLSafety1(t *testing.T) {
|
||||
if err := cs1.SetProposalAndBlock(prop, propBlock, propBlockParts, "some peer"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
<-newRoundCh
|
||||
t.Log("### ONTO ROUND 1")
|
||||
/*Round2
|
||||
// we timeout and prevote our lock
|
||||
// a polka happened but we didn't see it!
|
||||
@@ -792,13 +788,13 @@ func TestStateLockPOLSafety1(t *testing.T) {
|
||||
}
|
||||
t.Logf("new prop hash %v", fmt.Sprintf("%X", propBlockHash))
|
||||
// go to prevote, prevote for proposal block
|
||||
ensureVote(voteCh, h, r+1, types.VoteTypePrevote)
|
||||
<-voteCh
|
||||
validatePrevote(t, cs1, 1, vss[0], propBlockHash)
|
||||
|
||||
// now we see the others prevote for it, so we should lock on it
|
||||
signAddVotes(cs1, types.VoteTypePrevote, propBlockHash, propBlockParts.Header(), vs2, vs3, vs4)
|
||||
|
||||
ensureVote(voteCh, h, r+1, types.VoteTypePrecommit)
|
||||
<-voteCh // precommit
|
||||
|
||||
// we should have precommitted
|
||||
validatePrecommit(t, cs1, 1, 1, vss[0], propBlockHash, propBlockHash)
|
||||
@@ -820,7 +816,7 @@ func TestStateLockPOLSafety1(t *testing.T) {
|
||||
<-timeoutProposeCh
|
||||
|
||||
// finish prevote
|
||||
ensureVote(voteCh, h, r+2, types.VoteTypePrevote)
|
||||
<-voteCh
|
||||
|
||||
// we should prevote what we're locked on
|
||||
validatePrevote(t, cs1, 2, vss[0], propBlockHash)
|
||||
|
@@ -3,8 +3,8 @@ package consensus
|
||||
import (
|
||||
"time"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
type RoundVoteSet struct {
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
var config *cfg.Config // NOTE: must be reset for each _test.go file
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/tendermint/go-amino"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
func BenchmarkRoundStateDeepCopy(b *testing.B) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package consensus
|
||||
|
||||
import (
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
// kind of arbitrary
|
||||
|
@@ -12,8 +12,8 @@ import (
|
||||
|
||||
amino "github.com/tendermint/go-amino"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
auto "github.com/tendermint/tmlibs/autofile"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
auto "github.com/tendermint/tendermint/libs/autofile"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -17,10 +17,10 @@ import (
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
auto "github.com/tendermint/tmlibs/autofile"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
"github.com/tendermint/tmlibs/db"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
auto "github.com/tendermint/tendermint/libs/autofile"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
)
|
||||
|
||||
// WALWithNBlocks generates a consensus WAL. It does this by spining up a
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/consensus/types"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
137
crypto/Gopkg.lock
generated
137
crypto/Gopkg.lock
generated
@@ -1,137 +0,0 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/btcsuite/btcd"
|
||||
packages = ["btcec"]
|
||||
revision = "86fed781132ac890ee03e906e4ecd5d6fa180c64"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/btcsuite/btcutil"
|
||||
packages = ["base58"]
|
||||
revision = "d4cc87b860166d00d6b5b9e0d3b3d71d6088d4d4"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/davecgh/go-spew"
|
||||
packages = ["spew"]
|
||||
revision = "346938d642f2ec3594ed81d874461961cd0faa76"
|
||||
version = "v1.1.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/go-kit/kit"
|
||||
packages = [
|
||||
"log",
|
||||
"log/level",
|
||||
"log/term"
|
||||
]
|
||||
revision = "4dc7be5d2d12881735283bcab7352178e190fc71"
|
||||
version = "v0.6.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/go-logfmt/logfmt"
|
||||
packages = ["."]
|
||||
revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5"
|
||||
version = "v0.3.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/go-stack/stack"
|
||||
packages = ["."]
|
||||
revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc"
|
||||
version = "v1.7.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/gogo/protobuf"
|
||||
packages = [
|
||||
"gogoproto",
|
||||
"proto",
|
||||
"protoc-gen-gogo/descriptor"
|
||||
]
|
||||
revision = "1adfc126b41513cc696b209667c8656ea7aac67c"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/kr/logfmt"
|
||||
packages = ["."]
|
||||
revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/pkg/errors"
|
||||
packages = ["."]
|
||||
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
|
||||
version = "v0.8.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/pmezard/go-difflib"
|
||||
packages = ["difflib"]
|
||||
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/stretchr/testify"
|
||||
packages = [
|
||||
"assert",
|
||||
"require"
|
||||
]
|
||||
revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
|
||||
version = "v1.2.2"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/tendermint/ed25519"
|
||||
packages = [
|
||||
".",
|
||||
"edwards25519",
|
||||
"extra25519"
|
||||
]
|
||||
revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/tendermint/go-amino"
|
||||
packages = ["."]
|
||||
revision = "2106ca61d91029c931fd54968c2bb02dc96b1412"
|
||||
version = "0.10.1"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/tendermint/tmlibs"
|
||||
packages = [
|
||||
"common",
|
||||
"log",
|
||||
"test"
|
||||
]
|
||||
revision = "692f1d86a6e2c0efa698fd1e4541b68c74ffaf38"
|
||||
version = "v0.8.4"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/crypto"
|
||||
packages = [
|
||||
"bcrypt",
|
||||
"blowfish",
|
||||
"chacha20poly1305",
|
||||
"hkdf",
|
||||
"internal/chacha20",
|
||||
"internal/subtle",
|
||||
"nacl/secretbox",
|
||||
"openpgp/armor",
|
||||
"openpgp/errors",
|
||||
"poly1305",
|
||||
"ripemd160",
|
||||
"salsa20/salsa"
|
||||
]
|
||||
revision = "7f39a6fea4fe9364fb61e1def6a268a51b4f3a06"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/sys"
|
||||
packages = ["cpu"]
|
||||
revision = "ad87a3a340fa7f3bed189293fbfa7a9b7e021ae1"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "027b22b86396a971d5d5c1d298947f531f39743975d65a22e98601140aa1b1a1"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
@@ -1,49 +0,0 @@
|
||||
# Gopkg.toml example
|
||||
#
|
||||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
||||
# for detailed Gopkg.toml documentation.
|
||||
#
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project"
|
||||
# version = "1.0.0"
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project2"
|
||||
# branch = "dev"
|
||||
# source = "github.com/myfork/project2"
|
||||
#
|
||||
# [[override]]
|
||||
# name = "github.com/x/y"
|
||||
# version = "2.4.0"
|
||||
#
|
||||
# [prune]
|
||||
# non-go = false
|
||||
# go-tests = true
|
||||
# unused-packages = true
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/btcsuite/btcutil"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/stretchr/testify"
|
||||
version = "1.2.1"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/tendermint/ed25519"
|
||||
branch = "master"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/tendermint/go-amino"
|
||||
version = "0.10.0-rc2"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/tendermint/tmlibs"
|
||||
version = "0.8.1"
|
||||
|
||||
[prune]
|
||||
go-tests = true
|
||||
unused-packages = true
|
@@ -1,99 +0,0 @@
|
||||
GOTOOLS = \
|
||||
github.com/golang/dep/cmd/dep \
|
||||
# gopkg.in/alecthomas/gometalinter.v2 \
|
||||
|
||||
GOTOOLS_CHECK = dep #gometalinter.v2
|
||||
|
||||
all: check get_vendor_deps build test install
|
||||
|
||||
check: check_tools
|
||||
|
||||
|
||||
########################################
|
||||
### Build
|
||||
|
||||
# Command to generate the workd list (kept here for documentation purposes only):
|
||||
wordlist:
|
||||
# To re-generate wordlist.go run:
|
||||
# go-bindata -ignore ".*\.go" -o keys/words/bip39/wordlist.go -pkg "wordlist" keys/bip39/wordlist/...
|
||||
|
||||
build: wordlist
|
||||
# Nothing else to build!
|
||||
|
||||
install:
|
||||
# Nothing to install!
|
||||
|
||||
|
||||
########################################
|
||||
### Tools & dependencies
|
||||
|
||||
check_tools:
|
||||
@# https://stackoverflow.com/a/25668869
|
||||
@echo "Found tools: $(foreach tool,$(GOTOOLS_CHECK),\
|
||||
$(if $(shell which $(tool)),$(tool),$(error "No $(tool) in PATH")))"
|
||||
|
||||
get_tools:
|
||||
@echo "--> Installing tools"
|
||||
go get -u -v $(GOTOOLS)
|
||||
#@gometalinter.v2 --install
|
||||
|
||||
update_tools:
|
||||
@echo "--> Updating tools"
|
||||
@go get -u $(GOTOOLS)
|
||||
|
||||
get_vendor_deps:
|
||||
@rm -rf vendor/
|
||||
@echo "--> Running dep ensure"
|
||||
@dep ensure
|
||||
|
||||
|
||||
########################################
|
||||
### Testing
|
||||
|
||||
test:
|
||||
CGO_ENABLED=0 go test -p 1 $(shell go list ./... | grep -v vendor)
|
||||
|
||||
########################################
|
||||
### Formatting, linting, and vetting
|
||||
|
||||
fmt:
|
||||
@go fmt ./...
|
||||
|
||||
metalinter:
|
||||
@echo "==> Running linter"
|
||||
gometalinter.v2 --vendor --deadline=600s --disable-all \
|
||||
--enable=maligned \
|
||||
--enable=deadcode \
|
||||
--enable=goconst \
|
||||
--enable=goimports \
|
||||
--enable=gosimple \
|
||||
--enable=ineffassign \
|
||||
--enable=megacheck \
|
||||
--enable=misspell \
|
||||
--enable=staticcheck \
|
||||
--enable=safesql \
|
||||
--enable=structcheck \
|
||||
--enable=unconvert \
|
||||
--enable=unused \
|
||||
--enable=varcheck \
|
||||
--enable=vetshadow \
|
||||
./...
|
||||
#--enable=gas \
|
||||
#--enable=dupl \
|
||||
#--enable=errcheck \
|
||||
#--enable=gocyclo \
|
||||
#--enable=golint \ <== comments on anything exported
|
||||
#--enable=gotype \
|
||||
#--enable=interfacer \
|
||||
#--enable=unparam \
|
||||
#--enable=vet \
|
||||
|
||||
metalinter_all:
|
||||
protoc $(INCLUDE) --lint_out=. types/*.proto
|
||||
gometalinter.v2 --vendor --deadline=600s --enable-all --disable=lll ./...
|
||||
|
||||
|
||||
# To avoid unintended conflicts with file names, always add to .PHONY
|
||||
# unless there is a reason not to.
|
||||
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
||||
.PHONEY: check build install check_tools get_tools update_tools get_vendor_deps test fmt metalinter metalinter_all
|
@@ -1,6 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
protoc --gogo_out=. -I $GOPATH/src/ -I . -I $GOPATH/src/github.com/gogo/protobuf/protobuf merkle.proto
|
||||
echo "--> adding nolint declarations to protobuf generated files"
|
||||
awk '/package merkle/ { print "//nolint: gas"; print; next }1' merkle.pb.go > merkle.pb.go.new
|
||||
mv merkle.pb.go.new merkle.pb.go
|
@@ -28,4 +28,4 @@ https://bitcointalk.org/?topic=102395
|
||||
TODO(ismail): add 2nd pre-image protection or clarify further on how we use this and why this secure.
|
||||
|
||||
*/
|
||||
package merkle
|
||||
package merkle
|
||||
|
@@ -1,100 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: merkle.proto
|
||||
|
||||
/*
|
||||
Package merkle is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
merkle.proto
|
||||
|
||||
It has these top-level messages:
|
||||
ProofOp
|
||||
Proof
|
||||
*/
|
||||
package merkle
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type ProofOp struct {
|
||||
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
|
||||
Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ProofOp) Reset() { *m = ProofOp{} }
|
||||
func (m *ProofOp) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProofOp) ProtoMessage() {}
|
||||
func (*ProofOp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *ProofOp) GetType() string {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ProofOp) GetKey() []byte {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ProofOp) GetData() []byte {
|
||||
if m != nil {
|
||||
return m.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Proof struct {
|
||||
Ops []*ProofOp `protobuf:"bytes,1,rep,name=ops" json:"ops,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Proof) Reset() { *m = Proof{} }
|
||||
func (m *Proof) String() string { return proto.CompactTextString(m) }
|
||||
func (*Proof) ProtoMessage() {}
|
||||
func (*Proof) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Proof) GetOps() []*ProofOp {
|
||||
if m != nil {
|
||||
return m.Ops
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ProofOp)(nil), "merkle.ProofOp")
|
||||
proto.RegisterType((*Proof)(nil), "merkle.Proof")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("merkle.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 168 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x4d, 0x2d, 0xca,
|
||||
0xce, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0xa4, 0x74, 0xd3, 0x33,
|
||||
0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5, 0xc1, 0xd2,
|
||||
0x49, 0xa5, 0x69, 0x60, 0x1e, 0x98, 0x03, 0x66, 0x41, 0xb4, 0x29, 0x39, 0x73, 0xb1, 0x07, 0x14,
|
||||
0xe5, 0xe7, 0xa7, 0xf9, 0x17, 0x08, 0x09, 0x71, 0xb1, 0x94, 0x54, 0x16, 0xa4, 0x4a, 0x30, 0x2a,
|
||||
0x30, 0x6a, 0x70, 0x06, 0x81, 0xd9, 0x42, 0x02, 0x5c, 0xcc, 0xd9, 0xa9, 0x95, 0x12, 0x4c, 0x0a,
|
||||
0x8c, 0x1a, 0x3c, 0x41, 0x20, 0x26, 0x48, 0x55, 0x4a, 0x62, 0x49, 0xa2, 0x04, 0x33, 0x58, 0x08,
|
||||
0xcc, 0x56, 0x32, 0xe0, 0x62, 0x05, 0x1b, 0x22, 0xa4, 0xce, 0xc5, 0x9c, 0x5f, 0x50, 0x2c, 0xc1,
|
||||
0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0xc4, 0xaf, 0x07, 0x75, 0x20, 0xd4, 0x02, 0x27, 0x96, 0x13, 0xf7,
|
||||
0xe4, 0x19, 0x82, 0x40, 0x2a, 0x92, 0xd8, 0xc0, 0xb6, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
|
||||
0xe0, 0x7d, 0x7c, 0x4e, 0xc4, 0x00, 0x00, 0x00,
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
syntax = "proto3";
|
||||
package merkle;
|
||||
|
||||
// For more information on gogo.proto, see:
|
||||
// https://github.com/gogo/protobuf/blob/master/extensions.md
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
//----------------------------------------
|
||||
// Message types
|
||||
|
||||
message ProofOp {
|
||||
string type = 1;
|
||||
bytes key = 2;
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
message Proof {
|
||||
repeated ProofOp ops = 1 [(gogoproto.nullable)=false];
|
||||
}
|
@@ -1,124 +0,0 @@
|
||||
package merkle
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
//----------------------------------------
|
||||
// ProofOp gets converted to an instance of ProofOperator:
|
||||
|
||||
type ProofOperator interface {
|
||||
Run([][]byte) ([][]byte, error)
|
||||
GetKey() []byte
|
||||
ProofOp() ProofOp
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// Operations on a list of ProofOperators
|
||||
|
||||
type ProofOperators []ProofOperator
|
||||
|
||||
func (poz ProofOperators) VerifyValue(root []byte, keypath string, value []byte) (err error) {
|
||||
return poz.Verify(root, keypath, [][]byte{value})
|
||||
}
|
||||
|
||||
func (poz ProofOperators) Verify(root []byte, keypath string, args [][]byte) (err error) {
|
||||
keys, err := KeyPathToKeys(keypath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for i, op := range poz {
|
||||
key := op.GetKey()
|
||||
if len(key) != 0 {
|
||||
if !bytes.Equal(keys[0], key) {
|
||||
return cmn.NewError("Key mismatch on operation #%d: expected %+v but %+v", i, []byte(keys[0]), []byte(key))
|
||||
}
|
||||
keys = keys[1:]
|
||||
}
|
||||
args, err = op.Run(args)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
if !bytes.Equal(root, args[0]) {
|
||||
return cmn.NewError("Calculated root hash is invalid: expected %+v but %+v", root, args[0])
|
||||
}
|
||||
if len(keys) != 0 {
|
||||
return cmn.NewError("Keypath not consumed all")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
// ProofRuntime - main entrypoint
|
||||
|
||||
type OpDecoder func(ProofOp) (ProofOperator, error)
|
||||
|
||||
type ProofRuntime struct {
|
||||
decoders map[string]OpDecoder
|
||||
}
|
||||
|
||||
func NewProofRuntime() *ProofRuntime {
|
||||
return &ProofRuntime{
|
||||
decoders: make(map[string]OpDecoder),
|
||||
}
|
||||
}
|
||||
|
||||
func (prt *ProofRuntime) RegisterOpDecoder(typ string, dec OpDecoder) {
|
||||
_, ok := prt.decoders[typ]
|
||||
if ok {
|
||||
panic("already registered for type " + typ)
|
||||
}
|
||||
prt.decoders[typ] = dec
|
||||
}
|
||||
|
||||
func (prt *ProofRuntime) Decode(pop ProofOp) (ProofOperator, error) {
|
||||
decoder := prt.decoders[pop.Type]
|
||||
if decoder == nil {
|
||||
return nil, cmn.NewError("unrecognized proof type %v", pop.Type)
|
||||
}
|
||||
return decoder(pop)
|
||||
}
|
||||
|
||||
func (prt *ProofRuntime) DecodeProof(proof *Proof) (poz ProofOperators, err error) {
|
||||
poz = ProofOperators(nil)
|
||||
for _, pop := range proof.Ops {
|
||||
operator, err := prt.Decode(*pop)
|
||||
if err != nil {
|
||||
return nil, cmn.ErrorWrap(err, "decoding a proof operator")
|
||||
}
|
||||
poz = append(poz, operator)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (prt *ProofRuntime) VerifyValue(proof *Proof, root []byte, keypath string, value []byte) (err error) {
|
||||
return prt.Verify(proof, root, keypath, [][]byte{value})
|
||||
}
|
||||
|
||||
// TODO In the long run we'll need a method of classifcation of ops,
|
||||
// whether existence or absence or perhaps a third?
|
||||
func (prt *ProofRuntime) VerifyAbsence(proof *Proof, keypath string, root []byte) (err error) {
|
||||
return prt.Verify(proof, root, keypath, nil)
|
||||
}
|
||||
|
||||
func (prt *ProofRuntime) Verify(proof *Proof, root []byte, keypath string, args [][]byte) (err error) {
|
||||
poz, err := prt.DecodeProof(proof)
|
||||
if err != nil {
|
||||
return cmn.ErrorWrap(err, "decoding proof")
|
||||
}
|
||||
return poz.Verify(root, keypath, args)
|
||||
}
|
||||
|
||||
// DefaultProofRuntime only knows about Simple value
|
||||
// proofs.
|
||||
// To use e.g. IAVL proofs, register op-decoders as
|
||||
// defined in the IAVL package.
|
||||
func DefaultProofRuntime() (prt *ProofRuntime) {
|
||||
prt = NewProofRuntime()
|
||||
prt.RegisterOpDecoder(ProofOpSimpleValue, SimpleValueOpDecoder)
|
||||
return
|
||||
}
|
@@ -1,107 +0,0 @@
|
||||
package merkle
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
For generalized Merkle proofs, each layer of the proof may require an
|
||||
optional key. The key may be encoded either by URL-encoding or
|
||||
(upper-case) hex-encoding.
|
||||
TODO: In the future, more encodings may be supported, like base32 (e.g.
|
||||
/32:)
|
||||
|
||||
For example, for a Cosmos-SDK application where the first two proof layers
|
||||
are SimpleValueOps, and the third proof layer is an IAVLValueOp, the keys
|
||||
might look like:
|
||||
|
||||
0: []byte("App")
|
||||
1: []byte("IBC")
|
||||
2: []byte{0x01, 0x02, 0x03}
|
||||
|
||||
Assuming that we know that the first two layers are always ASCII texts, we
|
||||
probably want to use URLEncoding for those, whereas the third layer will
|
||||
require HEX encoding for efficient representation.
|
||||
|
||||
kp := new(KeyPath)
|
||||
kp.AppendKey([]byte("App"), KeyEncodingURL)
|
||||
kp.AppendKey([]byte("IBC"), KeyEncodingURL)
|
||||
kp.AppendKey([]byte{0x01, 0x02, 0x03}, KeyEncodingURL)
|
||||
kp.String() // Should return "/App/IBC/x:010203"
|
||||
|
||||
NOTE: All encodings *MUST* work compatibly, such that you can choose to use
|
||||
whatever encoding, and the decoded keys will always be the same. In other
|
||||
words, it's just as good to encode all three keys using URL encoding or HEX
|
||||
encoding... it just wouldn't be optimal in terms of readability or space
|
||||
efficiency.
|
||||
|
||||
NOTE: Punycode will never be supported here, because not all values can be
|
||||
decoded. For example, no string decodes to the string "xn--blah" in
|
||||
Punycode.
|
||||
|
||||
*/
|
||||
|
||||
type keyEncoding int
|
||||
|
||||
const (
|
||||
KeyEncodingURL keyEncoding = iota
|
||||
KeyEncodingHex
|
||||
KeyEncodingMax
|
||||
)
|
||||
|
||||
type Key struct {
|
||||
name []byte
|
||||
enc keyEncoding
|
||||
}
|
||||
|
||||
type KeyPath []Key
|
||||
|
||||
func (pth KeyPath) AppendKey(key []byte, enc keyEncoding) KeyPath {
|
||||
return append(pth, Key{key, enc})
|
||||
}
|
||||
|
||||
func (pth KeyPath) String() string {
|
||||
res := ""
|
||||
for _, key := range pth {
|
||||
switch key.enc {
|
||||
case KeyEncodingURL:
|
||||
res += "/" + url.PathEscape(string(key.name))
|
||||
case KeyEncodingHex:
|
||||
res += "/x:" + fmt.Sprintf("%X", key.name)
|
||||
default:
|
||||
panic("unexpected key encoding type")
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func KeyPathToKeys(path string) (keys [][]byte, err error) {
|
||||
if path == "" || path[0] != '/' {
|
||||
return nil, cmn.NewError("key path string must start with a forward slash '/'")
|
||||
}
|
||||
parts := strings.Split(path[1:], "/")
|
||||
keys = make([][]byte, len(parts))
|
||||
for i, part := range parts {
|
||||
if strings.HasPrefix(part, "x:") {
|
||||
hexPart := part[2:]
|
||||
key, err := hex.DecodeString(hexPart)
|
||||
if err != nil {
|
||||
return nil, cmn.ErrorWrap(err, "decoding hex-encoded part #%d: /%s", i, part)
|
||||
}
|
||||
keys[i] = key
|
||||
} else {
|
||||
key, err := url.PathUnescape(part)
|
||||
if err != nil {
|
||||
return nil, cmn.ErrorWrap(err, "decoding url-encoded part #%d: /%s", i, part)
|
||||
}
|
||||
keys[i] = []byte(key) // TODO Test this with random bytes, I'm not sure that it works for arbitrary bytes...
|
||||
}
|
||||
}
|
||||
return keys, nil
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
package merkle
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestKeyPath(t *testing.T) {
|
||||
var path KeyPath
|
||||
keys := make([][]byte, 10)
|
||||
alphanum := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
for d := 0; d < 1e4; d++ {
|
||||
path = nil
|
||||
|
||||
for i := range keys {
|
||||
enc := keyEncoding(rand.Intn(int(KeyEncodingMax)))
|
||||
keys[i] = make([]byte, rand.Uint32()%20)
|
||||
switch enc {
|
||||
case KeyEncodingURL:
|
||||
for j := range keys[i] {
|
||||
keys[i][j] = alphanum[rand.Intn(len(alphanum))]
|
||||
}
|
||||
case KeyEncodingHex:
|
||||
rand.Read(keys[i])
|
||||
default:
|
||||
panic("Unexpected encoding")
|
||||
}
|
||||
path = path.AppendKey(keys[i], enc)
|
||||
}
|
||||
|
||||
res, err := KeyPathToKeys(path.String())
|
||||
require.Nil(t, err)
|
||||
|
||||
for i, key := range keys {
|
||||
require.Equal(t, key, res[i])
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,91 +0,0 @@
|
||||
package merkle
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
const ProofOpSimpleValue = "simple:v"
|
||||
|
||||
// SimpleValueOp takes a key and a single value as argument and
|
||||
// produces the root hash. The corresponding tree structure is
|
||||
// the SimpleMap tree. SimpleMap takes a Hasher, and currently
|
||||
// Tendermint uses aminoHasher. SimpleValueOp should support
|
||||
// the hash function as used in aminoHasher. TODO support
|
||||
// additional hash functions here as options/args to this
|
||||
// operator.
|
||||
//
|
||||
// If the produced root hash matches the expected hash, the
|
||||
// proof is good.
|
||||
type SimpleValueOp struct {
|
||||
// Encoded in ProofOp.Key.
|
||||
key []byte
|
||||
|
||||
// To encode in ProofOp.Data
|
||||
Proof *SimpleProof `json:"simple-proof"`
|
||||
}
|
||||
|
||||
var _ ProofOperator = SimpleValueOp{}
|
||||
|
||||
func NewSimpleValueOp(key []byte, proof *SimpleProof) SimpleValueOp {
|
||||
return SimpleValueOp{
|
||||
key: key,
|
||||
Proof: proof,
|
||||
}
|
||||
}
|
||||
|
||||
func SimpleValueOpDecoder(pop ProofOp) (ProofOperator, error) {
|
||||
if pop.Type != ProofOpSimpleValue {
|
||||
return nil, cmn.NewError("unexpected ProofOp.Type; got %v, want %v", pop.Type, ProofOpSimpleValue)
|
||||
}
|
||||
var op SimpleValueOp // a bit strange as we'll discard this, but it works.
|
||||
err := cdc.UnmarshalBinary(pop.Data, &op)
|
||||
if err != nil {
|
||||
return nil, cmn.ErrorWrap(err, "decoding ProofOp.Data into SimpleValueOp")
|
||||
}
|
||||
return NewSimpleValueOp(pop.Key, op.Proof), nil
|
||||
}
|
||||
|
||||
func (op SimpleValueOp) ProofOp() ProofOp {
|
||||
bz := cdc.MustMarshalBinary(op)
|
||||
return ProofOp{
|
||||
Type: ProofOpSimpleValue,
|
||||
Key: op.key,
|
||||
Data: bz,
|
||||
}
|
||||
}
|
||||
|
||||
func (op SimpleValueOp) String() string {
|
||||
return fmt.Sprintf("SimpleValueOp{%v}", op.GetKey())
|
||||
}
|
||||
|
||||
func (op SimpleValueOp) Run(args [][]byte) ([][]byte, error) {
|
||||
if len(args) != 1 {
|
||||
return nil, cmn.NewError("expected 1 arg, got %v", len(args))
|
||||
}
|
||||
value := args[0]
|
||||
hasher := tmhash.New()
|
||||
hasher.Write(value) // does not error
|
||||
vhash := hasher.Sum(nil)
|
||||
|
||||
// Wrap <op.Key, vhash> to hash the KVPair.
|
||||
hasher = tmhash.New()
|
||||
encodeByteSlice(hasher, []byte(op.key)) // does not error
|
||||
encodeByteSlice(hasher, []byte(vhash)) // does not error
|
||||
kvhash := hasher.Sum(nil)
|
||||
|
||||
if !bytes.Equal(kvhash, op.Proof.LeafHash) {
|
||||
return nil, cmn.NewError("leaf hash mismatch: want %X got %X", op.Proof.LeafHash, kvhash)
|
||||
}
|
||||
|
||||
return [][]byte{
|
||||
op.Proof.ComputeRootHash(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (op SimpleValueOp) GetKey() []byte {
|
||||
return op.key
|
||||
}
|
@@ -2,7 +2,7 @@ package merkle
|
||||
|
||||
import (
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
)
|
||||
|
||||
// Merkle tree from a map.
|
||||
|
@@ -3,22 +3,11 @@ package merkle
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
// SimpleProof represents a simple Merkle proof.
|
||||
// NOTE: The convention for proofs is to include leaf hashes but to
|
||||
// exclude the root hash.
|
||||
// This convention is implemented across IAVL range proofs as well.
|
||||
// Keep this consistent unless there's a very good reason to change
|
||||
// everything. This also affects the generalized proof system as
|
||||
// well.
|
||||
// SimpleProof represents a simple merkle proof.
|
||||
type SimpleProof struct {
|
||||
Total int `json:"total"` // Total number of items.
|
||||
Index int `json:"index"` // Index of item to prove.
|
||||
LeafHash []byte `json:"leaf_hash"` // Hash of item value.
|
||||
Aunts [][]byte `json:"aunts"` // Hashes from leaf's sibling to a root's child.
|
||||
Aunts [][]byte `json:"aunts"` // Hashes from leaf's sibling to a root's child.
|
||||
}
|
||||
|
||||
// SimpleProofsFromHashers computes inclusion proof for given items.
|
||||
@@ -29,10 +18,7 @@ func SimpleProofsFromHashers(items []Hasher) (rootHash []byte, proofs []*SimpleP
|
||||
proofs = make([]*SimpleProof, len(items))
|
||||
for i, trail := range trails {
|
||||
proofs[i] = &SimpleProof{
|
||||
Total: len(items),
|
||||
Index: i,
|
||||
LeafHash: trail.Hash,
|
||||
Aunts: trail.FlattenAunts(),
|
||||
Aunts: trail.FlattenAunts(),
|
||||
}
|
||||
}
|
||||
return
|
||||
@@ -63,32 +49,11 @@ func SimpleProofsFromMap(m map[string]Hasher) (rootHash []byte, proofs map[strin
|
||||
return
|
||||
}
|
||||
|
||||
// Verify that the SimpleProof proves the root hash.
|
||||
func (sp *SimpleProof) Verify(rootHash []byte, index int, total int, leafHash []byte) error {
|
||||
if sp.Index != index {
|
||||
return cmn.NewError("invalid index: wanted %v got %v", index, sp.Index)
|
||||
}
|
||||
if sp.Total != total {
|
||||
return cmn.NewError("invalid total: wanted %v got %v", total, sp.Total)
|
||||
}
|
||||
if !bytes.Equal(sp.LeafHash, leafHash) {
|
||||
return cmn.NewError("invalid leaf hash: wanted %X got %X", leafHash, sp.LeafHash)
|
||||
}
|
||||
computedHash := sp.ComputeRootHash()
|
||||
if !bytes.Equal(computedHash, rootHash) {
|
||||
return cmn.NewError("invalid root hash: wanted %X got %X", rootHash, computedHash)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Compute the root hash given a leaf hash. Does not verify the result.
|
||||
func (sp *SimpleProof) ComputeRootHash() []byte {
|
||||
return computeHashFromAunts(
|
||||
sp.Index,
|
||||
sp.Total,
|
||||
sp.LeafHash,
|
||||
sp.Aunts,
|
||||
)
|
||||
// Verify that leafHash is a leaf hash of the simple-merkle-tree
|
||||
// which hashes to rootHash.
|
||||
func (sp *SimpleProof) Verify(index int, total int, leafHash []byte, rootHash []byte) bool {
|
||||
computedHash := computeHashFromAunts(index, total, leafHash, sp.Aunts)
|
||||
return computedHash != nil && bytes.Equal(computedHash, rootHash)
|
||||
}
|
||||
|
||||
// String implements the stringer interface for SimpleProof.
|
||||
|
@@ -9,12 +9,12 @@ func SimpleHashFromTwoHashes(left, right []byte) []byte {
|
||||
var hasher = tmhash.New()
|
||||
err := encodeByteSlice(hasher, left)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
err = encodeByteSlice(hasher, right)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
return hasher.Sum(nil)
|
||||
}
|
||||
|
||||
|
@@ -3,8 +3,8 @@ package merkle
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
. "github.com/tendermint/tmlibs/test"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
. "github.com/tendermint/tendermint/libs/test"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto/tmhash"
|
||||
"testing"
|
||||
@@ -39,16 +39,16 @@ func TestSimpleProof(t *testing.T) {
|
||||
proof := proofs[i]
|
||||
|
||||
// Verify success
|
||||
err := proof.Verify(rootHash, i, total, itemHash)
|
||||
if err != nil {
|
||||
t.Errorf("Verification failed: %v.", err)
|
||||
ok := proof.Verify(i, total, itemHash, rootHash)
|
||||
if !ok {
|
||||
t.Errorf("Verification failed for index %v.", i)
|
||||
}
|
||||
|
||||
// Wrong item index should make it fail
|
||||
{
|
||||
err = proof.Verify(rootHash, (i+1)%total, total, itemHash)
|
||||
if err == nil {
|
||||
t.Errorf("Expected verification to fail for wrong index %v", i)
|
||||
ok = proof.Verify((i+1)%total, total, itemHash, rootHash)
|
||||
if ok {
|
||||
t.Errorf("Expected verification to fail for wrong index %v.", i)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ func TestSimpleProof(t *testing.T) {
|
||||
origAunts := proof.Aunts
|
||||
proof.Aunts = append(proof.Aunts, cmn.RandBytes(32))
|
||||
{
|
||||
err = proof.Verify(rootHash, i, total, itemHash)
|
||||
if err == nil {
|
||||
t.Errorf("Expected verification to fail for wrong trail length")
|
||||
ok = proof.Verify(i, total, itemHash, rootHash)
|
||||
if ok {
|
||||
t.Errorf("Expected verification to fail for wrong trail length.")
|
||||
}
|
||||
}
|
||||
proof.Aunts = origAunts
|
||||
@@ -66,22 +66,22 @@ func TestSimpleProof(t *testing.T) {
|
||||
// Trail too short should make it fail
|
||||
proof.Aunts = proof.Aunts[0 : len(proof.Aunts)-1]
|
||||
{
|
||||
err = proof.Verify(rootHash, i, total, itemHash)
|
||||
if err == nil {
|
||||
t.Errorf("Expected verification to fail for wrong trail length")
|
||||
ok = proof.Verify(i, total, itemHash, rootHash)
|
||||
if ok {
|
||||
t.Errorf("Expected verification to fail for wrong trail length.")
|
||||
}
|
||||
}
|
||||
proof.Aunts = origAunts
|
||||
|
||||
// Mutating the itemHash should make it fail.
|
||||
err = proof.Verify(rootHash, i, total, MutateByteSlice(itemHash))
|
||||
if err == nil {
|
||||
ok = proof.Verify(i, total, MutateByteSlice(itemHash), rootHash)
|
||||
if ok {
|
||||
t.Errorf("Expected verification to fail for mutated leaf hash")
|
||||
}
|
||||
|
||||
// Mutating the rootHash should make it fail.
|
||||
err = proof.Verify(MutateByteSlice(rootHash), i, total, itemHash)
|
||||
if err == nil {
|
||||
ok = proof.Verify(i, total, itemHash, MutateByteSlice(rootHash))
|
||||
if ok {
|
||||
t.Errorf("Expected verification to fail for mutated root hash")
|
||||
}
|
||||
}
|
||||
|
@@ -1,16 +0,0 @@
|
||||
package merkle
|
||||
|
||||
import (
|
||||
"github.com/tendermint/go-amino"
|
||||
)
|
||||
|
||||
var cdc *amino.Codec
|
||||
|
||||
func init() {
|
||||
cdc = amino.NewCodec()
|
||||
RegisterWire(cdc)
|
||||
}
|
||||
|
||||
func RegisterWire(cdc *amino.Codec) {
|
||||
// Nothing to do.
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user