Skip to content

Update info on opcodes #297

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

Merged
merged 2 commits into from
Jul 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ For open-source contributors and infrastructure builders, please contact our tea
| `BLOCKHASH` | `block.blockhash` | Returns `keccak(chain_id \|\| block_number)` for the last 256 blocks. |
| `COINBASE` | `block.coinbase` | Returns the pre-deployed fee vault contract address. See [Scroll Contracts](/developers/scroll-contracts). |
| `DIFFICULTY` / `PREVRANDAO` | `block.difficulty` | Returns 0. |
| `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] |

<Aside type="caution" title="">
Opcodes from the Cancun upgrade are not yet available on Scroll, including `MCOPY`, `TSTORE`, `TLOAD`, `BLOBHASH` and `BLOBBASEFEE`. Additionally, [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) for accessing the Beacon Chain block root is not supported. We recommend using `shanghai` as your EVM target and avoiding using a Solidity version higher than `0.8.23`.
Opcodes related to EIP-4844, like `BLOBHASH` and `BLOBBASEFEE`, are not yet available on Scroll. Additionally, [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) for accessing the Beacon Chain block root is not supported.
</Aside>

[^eip1559]: We have currently disabled EIP-1559 on Scroll.
We support the `cancun` EVM target and the latest Solidity version `0.8.26`.

[^willadpot]: Will change to adopt Ethereum’s solution in the future.

## EVM Precompiles
Expand Down Expand Up @@ -91,12 +91,7 @@ When verifying `EXTCODESIZE`, it is expensive to load the whole contract data in

## Block Time

Scroll aims for a constant block time of 3 seconds. This is shorter and more consistent than the 12 seconds used in the Ethereum under ideal conditions.

This was chosen for two reasons:

- Having faster, constant block time results in quicker feedback and a better user experience.
- As we optimize the zkEVM circuits in our testnets, even if we maintain a smaller gas limit per block or batch, we can still reach higher throughput than Ethereum.
To improve the throughput of the Scroll chain, we introduced a dynamic block time in our [Curie upgrade](/technology/overview/scroll-upgrades#curie-upgrade). During the congestion period, a block will be sealed once the transactions in the block reach the circuit limit instead of waiting for the 3-second interval. During normal hours, blocks will still be sealed at 3-second interval to ensure a consistent user experience.

## Transaction Ordering

Expand Down
22 changes: 5 additions & 17 deletions src/content/docs/en/technology/chain/differences.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Aside from "../../../../../components/Aside.astro"
| `BLOCKHASH` | Returns `keccak(chain_id \|\| block_number)` for the last 256 blocks. |
| `COINBASE` | Returns the fee vault address (predeployed contract `0x5300000000000000000000000000000000000005`). |
| `DIFFICULTY` / `PREVRANDAO` | Always return 0. |
| `BASEFEE` | Disabled because currently we disabled EIP-1559. If the opcode is encountered, the transaction will be reverted. |
| `SELFDESTRUCT` | Disabled. If the opcode is encountered, the transaction will be reverted. |

## Precompiled Contracts
Expand All @@ -33,21 +32,10 @@ The remaining precompiled contracts have the same behavior as Ethereum. However,

## EIPs

Our sequencer was developed based on the London fork initially. We disabled some EIPs in the London fork and introduced a few EIPs from the Shanghai fork to improve the compatibility.
Our sequencer was developed based on the London fork initially. Since then we have adopted most features from London, Shanghai, and Cancun.

Disabled EIPs until the London fork:
Our EIP-1559 fee market behaves differently: the sequencer sets the L2 base fee (based on the L1 base fee), and we don't burn ETH.

- [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559): Fee market change and EIP-1559 transaction type
- [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930): Optional access lists
- [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198): `BASEFEE` opcode

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


<Aside type="tip" title="">
Opcodes from the Cancun upgrade are not yet available on Scroll, including `MCOPY`, `TSTORE`, `TLOAD`, `BLOBHASH` and `BLOBBASEFEE`. Additionally, [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) for accessing the Beacon Chain block root is not supported.
</Aside>
<Aside type="caution" title="">
Opcodes related to EIP-4844, like `BLOBHASH` and `BLOBBASEFEE`, are not yet available on Scroll. Additionally, [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) for accessing the Beacon Chain block root is not supported.
</Aside>