Skip to content

Commit

Permalink
Merge branch 'succinctlabs:main' into op-succinct-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
boyuan-chen authored Dec 12, 2024
2 parents cc43b21 + 7c80711 commit 766638d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
6 changes: 3 additions & 3 deletions book/contracts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ You can configure additional parameters when deploying or upgrading the `OPSucci
| `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. |
| `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`. 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: `address(0)`, no one can dispute proofs. Ethereum address authorized to dispute proofs. |
| `OWNER` | Default: The address of the account associated with `PRIVATE_KEY`. Ethereum address authorized to update the `aggregationVkey`, `rangeVkeyCommitment`, `verifier`, and `rollupConfigHash` parameters. Can also transfer ownership of the contract and update the approved proposers. In a production setting, set to the governance smart contract or multi-sig of the chain. |
| `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. |
| `OWNER` | Default: The address of the account associated with `PRIVATE_KEY`. If `PRIVATE_KEY` is not set, `address(0)`. Ethereum address authorized to update the `aggregationVkey`, `rangeVkeyCommitment`, `verifier`, and `rollupConfigHash` parameters. Can also transfer ownership of the contract and update the approved proposers. In a production setting, set to the governance smart contract or multi-sig of the chain. |
2 changes: 1 addition & 1 deletion proposer/succinct/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ async fn request_mock_span_proof(
// Start the server and native client with a timeout.
// Note: Ideally, the server should call out to a separate process that executes the native
// host, and return an ID that the client can poll on to check if the proof was submitted.
let mut witnessgen_executor = WitnessGenExecutor::default();
let mut witnessgen_executor = WitnessGenExecutor::new(WITNESSGEN_TIMEOUT, RunContext::Docker);
witnessgen_executor.spawn_witnessgen(&host_cli).await?;
// Log any errors from running the witness generation process.
let res = witnessgen_executor.flush().await;
Expand Down
30 changes: 18 additions & 12 deletions scripts/utils/bin/fetch_rollup_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ struct L2OOConfig {
range_vkey_commitment: String,
}

/// If the environment variable is set for the address, return it. Otherwise, return the address associated with the private key. If the private key is not set, return the zero address.
fn get_address(env_var: &str) -> String {
let private_key = env::var("PRIVATE_KEY").unwrap_or_else(|_| B256::ZERO.to_string());

env::var(env_var).unwrap_or_else(|_| {
if private_key == B256::ZERO.to_string() {
Address::ZERO.to_string()
} else {
let signer: PrivateKeySigner = private_key.parse().unwrap();
signer.address().to_string()
}
})
}

/// Update the L2OO config with the rollup config hash and other relevant data before the contract is deployed.
///
/// Specifically, updates the following fields in `opsuccinctl2ooconfig.json`:
Expand Down Expand Up @@ -102,18 +116,10 @@ async fn update_l2oo_config() -> Result<()> {
.map(|p| p.parse().unwrap())
.unwrap_or(DEFAULT_FINALIZATION_PERIOD_SECS);

let private_key = env::var("PRIVATE_KEY").unwrap_or_else(|_| B256::ZERO.to_string());
let (proposer, owner) = if private_key == B256::ZERO.to_string() {
(Address::ZERO.to_string(), Address::ZERO.to_string())
} else {
let signer: PrivateKeySigner = private_key.parse().expect("Failed to parse private key");
let signer_address = signer.address().to_string();
(
env::var("PROPOSER").unwrap_or(signer_address.clone()),
env::var("OWNER").unwrap_or(signer_address),
)
};
let challenger = env::var("CHALLENGER").unwrap_or(Address::ZERO.to_string());
// Default to the address associated with the private key if the environment variable is not set. If private key is not set, default to zero address.
let proposer = get_address("PROPOSER");
let owner = get_address("OWNER");
let challenger = get_address("CHALLENGER");

let prover = ProverClient::new();
let (_, agg_vkey) = prover.setup(AGG_ELF);
Expand Down

0 comments on commit 766638d

Please sign in to comment.