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

Ensures txpool recovers sender for txes #97

Merged
merged 3 commits into from
May 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions eth/stagedsync/stage_mining_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@ func getNextTransactions(

var sender libcommon.Address
copy(sender[:], txSlots.Senders.At(i))
if sender == (libcommon.Address{}) {
v, r, s := transaction.RawSignatureValues()
signer := types.MakeSigner(&cfg.chainConfig, header.Number.Uint64(), header.Time)
address, err := transaction.Sender(*signer)
if err != nil {
logger.Error("Recovered sender from txpool as empty but could not recover sender", "txHash", transaction.Hash(), "txType", transaction.Type(), "nonce", transaction.GetNonce(), "v", v, "r", r, "s", s, "err", err)
continue
}
logger.Warn("Recovered sender from txpool as empty", "txHash", transaction.Hash(), "txType", transaction.Type(), "nonce", transaction.GetNonce(), "v", v, "r", r, "s", s, "address", address)
sender = address
}

// Check if tx nonce is too low
txs = append(txs, transaction)
Expand Down
Loading