diff --git a/src/content/docs/en/developers/developer-quickstart.mdx b/src/content/docs/en/developers/developer-quickstart.mdx index 3da6c8786..465a3601c 100644 --- a/src/content/docs/en/developers/developer-quickstart.mdx +++ b/src/content/docs/en/developers/developer-quickstart.mdx @@ -113,7 +113,7 @@ const config: HardhatUserConfig = { To deploy using the Scroll Sepolia Testnet Public RPC, run: ```bash -forge create ... --rpc-url=https://sepolia-rpc.scroll.io/ --legacy +forge create ... --rpc-url=https://sepolia-rpc.scroll.io/ ``` ### Remix Web IDE diff --git a/src/content/docs/en/developers/guides/contract-deployment-tutorial.mdx b/src/content/docs/en/developers/guides/contract-deployment-tutorial.mdx index 1f293a3fe..7cf3d90ee 100644 --- a/src/content/docs/en/developers/guides/contract-deployment-tutorial.mdx +++ b/src/content/docs/en/developers/guides/contract-deployment-tutorial.mdx @@ -63,7 +63,6 @@ The Scroll Sepolia Testnet allows anyone to deploy a smart contract on Scroll. I --value \ --constructor-args \ --private-key \ - --legacy \ contracts/Lock.sol:Lock ``` @@ -77,7 +76,7 @@ The Scroll Sepolia Testnet allows anyone to deploy a smart contract on Scroll. I --value 0.00000000002ether \ --constructor-args 1696118400 \ --private-key 0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1 \ - --legacy contracts/Lock.sol:Lock + contracts/Lock.sol:Lock ``` ## Questions and Feedback diff --git a/src/content/docs/en/developers/guides/running-a-scroll-node.mdx b/src/content/docs/en/developers/guides/running-a-scroll-node.mdx index fb048ab80..0e003820e 100644 --- a/src/content/docs/en/developers/guides/running-a-scroll-node.mdx +++ b/src/content/docs/en/developers/guides/running-a-scroll-node.mdx @@ -16,9 +16,9 @@ For most developers, using [our official RPC endpoint](/en/developers/developer- ### Finding the latest version -We recommend using the latest release at https://github.com/scroll-tech/go-ethereum/releases. The required version for Scroll Mainnet is `scroll-v5.4.2` or higher, and for Scroll Sepolia it is `scroll-v5.4.2` or higher. If you'd like to keep up with new node releases, go to https://github.com/scroll-tech/go-ethereum, click on **Watch**, **Custom**, and make sure that **Releases** is selected. +We recommend using the latest release at https://github.com/scroll-tech/go-ethereum/releases. The required version for Scroll Mainnet is `scroll-v5.5.0` or higher, and for Scroll Sepolia it is `scroll-v5.4.2` or higher. If you'd like to keep up with new node releases, go to https://github.com/scroll-tech/go-ethereum, click on **Watch**, **Custom**, and make sure that **Releases** is selected. -For the remainder of this guide, `VERSION` will denote the version tag. For example, `scroll-v5.4.2`. +For the remainder of this guide, `VERSION` will denote the version tag. For example, `scroll-v5.5.0`. ### Hardware Requirements @@ -176,7 +176,7 @@ enode://c7b2d94e95da343db6e667a01cef90376a592f2d277fbcbf6e9c9186734ed8003d013895 "archimedesBlock": 0, "shanghaiBlock": 0, "bernoulliBlock": 5220340, - "curieBlock": 6924036, + "curieBlock": 7096836, "clique": { "period": 3, "epoch": 30000 diff --git a/src/content/docs/en/developers/l1-and-l2-bridging/eth-and-erc20-token-bridge.mdx b/src/content/docs/en/developers/l1-and-l2-bridging/eth-and-erc20-token-bridge.mdx index 8999637f8..8dfb5b08e 100644 --- a/src/content/docs/en/developers/l1-and-l2-bridging/eth-and-erc20-token-bridge.mdx +++ b/src/content/docs/en/developers/l1-and-l2-bridging/eth-and-erc20-token-bridge.mdx @@ -119,7 +119,7 @@ Sends ERC20 tokens from L1 to L2. | token | The token address on L1. | | to | The address of recipient's account on L2. | | amount | The amount of token to transfer, in wei. | -| gasLimit | Gas limit required to complete the deposit on L2. 20000 should be enough to process the transaction, depending on the Gateway, but unused funds are refunded. | +| gasLimit | Gas limit required to complete the deposit on L2. 200000 should be enough to process the transaction, depending on the Gateway, but unused funds are refunded. | ### getL2ERC20Address diff --git a/src/content/docs/en/technology/chain/rollup.mdx b/src/content/docs/en/technology/chain/rollup.mdx index 1232dd60e..e74177540 100644 --- a/src/content/docs/en/technology/chain/rollup.mdx +++ b/src/content/docs/en/technology/chain/rollup.mdx @@ -9,7 +9,6 @@ whatsnext: { "EVM Differences from Ethereum": "/en/technology/chain/differences/ import ClickToZoom from "../../../../../components/ClickToZoom.astro" import RollupProcess from "../_images/rollup.png" -import NetworkTabs from "../../../../../components/Tabs/NetworkTabs.astro" import { Tabs } from "../../../../../components/Tabs/Tabs.tsx" This document describes the rollup process in Scroll. @@ -121,77 +120,89 @@ At this stage, the state root of the latest finalized batch can be used trustles This section describes the codec of three data structures in the Rollup contract: `BatchHeader`, `Chunk`, and `BlockContext`. -The latest update to the codec was introduced in the Bernoulli upgrade. - -### Bernoulli - - #### `BatchHeader` Codec - - | Field | Bytes | Type | Offset | Description | - | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- | - | `version` | 1 | `uint8` | 0 | The batch header version | - | `batchIndex` | 8 | `uint64` | 1 | The index of the batch | - | `l1MessagePopped` | 8 | `uint64` | 9 | The number of L1 messages popped in the batch | - | `totalL1MessagePopped` | 8 | `uint64` | 17 | The number of total L1 messages popped after the batch | - | `dataHash` | 32 | `bytes32` | 25 | The data hash of the batch | - | `blobVersionedHash` | 32 | `bytes32` | 57 | The versioned hash of the blob with this batch’s data | - | `parentBatchHash` | 32 | `bytes32` | 89 | The parent batch hash | - | `skippedL1MessageBitmap` | dynamic | `uint256[]` | 121 | A bitmap to indicate which L1 messages are skipped in the batch | - - #### `Chunk` Codec - - | Field | Bytes | Type | Offset | Description | - | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | - | `numBlocks` | 1 | `uint8` | 0 | The number of blocks in the chunk | - | `block[0]` | 60 | `BlockContext` | 1 | The block information of the 1st block | - | ... | ... | ... | ... | ... | - | `block[i]` | 60 | `BlockContext` | `60*i+1` | The block information of `i+1`-th block | - | ... | ... | ... | ... | ... | - | `block[n-1]` | 60 | `BlockContext` | `60*n-59` | The block information of the last block | - - #### `BlockContext` Codec - - | Field | Bytes | Type | Offset | Description | - | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- | - | `blockNumber` | 8 | `uint64` | 0 | The block number | - | `timestamp` | 8 | `uint64` | 8 | The block time | - | `baseFee` | 32 | `uint256` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. | - | `gasLimit` | 8 | `uint64` | 48 | The gas limit of this block | - | `numTransactions` | 2 | `uint16` | 56 | The number of transactions in this block, including both L1 & L2 txs | - | `numL1Messages` | 2 | `uint16` | 58 | The number of L1 messages in this block - -### Archimedes - #### `BatchHeader` Codec - - | Field | Bytes | Type | Offset | Description | - | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- | - | `version` | 1 | `uint8` | 0 | The batch header version | - | `batchIndex` | 8 | `uint64` | 1 | The index of the batch | - | `l1MessagePopped` | 8 | `uint64` | 9 | The number of L1 messages popped in the batch | - | `totalL1MessagePopped` | 8 | `uint64` | 17 | The number of total L1 messages popped after the batch | - | `dataHash` | 32 | `bytes32` | 25 | The data hash of the batch | - | `parentBatchHash` | 32 | `bytes32` | 57 | The parent batch hash | - | `skippedL1MessageBitmap` | dynamic | `uint256[]` | 89 | A bitmap to indicate which L1 messages are skipped in the batch | - - #### `Chunk` Codec - - | Field | Bytes | Type | Offset | Description | - | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | - | `numBlocks` | 1 | `uint8` | 0 | The number of blocks in the chunk | - | `block[0]` | 60 | `BlockContext` | 1 | The block information of the 1st block | - | ... | ... | ... | ... | ... | - | `block[i]` | 60 | `BlockContext` | `60*i+1` | The block information of `i+1`-th block | - | ... | ... | ... | ... | ... | - | `block[n-1]` | 60 | `BlockContext` | `60*n-59` | The block information of the last block - | `l2Transactions` | dynamic | `bytes` | `60*n+1` | The concatenated RLP encoding of L2 transactions with signatures. The byte length (`uint32`) of RLP encoding is inserted before each transaction. | | - - #### `BlockContext` Codec - - | Field | Bytes | Type | Offset | Description | - | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- | - | `blockNumber` | 8 | `uint64` | 0 | The block number | - | `timestamp` | 8 | `uint64` | 8 | The block time | - | `baseFee` | 32 | `uint256` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. | - | `gasLimit` | 8 | `uint64` | 48 | The gas limit of this block | - | `numTransactions` | 2 | `uint16` | 56 | The number of transactions in this block, including both L1 & L2 txs | - | `numL1Messages` | 2 | `uint16` | 58 | The number of L1 messages in this block +The latest update to the codec was introduced in the [Bernoulli upgrade](/technology/overview/scroll-upgrades#bernoulli-upgrade). + + +bernoulli +archimedes + + + + This data format is still applicable post-Curie upgrade, and has not been changed. + + #### `BatchHeader` Codec + + | Field | Bytes | Type | Offset | Description | + | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- | + | `version` | 1 | `uint8` | 0 | The batch header version | + | `batchIndex` | 8 | `uint64` | 1 | The index of the batch | + | `l1MessagePopped` | 8 | `uint64` | 9 | The number of L1 messages popped in the batch | + | `totalL1MessagePopped` | 8 | `uint64` | 17 | The number of total L1 messages popped after the batch | + | `dataHash` | 32 | `bytes32` | 25 | The data hash of the batch | + | `blobVersionedHash` | 32 | `bytes32` | 57 | The versioned hash of the blob with this batch’s data | + | `parentBatchHash` | 32 | `bytes32` | 89 | The parent batch hash | + | `skippedL1MessageBitmap` | dynamic | `uint256[]` | 121 | A bitmap to indicate which L1 messages are skipped in the batch | + + #### `Chunk` Codec + + | Field | Bytes | Type | Offset | Description | + | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | + | `numBlocks` | 1 | `uint8` | 0 | The number of blocks in the chunk | + | `block[0]` | 60 | `BlockContext` | 1 | The block information of the 1st block | + | ... | ... | ... | ... | ... | + | `block[i]` | 60 | `BlockContext` | `60*i+1` | The block information of `i+1`-th block | + | ... | ... | ... | ... | ... | + | `block[n-1]` | 60 | `BlockContext` | `60*n-59` | The block information of the last block | + + #### `BlockContext` Codec + + | Field | Bytes | Type | Offset | Description | + | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- | + | `blockNumber` | 8 | `uint64` | 0 | The block number | + | `timestamp` | 8 | `uint64` | 8 | The block time | + | `baseFee` | 32 | `uint256` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. | + | `gasLimit` | 8 | `uint64` | 48 | The gas limit of this block | + | `numTransactions` | 2 | `uint16` | 56 | The number of transactions in this block, including both L1 & L2 txs | + | `numL1Messages` | 2 | `uint16` | 58 | The number of L1 messages in this block + + + + + + #### `BatchHeader` Codec + + | Field | Bytes | Type | Offset | Description | + | ------------------------ | ------- | ----------- | ------ | --------------------------------------------------------------- | + | `version` | 1 | `uint8` | 0 | The batch header version | + | `batchIndex` | 8 | `uint64` | 1 | The index of the batch | + | `l1MessagePopped` | 8 | `uint64` | 9 | The number of L1 messages popped in the batch | + | `totalL1MessagePopped` | 8 | `uint64` | 17 | The number of total L1 messages popped after the batch | + | `dataHash` | 32 | `bytes32` | 25 | The data hash of the batch | + | `parentBatchHash` | 32 | `bytes32` | 57 | The parent batch hash | + | `skippedL1MessageBitmap` | dynamic | `uint256[]` | 89 | A bitmap to indicate which L1 messages are skipped in the batch | + + #### `Chunk` Codec + + | Field | Bytes | Type | Offset | Description | + | ---------------- | ------- | -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | + | `numBlocks` | 1 | `uint8` | 0 | The number of blocks in the chunk | + | `block[0]` | 60 | `BlockContext` | 1 | The block information of the 1st block | + | ... | ... | ... | ... | ... | + | `block[i]` | 60 | `BlockContext` | `60*i+1` | The block information of `i+1`-th block | + | ... | ... | ... | ... | ... | + | `block[n-1]` | 60 | `BlockContext` | `60*n-59` | The block information of the last block + | `l2Transactions` | dynamic | `bytes` | `60*n+1` | The concatenated RLP encoding of L2 transactions with signatures. The byte length (`uint32`) of RLP encoding is inserted before each transaction. | | + + #### `BlockContext` Codec + + | Field | Bytes | Type | Offset | Description | + | ----------------- | ----- | --------- | ------ | ----------------------------------------------------------------------------------- | + | `blockNumber` | 8 | `uint64` | 0 | The block number | + | `timestamp` | 8 | `uint64` | 8 | The block time | + | `baseFee` | 32 | `uint256` | 16 | The base fee of this block. Currently, it is always 0, because we disable EIP-1559. | + | `gasLimit` | 8 | `uint64` | 48 | The gas limit of this block | + | `numTransactions` | 2 | `uint16` | 56 | The number of transactions in this block, including both L1 & L2 txs | + | `numL1Messages` | 2 | `uint16` | 58 | The number of L1 messages in this block + + + diff --git a/src/content/docs/en/technology/overview/scroll-upgrades.mdx b/src/content/docs/en/technology/overview/scroll-upgrades.mdx index 87558da24..306579649 100644 --- a/src/content/docs/en/technology/overview/scroll-upgrades.mdx +++ b/src/content/docs/en/technology/overview/scroll-upgrades.mdx @@ -19,6 +19,71 @@ The following contracts are used to initiate upgrades and execute upgrades after You can join our [Telegram channel for technical updates](https://t.me/scroll_tech_updates), which includes future upgrade announcements and on-chain operation events. +## Curie Upgrade + +### Overview + +This significant upgrade will reduce gas fees on the Scroll chain by 1.5x. Highlights include: + +- Compresses the data stored in blobs using the [zstd](https://github.com/scroll-tech/da-codec/tree/main/libzstd) algorithm. This compression reduces the data size, allowing each blob to store more transactions, thereby reducing data availability cost per transaction. +- Adopts a modified version of the EIP-1559 pricing model which is compatible with the EIP-1559 transaction interface, bringing beneftis such as more accurate transaction pricing and a more predictable and stable fee structure. +- Support for new EVM opcodes `TLOAD`, `TSTORE`, and `MCOPY`. Users can safely use the latest Solidity compiler version `0.8.26` to build the contracts. +- Introduces a dynamic block time. During periods of traffic congestion, a block will be packed when the number of transactions reaches the circuit limit instead of waiting for the 3-second interval. + +### Timeline + +- **Scroll Sepolia** + - Network Upgrade: June 17th, 2024 +- **Scroll Mainnet** + - Upgrade Initiation: June 20th, 2024 + - Timelock Completion & Upgrade: July 3rd, 2024 + +### Technical Details + +#### Contract Changes + +The code changes for this upgrade are documented in the following PRs: + +- [Accept compressed batches](https://github.com/scroll-tech/scroll/pull/1317) +- [Update `L1GasPriceOracle`](https://github.com/scroll-tech/scroll/pull/1343) +- [Change `MAX_COMMIT_SCALAR` and `MAX_BLOB_SCALAR` to 1e18](https://github.com/scroll-tech/scroll/pull/1354) +- [Remove batch index check when updating a verifier](https://github.com/scroll-tech/scroll/pull/1372) + +The main changes are as follows: + +- The rollup contract (`ScrollChain`) will now accept batches with both versions 1 and 2. [Version 1](https://github.com/scroll-tech/da-codec/tree/main/encoding/codecv1) is used for uncompressed blobs (pre-Curie), while [version 2](https://github.com/scroll-tech/da-codec/tree/main/encoding/codecv2) is used for compressed blobs (post-Curie). +- The `L1GasPriceOracle` contract will be updated to change the data fee formula to account for blob DA, providing a more accurate estimation of DA costs: + - Original formula: `(l1GasUsed(txRlp) + overhead) * l1BaseFee * scalar` + - New formula: `l1BaseFee * commitScalar + len(txRlp) * l1BlobBaseFee * blobScalar` + +#### Node Changes + +The new node version is `v5.5.0`. See the [release notes](https://github.com/scroll-tech/go-ethereum/releases/tag/scroll-v5.5.0) for the list of changes. + +#### zkEVM circuit changes + +The new version of zkevm circuits is `v0.11.4`. See [here](https://github.com/scroll-tech/zkevm-circuits/releases/tag/v0.11.4) for the release log. + +#### Audits + +- TrailofBits: coming soon! +- [Zellic](https://github.com/Zellic/publications/blob/master/Scroll%20zkEVM%20-%20Zellic%20Audit%20Report.pdf) + +### Compatibility + +#### Sequencer and Follower Nodes (l2geth) + +This upgrade is a hard fork, introducing the `TLOAD`, `TSTORE`, and `MCOPY` opcodes. Operators running an `l2geth` node are required to upgrade before the hard fork block. For more information, see the [node release note](https://github.com/scroll-tech/go-ethereum/releases/tag/scroll-v5.4.2). + +#### Dapps and Indexers + +For dApps, this upgrade is backward compatible. Developers should adjust the gas fee settings to incorporate the EIP-1559 pricing model. Note that dApps can no longer rely on the fixed 3-second block time in the application logic. + +For indexers, the [data format](https://docs.scroll.io/en/technology/chain/rollup/#codec) remains the same. The will be however changes to the data content: + +- The `version` field in `BatchHeader` will be changed to 2 since Curie block. +- The data stored in blob will be compressed and can be decompressed by [zstd v1.5.6](https://github.com/facebook/zstd/releases/tag/v1.5.6). + ## Bernoulli Upgrade ### Overview @@ -54,7 +119,7 @@ The new version of zkevm circuits is `v0.10.3`. See [here](https://github.com/sc #### Audits - [OpenZeppelin](https://blog.openzeppelin.com/scroll-eip-4844-support-audit) -- TrailofBits (will be posted soon) +- [TrailofBits](https://github.com/trailofbits/publications/blob/master/reviews/2024-04-scroll-4844-blob-securityreview.pdf) ### Compatibility @@ -87,14 +152,12 @@ To reduce bridging costs, we implemented several gas optimizations on our bridge ### Timeline - - **Scroll Sepolia:** - Network Upgrade: January 19, 2024 - **Scroll Mainnet:** - Upgrade Initiation: February 7, 2024 - Timelock Completion & Upgrade: February 21, 2024 - ### Technical Details #### Code Changes diff --git a/src/content/docs/en/technology/security/audits-and-bug-bounty.mdx b/src/content/docs/en/technology/security/audits-and-bug-bounty.mdx index 6f6d5d28b..c6a5482dc 100644 --- a/src/content/docs/en/technology/security/audits-and-bug-bounty.mdx +++ b/src/content/docs/en/technology/security/audits-and-bug-bounty.mdx @@ -8,6 +8,10 @@ permalink: "technology/security/audits-and-bug-bounty" import Aside from "../../../../../components/Aside.astro" + + Scroll treats security as a top priority. Aside from rigorous testing, an internal security team, and comprehensive code reviews, we have also engaged with multiple security audit firms to conduct audits on our codebase. We have also launched a bug bounty program to encourage the community to participate in the security of our protocol. @@ -78,4 +82,4 @@ Rewards depend on the severity of reported vulnerabilities: The scope of the bug bounty program covers the blockchain infrastructure and the smart contracts for bridging and rollup. For a detailed breakdown of bug categories, please refer to the bug bounty page. -Besides the listed scopes in the bug bounty program, we also encourage reporting any vulnerabilities identified to Immunefi, which we will still consider for rewards. For any discoveries of critical vulnerabilities outside of the scope of the bug bounty program, please also send reports to security@scroll.io. +Besides the listed scopes in the bug bounty program, we also encourage reporting any vulnerabilities identified to Immunefi, which we will still consider for rewards. diff --git a/src/content/docs/en/technology/sequencer/zktrie.mdx b/src/content/docs/en/technology/sequencer/zktrie.mdx index a6cbc3482..3442dd132 100644 --- a/src/content/docs/en/technology/sequencer/zktrie.mdx +++ b/src/content/docs/en/technology/sequencer/zktrie.mdx @@ -106,7 +106,7 @@ An Ethereum Account Leaf Node consists of an Ethereum address and a state accoun var address byte[20] // 20 bytes in big-endian valHi := address[0:16] valLo := address[16:20] * 2^96 // padding 12 bytes of 0 at the end -nodeKey := h{256}(valHi, valLo) +nodeKey := h{512}(valHi, valLo) ``` A state account struct in the Scroll consists of the following fields (`Fr` indicates the finite field and is a 254-bit value) @@ -182,7 +182,7 @@ A Storage Leaf Node encodes a key-value pair where both key and value are `u256` var storageKey byte[32] // 32 bytes in big-endian valHi := storageKey[0:16] valLo := storageKey[16:32] -nodeKey := h{256}(valHi, valLo) +nodeKey := h{512}(valHi, valLo) ``` The storage value is a `u256` value. The `flag` for the storage value is 1, shown below.