Skip to content

Commit 8205d6a

Browse files
committed
review technical-stack docs, pt 2
1 parent 5991608 commit 8205d6a

File tree

2 files changed

+57
-23
lines changed

2 files changed

+57
-23
lines changed

src/content/docs/en/sdk/technical-stack/contracts.mdx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Aside from "../../../../../components/Aside.astro"
1313

1414
## Overview
1515

16-
Contracts deployed for a Scroll SDK chain include both contracts on the L1 (or basechain), and contracts deployed on the L2. Additionally, the L2 has "pre-deployed" contracts, matching those on [Scroll](/en/developers/scroll-contracts#l2-predeploys).
16+
Contracts deployed for a Scroll SDK chain include both contracts on the L1 (or basechain), and contracts deployed on the L2 (or SDK chain). Additionally, the L2 has "pre-deployed" contracts, matching those on [Scroll](/en/developers/scroll-contracts#l2-predeploys).
1717

1818
## Primary Contracts
1919

@@ -49,30 +49,23 @@ Although there are many contracts deployed during a new chain deployment, the mo
4949

5050
## Deployment Process
5151

52-
All contracts are available in the [scroll-contracts repo](https://github.com/scroll-tech/scroll-contracts), and [Docker files](https://github.com/scroll-tech/scroll-contracts/tree/feat-deterministic-deployment/docker) and [Foundry scripts](https://github.com/scroll-tech/scroll-contracts/tree/feat-deterministic-deployment/scripts/deterministic) used for deployment available in the `feat-deterministic-deployment` branch.
53-
54-
Contracts are deployed using deterministic addresses, with a salt used to generate the address of the contract. For every new deployment, a unique salt should be configured in `config.toml`.
55-
56-
During deployment, a simulation is first done to determine what address a contract will deploy to. This step is done during the creation the config files for each service's chart and when the `genesis.json` file is created. Contract addresses are then used to set each service's configuration (see [`gen-configs.sh`](https://github.com/scroll-tech/scroll-contracts/blob/feat-robust-deployment/docker/scripts/gen-configs.sh)).
52+
Contracts are deployed by the `contracts` chart. Deterministic addresses are used, with a salt used to generate the address of the contract. For every new deployment, a unique salt should be configured in `config.toml`.
5753

58-
{/* <!-- TODO: modify URL to develop branch --> */}
54+
During the configuration generation step, a simulation is first done to determine what address a contract will deploy to. This step is done during the creation of the config files for each service's chart and when the `genesis.json` file is created. Contract addresses are then used to set each service's configuration (see [`gen-configs.sh`](https://github.com/scroll-tech/scroll-contracts/blob/feat-robust-deployment/docker/scripts/gen-configs.sh)).
5955

6056
Then, before the `contracts` chart is installed, you will need to fund your SDK `DEPLOYER` account to deploy all contracts on L1 and L2 using actual transactions.
6157

62-
The `contracts` pod will connect to the cluster's RPCs and deploy the necessary contracts.
58+
The `contracts` pod will connect to the L2 RPC and deploy the necessary contracts from the `DEPLOYER` account.
6359

64-
{/* TODO: is this still true? */}
65-
{/* To view the complete logs from the deployment process, see the `broadcast` folder in `/charts/scroll-stack/`. */}
66-
67-
{/* TODO: check again once we do this. */}
6860
<Aside type="tip">
61+
All contracts are available in the [scroll-contracts repo](https://github.com/scroll-tech/scroll-contracts), and [Docker files](https://github.com/scroll-tech/scroll-contracts/tree/feat-deterministic-deployment/docker) and [Foundry scripts](https://github.com/scroll-tech/scroll-contracts/tree/feat-deterministic-deployment/scripts/deterministic) used for deployment available in the `feat-deterministic-deployment` branch.
62+
6963
For manually deploying contracts without the reliance on a docker container, please review [this guide](https://github.com/scroll-tech/scroll-contracts/blob/feat-deterministic-deployment/docs/manual-deployment.md).
70-
{/* TODO: Link to develop branch once merged. */}
7164
</Aside>
7265

7366
### Funding Deployment Accounts
7467

75-
You will need to manually fund the following wallet addresses from `config.toml`:
68+
In production deployments, you will need to manually fund the following wallet addresses from `config.toml`:
7669

7770
- `DEPLOYER_ADDR` *(only needs funded on L1)*
7871
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}
@@ -85,11 +78,11 @@ You will need to manually fund the following wallet addresses from `config.toml`
8578
- `L2_GAS_ORACLE_SENDER_ADDR` *(funded after L2 chain deployment)*
8679
{/* - Suggested funds: `(L1 basefee * VARIABLE * 10e-9) ETH` */}
8780

88-
{/* <!-- TODO: modify for how this works after --> */}
81+
{/* TODO: Consider recommending an initial funding amount. */}
8982

90-
<Aside type="tip">
83+
<Aside type="tip" title="Funding L1 Devnet Accounts">
9184

92-
To fund an L1 addresses when using Anvil, you can run the command below, replacing the first param with the address.
85+
To fund an L1 addresses when using Anvil in a devnet, run `scrollsdk helper fund-accounts --dev`. Or, to manually set individual account balances, you can also run the command below, replacing the first param with the address.
9386

9487
```bash
9588
curl --location 'http://l1-devnet.scrollsdk/' \
@@ -101,16 +94,19 @@ curl --location 'http://l1-devnet.scrollsdk/' \
10194
"id":0
10295
}'
10396
```
97+
10498
</Aside>
10599

106-
<Aside type="tip">
100+
<Aside type="tip" title="Funding L2 Addresses">
107101

108102
To fund an L2 address directly via the L1 bridge, you can run the command below, replacing the RPC and setting a private key of an account funded on L1 and a recipient address on L2.
109103

110104
```bash
111105
cast send --rpc-url https://rpc2.sepolia.org --private-key "$PRIVATE_KEY" "$L1_GATEWAY_ROUTER_PROXY_ADDR" "depositETH(address,uint256,uint256)" "$L2_RECIPENT_ADDR" "1ether" "300000" --value "1.1ether"
112106
```
113107

108+
You can also use the interactive `scrollsdk helper fund-accounts --layer=2 [--private-key=<private-key>]` command to fund an L2 address, optionally passing a private key as funder.
109+
114110
</Aside>
115111

116112

src/content/docs/en/sdk/technical-stack/proof-generation.mdx

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,58 @@ excerpt: "Documents how zk proof generation is done on Scroll SDK."
1010
import Aside from "../../../../../components/Aside.astro"
1111

1212
{/* TODO: Review full page before launch */}
13+
Generating ZK Proofs is a key component for any ZK Rollup, and it can often be the most painful part of operating a zk rollup.
1314

14-
{/* Info about running the Ansible script for proof generation (and eventually using external prover partners) will go here. */}
15+
## Proof Generation Flow
1516

16-
Currently, Scroll SDK requires that you run your own provers. We're actively working with proof generation platforms to make proof generation as easy as providing an API key.
1717

1818
## Mock Finalization
1919

20-
In its default configuration, testnets can run without a ZK provers and simulate finalization. The L1 contract allows finalizing a batch without a valid proof, and the `rollup-relay` is configured to call the finalize method after 1 hour without a proof in the default configuration.
20+
Scroll SDK supports being run in two modes -- one using mock finalization, the other requiring valid zk proofs to finalize. Mock finalization is useful for devnets and testnets, where the zk proof generation is an unnecessary cost beyond brief testing periods.
2121

22-
To change this mock finalization delay, adjust `config.toml` to change `TEST_ENV_MOCK_FINALIZE_TIMEOUT` from `3600` to the number of seconds you want to delay.
22+
In its default configuration, testnets are without a ZK provers and simulate finalization. The L1 contract allows finalizing a batch without a valid proof, and the `rollup-relay` is configured to call the finalize method after 1 hour without a proof in the default configuration.
23+
24+
To change this mock finalization delay, adjust `config.toml` to change `rollup.TEST_ENV_MOCK_FINALIZE_TIMEOUT` from `3600` to the number of seconds you want to delay.
2325

2426
To disable mock finalization entirely, adjust `config.toml` to change `TEST_ENV_MOCK_FINALIZE_ENABLED` to `false`.
2527

26-
## Deploy a Prover
28+
<Aside type="danger">
29+
30+
Because different "testnet" contracts are deployed depending on if `TEST_ENV_MOCK_FINALIZE_ENABLED` is true, it should be set to true from the genesis block for any production environments intended to secure user funds.
31+
32+
</Aside>
33+
34+
## Outsourcing Proof Generation to External Service Providers
35+
36+
Teams shouldn't need to become ZK infrastructure experts (or professional GPU sourcers) to run a chain. We've partnered with proof generation specialists to make outsoucing proof generation as easy as deploying one more chart.
37+
38+
Using a proof generation service offers the following benefits:
39+
- Generate proofs on-demand through API-based services
40+
- Choose between enterprise solutions or proof marketplaces
41+
- Scale proof generation elastically based on your actual usage instead of reserving a specific capacity
42+
- Maintain flexibility to switch between providers, distribute load between them, or run your own GPUs
43+
44+
The following providers already support generating Scroll SDK proofs:
45+
- Sindri
46+
- Chart
47+
- Docs
48+
- Snarkify
49+
- Chart
50+
- Docs
51+
52+
{/* TODO: Add links to charts and docs */}
53+
54+
<Aside type="caution">
55+
These Helm Charts are not maintained by Scroll, but we have collaborated with the teams to integrate the [`scroll-proving-sdk`](https://github.com/scroll-tech/scroll-proving-sdk).
56+
</Aside>
57+
58+
See the [Enable Proof Generation using External Providers](/en/sdk/guides/digital-ocean-alt-gas-token#enable-proof-generation-using-external-providers) section of the Digital Ocean guide for an example of how to enable chunk, batch and bundle proofs using external providers.
59+
60+
## Self-host a Prover
61+
62+
<Aside type="danger">
63+
As of Oct. 31, 2024, these instructions are out-of-date. We are working on updating them.
64+
</Aside>
2765

2866
<Aside type="caution">
2967
These instructions are an outline of the process, but our testing of the SDK has focused on working with external proving service providers, so may be out of date with out current SDK implementation.

0 commit comments

Comments
 (0)