Skip to content

Commit 0092252

Browse files
authored
Fix op-proposer configuration for docker-compose.yml (#207)
* Update GAME_FACTORY to use proxy dispute game factory address * Fix incorrect path string in GAME_FACTORY settings * Add Espresso contract configs to prepare-allocs The prepare-allocs.sh script doesn't currently have the Espresso Smart Contracts enabled. This change enables the contract and sets the preApprovedBatcherKey to work in a non-TEE environment. * Modify game-type for op-proposer The default game type when the `game-type` parameter is unspecified is `0`. By default there does not seem to be a `Dispute Game` deployed for `game-type` `0`, however, other game types do exist, including `game-type` `1`. This change sets the `game-type` of the `op-proposer` to `1` for the `docker-compose.yml` file. * Specify a `create2Salt` value for espresso deployment When the `op-deployer` performs the `apply` operation, it utilizes the values in the `state.json` file to inform how it should behave. Namely among these is the `create2Salt` value. The `op-deployer` utilizes the `create2` method for performing deployments according to specifications. This salt value is utilized and helps to assist in determining the resulting contract addresses. For convenience, it would be nice to have some deterministic values to test against for repeatability. This change modifies the `state.json` file before running `op-deployer` `apply` in order to ensure that we can see deterministic contract address generation.
1 parent 00315d9 commit 0092252

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

espresso/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,12 @@ services:
321321
- sh
322322
- -c
323323
- |
324-
GAME_FACTORY=$(jq -r '.disputeGameFactoryImplAddress' ./deployer/bootstrap_implementations.json)
324+
GAME_FACTORY=$(jq -r '.opChainDeployments[0].disputeGameFactoryProxyAddress' ./deployer/state.json)
325325
op-proposer \
326326
--proposal-interval 6s \
327327
--mnemonic "test test test test test test test test test test test junk" \
328328
--hd-path "m/44'/60'/0'/0/0" \
329+
--game-type 1 \
329330
--game-factory-address $$GAME_FACTORY
330331
331332
espresso-dev-node:

espresso/scripts/prepare-allocs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ op-deployer init --l1-chain-id "${L1_CHAIN_ID}" \
7070
--intent-type standard-overrides \
7171
--outdir ${DEPLOYER_DIR}
7272

73+
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].espressoEnabled -t bool -v true
74+
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].preApprovedBatcherKey -v "${OPERATOR_ADDRESS}"
7375
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .l1ContractsLocator -v "${ARTIFACTS_DIR}"
7476
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .l2ContractsLocator -v "${ARTIFACTS_DIR}"
7577
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .fundDevAccounts -t bool -v true
@@ -81,6 +83,10 @@ dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].roles.unsafeBlockSigne
8183
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].roles.batcher -v "${OPERATOR_ADDRESS}"
8284
dasel put -f "${DEPLOYER_DIR}/intent.toml" -s .chains.[0].roles.proposer -v "${OPERATOR_ADDRESS}"
8385

86+
# Fill in a specified create2Salt for the deployer, in order to ensure that the
87+
# contract addresses are deterministic.
88+
dasel put -f "${DEPLOYER_DIR}/state.json" -s create2Salt -v "0xaecea4f57fadb2097ccd56594f2f22715ac52f92971c5913b70a7f1134b68feb"
89+
8490
op-deployer apply --l1-rpc-url "${ANVIL_URL}" \
8591
--workdir "${DEPLOYER_DIR}" \
8692
--private-key="${OPERATOR_PRIVATE_KEY}"

0 commit comments

Comments
 (0)