-
Notifications
You must be signed in to change notification settings - Fork 110
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
base: main
Are you sure you want to change the base?
Isthmus: operator fee #382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also curious to hear from @tynes and @roberto-bayardo, who's implemented changes to the fee function in Fjord.
I propose to use a prefix for this feature that conveys more meaning, like OperatorFee
or FixedFee
.
calculation: the `ConfigurableFee`, which is parameterized by two scalars: the `configurableFeeScalar` | ||
and the `configurableFeeConstant`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the use of the prefix "configurable" a bit meaningless for this feature. Other fee parameters, like the (blob)BaseFeeScalar
s are also "configurable". Maybe we use a prefix that better describes the reason for their introduction, like
OperatorFee
operatorFeeScalar
operatorFeeConstant
or something similar that attaches more meaning to them?fixedFee...
could also work.
Blocks after the Isthmus activation block contain all pre-Isthmus values 1:1, | ||
and also set the following new attributes: | ||
|
||
- The `configurableFeeScalar` is set to `0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want to set it to 1
? Otherwise there's no fees any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configurableFeeScalar is only scaled by the gas used -- it doesn't scale any of the existing fees. The goal is to add a separate component to the fee calculation, like base fee and priority fee.
|
||
The configurable fee is set as follows: | ||
|
||
`configurableFee = gas_used * configurableFeeScalar + configurableFeeConstant` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't need any fractional scaling, like we introduced with Fjord for the model parameters? I mean something like
`configurableFee = gas_used * configurableFeeScalar + configurableFeeConstant` | |
`configurableFee = (gas_used * configurableFeeScalar + configurableFeeConstant) / 1e6` |
to allow for a decimal precision of 6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point -- it makes sense for users to be able to have fractional scalars. However, I don't know why a user would want to have a fractional constant. The only reason I can think would be to save bits -- see my other comment.
| configurableFeeScalar | uint64 | 180-187 | | | ||
| configurableFeeConstant | uint64 | 188-195 | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want or need 64 bits instead of 32 bits size for the new parameters? E.g. the (blob)baseFeeScalar
s also worked with 32 bits (and also a decimal scaling factor, see other comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! I agree with your point about renaming to operatorFee
and allowing for 6 decimal points of precision, but I was a little unsure about reducing the bit width of the operatorFeeConstant
and operatorFeeScalar
.
I think it should be fine to decrease the Scalar
to 32 bits, but I'm concerned that 32 bits won't be enough to represent the constant factor. For example, in this transaction https://optimistic.etherscan.io/tx/0xa6dfc18c35bf39fa60823e9280bde18496e27e9016040f7ad9ded6797c374f05, the total transaction fee in wei requires 43 bits to represent.
If we scale the constant term by a fixed factor we could fit it in 32 bits. But I don't know how much control a user might want over this constant.
@leruaa Do you mind sharing an update of the status of this? |
@tynes I think it's ready to be merged, all the feedbacks have been handled. |
specs/protocol/isthmus/derivation.md
Outdated
# Network upgrade automation transactions | ||
|
||
The Isthmus hardfork activation block contains the following transactions, in this order: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is underspecified. What are the definitions of the network upgrade transactions? The ecotone specs contain examples of this. This is important because the derivation pipeline has to deterministically create these transactions, ie who is the from
, what is the to
, what is the data
? For the contract deployments, we need finalized bytecode, which will need to come from a release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you send a link to one of the ecotone specs that contains an example of the network upgrade transaction definitions?
I don't see a clear format in the derivation spec: https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/ecotone/derivation.md#ecotone-blob-retrieval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like they are in the wrong place: https://github.com/ethereum-optimism/specs/blob/87e13cba8f34a68858a334fc2587041b712facfa/specs/protocol/derivation.md#network-upgrade-automation-transactions
I can move them to the correct place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting we use the transaction gas limit instead of metered usage to minimize the potential abuse of gas refunds on proving costs.
Another question - now that standard L2 genesis is being decoupled from this, what is the state of the implementation of the system config + operator fee vault? how is the |
We need to handle both the upgrade case and the from genesis case. How do we handle the new predeploy in the upgrade case? We have a requirement that the derivation pipeline upgrade transactions are deterministic, its not straight forward to set the |
cc @yuwen01 @ratankaliani @leruaa thoughts on this? |
Opened #562 so that you can see what a spec for network upgrade txs look like |
@tynes about @hashcashier suggestion, we think that gas used is more representative of proving costs. Furthermore, we are in favor of an incremental approach, rather than updating the current implementation, at the risk of delaying delivery. Especially considering it's possible that Isthmus could be advanced to cycle 35, and that an audit needs to be done. |
@leruaa I am more concerned about delivery being delayed due to underspecification of key parts that i have commented on without it being addressed in a timely manner
Please explain why |
The I think @hashcashier should specify what potential "abuse" there might be on gas refunds, as that is not clear to me. |
This makes sense to me.
We've iterated many times on the fee formula for accurately charging for L1 data fees, and I guarantee we will continue to make improvements to it |
See the following EIP for an explanation: https://eips.ethereum.org/EIPS/eip-7778 It is a real thing, given you do not get your electricity and gpu time back in the same way that you get gas back onchain |
| `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` | |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Verify `data`: | ||
|
||
```bash | ||
git checkout 905311d64d3df67649837ec57f0b0a4b6214ce31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copypasta - we don't use pnpm anymore. Please prove to me that the bytecode in the txt file is legit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are going to want to use a commit of a release. This means we will want to remove any rc suffix on the semver of the specific contracts being upgraded
@@ -67,6 +73,7 @@ graph LR | |||
BaseFeeVault -- "getConfig(ConfigType.GAS_PAYING_TOKEN)(address,uint256,uint8)" --> L1Block | |||
SequencerFeeVault -- "getConfig(ConfigType.SEQUENCER_FEE_VAULT_CONFIG)(address,uint256,uint8)" --> L1Block | |||
L1FeeVault -- "getConfig(ConfigType.L1_FEE_VAULT_CONFIG)(address,uint256,uint8)" --> L1Block | |||
OperatorFeeVault -- "getConfig(ConfigType.OPERATOR_FEE_VAULT_CONFIG)(address,uint256,uint8)" --> L1Block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am confused about this integration into std L2 genesis, will need to look at what the implementation does
Overview
We propose adding additional fee scalars to the fee formula, which allow for more flexibility for chains that leverage alt-DA, ZK proving, or custom gas tokens.
This spec goes with this design doc.