Commit ddb94fd
committed
Merge bitcoin#35289: fuzz: Fix timeout in
004a7e3 fuzz: Fix txorphan timeout by limiting block weight (marcofleon)
Pull request description:
The `EraseForBlock` branch in the `txorphan` harness could produce a block with 1000 transactions in it, each with potentially up to 200,000 inputs, resulting in way too many [map lookups](https://github.com/bitcoin/bitcoin/blob/3cab711d69572431af78b0071fb721496f0241d7/src/node/txorphanage.cpp#L625). This was producing inputs that were taking 2 seconds or longer per iteration, which is too long.
Fix by only adding transactions to the block up to the block weight limit. This matches production behavior, as `EraseForBlock` is only called on a newly [connected block](https://github.com/bitcoin/bitcoin/blob/3cab711d69572431af78b0071fb721496f0241d7/src/net_processing.cpp#L2090).
ACKs for top commit:
maflcko:
lgtm ACK 004a7e3
instagibbs:
ACK 004a7e3
sedited:
ACK 004a7e3
Tree-SHA512: 465504402358e1bed629104b21e05301139f1590884de21e77d566a45e422eef6d4380c5714692f33f5398e4e299b8c9f84b82f58c56a98e410c5c841184aee5txorphan
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| |||
0 commit comments