-
Notifications
You must be signed in to change notification settings - Fork 769
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 #388
base: optimism
Are you sure you want to change the base?
Conversation
GasLimit: header.GasLimit, | ||
Random: random, | ||
L1CostFunc: types.NewL1CostFunc(config, statedb), | ||
OperatorCostFunc: types.NewOperatorCostFunc(config, statedb), |
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 lean towards not adding a new hook and just making the L1 cost function more generic, a better name for it would be L2CostFunc
which would imply it does the L2 specific fee calculations. Curious what other people think
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 thought about this too. Currently, these are the function signatures for the L1CostFunc and the OperatorCostFunc
type L1CostFunc func(rcd RollupCostData, blockTime uint64) *big.Int
type OperatorCostFunc func(gasUsed *big.Int, isRefund bool, blockTime uint64) *big.Int
I could potentially package up the gasUsed
and isRefund
together into an OperatorCostData
or something. Then, we'd have this type.
type L2CostFunc func(rcd RollupCostData, ocd OperatorCostData, blockTime uint64) (*big.Int, *big.Int)
which returns the l1 cost and operator cost as a pair.
This pattern seems clunkier to me -- though the L1 fee and Operator fee are conceptually similar, I don't like returning both in a single function. For example, when calculating refunds, we only need the operator fee but not the L1 fee.
I'd definitely be open to unifying the two with a cleaner function design though.
* Update to Isthmus * Allow to set IsthmusTime * update setL1BlockValuesIsthmus function selector
Adds the operator fee, as described in this design doc and this spec