Commit 2518321
Autostaker uses fixed gas limit and nonce on stake/unstake, wait bugfix (#3237)
- Set a fixed gas limit in autostaker when doing stake/unstake
transactions, because `estimateGas` on `stake` transactions will
otherwise fail (with not enough balance) until `unstake` transactions
have been mined.
- Control nonce manually to prevent overlaps
- Fix wait bug
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Autostaker switches stake/unstake to fixed gas limit with explicit
nonces and longer timeouts, while SDK exposes TransactionOpts and
updates staking helpers to accept tx options with improved receipt
handling/logging.
>
> - **Node (`autostaker`)**:
> - Use fixed `gasLimit` (`500000n`) and explicit `nonce` per action;
increase `TRANSACTION_TIMEOUT` to `180s`.
> - Change action submission to return `{ txResponse, txReceiptPromise
}`; broadcast all, then await receipts with `Promise.allSettled` and
summary logging.
> - Pass `TransactionOpts` to stake/unstake; remove gas estimation/bump
logic.
> - **SDK**:
> - Add and export `TransactionOpts` type; update
`_operatorContractUtils.stake/unstake` to accept tx opts and forward to
contract calls.
> - Remove gas estimation/bump; add nonce-aware logging and error
handling around `tx.wait`.
> - **Changelog**:
> - Note autostaker fixes and optimizations.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3fe01a8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Teo Gebhard <[email protected]>1 parent f2d1eca commit 2518321
File tree
4 files changed
+82
-49
lines changed- packages
- node/src/plugins/autostaker
- sdk/src
- contracts
4 files changed
+82
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 42 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
76 | | - | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | | - | |
| 146 | + | |
142 | 147 | | |
143 | 148 | | |
144 | 149 | | |
145 | | - | |
| 150 | + | |
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
149 | | - | |
150 | | - | |
151 | | - | |
| 154 | + | |
152 | 155 | | |
153 | | - | |
| 156 | + | |
154 | 157 | | |
155 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
160 | | - | |
| 165 | + | |
161 | 166 | | |
162 | | - | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
221 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
222 | 232 | | |
223 | | - | |
| 233 | + | |
224 | 234 | | |
225 | | - | |
226 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
227 | 243 | | |
228 | 244 | | |
| 245 | + | |
| 246 | + | |
229 | 247 | | |
230 | 248 | | |
231 | | - | |
232 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
233 | 256 | | |
234 | 257 | | |
235 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
| |||
170 | 181 | | |
171 | 182 | | |
172 | 183 | | |
173 | | - | |
| 184 | + | |
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
197 | 208 | | |
198 | | - | |
| 209 | + | |
199 | 210 | | |
200 | 211 | | |
201 | 212 | | |
| |||
205 | 216 | | |
206 | 217 | | |
207 | 218 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 219 | + | |
| 220 | + | |
215 | 221 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
219 | 231 | | |
220 | 232 | | |
221 | 233 | | |
| |||
252 | 264 | | |
253 | 265 | | |
254 | 266 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | | - | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
0 commit comments