From 919cb4cd0064d1cfa994e53a30a73f98975cfe34 Mon Sep 17 00:00:00 2001 From: Ivan Lagunovsky Date: Thu, 4 Jul 2024 03:08:48 +0200 Subject: [PATCH] docs(docs-site,protocol): streamline ProverSet deployment (#17730) Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com> --- .../node-operators/deploy-a-proverset.mdx | 45 ++++++--------- .../protocol/script/DeployProverSet.s.sol | 55 ++++--------------- .../protocol/script/DeployProverSetUtil.s.sol | 19 ------- 3 files changed, 30 insertions(+), 89 deletions(-) delete mode 100644 packages/protocol/script/DeployProverSetUtil.s.sol diff --git a/packages/docs-site/src/content/docs/guides/node-operators/deploy-a-proverset.mdx b/packages/docs-site/src/content/docs/guides/node-operators/deploy-a-proverset.mdx index b467eac581..507c435338 100644 --- a/packages/docs-site/src/content/docs/guides/node-operators/deploy-a-proverset.mdx +++ b/packages/docs-site/src/content/docs/guides/node-operators/deploy-a-proverset.mdx @@ -6,7 +6,7 @@ description: This guide will you help you deploy a ProverSet which enables you t import { Aside, Card, Steps, Tabs, TabItem } from '@astrojs/starlight/components' The recent protocol upgrade now requires that the address of the prover and proposer are the same. This can be achieved by simply using the same private keys to run the proposer and prover software, -but this is not recommended as it can cause nonce issues. +but this is not recommended as it can cause nonce issues. This guide outlines how to achieve this with separate EOAs running prover and proposer through the ProverSet smart contract. @@ -43,37 +43,28 @@ This guide outlines how to achieve this with separate EOAs running prover and pr -2. **Deploy the ProverSet implementation** +2. **Deploy the ProverSet** - Run the `DeployProverSetUtil.s.sol` script with your **proposer's private key**. You can find the script [here](https://github.com/taikoxyz/taiko-mono/tree/main/packages/protocol/script/DeployProverSetUtil.s.sol). + Set `ROLLUP_ADDRESS_MANAGER` to the address of the RollupAddressManager contract on the network you are deploying to. You can find these values in our network reference docs. - ```bash - forge script --chain-id {CHAIN_ID} --broadcast --rpc-url {YOUR_RPC_URL} --private-key=$PRIVATE_KEY script/DeployProverSetUtil.s.sol:DeployProverSetUtil - ``` - - The script should print your implementation address with the log: - - `New impl address is: 0x....` - - You will need the address for the next step. + Set `PROVER_SET_ADMIN` to the address of your **prover** EOA. You will be able to withdraw TAIKO/TTKOh from the contract to this address. -3. **Deploy the Proxy and init the ProverSet smart contract** - - Fill in the implementation address, set the **prover** EOA as admin, and ensure that the `ROLLUP_ADDRESS_MANAGER` matches for the respective network. You can find these values in our network reference docs. - - Run the `DeployProverSet.s.sol` script with your **proposer's private key** , altering the values in the script as necessary. You can find the script [here](https://github.com/taikoxyz/taiko-mono/tree/main/packages/protocol/script/DeployProverSet.s.sol). + Run the `DeployProverSet.s.sol` script with your **proposer's private key**. You can find the script [here](https://github.com/taikoxyz/taiko-mono/tree/main/packages/protocol/script/DeployProverSet.s.sol). ```bash - forge script --chain-id {CHAIN_ID} --rpc-url {YOUR_RPC_URL} --private-key=$PRIVATE_KEY --broadcast script/DeployProverSet.s.sol:DeployProverSet + ROLLUP_ADDRESS_MANAGER={ADDRESS} PROVER_SET_ADMIN={ADDRESS} forge script --chain-id {CHAIN_ID} --rpc-url {YOUR_RPC_URL} --private-key {PRIVATE_KEY} --broadcast script/DeployProverSet.s.sol:DeployProverSet ``` - The script should print your proxy address with the log: + The script should print your implementation and proxy address with the log: - `Proxy Address: 0x....` + ``` + Deployed ProverSet impl at address: 0x.... + Deployed ProverSet proxy at address: 0x.... + ``` - Use this address for the following steps. + Use proxy address for the following steps. -4. **Verify the contract as a proxy on Etherscan** +3. **Verify the contract as a proxy on Etherscan** Navigate to the `proxyAddress` logged as output of the script above in Etherscan. @@ -83,7 +74,7 @@ This guide outlines how to achieve this with separate EOAs running prover and pr Select the `Is this a proxy?` option and follow the instructions. This should verify the contract as a proxy to your `ProverSet` implementation. -5. **Write to the Proxy to `enableProver()`** +4. **Write to the Proxy to `enableProver()`** If the above step was completed correctly, you should be able to see the `Write as Proxy` option in the `Contract` tab. @@ -95,19 +86,19 @@ This guide outlines how to achieve this with separate EOAs running prover and pr This will allow both EOAs to send transactions to your ProverSet implementation which will act as a proxy to TaikoL1. -6. **Configure the contract as necessary** +5. **Configure the contract as necessary** Manage the contract's allowance with [approveAllowance()](https://github.com/taikoxyz/taiko-mono/blob/116d3f4886dea01333b829677ec9b6d4492479c6/packages/protocol/contracts/team/proving/ProverSet.sol#L63). TaikoL1's contract allowance is by default set to `UINT256.MAX` in the init function. -7. **Deposit your tokens and run your proposer + prover as usual!** +6. **Deposit your tokens and run your proposer + prover as usual!** If you've followed the instructions, send your TAIKO/TTKOh to the ProverSet proxy and begin running your prover and proposer as usual. - Ensure that you have set up the EOAs correctly to avoid problems. + Ensure that you have set up the EOAs correctly to avoid problems.