Skip to content

Commit a525f12

Browse files
fix (aggregator): clone tx opts to avoid increasing gas limit every tx (#314)
Co-authored-by: Mauro Toscano <[email protected]>
1 parent 79b4f8c commit a525f12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/chainio/avs_writer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ func (w *AvsWriter) SendTask(context context.Context, batchMerkleRoot [32]byte,
8686
}
8787

8888
func (w *AvsWriter) SendAggregatedResponse(ctx context.Context, batchMerkleRoot [32]byte, nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature) (*gethtypes.Receipt, error) {
89-
txOpts := w.Signer.GetTxOpts()
89+
txOpts := *w.Signer.GetTxOpts()
9090
txOpts.NoSend = true // simulate the transaction
91-
tx, err := w.AvsContractBindings.ServiceManager.RespondToTask(txOpts, batchMerkleRoot, nonSignerStakesAndSignature)
91+
tx, err := w.AvsContractBindings.ServiceManager.RespondToTask(&txOpts, batchMerkleRoot, nonSignerStakesAndSignature)
9292
if err != nil {
9393
w.logger.Error("Error submitting SubmitTaskResponse tx while calling respondToTask", "err", err)
9494
return nil, err
@@ -97,7 +97,7 @@ func (w *AvsWriter) SendAggregatedResponse(ctx context.Context, batchMerkleRoot
9797
// Send the transaction
9898
txOpts.NoSend = false
9999
txOpts.GasLimit = tx.Gas() * 110 / 100 // Add 10% to the gas limit
100-
tx, err = w.AvsContractBindings.ServiceManager.RespondToTask(txOpts, batchMerkleRoot, nonSignerStakesAndSignature)
100+
tx, err = w.AvsContractBindings.ServiceManager.RespondToTask(&txOpts, batchMerkleRoot, nonSignerStakesAndSignature)
101101
if err != nil {
102102
w.logger.Error("Error submitting SubmitTaskResponse tx while calling respondToTask", "err", err)
103103
return nil, err

0 commit comments

Comments
 (0)