Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat): Combine common Transmitter into FunctionsContractTransmitter #12473

Merged
merged 5 commits into from
Apr 1, 2024

Conversation

justinkaseman
Copy link
Contributor

No description provided.

Copy link
Contributor

I see that you haven't updated any README files. Would it make sense to do so?

@@ -71,11 +71,18 @@ func (t *transmitter) CreateEthTransaction(ctx context.Context, toAddress common
return errors.Wrap(err, "skipped OCR transmission, error getting round-robin address")
}

var gasLimit uint64
if txMeta != nil && txMeta.GasLimit != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who sets this field "txMeta.GasLimit"?
Will it be added in a later PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly. The place where Functions would use this is here:

return errors.Wrap(oc.transmitter.CreateEthTransaction(ctx, destinationContract, payload, txMeta), "failed to send Eth transaction")

@justinkaseman justinkaseman requested a review from a team March 19, 2024 01:31
@justinkaseman justinkaseman changed the title (feat): Add "GasLimit" field to TxMgrMeta for within transaction overrides to the node's configured TxMgr gas limit (feat): Add copy of common transmitter: FunctionsTransmitter Mar 20, 2024
@justinkaseman justinkaseman removed the request for review from amit-momin March 20, 2024 03:27
@justinkaseman justinkaseman changed the title (feat): Add copy of common transmitter: FunctionsTransmitter (feat): Combine common Transmitter into FunctionsContractTransmitter Mar 20, 2024
@justinkaseman justinkaseman marked this pull request as ready for review March 20, 2024 03:45
@justinkaseman justinkaseman requested a review from a team as a code owner March 20, 2024 03:45
return oc.effectiveTransmitterAddress
}

func (oc *contractTransmitter) fromAddress() common.Address {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need a helper if it's used only once

contractReader contractReader
lp logpoller.LogPoller
lggr logger.Logger
reportToEvmTxMeta ReportToEthMetadata
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get rid of this, it's always set to nil (= no-op). Also remove reportToEvmTxMetaNoop function.

}, nil
}

func (oc *contractTransmitter) createEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think txMeta is always nil so we could remove it from params.

agparadiso
agparadiso previously approved these changes Mar 28, 2024
transmittedEventSig: transmitted.ID,
lp: lp,
contractReader: caller,
lggr: lggr.Named("OCRContractTransmitter"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it help when debugging if the lggr was named: OCRFunctionsContractTransmitter?

@justinkaseman justinkaseman added this pull request to the merge queue Apr 1, 2024
Merged via the queue into develop with commit f1d1f24 Apr 1, 2024
102 checks passed
@justinkaseman justinkaseman deleted the FUN-944 branch April 1, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants