Commit 1a81a3a
committed
Make fuzz targets deterministic
Use deterministic time and hash table ordering when building with
cfg(fuzzing) to ensure fuzz test cases reproduce consistently.
In channelmanager, use highest_seen_timestamp instead of
SystemTime::now() under cfg(fuzzing) for duration_since_epoch and
stale payment removal.
In offers/flow, apply the same cfg(fuzzing) treatment to
duration_since_epoch so offers-related code paths also use
highest_seen_timestamp.
In channel, disable hold time tracking under cfg(fuzzing) by
returning None from duration_since_epoch, consistent with the
no-std behavior.
In hash_tables, extend the existing test deterministic hasher to
also apply under cfg(fuzzing), always using zeroed SipHash keys.
AI tools were used in preparing this commit.1 parent 450c03a commit 1a81a3a
4 files changed
Lines changed: 16 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16717 | 16717 | | |
16718 | 16718 | | |
16719 | 16719 | | |
16720 | | - | |
| 16720 | + | |
16721 | 16721 | | |
16722 | 16722 | | |
16723 | | - | |
| 16723 | + | |
16724 | 16724 | | |
16725 | 16725 | | |
16726 | 16726 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8936 | 8936 | | |
8937 | 8937 | | |
8938 | 8938 | | |
8939 | | - | |
| 8939 | + | |
8940 | 8940 | | |
8941 | 8941 | | |
8942 | 8942 | | |
8943 | | - | |
| 8943 | + | |
8944 | 8944 | | |
8945 | 8945 | | |
8946 | 8946 | | |
| |||
14129 | 14129 | | |
14130 | 14130 | | |
14131 | 14131 | | |
14132 | | - | |
| 14132 | + | |
14133 | 14133 | | |
14134 | 14134 | | |
14135 | 14135 | | |
| |||
14139 | 14139 | | |
14140 | 14140 | | |
14141 | 14141 | | |
14142 | | - | |
| 14142 | + | |
14143 | 14143 | | |
14144 | 14144 | | |
14145 | 14145 | | |
| |||
14996 | 14996 | | |
14997 | 14997 | | |
14998 | 14998 | | |
14999 | | - | |
| 14999 | + | |
15000 | 15000 | | |
15001 | | - | |
| 15001 | + | |
15002 | 15002 | | |
15003 | 15003 | | |
15004 | 15004 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
0 commit comments