Skip to content
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

Fix docker context #3

Merged
merged 6 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release to GCP

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'

env:
DOCKER_REGISTRY: us-docker.pkg.dev

steps:
- uses: 'actions/checkout@v4'

- name: Authenticate to GCP using Workload Identity Federation
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}'
service_account: '${{ secrets.SERVICE_ACCOUNT }}'

- name: Docker Auth
id: docker-auth
uses: 'docker/login-action@v1'
with:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: ${{ env.DOCKER_REGISTRY }}

- name: Push proposr to GCP
run: |
gcloud auth configure-docker ${{ env.DOCKER_REGISTRY }}
docker build . -f proposer/op/Dockerfile.op_proposer -t ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-proposer:${{ github.ref_name }}
docker push ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-proposer:${{ github.ref_name }}

- name: Push server to GCP
run: |
docker build . -f proposer/succinct/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-server:${{ github.ref_name }}
docker push ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-server:${{ github.ref_name }}
1 change: 1 addition & 0 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
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 book/contracts/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
49 changes: 49 additions & 0 deletions configs/288882/rollup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"genesis": {
"l1": {
"number": 6576100,
"hash": "0xb6404ecff691edd6895c474f4dfca5b3e27b92a19deabd80cbe05c75c1b4c924"
},
"l2": {
"number": 0,
"hash": "0xe919706177d2c568ed21a4b443d421c8098b4e453a29bd432258fab3f7fe1d07"
},
"l2_time": 1724692140,
"system_config": {
"batcherAddr": "0xe40d3fb61a6a9e16ffd17ae4ed225de00a4b16fd",
"overhead": "0x834",
"scalar": "0xf4240",
"gasLimit": 30000000,
"baseFeeScalar": null,
"blobBaseFeeScalar": null,
"eip1559Denominator": null,
"eip1559Elasticity": null
}
},
"block_time": 2,
"max_sequencer_drift": 600,
"seq_window_size": 3600,
"channel_timeout": 300,
"granite_channel_timeout": 50,
"l1_chain_id": 11155111,
"l2_chain_id": 288882,
"base_fee_params": {
"max_change_denominator": "0x32",
"elasticity_multiplier": "0x6"
},
"canyon_base_fee_params": {
"max_change_denominator": "0xfa",
"elasticity_multiplier": "0x6"
},
"regolith_time": 0,
"canyon_time": 1724692140,
"delta_time": 1724692140,
"ecotone_time": 1724692141,
"fjord_time": 1724692150,
"granite_time": 1724914800,
"batch_inbox_address": "0xfff0000000000000000000000000000000288882",
"deposit_contract_address": "0xd00d5cc5620697a31014e5594aabba590793836d",
"l1_system_config_address": "0xcc3c025036612b849340d6866ec0bd4d2d794a36",
"protocol_versions_address": "0x0000000000000000000000000000000000000000",
"da_challenge_address": "0x0000000000000000000000000000000000000000"
}
184 changes: 184 additions & 0 deletions contracts/deployment/boba-devnet/run-1730852486.json

Large diffs are not rendered by default.

184 changes: 184 additions & 0 deletions contracts/deployment/boba-devnet/run-latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion proposer/op/proposer/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
Loading