Skip to content
All Hekla Node Runners: Imminent Ontake fork Sep 30th, upgrade needed. Please update your provers to raiko 1.2.0! Click here for more info

Deploy a ProverSet

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.

This guide outlines how to achieve this with separate EOAs running prover and proposer through the ProverSet smart contract.

Prerequisites

  • You have TAIKO or TTKOh depending on which network you are proving on
  • You have enough ETH or holesky ETH for gas fees

Deploying a ProverSet

  1. Clone the Taiko monorepo

    The Taiko monorepo contains the scripts for deploying your ProverSet. Checkout the latest stable release. (Use protocol-v1.9.0 for Hekla!)

    Terminal window
    git clone https://github.com/taikoxyz/taiko-mono.git
    cd taiko-mono/packages/protocol
    git checkout tags/{release-tag}
  2. Deploy the ProverSet

    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.

    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.

    Run the DeployProverSet.s.sol script with your proposer’s private key. You can find the script here.

    Terminal window
    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 implementation and proxy address with the log:

    Deployed ProverSet impl at address: 0x....
    Deployed ProverSet proxy at address: 0x....

    Use proxy address for the following steps.

  3. Verify the contract as a proxy on Etherscan

    Navigate to the proxyAddress logged as output of the script above in Etherscan.

    In the Contract tab, you can find the More options section as follows:

    Verify as Proxy

    Select the Is this a proxy? option and follow the instructions. This should verify the contract as a proxy to your ProverSet implementation.

  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.

    Connect to Etherscan with the EOA you used to deploy the ProverSet and send two enableProver() transactions, enabling both your proposer and prover EOAs as provers. Set isProver as true for both transactions. You can set these as false if you want to disable these provers in the future.

    This will allow both EOAs to send transactions to your ProverSet implementation which will act as a proxy to TaikoL1.

  5. Configure the contract as necessary

    Manage the contract’s allowance with approveAllowance(). TaikoL1’s contract allowance is by default set to UINT256.MAX in the init function.

  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. If you’ve set up your allowance properly, there should be no need to use the depositBond function, as it deposits TTKOh from the ProverSet to TaikoL1.

    Ensure that you have set up the EOAs correctly to avoid problems.

Upgrading a ProverSet

If you’ve already deployed a ProverSet but would like to upgrade it through the Proxy, this guide is for you!

  1. Find your existing Proxy’s address

    This will be necessary for the following step.

  2. Navigate to the taiko monorepo and checkout the release version of ProverSet you want to deploy.

    Terminal window
    cd taiko-mono/packages/protocol
    git checkout tags/{PROTOCOL_RELEASE_TAG}
  3. Deploy the ProverSet contract from your prover EOA and call upgradeTo with the new implementation address on your original Proxy

    Execute the following command, filling in the values in the curly braces appropriately.

    Terminal window
    forge create --private-key {YOUR_PRIVATE_KEY} --chain-id {CHAIN_ID} --rpc-url {YOUR_RPC_URL} contracts/layer1/provers/ProverSet.sol:ProverSet

    You should see logs like these:

    Deployer: 0x3e5c...
    Deployed to: 0x9186...
    Transaction hash: 0xf0ebb...

    Then, proceed to your original Proxy contract; access the Write to Proxy tab and scroll to the upgradeTo() function.

    Connect your EOA that you originally deployed the ProverSet from and call the function with your new Deployed to: address.

    Once the transaction succeeds, you have successfully upgraded your ProverSet.

FAQ

Where is my TTKOh/TAIKO?

If you’ve managed to propose and prove some blocks, it’s likely you’re wondering where your tokens went after.

It’s not missing, it’s just been deposited as bond in the TaikoL1 contract; you can withdraw it to the ProverSet contract with withdrawBond() manually.

How do I verify my ProverSet contract?

Once you’ve deployed the contract, you should be able to find the contract address. You can do this on Etherscan manually or with forge!

You will need foundry installed, and an Etherscan API key; you can get this by signing in on etherscan.io and navigating to your profile’s API Keys. Then, navigate to the protocol package in taiko-mono and execute the following command substituting values in curly braces as necessary.

Terminal window
forge verify-contract --chain-id {CHAIN_ID} --etherscan-api-key {GET-API-KEY-FROM-ETHERSCAN-FIRST} {PUT-CONTRACT-ADDRESS-HERE} contracts/layer1/provers/ProverSet.sol:ProverSet

You should get a success message and your contract should now show up as verified on Etherscan!

Troubleshooting

If you run into any problems, please visit the node troubleshooting page for help. If you run into an error that isn’t yet listed, please reach out in our Discord!