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

Add metadata exchange to trigger and handler #15043

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

DavidOrchard
Copy link
Contributor

@DavidOrchard DavidOrchard commented Oct 31, 2024

Metadata exchange from handlers to gateways.

TODOs before merge:

  • trigger send to gateway tests. There's a first test but it's failing in time advancement in a way that I don't understand. Error message is in a comment.
  • handler update workflow consensus on a timer once the above is working in trigger.
  • prune expired node configs
  • handler has expired config so no change in consensus.

@DavidOrchard DavidOrchard requested review from a team as code owners October 31, 2024 02:30
@DavidOrchard DavidOrchard requested a review from jmank88 October 31, 2024 02:30
@DavidOrchard DavidOrchard force-pushed the feature/CAPPL-81-metadata-exchange-3 branch 8 times, most recently from f2abb56 to 5117aae Compare October 31, 2024 23:06
@DavidOrchard DavidOrchard force-pushed the feature/CAPPL-81-metadata-exchange-3 branch from 5117aae to e966e1e Compare November 11, 2024 19:56
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Nov 11, 2024
@DavidOrchard DavidOrchard force-pushed the feature/CAPPL-81-metadata-exchange-3 branch from e966e1e to b9cdec8 Compare November 14, 2024 21:40
@smartcontractkit smartcontractkit deleted a comment from github-actions bot Nov 14, 2024
Comment on lines +209 to +210
// TODO: Should we return here instead?
payloadJSON, _ = json.Marshal(ghcapabilities.TriggerResponsePayload{Status: "ERROR", ErrorMessage: fmt.Sprintf("error %s marshalling payload", err.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 we can log the error

}
err = h.connector.SignAndSendToGateway(ctx, gatewayIDStr, &body)
if err != nil {
h.lggr.Errorw("error sending message", "gateway", gatewayIDStr, "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

can return errors.Wrap(err, "error sending message") here and it will get logged in loop()

count uint
}

func (h *handler) updateTriggerConsensus() {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this function is not called in this PR. how do we determine when we should trigger consensus?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I forgot to put a TODO that once i have a timer with tests working (from the trigger), the handler needs to do something similar. I've updated the PR description.

@@ -38,6 +43,7 @@ type webapiTrigger struct {
ch chan<- capabilities.TriggerResponse
config webapicap.TriggerConfig
rateLimiter *common.RateLimiter
rawConfig *values.Map
Copy link
Contributor

@jinhoonbang jinhoonbang Nov 15, 2024

Choose a reason for hiding this comment

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

what data is in this rawConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the config that is in the triggers config, ie allowedSenders, allowedTopics, RateLimiter.. I wanted to make the metadata exchange "future-proof" so that changes to the config don't require rewriting the exchange logic.

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.

2 participants