forked from Consensys/linea-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
228 lines (182 loc) · 8.37 KB
/
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
define get_future_time
$(shell \
OS=$$(uname); \
if [ "$$OS" = "Linux" ]; then \
date -d '+3 seconds' +%s; \
elif [ "$$OS" = "Darwin" ]; then \
date -v +3S +%s; \
fi \
)
endef
pnpm-install:
pnpm install
docker-pull-develop:
L1_GENESIS_TIME=$(get_future_time) docker compose -f docker/compose.yml pull
clean-smc-folders:
rm -f contracts/.openzeppelin/unknown-31648428.json
rm -f contracts/.openzeppelin/unknown-1337.json
clean-local-folders:
make clean-smc-folders
rm -rf tmp/local/*
clean-testnet-folders:
make clean-smc-folders
rm -rf tmp/testnet/*
clean-environment:
docker compose -f docker/compose.yml -f docker/compose-local-dev-traces-v2.overrides.yml --profile l1 --profile l2 --profile debug down || true
make clean-local-folders
docker network prune -f
docker volume rm linea-local-dev linea-logs || true # ignore failure if volumes do not exist already
# Commented out because it's quite time consuming to download the plugin, but it's useful to remember about it
#rm -rf tmp/linea-besu-sequencer/plugins/
start-l1:
L1_GENESIS_TIME=$(get_future_time) docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml --profile l1 up -d
start-l2:
docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml --profile l2 up -d
start-l2-blockchain-only:
docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml --profile l2-bc up -d
start-whole-environment:
# docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml build prover
docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml --profile l1 --profile l2 up -d
start-whole-environment-with-finalized-tag-updater:
docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml -f docker/compose-local-dev-finalized-tag-updater.overrides.yml --profile l1 --profile l2 up -d
start-whole-environment-traces-v2:
docker compose -f docker/compose.yml -f docker/compose-local-dev-traces-v2.overrides.yml --profile l1 --profile l2 up -d
start-whole-environment-traces-v2-with-finalized-tag-updater:
docker compose -f docker/compose.yml -f docker/compose-local-dev-traces-v2.overrides.yml -f docker/compose-local-dev-finalized-tag-updater.overrides.yml --profile l1 --profile l2 up -d
pull-all-images:
docker compose -f docker/compose.yml -f docker/compose-local-dev-traces-v2.overrides.yml --profile l1 --profile l2 pull
compile-contracts:
cd contracts; \
make compile
compile-contracts-no-cache:
cd contracts/; \
make force-compile
deploy-linea-rollup:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
PRIVATE_KEY=$${DEPLOYMENT_PRIVATE_KEY:-0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80} \
BLOCKCHAIN_NODE=http:\\localhost:8445/ \
PLONKVERIFIER_NAME=IntegrationTestTrueVerifier \
LINEA_ROLLUP_INITIAL_STATE_ROOT_HASH=0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd \
LINEA_ROLLUP_INITIAL_L2_BLOCK_NUMBER=0 \
LINEA_ROLLUP_SECURITY_COUNCIL=0x90F79bf6EB2c4f870365E785982E1f101E93b906 \
LINEA_ROLLUP_OPERATORS=$${LINEA_ROLLUP_OPERATORS:-0x70997970C51812dc3A010C7d01b50e0d17dc79C8,0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC} \
LINEA_ROLLUP_RATE_LIMIT_PERIOD=86400 \
LINEA_ROLLUP_RATE_LIMIT_AMOUNT=1000000000000000000000 \
LINEA_ROLLUP_GENESIS_TIMESTAMP=1683325137 \
npx hardhat deploy --no-compile --network zkevm_dev --tags PlonkVerifier,LineaRollup
deploy-l2messageservice:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
PRIVATE_KEY=$${DEPLOYMENT_PRIVATE_KEY:-0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae} \
BLOCKCHAIN_NODE=http:\\localhost:8545/ \
L2MSGSERVICE_SECURITY_COUNCIL=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 \
L2MSGSERVICE_L1L2_MESSAGE_SETTER=$${L2MSGSERVICE_L1L2_MESSAGE_SETTER:-0xd42e308fc964b71e18126df469c21b0d7bcb86cc} \
L2MSGSERVICE_RATE_LIMIT_PERIOD=86400 \
L2MSGSERVICE_RATE_LIMIT_AMOUNT=1000000000000000000000 \
npx hardhat deploy --no-compile --network zkevm_dev --tags L2MessageService
upgrade-linea-rollup-on-uat:
cd contracts/; \
rm -f .openzeppelin/goerli.json; \
sed "s/BLOCKCHAIN_NODE=.*/BLOCKCHAIN_NODE=https:\/\/goerli.infura.io\/v3\/${INFURA_KEY}/" .env.template.uat > .env; \
sed -i~ "s/PRIVATE_KEY=.*/PRIVATE_KEY=${PRIVATE_KEY}/" .env; \
npx hardhat run ./scripts/upgrades/upgradeZkEVM.ts --network zkevm_dev
fresh-start-l2-blockchain-only:
make clean-environment
make start-l2-blockchain-only
restart-shomei:
docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml rm zkbesu-shomei shomei
rm -rf tmp/local/shomei/*
docker compose -f docker/compose.yml -f docker/compose-local-dev.overrides.yml up zkbesu-shomei shomei -d
fresh-start-all-smc-v4:
make clean-environment
make start-all-smc-v4
fresh-start-all:
make clean-environment
make start-all
fresh-start-all-traces-v2:
make clean-environment
make start-all-traces-v2
fresh-start-all-traces-v2-with-finalized-tag-updater:
make clean-environment
make start-all-traces-v2-with-finalized-tag-updater
start-all-smc-v4:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment
make deploy-contracts-v4
start-all:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment
make deploy-contracts
start-all-with-finalized-tag-updater:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment-with-finalized-tag-updater
make deploy-contracts
start-all-traces-v2:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment-traces-v2
make deploy-contracts
start-all-traces-v2-with-finalized-tag-updater:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment-traces-v2-with-finalized-tag-updater
make deploy-contracts
deploy-contracts-v4:
make compile-contracts
$(MAKE) -j2 deploy-linea-rollup-v4 deploy-l2messageservice
deploy-contracts:
make compile-contracts
$(MAKE) -j2 deploy-linea-rollup deploy-l2messageservice
testnet-start-l2:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml --profile l2 up -d
testnet-start-l2-traces-node-only:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overries.yml up traces-node -d
testnet-start: start-l1 deploy-linea-rollup testnet-start-l2
testnet-restart-l2-keep-state:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml rm -f -s -v sequencer traces-node coordinator
make testnet-start-l2
testnet-restart-l2-clean-state:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml rm -f -s -v sequencer traces-node coordinator
docker volume rm testnet-data
make clean-testnet-folders
make testnet-start-l2
testnet-down:
docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml --profile l1 --profile l2 down -v
make clean-testnet-folders
stop_pid:
if [ -f $(PID_FILE) ]; then \
kill `cat $(PID_FILE)`; \
echo "Stopped process with PID `cat $(PID_FILE)`"; \
rm $(PID_FILE); \
else \
echo "$(PID_FILE) does not exist. No process to stop."; \
fi
restart-l2-minimal-stack-local:
make stop-coordinator
make stop-traces-api
make stop_pid PID_FILE=tmp/local/traces-app.pid
make clean-environment
make start-l2
make deploy-l2messageservice-to-local
make start-traces-api
make start-coordinator
# TODO: use locally built prover for faster feedback loop
stop-l2-minimal-stack-local:
make stop-coordinator
make stop-traces-api
make clean-environment
start-coordinator:
mkdir -p tmp/local/logs
./gradlew coordinator:app:run \
-Dconfig.override.testL1Disabled=true \
-Dconfig.override.traces.counters.endpoints="http://127.0.0.1:8081" \
-Dconfig.override.traces.conflation.endpoints="http://127.0.0.1:8081" \
-Dconfig.override.dynamic-gas-price-service.miner-gas-price-update-recipients="http://127.0.0.1:8545/,http://127.0.0.1:8645/" > tmp/local/logs/coordinator.log & echo "$$!" > tmp/local/coordinator.pid
stop-coordinator:
make stop_pid PID_FILE=tmp/local/coordinator.pid
restart-coordinator:
make stop-coordinator
make start-coordinator
start-traces-api:
mkdir -p tmp/local/logs
mkdir -p tmp/local/traces/raw
./gradlew traces-api:app:run > tmp/local/logs/traces-app.log & echo "$$!" > tmp/local/traces-app.pid
stop-traces-api:
make stop_pid PID_FILE=tmp/local/traces-app.pid
restart-traces-api:
make stop-traces-api
make start-traces-api