-
Notifications
You must be signed in to change notification settings - Fork 263
Proposer setup guide #1645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
krofax
wants to merge
31
commits into
main
Choose a base branch
from
proposer-guide
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Proposer setup guide #1645
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c93d0d0
update batcher configs
krofax 6056903
Added the proposer guide and next steps
krofax 1b7c798
fix breadcrumbs
krofax 15ffc89
Update pages/operators/chain-operators/tutorials/absolute-prestate.mdx
krofax def8774
Update pages/operators/chain-operators/tutorials/migrating-permission…
krofax 174452d
updated config values
ZakAyesh 00b8e4c
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
ZakAyesh e9b16ec
updated description of proposers roll
ZakAyesh 538b1bc
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
ZakAyesh b1818ba
updated the structure
krofax 34bdfda
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
krofax 856e17d
updated the docs
krofax 06fbc45
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
krofax 3c7dde9
revert batcher changes
krofax 6e8fa74
updated the docs
krofax f8db0fe
updated the contents
krofax da61bee
updated the contents of the docs
krofax 57b408f
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
krofax ad8da1e
update the title
krofax 829dfa9
update the links
krofax 5fcae2c
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
krofax 8bbf76b
Add todo
krofax e988cc4
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
krofax a26f8fe
updated text
krofax 0072ea3
updated the content of the docs
krofax 2c2876b
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
krofax ed205d2
Clarify proposer setup instructions in the guide
krofax afa1ae2
Enhance proposer setup guide with updated links and additional config…
krofax 6d7807b
Update proposer setup guide with corrected links to sequencer node an…
krofax 8fe042c
merge conflicts
krofax 66b06ee
update the breadcrumbs
krofax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
265 changes: 265 additions & 0 deletions
265
pages/operators/chain-operators/deploy/proposer-setup-guide.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,265 @@ | ||||||
--- | ||||||
title: Spinning up the proposer | ||||||
lang: en-US | ||||||
description: Learn how to set up and configure an OP Stack proposer to post L2 state roots. | ||||||
content_type: tutorial | ||||||
topic: proposer-setup | ||||||
personas: | ||||||
- chain-operator | ||||||
categories: | ||||||
- testnet | ||||||
- mainnet | ||||||
- op-proposer | ||||||
- state-commitment | ||||||
- l2-output-submission | ||||||
- withdrawal-verification | ||||||
is_imported_content: 'false' | ||||||
--- | ||||||
|
||||||
import { Callout, Steps } from 'nextra/components' | ||||||
|
||||||
# Spinning up the proposer | ||||||
|
||||||
After you have [spun up your sequencer](/operators/chain-operators/deploy/sequencer-node), you need to attach a proposer to post your L2 state roots data back onto L1 so we can prove withdrawal validity. The proposer is a critical component that enables trustless L2-to-L1 messaging and creates the authoritative view of L2 state from L1's perspective. | ||||||
|
||||||
This guide assumes you already have a functioning sequencer and the necessary L1 contracts deployed using [`op-deployer`](/operators/chain-operators/tools/op-deployer). If you haven't set up your sequencer yet, please refer to the [sequencer guide](/operators/chain-operators/deploy/sequencer-node) first. | ||||||
|
||||||
To see configuration info for the proposer, check out the [configuration page](/operators/chain-operators/configuration/proposer). | ||||||
|
||||||
## Understanding the proposer's role | ||||||
|
||||||
The proposer (`op-proposer`) serves as a crucial bridge between your L2 chain and L1. Its primary responsibilities include: | ||||||
|
||||||
* **State commitment**: Proposing L2 state roots to L1 at regular intervals | ||||||
* **Withdrawal enablement**: Providing the necessary commitments for users to prove and finalize withdrawals | ||||||
|
||||||
The proposer creates dispute games via the `DisputeGameFactory` contract. | ||||||
|
||||||
## Prerequisites | ||||||
|
||||||
Before setting up your proposer, ensure you have: | ||||||
|
||||||
**Running infrastructure:** | ||||||
|
||||||
* An operational sequencer node | ||||||
* Access to a L1 RPC endpoint | ||||||
|
||||||
**Network information:** | ||||||
|
||||||
* Your L2 chain ID and network configuration | ||||||
* L1 network details (chain ID, RPC endpoints) | ||||||
|
||||||
## Software installation | ||||||
|
||||||
### Build from source | ||||||
|
||||||
Clone and build op-proposer | ||||||
|
||||||
```bash | ||||||
# If you don't already have the optimism repository from the sequencer setup | ||||||
git clone https://github.com/ethereum-optimism/optimism.git | ||||||
cd optimism | ||||||
|
||||||
# Checkout the latest release tag | ||||||
git checkout op-proposer/v1.10.0 | ||||||
|
||||||
# Build op-proposer | ||||||
cd op-proposer | ||||||
just | ||||||
|
||||||
# Binary will be available at ./bin/op-proposer | ||||||
``` | ||||||
|
||||||
<Callout type="info"> | ||||||
This uses `op-proposer/v1.10.0` which is compatible with op-node/v1.13.3 and op-geth/v1.101511.0 from \[spinning up the sequencer guide]\(Will link to this, when its live). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just make sure you fix these links |
||||||
Always check the [release notes](https://github.com/ethereum-optimism/optimism/releases) for compatibility. | ||||||
</Callout> | ||||||
krofax marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
### Verify installation | ||||||
|
||||||
Run this command to verify the installation. | ||||||
|
||||||
```bash | ||||||
./bin/op-proposer --version | ||||||
``` | ||||||
|
||||||
## Configuration setup | ||||||
|
||||||
### 1. Organize your workspace | ||||||
|
||||||
at the same level as your sequencer from the \[sequencer tutorial]\(link-to-the sequencer tutorial): | ||||||
|
||||||
krofax marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
```bash | ||||||
# Create proposer directory at the same level as your sequencer | ||||||
mkdir proposer-node | ||||||
cd proposer-node | ||||||
|
||||||
# Create scripts directory | ||||||
mkdir scripts | ||||||
``` | ||||||
|
||||||
### 2. Extract DisputeGameFactory address | ||||||
|
||||||
Extract the DisputeGameFactory contract address from your op-deployer output: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```bash | ||||||
# Navigate to proposer directory | ||||||
cd proposer-node | ||||||
|
||||||
# Copy the state.json from .deployer directory created while using op-deployer | ||||||
# Update the path if your .deployer directory is located elsewhere | ||||||
cp ../.deployer/state.json . | ||||||
|
||||||
# Extract the DisputeGameFactory address | ||||||
GAME_FACTORY_ADDRESS=$(cat state.json | jq -r '.opChainDeployments[0].disputeGameFactoryProxyAddress') | ||||||
echo "DisputeGameFactory Address: $GAME_FACTORY_ADDRESS" | ||||||
``` | ||||||
|
||||||
<Callout type="info"> | ||||||
The proposer only needs the `DisputeGameFactory` address to submit proposals. | ||||||
The `GAME_TYPE=0` represents the standard fault proof game type. | ||||||
</Callout> | ||||||
|
||||||
### 3. Set up environment variables | ||||||
|
||||||
Create your `.env` file with the actual values: | ||||||
|
||||||
```bash | ||||||
# Create .env file with your actual values | ||||||
# L1 Configuration - Replace with your actual RPC URL | ||||||
L1_RPC_URL=https://sepolia.infura.io/v3/YOUR_ACTUAL_INFURA_KEY | ||||||
|
||||||
# L2 Configuration - Should match your sequencer setup | ||||||
L2_RPC_URL=http://localhost:8545 | ||||||
ROLLUP_RPC_URL=http://localhost:8547 | ||||||
|
||||||
# Contract addresses - Extract from your op-deployer output | ||||||
GAME_FACTORY_ADDRESS=YOUR_ACTUAL_GAME_FACTORY_ADDRESS | ||||||
|
||||||
# Private key - Replace with your actual private key | ||||||
PRIVATE_KEY=0xYOUR_ACTUAL_PRIVATE_KEY | ||||||
|
||||||
# Proposer configuration | ||||||
PROPOSAL_INTERVAL=3600s | ||||||
GAME_TYPE=0 | ||||||
POLL_INTERVAL=20s | ||||||
|
||||||
# RPC configuration | ||||||
PROPOSER_RPC_PORT=8560 | ||||||
``` | ||||||
|
||||||
**Important**: Replace ALL placeholder values (`YOUR_ACTUAL_*`) with your real configuration values! | ||||||
|
||||||
### 4. Get your private key | ||||||
|
||||||
Get a private key from your wallet. | ||||||
|
||||||
## Proposer configuration | ||||||
|
||||||
Create `scripts/start-proposer.sh`: | ||||||
|
||||||
```bash | ||||||
#!/bin/bash | ||||||
|
||||||
source .env | ||||||
|
||||||
# Path to the op-proposer binary we built | ||||||
../optimism/op-proposer/bin/op-proposer \ | ||||||
--poll-interval=$POLL_INTERVAL \ | ||||||
--rpc.port=$PROPOSER_RPC_PORT \ | ||||||
--rpc.enable-admin \ | ||||||
--rollup-rpc=$ROLLUP_RPC_URL \ | ||||||
--l1-eth-rpc=$L1_RPC_URL \ | ||||||
--private-key=$PRIVATE_KEY \ | ||||||
--game-factory-address=$GAME_FACTORY_ADDRESS \ | ||||||
--game-type=$GAME_TYPE \ | ||||||
--proposal-interval=$PROPOSAL_INTERVAL \ | ||||||
--num-confirmations=1 \ | ||||||
--resubmission-timeout=30s \ | ||||||
--wait-node-sync=true \ | ||||||
--log.level=info | ||||||
``` | ||||||
|
||||||
Your final directory structure should look like: | ||||||
|
||||||
```bash | ||||||
~/ | ||||||
├── optimism/ # Contains op-proposer binary | ||||||
├── sequencer-node/ # Your sequencer setup | ||||||
├── .deployer/ # From op-deployer | ||||||
│ └── state.json | ||||||
└── proposer-node/ # Your proposer working directory | ||||||
├── state.json # Copied from .deployer | ||||||
├── .env | ||||||
└── scripts/ | ||||||
└── start-proposer.sh | ||||||
``` | ||||||
|
||||||
## Starting the proposer | ||||||
|
||||||
### 1. Verify prerequisites | ||||||
|
||||||
Ensure your sequencer and op-node are running: | ||||||
|
||||||
```bash | ||||||
|
||||||
# Test L1 connectivity | ||||||
# Note: Make sure you have exported these environment variables to your current shell session: | ||||||
# export L1_RPC_URL="https://sepolia.infura.io/v3/YOUR_KEY" | ||||||
# export L2_RPC_URL="http://localhost:8545" | ||||||
# export ROLLUP_RPC_URL="http://localhost:8547" | ||||||
|
||||||
curl -X POST -H "Content-Type: application/json" \ | ||||||
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ | ||||||
$L1_RPC_URL | ||||||
|
||||||
# Test L2 connectivity | ||||||
curl -X POST -H "Content-Type: application/json" \ | ||||||
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ | ||||||
$L2_RPC_URL | ||||||
|
||||||
# Test rollup node connectivity | ||||||
curl -X POST -H "Content-Type: application/json" \ | ||||||
--data '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' \ | ||||||
$ROLLUP_RPC_URL | ||||||
``` | ||||||
|
||||||
### 2. Start the proposer | ||||||
|
||||||
```bash | ||||||
# Make the script executable | ||||||
chmod +x scripts/start-proposer.sh | ||||||
|
||||||
# Start the proposer | ||||||
./scripts/start-proposer.sh | ||||||
``` | ||||||
|
||||||
## Verification | ||||||
|
||||||
Verify your proposer is working correctly: | ||||||
|
||||||
### Check proposer status | ||||||
|
||||||
```bash | ||||||
|
||||||
# Monitor proposal activity | ||||||
curl -X POST -H "Content-Type: application/json" \ | ||||||
--data '{"jsonrpc":"2.0","method":"optimism_outputAtBlock","params":["latest"],"id":1}' \ | ||||||
http://localhost:8547 | ||||||
|
||||||
# Check if your proposer address has enough ETH for gas | ||||||
# (Replace with your actual proposer address) | ||||||
curl -X POST -H "Content-Type: application/json" \ | ||||||
--data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xYOUR_PROPOSER_ADDRESS","latest"],"id":1}' \ | ||||||
$L1_RPC_URL | ||||||
``` | ||||||
|
||||||
Your proposer is now operational! | ||||||
|
||||||
## Next steps | ||||||
|
||||||
* Learn how to set up the [sequencer node](/operators/chain-operators/deploy/sequencer-node) for your OP Stack chain. | ||||||
* For detailed parameter documentation, see the [proposer configuration reference](/operators/chain-operators/configuration/proposer). | ||||||
* For more detail on deploying new dispute games with OPCM, [see the docs](/operators/chain-operators/tutorials/dispute-games). | ||||||
* checkout the [migrating to permissionless fault proofs](/operators/chain-operators/tutorials/migrating-permissionless) guide | ||||||
* For cost optimization resources, check out the [Fee calculation tools](/operators/chain-operators/tools/fee-calculator). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.