diff --git a/packages/relayer/message/process_message.go b/packages/relayer/message/process_message.go index 00ef8499ca..6f83cc669d 100644 --- a/packages/relayer/message/process_message.go +++ b/packages/relayer/message/process_message.go @@ -128,20 +128,18 @@ func (p *Processor) sendProcessMessageCall( return nil, errors.New("p.getLatestNonce") } - // profitable, gas, err := p.isProfitable(ctx, event.Message, proof) - // if err != nil { - // return nil, errors.Wrap(err, "p.isProfitable") - // } - - // if bool(p.profitableOnly) && !profitable { - // return nil, relayer.ErrUnprofitable - // } - - // if gas != 0 { - // auth.GasLimit = gas - // log.Infof("gasLimit: %v", gas) - // } - auth.GasLimit = 1200000 + profitable, gas, err := p.isProfitable(ctx, event.Message, proof) + if err != nil { + return nil, errors.Wrap(err, "p.isProfitable") + } + + if bool(p.profitableOnly) && !profitable { + return nil, relayer.ErrUnprofitable + } + + if gas != 0 { + auth.GasLimit = gas + } // process the message on the destination bridge. tx, err := p.destBridge.ProcessMessage(auth, event.Message, proof)