Skip to content
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

Isthmus: operator fee #382

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f4ef24d
holocene exec-engine
yuwen01 Sep 19, 2024
d2f40a0
update other files in holocene directory
yuwen01 Sep 19, 2024
7ddbce3
update feevault
yuwen01 Sep 19, 2024
2e12898
dont change the function signature
yuwen01 Sep 19, 2024
1407fa9
specify initial configurablefee
yuwen01 Sep 19, 2024
50c22ec
typos in exec engine
yuwen01 Sep 19, 2024
78cb4cb
remove configurablefeevault
yuwen01 Sep 19, 2024
6a78e21
linter
yuwen01 Sep 19, 2024
fb53c85
clean up + pack storage slots
yuwen01 Sep 20, 2024
b56048a
optimize packing a little
yuwen01 Sep 20, 2024
7c90f2b
oxford comma
yuwen01 Sep 20, 2024
f4e27b3
rephrase
yuwen01 Sep 20, 2024
1526415
move changes to isthmus
yuwen01 Sep 20, 2024
7085d98
reset holocene
yuwen01 Sep 20, 2024
148230b
linter
yuwen01 Sep 20, 2024
fbf8dfb
update configupdate version
yuwen01 Sep 20, 2024
48a25af
removed mention of holocene, added isthmus to SUMMARY
yuwen01 Sep 20, 2024
98fdb84
merged main
yuwen01 Sep 20, 2024
ead7704
fixed link
yuwen01 Sep 20, 2024
1ade65a
add predeploys and system-config
yuwen01 Sep 20, 2024
4673839
update summary
yuwen01 Sep 20, 2024
b945faf
rerun doctoc
yuwen01 Sep 20, 2024
2f73dc2
fix calldata
yuwen01 Sep 20, 2024
43c5ea9
Update specs/protocol/isthmus/configurability.md
yuwen01 Sep 23, 2024
2efe231
sebastians suggestions
yuwen01 Sep 23, 2024
816cc6c
typo in l1-attributes
yuwen01 Sep 24, 2024
a8e094e
Merge branch 'main' of github.com:ethereum-optimism/specs into yuwen/…
yuwen01 Sep 25, 2024
1314351
also change the gaspriceoracle
yuwen01 Sep 26, 2024
63d1760
Merge branch 'main' into yuwen/additional-fee-scalars
yuwen01 Sep 27, 2024
76fa61a
WIP: move everything to holocene
yuwen01 Sep 30, 2024
3afa960
move to holocene
yuwen01 Sep 30, 2024
f45744f
update summary
yuwen01 Sep 30, 2024
2a64355
Merge branch 'main' into yuwen/additional-fee-scalars
yuwen01 Sep 30, 2024
2f0187f
fix typos
yuwen01 Sep 30, 2024
1625dab
typo
yuwen01 Sep 30, 2024
bc293f2
add the operatorFeeVault back
yuwen01 Oct 1, 2024
ff1aa7f
gas price oracle clarifications
yuwen01 Oct 1, 2024
317ac76
fix typos
yuwen01 Oct 1, 2024
bbb9e05
another typo
yuwen01 Oct 1, 2024
4c3eaca
update overview
yuwen01 Oct 1, 2024
cfdc6fc
new role
yuwen01 Oct 2, 2024
3db2793
operator fee manager doesnt collect fees
yuwen01 Oct 2, 2024
e2af323
fill in constants
yuwen01 Oct 2, 2024
b88dcf8
add operator fee vault address
yuwen01 Oct 2, 2024
dcf4bdd
dont emit new configupdate
yuwen01 Oct 2, 2024
6ad2938
typo
yuwen01 Oct 2, 2024
3d9f967
typos
yuwen01 Oct 2, 2024
3c99591
add more support for operator fee manager
yuwen01 Oct 2, 2024
2bf6246
migrate to isthmus
yuwen01 Oct 3, 2024
4e0f724
typos
yuwen01 Oct 3, 2024
9ab37f9
run linter
yuwen01 Oct 3, 2024
c7efd31
merge main
yuwen01 Oct 20, 2024
6c57838
set fee manager in roles
yuwen01 Nov 8, 2024
1aa27f4
merge main again
yuwen01 Nov 8, 2024
219e72c
add sysconfig to summary
yuwen01 Nov 8, 2024
762dbf7
move roles to root configurability.md + typo
yuwen01 Nov 18, 2024
99c9f4d
typo
yuwen01 Nov 18, 2024
18c8127
operator fee manager
yuwen01 Nov 20, 2024
54ea6a4
Merge branch 'main' into yuwen/additional-fee-scalars
yuwen01 Nov 20, 2024
6512664
clarification on l1 block attributes function selector
yuwen01 Nov 25, 2024
c7cffb1
Update to getL1Fee;
yuwen01 Dec 4, 2024
0accd5f
revert getL1Fee() update
leruaa Dec 9, 2024
91a129c
Merge branch 'ethereum-optimism:main' into yuwen/additional-fee-scalars
leruaa Jan 6, 2025
e3f4913
removing posponed "Fee Vault Config"
leruaa Jan 6, 2025
9acbf42
lint
leruaa Jan 8, 2025
f205eae
Merge remote-tracking branch 'origin/main' into yuwen/additional-fee-…
leruaa Jan 24, 2025
ba1745e
fix merge
leruaa Jan 24, 2025
74d388f
Merge remote-tracking branch 'origin/main' into yuwen/additional-fee-…
leruaa Jan 29, 2025
e70bc27
add Isthmus operator fee network upgrade transactions
leruaa Jan 30, 2025
e64de24
fix: lint
leruaa Jan 30, 2025
92b2d4b
fix: toc
leruaa Jan 30, 2025
3d6b257
fix: detangle operator fee spec from standard L2 genesis one
leruaa Jan 31, 2025
31500e1
fix: remove use of pnpm
leruaa Jan 31, 2025
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
4 changes: 4 additions & 0 deletions specs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@
- [Execution Engine](./protocol/holocene/exec-engine.md)
- [System Config](./protocol/holocene/system-config.md)
- [Isthmus](./protocol/isthmus/overview.md)
- [Configurability](./protocol/isthmus/configurability.md)
- [Derivation](./protocol/isthmus/derivation.md)
- [Execution Engine](./protocol/isthmus/exec-engine.md)
- [Derivation](./protocol/isthmus/derivation.md)
- [L1 Attributes](./protocol/isthmus/l1-attributes.md)
- [Predeploys](./protocol/isthmus/predeploys.md)
- [Superchain Config](./protocol/isthmus/superchain-config.md)
- [System Config](./protocol/isthmus/system-config.md)
- [Governance]()
- [Governance Token](./governance/gov-token.md)
- [Experimental]()
Expand Down
25 changes: 25 additions & 0 deletions specs/protocol/configurability.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
- [Start block](#start-block)
- [Superchain target](#superchain-target)
- [Governance Token](#governance-token)
- [Operator Fee Scalar](#operator-fee-scalar)
- [Operator Fee Constant](#operator-fee-constant)
- [Resource Config](#resource-config)
- [Policy Parameters](#policy-parameters)
- [Data Availability Type](#data-availability-type)
Expand All @@ -47,6 +49,7 @@
- [Guardian address](#guardian-address)
- [Proposer address](#proposer-address)
- [Sequencer P2P / Unsafe head signer](#sequencer-p2p--unsafe-head-signer)
- [Operator Fee Manager](#operator-fee-manager)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -283,6 +286,21 @@ contracts deployed on layer 1.<br/>
**Requirement:** Disabled<br/>
**Notes:** Simple clear restriction.<br/>

### [Operator Fee Scalar](exec-engine.md#operator-fees)

**Description:** Operator fee scalar -- used to calculate the operator fee<br/>
**Administrator:** [Operator Fee Manager](#operator-fee-manager)<br/>
**Requirement:** 0 <br/>

### [Operator Fee Constant](exec-engine.md#operator-fees)

**Description:** Operator fee constant -- used to calculate the operator fee<br/>
**Administrator:** [Operator Fee Manager](#operator-fee-manager)<br/>
**Requirement:** 0 <br/>

Note that the operator fee scalar and constant are primarily used for non-standard configurations,
like op-succinct, so their standard values are 0.

[^chain-id-uniqueness]: The chain ID must be globally unique among all EVM chains.

### Resource Config
Expand Down Expand Up @@ -441,4 +459,11 @@ configuration of the permissioned dispute game.<br/>
**Requirement:** No requirement<br/>
**Notes:** <br/>

### Operator Fee Manager

**Description:** Account authorized to modify the operator fee scalar. <br/>
**Administrator:** [System Config Owner](#admin-roles)<br/>
refcell marked this conversation as resolved.
Show resolved Hide resolved
**Requirement:** `address(0)`<br/>
**Notes:** For standard configurations, the operator fee manager is not used, so it is set to the null address. <br/>

[^of-gnosis-safe-l1]: 5 of 7 GnosisSafe controlled by Optimism Foundation (OF). Mainnet and Sepolia addresses can be found at [privileged roles](https://docs.optimism.io/chain/security/privileged-roles).
59 changes: 38 additions & 21 deletions specs/protocol/isthmus/configurability.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
- [`SystemConfig`](#systemconfig)
- [`ConfigUpdate`](#configupdate)
- [Initialization](#initialization)
- [Modifying Operator Fee Parameters](#modifying-operator-fee-parameters)
- [Interface](#interface)
- [Fee Vault Config](#fee-vault-config)
- [`setBaseFeeVaultConfig`](#setbasefeevaultconfig)
- [`setL1FeeVaultConfig`](#setl1feevaultconfig)
- [`setSequencerFeeVaultConfig`](#setsequencerfeevaultconfig)
- [Operator fee parameters](#operator-fee-parameters)
- [`operatorFeeScalar`](#operatorfeescalar)
- [`operatorFeeConstant`](#operatorfeeconstant)
- [`setOperatorFeeScalars`](#setoperatorfeescalars)
- [`OptimismPortal`](#optimismportal)
- [Interface](#interface-1)
- [`setConfig`](#setconfig)
Expand All @@ -25,7 +26,7 @@
## Overview

The `SystemConfig` and `OptimismPortal` are updated with a new flow for chain
configurability.
configurability. A new service role `OperatorFeeManager` is added to manage the operator fee collection.

## Constants

Expand All @@ -39,10 +40,11 @@ The `ConfigType` enum represents configuration that can be modified.
| `BASE_FEE_VAULT_CONFIG` | `uint8(1)` | Sets the Fee Vault Config for the `BaseFeeVault` |
| `L1_FEE_VAULT_CONFIG` | `uint8(2)` | Sets the Fee Vault Config for the `L1FeeVault` |
| `SEQUENCER_FEE_VAULT_CONFIG` | `uint8(3)` | Sets the Fee Vault Config for the `SequencerFeeVault` |
| `L1_CROSS_DOMAIN_MESSENGER_ADDRESS` | `uint8(4)` | Sets the `L1CrossDomainMessenger` address |
| `L1_ERC_721_BRIDGE_ADDRESS` | `uint8(5)` | Sets the `L1ERC721Bridge` address |
| `L1_STANDARD_BRIDGE_ADDRESS` | `uint8(6)` | Sets the `L1StandardBridge` address |
| `REMOTE_CHAIN_ID` | `uint8(7)` | Sets the chain id of the base chain |
| `OPERATOR_FEE_VAULT_CONFIG` | `uint8(4)` | Sets the Fee Vault Config for the `OperatorFeeVault` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given we are not combining this with L2 standard genesis, we are going to need to rethink how we go about configuring the system. How does the existing solidity implementation work?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there was a bad merge in this file, I will have a look.

Currently I added a new method setOperatorFeeScalars(uint32, uint64) to SystemConfig. But reading the same file in the main branch, I see a section about Fee Vault Config, so I guess I should conform with that and add a function setOperatoreFeeVaultConfig(address,uint256,WithdrawalNetwork) method. Is it what you have in mind?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I saw the Fee Vault Config section is part of L2 standard genesis, so I won't need to conform with that.

| `L1_CROSS_DOMAIN_MESSENGER_ADDRESS` | `uint8(5)` | Sets the `L1CrossDomainMessenger` address |
| `L1_ERC_721_BRIDGE_ADDRESS` | `uint8(6)` | Sets the `L1ERC721Bridge` address |
| `L1_STANDARD_BRIDGE_ADDRESS` | `uint8(7)` | Sets the `L1StandardBridge` address |
| `REMOTE_CHAIN_ID` | `uint8(8)` | Sets the chain id of the base chain |

## `SystemConfig`

Expand All @@ -57,6 +59,7 @@ The following `ConfigUpdate` event is defined where the `CONFIG_VERSION` is `uin
| `GAS_LIMIT` | `uint8(2)` | `abi.encode(uint64 _gasLimit)` | Modifies the L2 gas limit |
| `UNSAFE_BLOCK_SIGNER` | `uint8(3)` | `abi.encode(address)` | Modifies the account that is authorized to progress the unsafe chain |
| `EIP_1559_PARAMS` | `uint8(4)` | `uint256(uint64(uint32(_denominator))) << 32 \| uint64(uint32(_elasticity))` | Modifies the EIP-1559 denominator and elasticity |
| `OPERATOR_FEE_PARAMS` | `uint8(5)` | `uint256(_operatorFeeScalar) << 64 \| _operatorFeeConstant` | Modifies the operator fee parameters |

### Initialization

Expand All @@ -67,43 +70,57 @@ The following actions should happen during the initialization of the `SystemConf
- `emit ConfigUpdate.GAS_LIMIT`
- `emit ConfigUpdate.UNSAFE_BLOCK_SIGNER`
- `emit ConfigUpdate.EIP_1559_PARAMS`
- `emit ConfigUpdate.OPERATOR_FEE_PARAMS`
- `setConfig(SET_GAS_PAYING_TOKEN)`
- `setConfig(SET_BASE_FEE_VAULT_CONFIG)`
- `setConfig(SET_L1_FEE_VAULT_CONFIG)`
- `setConfig(SET_SEQUENCER_FEE_VAULT_CONFIG)`
- `setConfig(SET_OPERATOR_FEE_VAULT_CONFIG)`
- `setConfig(SET_L1_CROSS_DOMAIN_MESSENGER_ADDRESS)`
- `setConfig(SET_L1_ERC_721_BRIDGE_ADDRESS)`
- `setConfig(SET_L1_STANDARD_BRIDGE_ADDRESS)`
- `setConfig(SET_REMOTE_CHAIN_ID)`

These actions MAY only be triggered if there is a diff to the value.

### Interface
Since the `OperatorFeeVault` is new in Isthmus, the `setConfig(SET_OPERATOR_FEE_VAULT_CONFIG)` MUST be emitted.

`ConfigUpdate.OPERATOR_FEE_PARAMS` MAY be emitted. If it is not emitted, the `operatorFeeScalar` and
`operatorFeeConstant` are set to 0 by default.

### Modifying Operator Fee Parameters

A new `SystemConfig` `UpdateType` is introduced that enables the modification of
the `operatorFeeScalar` and `operatorFeeConstant` by the [`OperatorFeeManager`](../configurability.md#operator-fee-manager).

#### Fee Vault Config
### Interface

For each `FeeVault`, there is a setter for its config. The arguments to the setter include
the `RECIPIENT`, the `MIN_WITHDRAWAL_AMOUNT` and the `WithdrawalNetwork`.
Each of these functions should be `public` and only callable by the chain governor.
#### Operator fee parameters

Each function calls `OptimismPortal.setConfig(ConfigType,bytes)` with its corresponding `ConfigType`.
##### `operatorFeeScalar`

##### `setBaseFeeVaultConfig`
This function returns the currently configured operator fee scalar.

```solidity
function setBaseFeeVaultConfig(address,uint256,WithdrawalNetwork)
function operatorFeeScalar()(uint32)
```

##### `setL1FeeVaultConfig`
##### `operatorFeeConstant`

This function returns the currently configured operator fee constant.

```solidity
function setL1FeeVaultConfig(address,uint256,WithdrawalNetwork)
function operatorFeeConstant()(uint64)
```

##### `setSequencerFeeVaultConfig`
##### `setOperatorFeeScalars`

This function sets the `operatorFeeScalar` and `operatorFeeConstant`.

This function MUST only be callable by the [`OperatorFeeManager`](../configurability.md#operator-fee-manager).

```solidity
function setSequencerFeeVaultConfig(address,uint256,WithdrawalNetwork)
function setOperatorFeeScalar(uint32 _operatorFeeScalar, uint64 _operatorFeeConstant)
```

## `OptimismPortal`
Expand Down
Loading