Commit 8b8269a
committed
Per default refetch the chain tip at most every 20 seconds
At the current state, every access to protocol params causes at least
one chain tip fetch. Due to the potential delay of this request, often
another protocol params fetch is triggered as well.
This significantly (and mostly unnecessarily) slows down transaction building.
This fix caches the chain tip for a default of 20 seconds (the average
slot time), making sure that subsequent calls to _is_chain_tip_updated
return without any delay, drastically speeding up tx building.1 parent 6ec8623 commit 8b8269a
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | | - | |
| 123 | + | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
| |||
0 commit comments