|
| 1 | +--- |
| 2 | +title: Preparing for Fjord Breaking Changes |
| 3 | +lang: en-US |
| 4 | +description: Learn how to prepare for Fjord upgrade breaking changes. |
| 5 | +--- |
| 6 | + |
| 7 | +import { Steps, Callout } from 'nextra/components' |
| 8 | + |
| 9 | +# Preparing for Fjord Breaking Changes |
| 10 | + |
| 11 | +This page outlines breaking changes related to the Fjord network upgrade for wallets and front-end developers, chain operators, and node operators. |
| 12 | +If you experience difficulty at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions). |
| 13 | + |
| 14 | +<Callout type="info"> |
| 15 | + The Fjord upgrade for OP Sepolia was activated on **1716998400 Wed May 29 16:00:00 UTC 2024**. The Fjord OP Mainnet upgrade will be optimistically activated **1720627201 Thu July 10 16:00:01 UTC 2024**, pending [governance approval](https://gov.optimism.io/t/upgrade-proposal-9-fjord-network-upgrade/8236). |
| 16 | +</Callout> |
| 17 | + |
| 18 | +## What's Included in Fjord |
| 19 | + |
| 20 | +The [Fjord network upgrade](https://specs.optimism.io/fjord/overview.html) includes the following: |
| 21 | + |
| 22 | +* [RIP-7212](https://specs.optimism.io/protocol/precompiles.html#P256VERIFY): Precompile for secp256r1 Curve Support, to reduce gas costs of many smart wallet applications. |
| 23 | +* [Brotli](https://specs.optimism.io/fjord/derivation.html#brotli-channel-compression) as a channel compression option, for \~5-15% lower data availability costs. |
| 24 | +* Parameter changes: |
| 25 | + * [Max sequencer drift](https://specs.optimism.io/fjord/derivation.html#constant-maximum-sequencer-drift) becomes a constant with value increased to 1800 seconds |
| 26 | + * 10x increased values for `MAX_RLP_BYTES_PER_CHANNEL` and `MAX_CHANNEL_BANK_SIZE` ([spec](https://specs.optimism.io/fjord/derivation.html#increasing-max_rlp_bytes_per_channel-and-max_channel_bank_size)) |
| 27 | +* The [Fjord hardfork activation block](https://specs.optimism.io/fjord/derivation.html#network-upgrade-automation-transactions) includes several transactions to perform all L2 contract deployments, upgrades, enablements, and proxy updates. |
| 28 | +* L1 Gas Cost changes: |
| 29 | + * [FastLZ](https://specs.optimism.io/fjord/exec-engine.html#fees) based L1 fee [cost calculation](https://specs.optimism.io/fjord/exec-engine.html#fees) with an upgraded [`GasPriceOracle` L2 predeploy](https://specs.optimism.io/fjord/derivation.html#gaspriceoracle-deployment) to compute it |
| 30 | + * `GasPriceOracle` gets a new function `getL1FeeUpperBound` as a cheap new way to calculate an upper bound for the max fee of a new transaction |
| 31 | + * `getL1GasUsed` method of the `GasPriceOracle` contract ([spec](https://specs.optimism.io/fjord/predeploys.html#l1-gas-usage-estimation)) is being deprecated |
| 32 | + * `L1GasUsed` field of the transaction receipt ([spec](https://specs.optimism.io/fjord/exec-engine.html)) is being deprecated |
| 33 | + |
| 34 | +## For Wallets and Front-End Developers |
| 35 | + |
| 36 | +The proposed Fjord upgrade to the OP Stack and OP Mainnet changes the formula for estimating the [L1 Data Fee](/stack/transactions/fees#l1-data-fee) component of the [OP Stack Transaction Fee](/stack/transactions/fees). |
| 37 | + |
| 38 | +* `getL1Fee` on the [GasPriceOracle contract](https://github.com/ethereum-optimism/optimism/blob/0dcb1b2c7dadec98a24f47e2e2d781a25800d9e1/packages/contracts-bedrock/src/L2/GasPriceOracle.sol#L54) has been updated. It now performs FastLZ compression on-chain, which is a better approximation of the compressibility of a transaction. Combined with a linear regression model, this gives a more accurate prediction of L1 data fees. |
| 39 | +* `getL1GasUsed` and the corresponding `L1GasUsed` field of transaction receipts are being deprecated as they no longer accurately reflect gas usage as of Ecotone. The function and field will remain; however, their usefulness is limited as they still assume calldata batching. `getL1Fee` should be used when trying to predict L1 Data fees. |
| 40 | +* `getL1FeeUpperBound` is a new method to estimate fee upper bounds when sending transactions. It is much cheaper, in gas costs, than previous methods. This is what wallets and front-ends should use in practice in most cases. |
| 41 | +* Read the [Fjord Formula section](/stack/transactions/fees#fjord) of the [Transaction Fees](/stack/transactions/fees) page for more information about the new formula. |
| 42 | + |
| 43 | +Your application may need to be updated to account for this change. Read below to learn how specific changes in the Fjord upgrade require updates to your application. |
| 44 | + |
| 45 | +### Preparing Your Wallet or Front-End |
| 46 | + |
| 47 | +Changes to the L1 Data Fee formula may affect your application if you are computing this fee component on your own. It's strongly recommended that you use [existing tooling](/builders/app-developers/transactions/estimates#tooling) to estimate transaction fees instead of computing them yourself. |
| 48 | + |
| 49 | +* If you cannot use existing tooling, use the `getL1Fee` function on the `GasPriceOracle` smart contract to compute the L1 Data Fee component of the transaction fee. Avoid implementing the formula yourself, as it may change in the future. |
| 50 | +* Alternatively, you should consider using `getL1FeeUpperBound` if you only need to estimate an upper bound of the L1 fee for the purpose of transaction sending. |
| 51 | + |
| 52 | +## For Chain Operators |
| 53 | + |
| 54 | +The proposed Fjord upgrade impacts OP chains and requires chain operators to upgrade their chain and configure the sequencer for Fjord. |
| 55 | + |
| 56 | +* [Max sequencer drift](https://specs.optimism.io/fjord/derivation.html#constant-maximum-sequencer-drift) becomes a constant with value increased to 1800 seconds. This gives chain operators more time to respond to L1 node issues without facing a potential L2 chain halt. |
| 57 | +* [Brotli](https://specs.optimism.io/fjord/derivation.html#brotli-channel-compression) is now supported as a channel compression option, for \~5-15% lower data availability costs. |
| 58 | +* An update of the fee scalars on the `SystemConfig` is necessary, similar to Ecotone. |
| 59 | + |
| 60 | +<Steps> |
| 61 | + ### Prepare `SystemConfig` Transaction |
| 62 | + |
| 63 | + An onchain transaction will be required to update the scalar for Fjord. This needs to be prepared days in advance before the activation to ensure chain operators don't operate at a loss when Fjord activates. |
| 64 | + |
| 65 | + * Encode the scalar value using the [ecotone scalar encoding tool](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/ecotone-scalar) |
| 66 | + * Send a `setGasConfig` transaction to `SystemConfig` |
| 67 | + * Set `BaseFeeScalar` and `BlobBaseFeeScalar` values based on the [Fjord calculator](https://docs.google.com/spreadsheets/d/1V3CWpeUzXv5Iopw8lBSS8tWoSzyR4PDDwV9cu2kKOrs/edit#gid=186414307) |
| 68 | + |
| 69 | + ### Prepare Sequencer Node |
| 70 | + |
| 71 | + <Callout type="warning"> |
| 72 | + If you are operating an OP Chain that has an entry in the [`superchain-registry`](https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/configs/chainList.json), the Fjord activation date is part of the `op-node` and `op-geth` nodes, and are using the [--network](/builders/node-operators/configuration/consensus-config#network) and [--op-network](/builders/node-operators/configuration/execution-config#op-network-betaop-network) flags. No action is needed for the sequencer after preparing the `SystemConfig` transaction. Please skip to [Step 3: Prepare Batcher](#prepare-batcher). |
| 73 | + </Callout> |
| 74 | + |
| 75 | + For custom chains not included in the [`superchain-registry`](https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/configs/chainList.json), you will need to manually configure the [activation timestamp](https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/configs/mainnet/superchain.yaml). You have two configuration options for your sequencer node: |
| 76 | + |
| 77 | + * **Option 1:** Set the Fjord activation date in your `rollup.json` config file. You will still need to set the `override.fjord` flag in `op-geth` with the UNIX timestamp. |
| 78 | + * **Option 2:** Alternatively, chain operators can use the override flags to configure your sequencer node by specifying a time in the future when Fjord will activate. |
| 79 | + * Set `override.fjord` in both `op-node` and `op-geth` to the UNIX timestamp of the block you want to activate the Fjord hardfork or corresponding env vars for this. |
| 80 | + * In general, run `op-node --help` or `op-geth --help` to see flags, their descriptions and environment variables. |
| 81 | + |
| 82 | + ### Prepare Batcher |
| 83 | + |
| 84 | + Preparing your batcher to activate Brotli compression is optional but recommended to achieve better channel compression. |
| 85 | + |
| 86 | + * You can activate Brotli compression for your batcher by setting the `compression-algo` flag. |
| 87 | + * `brotli-10` is the recommended Brotli level and works fine for most chain configurations. |
| 88 | + * However, chain operators can experiment with `brotli-11` if it gives them better compression and their batcher can still keep up with the increased compression computation needs. |
| 89 | + |
| 90 | + <Callout type="info"> |
| 91 | + `brotli` defaults to `brotli-10`. If the flag is unset, it still defaults to `zlib`. |
| 92 | + </Callout> |
| 93 | + |
| 94 | + * You can also run the batcher help to see available options: `go run ./op-batcher/cmd --help |less` |
| 95 | + |
| 96 | + ```jsx |
| 97 | + --compression-algo value (default: zlib) ($OP_BATCHER_COMPRESSION_ALGO) |
| 98 | + The compression algorithm to use. Valid options: zlib, brotli, brotli-9, |
| 99 | + brotli-10, brotli-11 |
| 100 | + ``` |
| 101 | +</Steps> |
| 102 | + |
| 103 | +<Callout type="info"> |
| 104 | + To verify proper configuration, chain operators should confirm in the startup logs of their `op-node` and `op-geth` that the correct Fjord activation timestamps are set. |
| 105 | +</Callout> |
| 106 | + |
| 107 | +## For Node Operators |
| 108 | + |
| 109 | +Node operators will need to upgrade to Fjord before the activation date. For Sepolia, the op-node release [v1.7.7](https://github.com/ethereum-optimism/optimism/releases/tag/v1.7.7) and op-geth release [v1.101315.2](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101315.2) contain these changes. |
| 110 | + |
| 111 | +These following steps are necessary for EVERY node operator: |
| 112 | + |
| 113 | +<Steps> |
| 114 | + ### Update to the Latest Release |
| 115 | + |
| 116 | + * [`op-geth`](https://github.com/ethereum-optimism/op-geth/releases/tag/v1.101315.2) |
| 117 | + * [`op-node`](https://github.com/ethereum-optimism/optimism/releases/tag/v1.7.7) |
| 118 | + |
| 119 | + ### Configure the Fjord Activation Date |
| 120 | + |
| 121 | + <Callout type="warning"> |
| 122 | + If you are operating a node for an OP Chain that has an entry in the [`superchain-registry`](https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/configs/chainList.json), the Fjord activation date is part of the `op-node` and `op-geth` nodes. So, no action is needed for the sequencer after upgrading to the latest release. Please skip to [Step 3: Verify Your Configuration](#verify-your-configuration). |
| 123 | + </Callout> |
| 124 | + |
| 125 | + For node operators of custom chains not included in the [`superchain-registry`](https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/configs/chainList.json), you will need to manually configure the [activation timestamp](https://github.com/ethereum-optimism/superchain-registry/blob/main/superchain/configs/mainnet/superchain.yaml). This can be done one of two ways: |
| 126 | + |
| 127 | + * **Option 1:** Set the activation time in the `rollup.json` for `op-node`. You will still need to set the `override.fjord` flag in `op-geth` if you use this option. |
| 128 | + * **Option 2:** Set the activation time via overrides (CLI) in both `op-node` and `op-geth`. These will need to be set on `op-node` and `op-geth` for the sequencer and all other nodes. |
| 129 | + |
| 130 | + ### Verify Your Configuration |
| 131 | + |
| 132 | + Make the following checks to verify that your node is properly configured. |
| 133 | + |
| 134 | + * `op-node` and `op-geth` will log their configurations at startup |
| 135 | + * Check that the Fjord time is set to `activation-timestamp` in the op-node startup logs |
| 136 | + * Check that the Fjord time is set to `activation-timestamp` in the op-geth startup logs |
| 137 | +</Steps> |
0 commit comments