forked from Decentralized-Pictures/T4L3NT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sandbox.Makefile
273 lines (250 loc) · 10.4 KB
/
sandbox.Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
TMP=/tmp
CURRENT_PROTO=010-PtGRANAD
CURRENT_PROTO_HASH=PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV
CURRENT_PROTO_NAME=Granada
## To be recommented when protocol G is over
NEXT_PROTO=011-PtHangz2
NEXT_PROTO_HASH=PtHangz2aRngywmSRGGvrcTyMbbdpWdpFKuS4uMWxg2RaH9i1qx
NEXT_PROTO_NAME=Hangzhou
ALPHA_PROTO=alpha
ALPHA_PROTO_HASH=ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK
.PHONY: all
all: accusations_simple_double_baking \
accusations_simple_double_endorsing \
voting_demo_noops \
user_activated_upgrade_alpha \
daemons_upgrade_alpha \
node_synchronization
all: accusations_simple_double_baking \
accusations_simple_double_endorsing \
voting_demo_noops \
user_activated_upgrade_next \
user_activated_upgrade_alpha \
daemons_upgrade_next \
daemons_upgrade_alpha \
node_synchronization
# The following rules define how to build Tezos binaries if they are
# missing.
#
# We only run "dune build" if it is strictly necessary. The CI stores
# the binaries as artefacts, but not _build. Those rules allow us to
# use these artefacts. Systematically running dune would cause a full
# rebuild since _build is not an artefact.
#
# The drawback of writing the rules this way is that if we need
# several binaries, we call dune several times, which takes a bit
# longer than calling it only once (dune scans the whole repository
# first).
#
# The real drawback of writing the rules this way is that during
# development, if you change something in the sources, as the binaries
# exist, nothing is recompiled!
tezos-node:
dune build src/bin_node/main.exe
cp _build/default/src/bin_node/main.exe $@
tezos-client:
dune build src/bin_client/main_client.exe
cp _build/default/src/bin_client/main_client.exe $@
tezos-admin-client:
dune build src/bin_client/main_admin.exe
cp _build/default/src/bin_client/main_admin.exe $@
tezos-sandbox:
dune build src/bin_sandbox/main.exe
cp _build/default/src/bin_sandbox/main.exe $@
# The following rules define how to run sandbox (i.e. Flextesa) integration tests.
# Note how base ports are well separated to be able to run them in parallel if needed
# (with make -j).
#
# Those rules are directly translated from src/bin_sandbox/dune rules.
.PHONY: accusations_simple_double_baking
accusations_simple_double_baking: tezos-sandbox tezos-client tezos-node
./tezos-sandbox accusations simple-double-baking \
--root-path ${TMP}/flextesa-acc-sdb/ \
--with-timestamp \
--base-port 10_000 \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node
.PHONY: accusations_simple_double_endorsing
accusations_simple_double_endorsing: tezos-sandbox tezos-client tezos-node
./tezos-sandbox accusations simple-double-endorsing \
--root-path ${TMP}/flextesa-acc-sde/ \
--with-timestamp \
--base-port 11_000 \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node
.PHONY: voting_demo_noops
voting_demo_noops: tezos-sandbox tezos-client tezos-admin-client tezos-node
./tezos-sandbox voting \
src/proto_demo_noops/lib_protocol/TEZOS_PROTOCOL \
src/proto_demo_noops/lib_protocol/TEZOS_PROTOCOL \
--root-path ${TMP}/flextesa-voting-demo-noops/ \
--base-port 12_000 \
--size 3 \
--with-timestamp \
--winning-client-is-clueless \
--winner-client-binary ./tezos-client \
--current-client-binary ./tezos-client \
--current-admin-client-binary ./tezos-admin-client \
--current-node-binary ./tezos-node \
--timestamp-delay=-600
.PHONY: user_activated_upgrade_next
user_activated_upgrade_next: tezos-sandbox tezos-client tezos-node \
tezos-baker-${CURRENT_PROTO} tezos-endorser-${CURRENT_PROTO} tezos-accuser-${CURRENT_PROTO} \
tezos-baker-${NEXT_PROTO} tezos-endorser-${NEXT_PROTO} tezos-accuser-${NEXT_PROTO}
./tezos-sandbox mini-net \
--root-path ${TMP}/flextesa-hard-fork/ \
--base-port 13_000 \
--size 2 \
--number-of-b 2 \
--with-timestamp \
--until 20 \
--protocol-hash ${CURRENT_PROTO_HASH} \
--protocol-kind ${CURRENT_PROTO_NAME} \
--tezos-client ./tezos-client \
--tezos-node ./tezos-node \
--tezos-baker ./tezos-baker-${CURRENT_PROTO} \
--tezos-endorser ./tezos-endorser-${CURRENT_PROTO} \
--tezos-accuser ./tezos-accuser-${CURRENT_PROTO} \
--hard-fork 8:${NEXT_PROTO_HASH} \
--hard-fork-baker ./tezos-baker-${NEXT_PROTO} \
--hard-fork-endorser ./tezos-endorser-${NEXT_PROTO} \
--hard-fork-accuser ./tezos-accuser-${NEXT_PROTO}
.PHONY: user_activated_upgrade_alpha
user_activated_upgrade_alpha: tezos-sandbox tezos-client tezos-node \
tezos-baker-${CURRENT_PROTO} tezos-endorser-${CURRENT_PROTO} tezos-accuser-${CURRENT_PROTO} \
tezos-baker-${ALPHA_PROTO} tezos-endorser-${ALPHA_PROTO} tezos-accuser-${ALPHA_PROTO}
./tezos-sandbox mini-net \
--root-path ${TMP}/flextesa-hard-fork-alpha/ \
--base-port 14_000 \
--size 2 \
--number-of-b 2 \
--with-timestamp \
--until 20 \
--protocol-hash ${CURRENT_PROTO_HASH} \
--protocol-kind ${CURRENT_PROTO_NAME} \
--tezos-client ./tezos-client \
--tezos-node ./tezos-node \
--tezos-baker ./tezos-baker-${CURRENT_PROTO} \
--tezos-endorser ./tezos-endorser-${CURRENT_PROTO} \
--tezos-accuser ./tezos-accuser-${CURRENT_PROTO} \
--hard-fork 8:${ALPHA_PROTO_HASH} \
--hard-fork-baker ./tezos-baker-${ALPHA_PROTO} \
--hard-fork-endorser ./tezos-endorser-${ALPHA_PROTO} \
--hard-fork-accuser ./tezos-accuser-${ALPHA_PROTO}
.PHONY: daemons_upgrade_next
daemons_upgrade_next: tezos-sandbox tezos-client tezos-admin-client tezos-node \
tezos-baker-${CURRENT_PROTO} tezos-endorser-${CURRENT_PROTO} tezos-accuser-${CURRENT_PROTO} \
tezos-baker-${NEXT_PROTO} tezos-endorser-${NEXT_PROTO} tezos-accuser-${NEXT_PROTO}
./tezos-sandbox daemons-upgrade \
src/proto_${subst -,_,${NEXT_PROTO}}/lib_protocol/TEZOS_PROTOCOL \
--root-path ${TMP}/flextesa-daemons-upgrade/ \
--base-port 15_000 \
--extra-dummy-proposals-batch-size 2 \
--extra-dummy-proposals-batch-levels 3,5 \
--size 2 \
--number-of-b 2 \
--time-betw 3 \
--blocks-per-vot 14 \
--with-timestamp \
--protocol-hash ${CURRENT_PROTO_HASH} \
--protocol-kind ${CURRENT_PROTO_NAME} \
--tezos-client ./tezos-client \
--tezos-admin ./tezos-admin-client \
--tezos-node ./tezos-node \
--first-baker ./tezos-baker-${CURRENT_PROTO} \
--first-endorser ./tezos-endorser-${CURRENT_PROTO} \
--first-accuser ./tezos-accuser-${CURRENT_PROTO} \
--second-baker ./tezos-baker-${NEXT_PROTO} \
--second-endorser ./tezos-endorser-${NEXT_PROTO} \
--second-accuser ./tezos-accuser-${NEXT_PROTO}
.PHONY: daemons_upgrade_alpha
daemons_upgrade_alpha: tezos-sandbox tezos-client tezos-admin-client tezos-node \
tezos-baker-${CURRENT_PROTO} tezos-endorser-${CURRENT_PROTO} tezos-accuser-${CURRENT_PROTO} \
tezos-baker-${ALPHA_PROTO} tezos-endorser-${ALPHA_PROTO} tezos-accuser-${ALPHA_PROTO}
./tezos-sandbox daemons-upgrade \
src/proto_${subst -,_,${ALPHA_PROTO}}/lib_protocol/TEZOS_PROTOCOL \
--root-path ${TMP}/flextesa-daemons-upgrade-alpha/ \
--base-port 16_000 \
--extra-dummy-proposals-batch-size 2 \
--extra-dummy-proposals-batch-levels 3,5 \
--size 2 \
--number-of-b 2 \
--time-betw 3 \
--blocks-per-vot 14 \
--with-timestamp \
--protocol-hash ${CURRENT_PROTO_HASH} \
--protocol-kind ${CURRENT_PROTO_NAME} \
--tezos-client ./tezos-client \
--tezos-admin ./tezos-admin-client \
--tezos-node ./tezos-node \
--first-baker ./tezos-baker-${CURRENT_PROTO} \
--first-endorser ./tezos-endorser-${CURRENT_PROTO} \
--first-accuser ./tezos-accuser-${CURRENT_PROTO} \
--second-baker ./tezos-baker-${ALPHA_PROTO} \
--second-endorser ./tezos-endorser-${ALPHA_PROTO} \
--second-accuser ./tezos-accuser-${ALPHA_PROTO}
# The following tests (node synchronization) cannot be run in parallel
# because they don't support --base-port.
# They are also not run in the CI, probably because an equivalent Tezt test exists.
.PHONY: node_synchronization_archive_full
node_synchronization_archive_full: tezos-sandbox tezos-client tezos-node
./tezos-sandbox node-synchronization \
--root-path ${TMP}/flextesa-node-synchronization-archive-full/ \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node \
--primary-history-mode archive \
--secondary-history-mode full \
--should-synch true
.PHONY: node_synchronization_archive_rolling
node_synchronization_archive_rolling: tezos-sandbox tezos-client tezos-node
./tezos-sandbox node-synchronization \
--root-path ${TMP}/flextesa-node-synchronization-archive-rolling/ \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node \
--primary-history-mode archive \
--secondary-history-mode rolling \
--should-synch true
.PHONY: node_synchronization_full_archive
node_synchronization_full_archive: tezos-sandbox tezos-client tezos-node
./tezos-sandbox node-synchronization \
--root-path ${TMP}/flextesa-node-synchronization-full-archive/ \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node \
--primary-history-mode full \
--secondary-history-mode archive \
--should-synch true
.PHONY: node_synchronization_full_rolling
node_synchronization_full_rolling: tezos-sandbox tezos-client tezos-node
./tezos-sandbox node-synchronization \
--root-path ${TMP}/flextesa-node-synchronization-full-rolling/ \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node \
--primary-history-mode full \
--secondary-history-mode rolling \
--should-synch true
.PHONY: node_synchronization_rolling_archive
node_synchronization_rolling_archive: tezos-sandbox tezos-client tezos-node
./tezos-sandbox node-synchronization \
--root-path ${TMP}/flextesa-node-synchronization-rolling-archive/ \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node \
--primary-history-mode rolling \
--secondary-history-mode archive \
--should-synch false
.PHONY: node_synchronization_rolling_full
node_synchronization_rolling_full: tezos-sandbox tezos-client tezos-node
./tezos-sandbox node-synchronization \
--root-path ${TMP}/flextesa-node-synchronization-rolling-full/ \
--tezos-client-binary ./tezos-client \
--tezos-node-binary ./tezos-node \
--primary-history-mode rolling \
--secondary-history-mode full \
--should-synch false
# The full "node synchronization" collection.
.PHONY: node_synchronization
node_synchronization: node_synchronization_archive_full \
node_synchronization_archive_rolling \
node_synchronization_full_archive \
node_synchronization_full_rolling \
node_synchronization_rolling_archive \
node_synchronization_rolling_full