Skip to content

Commit

Permalink
fix(relayer): estimate gas, now that gas estimation works again (#13176)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Feb 17, 2023
1 parent 2943e3e commit b7ae677
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions packages/relayer/message/process_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b7ae677

Please sign in to comment.