Skip to content

gentlejay/succinct-prover-guide

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Succinct Prover Guide

Hardware Requirements:

Minimal Setup

  • CPU: 8 cores or more
  • Memory: 16GB+
  • NVIDIA GPU (e.g., RTX 4090, L4, A10G)

Software

  • Supported: Ubuntu 20.04/22.04/24.04
  • NVIDIA Driver: 555+
  • If you are running on Windows os locally, install Ubuntu 22 WSL using this Guide

Rent GPU

Recommended GPU Providers

  • Vast.ai: SSH-Key needed
    • Rent VM Ubuntu template
    • Refer to this Guide to generate SSH-Key, Rent GPU and connect to your Vast GPU

Also saw people mentioning GenesisCloud & Tensordock that I am not using them due to not supporting cryptocurrencies


Prover Setup

  • 1- Create a Prover in Succinct Staking Dashboard on Sepolia network

  • 2- Save your prover 0xaddress under My Prover (Keep a very low amount in your wallet)

  • 3- Stake $PROVE token on your Prover here

  • 4- You can add a new signer wallet (fresh wallet) in prover interface to your prover since you have to input the privatekey into the CLI

  • Note: I'm currently proving with less than 1000 $PROVE tokens staked while team says you need 1000 tokens, I'm experimenting things and will update this.


Dependecies

Update Packages

sudo apt update && sudo apt upgrade -y
sudo apt install git -y

Clone Repo

git clone https://github.com/0xmoei/succinct

cd succinct

Install Dependecies

chmod +x setup.sh
sudo ./setup.sh

Setup Prover

Copy .env from example

cp .env.example .env

Edit .env:

nano .env
  • Replace the variables with your own values.
  • PGUS_PER_SECOND & PROVE_PER_BPGU: Keep default values, or go through Calibrate section to configure them.

Calibrate Prover

The prover needs to be calibrated to your hardware in order to configure key parameters that govern its behavior. There are two key parameters that need to be set:

  • Bidding Price (PROVE_PER_BPGU): This is the price per proving gas unit (PGU) that the prover will bid for. This determines the profit margin of the prover and it's competitiveness with the rest of the network.
  • Expected Throughput(PGUS_PER_SECOND): This is an estimate of the prover's proving throughput in PGUs per second. This is used to estimate whether a prover can complete a proof before its deadline.
docker run --gpus all \
    --device-cgroup-rule='c 195:* rmw' \
    --name spn-callibrate \
    --network host \
    -e NETWORK_PRIVATE_KEY="$PRIVATE_KEY" \
    -v /var/run/docker.sock:/var/run/docker.sock \
    public.ecr.aws/succinct-labs/spn-node:latest-gpu \
    calibrate \
    --usd-cost-per-hour 0.80 \
    --utilization-rate 0.5 \
    --profit-margin 0.1 \
    --prove-price 1.00

This will output calibration results that look like the following:

Parameters:
┌──────────────────┬────────┐
│ Parameter        │ Value  │
├──────────────────┼────────┤
│ Cost Per Hour    │ $0.80  │
├──────────────────┼────────┤
│ Utilization Rate │ 50.00% │
├──────────────────┼────────┤
│ Profit Margin    │ 10.00% │
├──────────────────┼────────┤
│ Price of $PROVE  │ $1.00  │
└──────────────────┴────────┘

Starting calibration...

Calibration Results:
┌──────────────────────┬─────────────────────────┐
│ Metric               │ Value                   │
├──────────────────────┼─────────────────────────┤
│ Estimated Throughput │ 1742469 PGUs/second     │
├──────────────────────┼─────────────────────────┤
│ Estimated Bid Price  │ 0.28 $PROVE per 1B PGUs │
└──────────────────────┴─────────────────────────┘
  • This tells you that your prover can prove 1742469 prover gas units (PGUs) per second and that you should bid 0.28 $PROVE per 1B PGUs for proofs.
  • Now you can set PGUS_PER_SECOND & PROVE_PER_BPGU based on your callibration in .env file
  • Although, you can keep PROVE_PER_BPGU as low as 1.01 to prove more requests with less income

After Callibration, delete its docker container:

docker rm spn-callibrate

Run Prover

# Ensure you are in succinct directory
cd succinct

# Run
docker compose up -d

Prover Logs

# Logs
docker compose logs -f

# Last 100 logs
docker compose logs -fn 100

When looking for a request:

image

When proving a request:

image

Common Errors

1- docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

  • Make sure your server runs Ubuntu VM.

2- ERROR: Permanent error encountered when Bid: request is not in the requested state (Client specified an invalid argument)

3- ERROR Permanent error encountered when Bid: Timeout expired (The operation was cancelled)

  • Normal errors due to network or your prover's behaviour.

Stop Prover

docker stop sp1-gpu succinct-spn-node-1
docker rm sp1-gpu succinct-spn-node-1

Stake on a Prover via CLI

1- Install Rust & foundry:

# Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# Foundry
curl -L https://foundry.paradigm.xyz | bash
source /$HOME/.bashrc
foundryup

# Check Foundry Version
cast --version

2- Stake Commands:

Approve:

cast send --rpc-url https://sepolia.drpc.org --private-key YOUR_PRIVATE_KEY 0x376099fd6B50B60FE8b24B909827C1795D6e5096 "approve(address,uint256)" 0x837D40650aB3b0AA02E7e28238D9FEA73031856C 10000000000000000000
  • Replace followings in the above command:
    • YOUR_PRIVATE_KEY: Your EVM wallet privatekey with $PROVE tokens on Sepolia ETH
    • 100000000000000000000: Means 10 $PROVE tokens, you can modify it

Stake:

cast send --rpc-url https://sepolia.drpc.org --gas-limit 200000000 --private-key YOUR_PRIVATE_KEY 0x837D40650aB3b0AA02E7e28238D9FEA73031856C "stake(address,uint256)" 0x24Fb606c055f28f2072EaFf2D63e16Ba01f48348 10000000000000000000
  • Replace followings in the above command:
    • YOUR_PRIVATE_KEY: Your EVM wallet privatekey with $PROVE tokens on Sepolia ETH
    • 100000000000000000000: Means 10 $PROVE tokens, you can modify it
    • 0x24Fb606c055f28f2072EaFf2D63e16Ba01f48348 is my prover address, you can replace it with any other prover address you want

Balance of $PROVE

cast call --rpc-url https://sepolia.drpc.org 0x376099fd6B50B60FE8b24B909827C1795D6e5096 "balanceOf(address)(uint256)" WALLET_ADDRESS
  • Replace WALLET_ADDRESS with your wallet address

Balance of Staked $PROVE

cast call --rpc-url https://sepolia.drpc.org 0x837D40650aB3b0AA02E7e28238D9FEA73031856C "balanceOf(address)(uint256)" WALLET_ADDRESS
  • Replace WALLET_ADDRESS with your wallet address

I will update the guide with more optimization soon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%