Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Copy orchestrator implementation from Celestia-app #50

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Dec 1, 2022

Overview

Closes #11

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@rach-id rach-id added the orchestrator orchestrator related label Dec 1, 2022
@rach-id rach-id requested a review from evan-forbes December 1, 2022 12:20
@rach-id rach-id self-assigned this Dec 1, 2022
@rach-id rach-id requested a review from rahulghangas January 2, 2023 12:57
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

left a few minor questions, but otherwise LGTM as a good starting point

Comment on lines +28 to +36
type I interface {
Start(ctx context.Context)
StartNewEventsListener(ctx context.Context, queue chan<- uint64, signalChan <-chan struct{}) error
EnqueueMissingEvents(ctx context.Context, queue chan<- uint64, signalChan <-chan struct{}) error
ProcessNonces(ctx context.Context, noncesQueue <-chan uint64, signalChan chan<- struct{}) error
Process(ctx context.Context, nonce uint64) error
ProcessValsetEvent(ctx context.Context, valset celestiatypes.Valset) error
ProcessDataCommitmentEvent(ctx context.Context, dc celestiatypes.DataCommitment) error
}
Copy link
Member

Choose a reason for hiding this comment

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

naming an interface I feels very non-standard lol, but I think I see where this is coming from given that everything is named orchestrator.

While we certainly don't have to handle in this PR, I think re-evaluating this, and other, interfaces would prove valuable . IIRC, we originally added the interface to make some unit tests easier, but then changes the design. if that's the case, then we should think about creating a different mock that can do something very similar. In general, I'm typically skeptical of large interfaces, especially when we only plan on supporting a single implementation.

speaking of which, do we also not have any unit tests for these? if not, mind creating an issue or handling here? thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

then we should think about creating a different mock that can do something very similar

Do you have some suggestion or an example of using different mocks without having to create a general interface? Would love to take a look at it and improve on this

do we also not have any unit tests for these?

Good catch #51

Copy link
Member

@evan-forbes evan-forbes Jan 5, 2023

Choose a reason for hiding this comment

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

well, we could use generated mocks, but I'm not the biggest fan of those either, or mocking when not absolutely necessary. One thing might be possible is to only mock the app queries. We could also use a testnode. Those can have fast 200ms blocktimes or so, and only take a few seconds to run simple tests

Copy link
Member Author

Choose a reason for hiding this comment

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

We could also use a testnode

I like this, created issue: #55

So, we just leave the current interface as it is for now? until we have a testnode?

@rach-id rach-id merged commit df9159c into celestiaorg:main Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
orchestrator orchestrator related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy the orchestrator signing code
2 participants