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

[Functions] Heartbeat request support in Gateway handlers #11345

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

bolekk
Copy link
Contributor

@bolekk bolekk commented Nov 20, 2023

  1. Functions Handler
  • add a new method "heartbeat"
  • add a configurable list of allowed heartbeat senders
  • collect results from first F+1 nodes and send back in raw form
  1. Connector Handler
  • asynchronously forward requests to Listener and cache results
  • run a loop to collect OCR reports from Offchain Transmitter
  1. Listener
  • add Timestamp field and validate it

Copy link
Contributor

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

@bolekk bolekk force-pushed the feature/FUN-1076-heartbeats-gateway branch 2 times, most recently from 893696c to 2ac4bfc Compare November 20, 2023 19:57
@bolekk bolekk marked this pull request as ready for review November 20, 2023 20:20
@bolekk bolekk requested a review from a team as a code owner November 20, 2023 20:20
return
}

internalId := InternalId(fromAddr.Bytes(), request.RequestId)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I get this right, the only purpose of this "internal ID" is to make it the key to map.
However, you could simply make the key to be a value struct,

type heartbeatRequestKey struct {
  sender []byte
  requestId RequestID
}

and then this struct can be directly used by map which will does hashing internally.
This would look much clearer to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still need to have a single ID for request processing in the core node.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't it be just RequestID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because in the offchain scenario, RequestID is chosen by a user so we can't guarantee global uniqueness.

return
}

internalId := InternalId(fromAddr.Bytes(), request.RequestId)
Copy link
Contributor

@justinkaseman justinkaseman Nov 21, 2023

Choose a reason for hiding this comment

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

Is the idea that request.RequestId will be generated in the same way that the contracts generate request ids?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not at all. Request ID in the offchain heartbeat request is generated by the user. To guarantee global uniqueness, we need to combine it with user address.

@bolekk bolekk force-pushed the feature/FUN-1076-heartbeats-gateway branch from 2ac4bfc to 25504df Compare November 21, 2023 22:32
1. Functions Handler
  - add a new method "heartbeat"
  - add a configurable list of allowed heartbeat senders
  - collect results from first F+1 nodes and send back in raw form
2. Connector Handler
  - asynchronously forward requests to Listener and cache results
  - run a loop to collect OCR reports from Offchain Transmitter
3. Listener
  - add Timestampi field and validate it
@bolekk bolekk force-pushed the feature/FUN-1076-heartbeats-gateway branch from 25504df to 601579d Compare November 21, 2023 22:37
@cl-sonarqube-production
Copy link

@justinkaseman justinkaseman self-requested a review November 27, 2023 20:03
@bolekk bolekk added this pull request to the merge queue Nov 27, 2023
Merged via the queue into develop with commit 54563c0 Nov 27, 2023
88 checks passed
@bolekk bolekk deleted the feature/FUN-1076-heartbeats-gateway branch November 27, 2023 22:03
fbac pushed a commit that referenced this pull request Dec 14, 2023
1. Functions Handler
  - add a new method "heartbeat"
  - add a configurable list of allowed heartbeat senders
  - collect results from first F+1 nodes and send back in raw form
2. Connector Handler
  - asynchronously forward requests to Listener and cache results
  - run a loop to collect OCR reports from Offchain Transmitter
3. Listener
  - add Timestampi field and validate it
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