From 72ec8dc095bb82a7b94695ba10dde2e5dee758bc Mon Sep 17 00:00:00 2001 From: Daniel Helm Date: Wed, 13 Mar 2024 17:38:47 -0500 Subject: [PATCH 1/3] adds dencun / cancun info and precompile limits --- .../en/developers/developer-quickstart.mdx | 4 ++++ .../ethereum-and-scroll-differences.mdx | 19 +++++++++++++++++++ .../docs/en/technology/chain/differences.mdx | 7 +++++++ 3 files changed, 30 insertions(+) diff --git a/src/content/docs/en/developers/developer-quickstart.mdx b/src/content/docs/en/developers/developer-quickstart.mdx index 302f4f214..9ff76a872 100644 --- a/src/content/docs/en/developers/developer-quickstart.mdx +++ b/src/content/docs/en/developers/developer-quickstart.mdx @@ -83,6 +83,10 @@ Use the table below to configure your Ethereum tools to the Scroll Sepolia Testn Contracts](/developers/verifying-smart-contracts). + + ### Hardhat Modify your Hardhat config file `hardhat.config.ts` to point at the Scroll Sepolia Testnet public RPC. diff --git a/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx b/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx index 5d73ae02b..dfba37f60 100644 --- a/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx +++ b/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx @@ -20,6 +20,7 @@ For open-source contributors and infrastructure builders, please contact our tea ## EVM Opcodes + | Opcode | Solidity equivalent | Scroll Behavior | | --------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------- | | `BLOCKHASH` | `block.blockhash` | Returns `keccak(chain_id \|\| block_number)` for the last 256 blocks. | @@ -28,6 +29,10 @@ For open-source contributors and infrastructure builders, please contact our tea | `BASEFEE` | `block.basefee` | Disabled.[^eip1559] If the opcode is encountered, the transaction will be reverted. | | `SELFDESTRUCT` | `selfdestruct` | Disabled. If the opcode is encountered, the transaction will be reverted.[^willadpot] | + + [^eip1559]: We have currently disabled EIP-1559 on Scroll. [^willadpot]: Will change to adopt Ethereum’s solution in the future. @@ -41,6 +46,20 @@ The `ecPairing` precompile is supported, but the number of points(sets, pairs) i The other EVM precompiles are all supported: `ecRecover`, `identity`, `ecAdd`, `ecMul`. +### Precompile Limits + +Because of a bounded size of the zkEVM circuits, there is an upper limit on the number of calls that can be made for some precompiles. These transactions will not revert, but simply be skipped by the sequencer if they cannot fit into the space of the circuit. Read more about the [Circuit Capacity Checker](/en/technology/sequencer/execution-node#circuit-capacity-checker). + +| Precompile / Opcode | Limit | +| ------------------- | ----- | +| `keccak256` | 3157 | +| `ecRecover` | 119 | +| `modexp` | 23 | +| `ecAdd` | 50 | +| `ecMul` | 50 | +| `ecPairing` | 2 | + + ## State Account ### **Additional Fields** diff --git a/src/content/docs/en/technology/chain/differences.mdx b/src/content/docs/en/technology/chain/differences.mdx index bbb6dac52..94c693e53 100644 --- a/src/content/docs/en/technology/chain/differences.mdx +++ b/src/content/docs/en/technology/chain/differences.mdx @@ -7,6 +7,8 @@ permalink: "technology/chain/differences" whatsnext: { "Bridge": "/technology/bridge/cross-domain-messaging/" } --- +import Aside from "../../../../components/Aside.astro" + ## Opcodes | Opcode | Scroll Behavior | @@ -44,3 +46,8 @@ EIPs imported from the Shanghai fork: - [EIP-3651](https://eips.ethereum.org/EIPS/eip-3651): Warm `COINBASE` - [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855): `PUSH0` instruction - [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860): Limit and meter initcode + + + From da47ce7f1ededcc52de3e3b15c7b6bcbfc6269d9 Mon Sep 17 00:00:00 2001 From: Daniel Helm Date: Mon, 15 Apr 2024 15:52:38 -0500 Subject: [PATCH 2/3] add point evaluation and additional opcode --- .../docs/en/developers/ethereum-and-scroll-differences.mdx | 5 +++-- src/content/docs/en/technology/chain/differences.mdx | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx b/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx index dfba37f60..d47b9989e 100644 --- a/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx +++ b/src/content/docs/en/developers/ethereum-and-scroll-differences.mdx @@ -30,7 +30,7 @@ For open-source contributors and infrastructure builders, please contact our tea | `SELFDESTRUCT` | `selfdestruct` | Disabled. If the opcode is encountered, the transaction will be reverted.[^willadpot] | [^eip1559]: We have currently disabled EIP-1559 on Scroll. @@ -38,7 +38,7 @@ Opcodes from the Cancun upgrade are not yet available on Scroll, including `MCOP ## EVM Precompiles -The `SHA2-256` (address `0x2`), `RIPEMD-160` (address `0x3`), and `blake2f` (address `0x9`) precompiles are currently not supported. Calls to these precompiled contracts will revert. We plan to enable these three precompiles in a future hard fork. +The `SHA2-256` (address `0x2`), `RIPEMD-160` (address `0x3`), `blake2f` (address `0x9`), and `point evaluation` (address `0x0a`) precompiles are currently not supported. Calls to these precompiled contracts will revert. We plan to enable these three precompiles in a future hard fork. The `modexp` precompile is supported but only supports inputs of size less than or equal to 32 bytes (i.e. `u256`). @@ -58,6 +58,7 @@ Because of a bounded size of the zkEVM circuits, there is an upper limit on the | `ecAdd` | 50 | | `ecMul` | 50 | | `ecPairing` | 2 | +{/* TODO: Add SHA256 after upgrade */} ## State Account diff --git a/src/content/docs/en/technology/chain/differences.mdx b/src/content/docs/en/technology/chain/differences.mdx index 94c693e53..e375e5cd1 100644 --- a/src/content/docs/en/technology/chain/differences.mdx +++ b/src/content/docs/en/technology/chain/differences.mdx @@ -28,6 +28,7 @@ import Aside from "../../../../components/Aside.astro" | `0x05` | `modexp` | Restrict the input values `B, E, M` to unsigned integers less than $2^{256}$. | | `0x08` | `ecPairing` | The inputs are still multiple of 6 32-byte values, but limit the number of tuples to at most 4. | | `0x09` | `blake2f` | Currently not supported. | +| `0x0a` | `point evaluation` | Currently not supported. | The remaining precompiled contracts have the same behavior as Ethereum. However, their maximum usage within a block is constrained by a limit tied to the zkEVM circuit capacity. @@ -49,5 +50,5 @@ EIPs imported from the Shanghai fork: From 7f258ce30d276068250fa9c8f25c9272bd14af7e Mon Sep 17 00:00:00 2001 From: Daniel Helm Date: Mon, 15 Apr 2024 16:03:17 -0500 Subject: [PATCH 3/3] fix Aside import --- src/content/docs/en/technology/chain/differences.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/technology/chain/differences.mdx b/src/content/docs/en/technology/chain/differences.mdx index f77f1de62..d0ce1cfdf 100644 --- a/src/content/docs/en/technology/chain/differences.mdx +++ b/src/content/docs/en/technology/chain/differences.mdx @@ -7,7 +7,7 @@ permalink: "technology/chain/differences" whatsnext: { "Bridge": "/en/technology/bridge/cross-domain-messaging/" } --- -import Aside from "../../../../components/Aside.astro" +import Aside from "../../../../../components/Aside.astro" ## Opcodes