Skip to content

[R4R]Fix miningprefetcher#843

Merged
qinglin89 merged 1 commit intobnb-chain:developfrom
qinglin89:fix-miningprefetcher-l
Apr 6, 2022
Merged

[R4R]Fix miningprefetcher#843
qinglin89 merged 1 commit intobnb-chain:developfrom
qinglin89:fix-miningprefetcher-l

Conversation

@qinglin89
Copy link
Copy Markdown
Contributor

@qinglin89 qinglin89 commented Apr 6, 2022

Description

panic with nil pointer of Transaction.inner

Rationale

If PrefetchMining run fast enough that sub-prefetcher-routines checked txCurr before transaction had been peeked from TransactionByPriceAndNonce at the main worker routine, it would get an empty Transaction struct with nil inner filed which would cause panic in func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error)
截屏2022-04-06 15 23 08

Example

N/A

Changes

Notable changes:

  • Instead of using empty Transaction for tx initialization, Peek the first transaction from TransactionByPriceAndNonce for current transaction txCurr at miner/worker.go:line787 which would be accessed in mining-prefetcher-routine

@qinglin89 qinglin89 merged commit 12c5eb0 into bnb-chain:develop Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants