core: check txn length when building a transaction set#17178
core: check txn length when building a transaction set#17178jmank88 wants to merge 1 commit intoethereum:masterfrom jmank88:patch-1
Conversation
|
How did you get the crash in the first place? Empty slices should most definitely not end up in that map. |
|
Nothing unusual - just sending a regular transaction on a private clique network. I have yet to pinpoint where/why the tx is being discarded. We patched this on a fork back in April, but it was only occasional and we assumed that we had introduced the problem with a previous change. However, this is now happening consistently for us with the latest geth. |
|
Any chance of providing a repro script for us? I'd be really curious what goes wrong. |
|
Dodging the panic helps, but we're still blocked by the transaction being dropped, so I'll track it down one way or another. |
|
I traced it to So there are a few potential problems here:
|
|
Oh, good catch, they should most definitely not default to 0. That would explain why the weird behavior happens. |
|
PR for |
|
Has this problem been solved? I also have this problem. @jmank88 |
when acc is not equal to from, |
|
Closing this in favor of #17210, please check the review comments and fix. @sunanxiang That seems to be an unrelated but interesting problem. Could you describe how you managed to hit this issue and how I could reproduce it? Please open a new issue for it. |
This PR proposes a length check to prevent an
index out of rangepanic when buildingNewTransactionsByPriceAndNonce. Perhaps empty slice values are actually 'bad data' which shouldn't have been in the input map in the first place, but this check is cheap.