From 5b7c0dfa333ad667beabc9d9e11ba7482d7528a1 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Wed, 11 Dec 2024 10:25:49 -0800 Subject: [PATCH 1/4] fix(proposer): remove error on `safeDB` not activated (#271) --- proposer/op/proposer/range.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposer/op/proposer/range.go b/proposer/op/proposer/range.go index 6fcccd79..db98b304 100644 --- a/proposer/op/proposer/range.go +++ b/proposer/op/proposer/range.go @@ -189,7 +189,7 @@ func (l *L2OutputSubmitter) GetRangeProofBoundaries(ctx context.Context) error { // splitting algorithm. Otherwise, we use the simple range splitting algorithm. safeDBActivated, err := l.isSafeDBActivated(ctx, rollupClient) if err != nil { - return fmt.Errorf("failed to check if safeDB is activated: %w", err) + l.Log.Warn("safeDB is not activated. Using simple range splitting algorithm.", "err", err) } var spans []Span From 43f03f0053bb4d26a18a8d5125b0a69e293db70e Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Wed, 11 Dec 2024 12:33:34 -0800 Subject: [PATCH 2/4] docs: kurtosis + lint --- book/SUMMARY.md | 1 + book/contracts/upgrade.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/book/SUMMARY.md b/book/SUMMARY.md index 848a0b16..9a21f57d 100644 --- a/book/SUMMARY.md +++ b/book/SUMMARY.md @@ -13,6 +13,7 @@ - [L2 Node Setup](./advanced/node-setup.md) - [Block Data CLI Tool](./advanced/block-data.md) - [Proposer](./advanced/proposer.md) + - [Kurtosis](./advanced/kurtosis.md) - [Upgrade to a new `op-succinct` version](./advanced/upgrade.md) - [`OPSuccinctL2OutputOracle`](./contracts/intro.md) - [Configuration](./contracts/configuration.md) diff --git a/book/contracts/upgrade.md b/book/contracts/upgrade.md index b23553eb..81a3e15b 100644 --- a/book/contracts/upgrade.md +++ b/book/contracts/upgrade.md @@ -4,7 +4,7 @@ Similar to the `L2OutputOracle` contract, the `OPSuccinctL2OutputOracle` is mana ## 1. Decide on the target `OPSuccinctL2OutputOracle` contract code -### (Recommanded) Using `OPSuccinctL2OutputOracle` from a release +### (Recommended) Using `OPSuccinctL2OutputOracle` from a release Check out the latest release of `op-succinct` from [here](https://github.com/succinctlabs/op-succinct/releases). You can always find the latest version of the `OPSuccinctL2OutputOracle` on the latest release. From 2bd8550db473be22a0edda4063b062cc15f23ea7 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Thu, 12 Dec 2024 13:52:04 -0800 Subject: [PATCH 3/4] fix: rollup deployment configuration (#272) --- book/contracts/configuration.md | 6 ++--- scripts/utils/bin/fetch_rollup_config.rs | 33 +++++++++++++++--------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/book/contracts/configuration.md b/book/contracts/configuration.md index 6d8e6d81..3cfdadfe 100644 --- a/book/contracts/configuration.md +++ b/book/contracts/configuration.md @@ -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. | diff --git a/scripts/utils/bin/fetch_rollup_config.rs b/scripts/utils/bin/fetch_rollup_config.rs index cbe0749e..54ab45e6 100644 --- a/scripts/utils/bin/fetch_rollup_config.rs +++ b/scripts/utils/bin/fetch_rollup_config.rs @@ -34,6 +34,23 @@ 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).map_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() + } + }, + |addr| addr, + ) +} + /// 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`: @@ -102,18 +119,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); From 7c80711080b067e71929a8919e2c0bbefb7e2aa3 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Thu, 12 Dec 2024 14:57:00 -0800 Subject: [PATCH 4/4] feat: fix clippy, docker context (#273) --- proposer/succinct/bin/server.rs | 2 +- scripts/utils/bin/fetch_rollup_config.rs | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/proposer/succinct/bin/server.rs b/proposer/succinct/bin/server.rs index 299c070c..daaa66d2 100644 --- a/proposer/succinct/bin/server.rs +++ b/proposer/succinct/bin/server.rs @@ -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; diff --git a/scripts/utils/bin/fetch_rollup_config.rs b/scripts/utils/bin/fetch_rollup_config.rs index 54ab45e6..61d7c457 100644 --- a/scripts/utils/bin/fetch_rollup_config.rs +++ b/scripts/utils/bin/fetch_rollup_config.rs @@ -38,17 +38,14 @@ struct L2OOConfig { 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).map_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() - } - }, - |addr| addr, - ) + 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.