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: create requests #42

Merged
merged 7 commits into from
Sep 16, 2024
Merged

feat: create requests #42

merged 7 commits into from
Sep 16, 2024

Conversation

0xyaco
Copy link
Collaborator

@0xyaco 0xyaco commented Sep 16, 2024

🤖 Linear

Closes GRT-171

Description

  • Epoch type created
  • Create requests for current epoch
  • Add a new condition for actor termination based on their epoch being concluded

Copy link

linear bot commented Sep 16, 2024

@0xyaco 0xyaco changed the title Feat/spawn agents feat: create requests Sep 16, 2024
0xnigir1
0xnigir1 previously approved these changes Sep 16, 2024
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.

lgtm 💯

Comment on lines 10 to 14
export type Epoch = {
epoch: bigint;
epochFirstBlockNumber: bigint;
epochStartTimestamp: Timestamp;
};
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
export type Epoch = {
epoch: bigint;
epochFirstBlockNumber: bigint;
epochStartTimestamp: Timestamp;
};
export type Epoch = {
count: bigint;
firstBlockNumber: bigint;
startTimestamp: Timestamp;
};

What do you think if we do it this way. I noticed some places that u did Epoch["epoch"] and i think Epoch["count"] or Epoch["number"] might be more descriptive and cleaner.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ended up using number, on the basis of having epoch.number and also block.number. count feels a little bit more like there are elements inside the Epoch

jahabeebs
jahabeebs previously approved these changes Sep 16, 2024
Copy link
Collaborator

@jahabeebs jahabeebs left a comment

Choose a reason for hiding this comment

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

Looks good, just a types comment

@@ -53,6 +54,8 @@ const EBO_EVENT_COMPARATOR = (e1: EboEvent<EboEventName>, e2: EboEvent<EboEventN
return e1.logIndex - e2.logIndex;
};

export type ActorRequest = { id: RequestId; epoch: bigint; chainId: Caip2ChainId };
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if you meant to put this in types file?

import { RequestId } from "../types/prophet.js";
import { EboActor } from "./eboActor.js";
import { RequestId } from "../types/index.js";
import { ActorRequest, EboActor } from "./eboActor.js";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah maybe the types should be moved and imported from index.js since we're using them in a couple files

@0xyaco 0xyaco dismissed stale reviews from jahabeebs and 0xnigir1 via 2aade37 September 16, 2024 16:49
@0xyaco 0xyaco merged commit dcd5d89 into dev Sep 16, 2024
5 checks passed
@0xyaco 0xyaco deleted the feat/spawn-agents branch September 16, 2024 17:03
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