Conversation
006e714 to
1143d87
Compare
1b82392 to
c20186a
Compare
miner/currency_blocklist.go
Outdated
| headerEvictionTimeoutSeconds uint64 | ||
| oldestHeader *types.Header | ||
|
|
||
| enactFilterEnabled *atomic.Int32 |
There was a problem hiding this comment.
That's a very good question... somehow I thought it doesn't exist
We want to be verbose when the API handler fails, since the blocklist is assumed to not be nil
b7c39f9 to
ed193d8
Compare
| } | ||
|
|
||
| // Clean up old transaction hash from map | ||
| oldHash := b.ring[b.index] |
There was a problem hiding this comment.
wonder what happens when the ring is not yet full... this returns zero and delete(zero) doesn't break?
There was a problem hiding this comment.
It will be the empty hash, and delete the empty hash which will be a no-op.
| common.CurrencyAllowlist(env.feeCurrencyContext.ExchangeRates), | ||
| header, | ||
| ) | ||
| env.blockingAllowed = miner.feeCurrencyBlocklist.GetEnableFilterStatus() |
There was a problem hiding this comment.
Yep, env is constructed per block at line 331
There was a problem hiding this comment.
Yes, every time a new payload is requested to be built by the engine-api a new environment is created
| } | ||
| } | ||
| if miner.blockedTxRingbuffer.Has(ltx.Hash) { | ||
| log.Trace("Skipping tx execution, tx in blockedTxRingbuffer", "hash", ltx.Hash) |
There was a problem hiding this comment.
trace? maybe some level we had for skipping a tx due to fee currency lock
There was a problem hiding this comment.
This would be logged on every block build attempt, so every 1 second
There was a problem hiding this comment.
This is the same level we had for skipping a tx due to the fee currency lock, see line 597
miner/worker.go
Outdated
| // so that they are not allowlisted in the following blocks | ||
| // (only locally in the txpool, not consensus-critical) | ||
| miner.feeCurrencyBlocklist.Add(feeCurrency, *env.header) | ||
| miner.feeCurrencyBlocklist.Add(*tx.FeeCurrency(), *env.header) |
There was a problem hiding this comment.
we're sure that tx.FeeCurrency is never nil here?
There was a problem hiding this comment.
Previously this function was being called with the de-referenced fee currency here (line 427, github seems to have an issue correctly scrolling to that point) so I'm as sure as we previously were that fee currency is not nil.
eth/api_admin.go
Outdated
| api.eth.Miner().UnblockTransaction(hash) | ||
| } | ||
|
|
||
| func (api *AdminAPI) UnblockFeeCurrency(address common.Address) { |
There was a problem hiding this comment.
Would it be helpful to have getter API for blocked fee currency list or tx list?
There was a problem hiding this comment.
Why not. I think the fee-currency is not strictly necessary since we have the "block" and "evict" log messages.
The transactions would be helpful, because this is only logged with trace level.
There was a problem hiding this comment.
Yeah I think so. TBH I want to go over this whole blocking feature again and ensure the design is clean. Yesterday we were somewhat in a hurry so didn't have the time to consider all the niceties that you normally would.
Co-authored-by: Seola Oh <osa8361@gmail.com>
304d0fc to
4e2425a
Compare
|
I pulled out the fixes for deactivating the blocklist on l1 derivation / pending building to #363. |
| return b.enactFilterEnabled.Load() | ||
| } | ||
|
|
||
| // This only activates / deactivates wether the |
There was a problem hiding this comment.
| // This only activates / deactivates wether the | |
| // SetEnableFilterStatus only activates / deactivates whether the |
| receipt, err := miner.applyTransaction(env, tx) | ||
| if err != nil { | ||
| if errors.Is(err, contracts.ErrFeeCurrencyEVMCall) { | ||
|
|
|
Closing in favour of 3 more targeted PRs |
No description provided.