Skip to content

Commit eea7b24

Browse files
committed
Don't broadcast without SOPs
1 parent 360144c commit eea7b24

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

pkg/txm/clientwrappers/dualbroadcast/meta_client.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
const (
29-
timeout = time.Second * 300
29+
timeout = time.Second * 5
3030
metaABI = `[
3131
{
3232
"type": "function",
@@ -245,7 +245,7 @@ func (a *MetaClient) SendRequest(parentCtx context.Context, tx *types.Transactio
245245
ChainID: &cid,
246246
ToAddress: tx.ToAddress,
247247
Payload: tx.Data,
248-
ER: false,
248+
ER: true,
249249
FromAddress: tx.FromAddress,
250250
MaxFeePerGas: &fee,
251251
}
@@ -298,6 +298,9 @@ func (a *MetaClient) SendRequest(parentCtx context.Context, tx *types.Transactio
298298
}
299299

300300
if response.Error.ErrorMessage != "" {
301+
if strings.Contains(response.Error.ErrorMessage, "no solver operations received") {
302+
return nil, nil
303+
}
301304
return nil, errors.New(response.Error.ErrorMessage)
302305
}
303306

@@ -401,11 +404,16 @@ func VerifyMetadata(txData []byte, fromAddress common.Address, result Metacallda
401404
}
402405

403406
// SOP
407+
atLeastOne := false
404408
for _, sop := range result.SOPs {
405409
if sop.To != to || sop.Control != dApp {
406410
// Exit early
407411
return nil, fmt.Errorf("incorrect SOP: sop.To: %v, sop.Control: %v, to: %v, dApp: %v", sop.To, sop.Control, to, dApp)
408412
}
413+
atLeastOne = true
414+
}
415+
if !atLeastOne {
416+
return nil, nil
409417
}
410418

411419
// UOP

0 commit comments

Comments
 (0)