Skip to content

Commit

Permalink
chore(proposer + book): docs + proposer (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Mar 8, 2025
1 parent fac8fb3 commit 6774a34
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
1 change: 1 addition & 0 deletions book/advanced/proposer.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Before starting the proposer, ensure you have deployed the L2 Output Oracle and
| `NETWORK_PRIVATE_KEY` | Key for the Succinct Prover Network. Get access [here](https://docs.succinct.xyz/docs/generating-proofs/prover-network). |
| `L2OO_ADDRESS` | Address of the `OPSuccinctL2OutputOracle` contract. |
| `PRIVATE_KEY` | Private key for the account that will be posting output roots to L1. |
| `DATABASE_URL` | The address of a Postgres database for storing the intermediate proposer state. |

## Advanced Environment Variables

Expand Down
2 changes: 1 addition & 1 deletion book/contracts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can configure additional parameters when deploying or upgrading the `OPSucci
|-----------|-------------|
| `VERIFIER_ADDRESS` | Default: Succinct's official Groth16 VerifierGateway. Address of the `ISP1Verifier` contract used to verify proofs. For mock proofs, this is the address of the `SP1MockVerifier` contract. |
| `STARTING_BLOCK_NUMBER` | Default: The finalized block number on L2. The block number to initialize the contract from. OP Succinct will start proving state roots from this block number. |
| `SUBMISSION_INTERVAL` | Default: `1000`. The minimum interval in L2 blocks at which checkpoints must be submitted. An aggregation proof can be posted for any range larger than this interval. |
| `SUBMISSION_INTERVAL` | Default: `10`. The minimum interval in L2 blocks for a proof to be submitted. An aggregation proof can be posted for any range larger than this interval. |
| `FINALIZATION_PERIOD_SECS` | Default: `3600` (1 hour). The time period (in seconds) after which a proposed output becomes finalized and withdrawals can be processed. |
| `PROPOSER` | Default: The address of the account associated with `PRIVATE_KEY`. If `PRIVATE_KEY` is not set, `address(0)`. An Ethereum address authorized to submit proofs. Set to `address(0)` to allow permissionless submissions. **Note: Use `addProposer` and `removeProposer` functions to update the list of approved proposers.** |
| `CHALLENGER` | Default: The address of the account associated with `PRIVATE_KEY`. If `PRIVATE_KEY` is not set, `address(0)`. Ethereum address authorized to dispute proofs. Set to `address(0)` for no challenging. |
Expand Down
3 changes: 2 additions & 1 deletion book/quick-start/full.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ To start the `op-succinct` service, add the following parameters to the `.env` f
| `L2OO_ADDRESS` | The address of the `OPSuccinctL2OutputOracle` contract from the previous step. |
| `NETWORK_PRIVATE_KEY` | The private key for the account that will be submitting proofs to the L1. |
| `NETWORK_RPC_URL` | The RPC endpoint for the Succinct Prover Network. The default endpoint (`https://rpc.succinct.xyz`) is not suitable for use in OP Succinct. Reach out to the Succinct team to get access with OP Succinct. |

| `DATABASE_URL` | The address of a Postgres database for storing the intermediate proposer state. |
Now, you should have the following in your `.env` file:

| Parameter | Description |
Expand All @@ -93,6 +93,7 @@ Now, you should have the following in your `.env` file:
| `L2OO_ADDRESS` | The address of the `OPSuccinctL2OutputOracle` contract from the previous step. |
| `NETWORK_PRIVATE_KEY` | The private key for the account that will be submitting proofs to the L1. |
| `NETWORK_RPC_URL` | Reach out to the Succinct team to get access [here](https://docs.google.com/forms/d/e/1FAIpQLSd2Yil8TrU54cIuohH1WvDvbxTusyqh5rsDmMAtGC85-Arshg/viewform?ref=https://succinctlabs.github.io/op-succinct/). The default endpoint (`https://rpc.succinct.xyz`) is not suitable for use in OP Succinct. |
| `DATABASE_URL` | The address of a Postgres database for storing the intermediate proposer state. |

### 4) Start the `op-succinct` service.

Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/bin/fetch_rollup_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async fn update_l2oo_config() -> Result<()> {

let submission_interval = env::var("SUBMISSION_INTERVAL")
.map(|p| p.parse().unwrap())
.unwrap_or(1000);
.unwrap_or(10);

// Default finalization period of 1 hour. Gives the challenger enough time to dispute the output.
// Docs: https://docs.optimism.io/builders/chain-operators/configuration/rollup#finalizationperiodseconds
Expand Down
15 changes: 2 additions & 13 deletions validity/src/proposer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ pub struct RequesterConfig {
pub struct DriverConfig {
pub network_prover: Arc<NetworkProver>,
pub fetcher: Arc<OPSuccinctDataFetcher>,
pub range_proof_size: u64,
pub submission_interval: u64,
pub proof_timeout: u64,
pub driver_db_client: Arc<DriverDBClient>,
pub max_concurrent_proof_requests: u64,
pub max_concurrent_witness_gen: u64,
pub loop_interval_seconds: u64,
}
/// Type alias for a map of task IDs to their join handles and associated requests
Expand Down Expand Up @@ -130,7 +125,6 @@ where

// Initialize fetcher
let rollup_config_hash = hash_rollup_config(fetcher.rollup_config.as_ref().unwrap());
const PROOF_TIMEOUT: u64 = 60 * 60;

let program_config = ProgramConfig {
range_vk: Arc::new(range_vk),
Expand Down Expand Up @@ -168,12 +162,7 @@ where
driver_config: DriverConfig {
network_prover,
fetcher,
range_proof_size: 0,
submission_interval: 0,
proof_timeout: PROOF_TIMEOUT,
driver_db_client: db_client,
max_concurrent_proof_requests: requester_config.max_concurrent_proof_requests,
max_concurrent_witness_gen: requester_config.max_concurrent_witness_gen,
loop_interval_seconds: loop_interval_seconds.unwrap_or(DEFAULT_LOOP_INTERVAL),
},
contract_config: ContractConfig {
Expand Down Expand Up @@ -551,14 +540,14 @@ where

// If there are already MAX_CONCURRENT_PROOF_REQUESTS proofs in WitnessGeneration, Execute, and Prove status, return.
if witness_gen_count + execution_count + prove_count
>= self.driver_config.max_concurrent_proof_requests as i64
>= self.requester_config.max_concurrent_proof_requests as i64
{
debug!("There are already MAX_CONCURRENT_PROOF_REQUESTS proofs in WitnessGeneration, Execute, and Prove status.");
return Ok(());
}

// If there are already MAX_CONCURRENT_WITNESS_GEN proofs in WitnessGeneration status, return.
if witness_gen_count >= self.driver_config.max_concurrent_witness_gen as i64 {
if witness_gen_count >= self.requester_config.max_concurrent_witness_gen as i64 {
debug!(
"There are already MAX_CONCURRENT_WITNESS_GEN proofs in WitnessGeneration status."
);
Expand Down

0 comments on commit 6774a34

Please sign in to comment.