Skip to content
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

[R4R]Fix miningprefetcher #843

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

qinglin89
Copy link
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