@@ -180,6 +180,7 @@ func (r *Relayer) SendUserOperation() modules.BatchHandlerFunc {
180
180
181
181
// Estimate gas for handleOps() and drop all userOps that cause unexpected reverts.
182
182
var gas uint64
183
+ estRev := []string {}
183
184
for len (ctx .Batch ) > 0 {
184
185
est , revert , err := transaction .EstimateHandleOpsGas (
185
186
r .eoa ,
@@ -194,6 +195,7 @@ func (r *Relayer) SendUserOperation() modules.BatchHandlerFunc {
194
195
return err
195
196
} else if revert != nil {
196
197
ctx .MarkOpIndexForRemoval (revert .OpIndex )
198
+ estRev = append (estRev , revert .Reason )
197
199
198
200
hashes := getUserOpHashesFromOps (ctx .EntryPoint , ctx .ChainID , ctx .PendingRemoval ... )
199
201
if err := removeUserOpHashEntries (txn , hashes ... ); err != nil {
@@ -204,8 +206,10 @@ func (r *Relayer) SendUserOperation() modules.BatchHandlerFunc {
204
206
break
205
207
}
206
208
}
209
+ ctx .Data ["relayer_est_revert_reasons" ] = estRev
207
210
208
211
// Call handleOps() with gas estimate and drop all userOps that cause unexpected reverts.
212
+ txnRev := []string {}
209
213
for len (ctx .Batch ) > 0 {
210
214
t , revert , err := transaction .HandleOps (
211
215
r .eoa ,
@@ -221,6 +225,7 @@ func (r *Relayer) SendUserOperation() modules.BatchHandlerFunc {
221
225
return err
222
226
} else if revert != nil {
223
227
ctx .MarkOpIndexForRemoval (revert .OpIndex )
228
+ txnRev = append (txnRev , revert .Reason )
224
229
225
230
hashes := getUserOpHashesFromOps (ctx .EntryPoint , ctx .ChainID , ctx .PendingRemoval ... )
226
231
if err := removeUserOpHashEntries (txn , hashes ... ); err != nil {
@@ -231,6 +236,7 @@ func (r *Relayer) SendUserOperation() modules.BatchHandlerFunc {
231
236
break
232
237
}
233
238
}
239
+ ctx .Data ["relayer_txn_revert_reasons" ] = txnRev
234
240
235
241
hashes := getUserOpHashesFromOps (ctx .EntryPoint , ctx .ChainID , ctx .Batch ... )
236
242
del = append ([]string {}, hashes ... )
0 commit comments