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: handle requests with no responses after deadline #91

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

Conversation

jahabeebs
Copy link
Collaborator

🤖 Linear

Closes GRT-236

Description

  • Adds new finalizeRequestWithNoResponse method to eboActor
  • Did some test cleanup to update some types, shorten imports, and add a type guard for err.message

@jahabeebs jahabeebs self-assigned this Nov 16, 2024
Copy link

linear bot commented Nov 16, 2024

this.logger.info(`Finalizing request ${request.id} with no response`);

const response: Response["prophetData"] = {
requestId: "0x0000000000000000000000000000000000000000" as RequestId, // Can be any request ID
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
requestId: "0x0000000000000000000000000000000000000000" as RequestId, // Can be any request ID
requestId: "0x0000000000000000000000000000000000000000" as RequestId, // Must be 0x0 address

return;
} else {
// TODO: check for responseModuleData.deadline, if no answer has been accepted after the deadline
// notify and (TBD) finalize with no response
// Check if the response deadline has passed with no accepted responses
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we might have an edge case where there are no finalizable responses (yet), there are still some open disputes and one of them could end up with Lost status, thus, causing the disputed response to be the accepted one.

We should check for active disputes, prior finalizing with no request. Something like this probably?

Suggested change
// Check if the response deadline has passed with no accepted responses
const activeDisputes = this.getActiveDisputes();
if (activeDisputes.length === 0) return;
// Check if the response deadline has passed with no accepted responses

@@ -972,95 +962,5 @@ describe("EboProcessor", () => {
expect(createRequestSpy).toHaveBeenCalledTimes(1);
expect(createRequestSpy).toHaveBeenCalledWith(currentEpoch.number, "eip155:42161");
});

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to confirm that I'm not missing anything: these are the duplicated tests, right?

Copy link
Collaborator

@0xnigir1 0xnigir1 left a comment

Choose a reason for hiding this comment

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

good to go after addressing Yaco's comments 👍

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.

3 participants