-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Copy pathrepro.justfile
60 lines (52 loc) · 1.96 KB
/
repro.justfile
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
GIT_COMMIT := ""
GIT_DATE := ""
CANNON_VERSION := "v0.0.0"
OP_PROGRAM_VERSION := "v0.0.0"
GOOS := ""
GOARCH := ""
# Build the cannon binary
cannon:
#!/bin/bash
# in devnet scenario, the cannon binary is already built.
[ -x /app/cannon/bin/cannon ] && exit 0
cd ../cannon
make cannon \
GOOS={{GOOS}} \
GOARCH={{GOARCH}} \
GITCOMMIT={{GIT_COMMIT}} \
GITDATE={{GIT_DATE}} \
VERSION={{CANNON_VERSION}}
# Build the op-program-client elf binaries
op-program-client-mips:
#!/bin/bash
cd ../op-program
make op-program-client-mips \
GOOS=linux \
GOARCH=mips \
GOMIPS=softfloat \
GITCOMMIT={{GIT_COMMIT}} \
GITDATE={{GIT_DATE}} \
VERSION={{OP_PROGRAM_VERSION}}
# Run the op-program-client elf binary directly through cannon's load-elf subcommand.
client TYPE CLIENT_SUFFIX PRESTATE_SUFFIX: cannon op-program-client-mips
#!/bin/bash
/app/cannon/bin/cannon load-elf \
--type {{TYPE}} \
--path /app/op-program/bin/op-program-client{{CLIENT_SUFFIX}}.elf \
--out /app/op-program/bin/prestate{{PRESTATE_SUFFIX}}.bin.gz \
--meta "/app/op-program/bin/meta{{PRESTATE_SUFFIX}}.json"
# Generate the prestate proof containing the absolute pre-state hash.
prestate TYPE CLIENT_SUFFIX PRESTATE_SUFFIX: (client TYPE CLIENT_SUFFIX PRESTATE_SUFFIX)
#!/bin/bash
/app/cannon/bin/cannon run \
--proof-at '=0' \
--stop-at '=1' \
--input /app/op-program/bin/prestate{{PRESTATE_SUFFIX}}.bin.gz \
--meta "" \
--proof-fmt '/app/op-program/bin/%d{{PRESTATE_SUFFIX}}.json' \
--output ""
mv /app/op-program/bin/0{{PRESTATE_SUFFIX}}.json /app/op-program/bin/prestate-proof{{PRESTATE_SUFFIX}}.json
build-default: (prestate "singlethreaded-2" "" "")
build-mt64: (prestate "multithreaded64-3" "64" "-mt64")
build-interop: (prestate "multithreaded64-3" "-interop" "-interop")
build-all: build-default build-mt64 build-interop