fix l1 fee cache, rpc, tracing and tx pool#31
Conversation
f013e38 to
bee7bc3
Compare
trianglesphere
left a comment
There was a problem hiding this comment.
I gave parts of this a light skim. The context functions seems like it makes sense. I bet I can rework the unmetering PR to not use the msg options interface.
bee7bc3 to
a85cf7b
Compare
734a9a9 to
d9da8f7
Compare
| } | ||
|
|
||
| // RollupDataGas is the amount of gas it takes to confirm the tx on L1 as a rollup | ||
| func (tx *Transaction) RollupDataGas() uint64 { |
There was a problem hiding this comment.
This function will need to be hardforkable eventually
There was a problem hiding this comment.
Worst-case we deprecate the function, and call a different function. The l1 cost computation has access to both the chain config and current block number (in addition to the statedb), so there it's easy to hardfork:
trianglesphere
left a comment
There was a problem hiding this comment.
The only place I'm a little iffy on is the tx pool. I think it does work for now, but the semantics around the L1 Cost make it hard to integrate it into the tx pool.
| } | ||
| balance := pool.currentState.GetBalance(addr) | ||
| if !list.Empty() { | ||
| // Reduce the cost-cap by L1 rollup cost of the first tx if necessary. Other txs will get filtered out afterwards. |
There was a problem hiding this comment.
I think this works, but it's a bit weird b/c there's no hard cap.
If there was a hard cap we could do something like enforce that the balance was enough to pay the cap & then place it into the tx priced list. Right now without the cap, it's not really clear when the tx would/could become valid again if it had low but present funds.
d9da8f7 to
f579014
Compare
|
Seems like CI is flaky, |
This PR fixes:
chainConfig.OptimismConfig != nilinstead of doublehainConfig.OptimismConfig != nil && OptimismConfig.EnabledTransactionfor performance (repeatedly used in tx pool and state transition etc.)BlockContext, just like other state related tx contextApplyTransactionnow behaves the same as the block processing, fixing the caching bug. The cache is not filled when deposits are processed, so it'll use the latest l1 info data (introduced with a deposit at start of block)BlockContexteverywhere whereAsMessagewas being called.Works with op-e2e tests on monorepo
developbranch