fix(miner): no check anchor tx when return pending tx #361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I'm debugging with foundry-rs/foundry#9622, I found taiko in sometimes doesn't return the pending state, and after some digging, seems it was caused by
taiko-geth/consensus/taiko/consensus.go
Lines 240 to 249 in 19655c3
As taiko-geth's txpool will receive both users' transaction list and engine's transaction list, for the later one the first tx will always the Anchor transaction, ref https://github.com/taikoxyz/taiko-mono/blob/b781f761d786d32d25877fd7299fc90dab208d82/packages/taiko-client/driver/chain_syncer/blob/syncer.go#L321-L334
In that case, the Verify succeed and
miner.Pending
returns the pending state.When the txpool hasn't received the engine_NewPayload, it will only contains the users' trasaction list, and for this case, this Verify will fail.
So I propose to check it again with the error code, if in taiko mode and err is
ErrAnchorTxNotFound
just return miner's pending state as well.