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(code/app): Introduce channel-based interface for building applications #603

Merged
merged 9 commits into from
Nov 28, 2024

Conversation

greg-szabo
Copy link
Member

@greg-szabo greg-szabo commented Nov 22, 2024

Closes: #620

Introduce a channel-based Host (or Connector) that allows building Malachite applications that interact with the consensus engine via a Tokio channel instead of the actor framework.


PR author checklist

@romac romac changed the title feat(app): app-channel feat(app): Introduce channel-based interface for building applications Nov 22, 2024
@romac romac changed the title feat(app): Introduce channel-based interface for building applications feat(code/app): Introduce channel-based interface for building applications Nov 22, 2024
@greg-szabo greg-szabo requested a review from romac November 24, 2024 11:44
Copy link
Member

@romac romac 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 couple nitpicks but otherwise looks great! 🚀

code/crates/app-channel/src/channel.rs Outdated Show resolved Hide resolved
code/crates/app-channel/src/actor.rs Outdated Show resolved Hide resolved
code/crates/app-channel/src/actor.rs Outdated Show resolved Hide resolved
Copy link
Member

@romac romac left a comment

Choose a reason for hiding this comment

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

Ah actually, I found a couple missing things to fix before merging

code/crates/app-channel/src/actor.rs Outdated Show resolved Hide resolved
code/crates/app-channel/src/actor.rs Outdated Show resolved Hide resolved
@greg-szabo
Copy link
Member Author

I've done the modifications. I have some concern with handling the HostMsg::Decided because right now the application can send a StartHeight message to consensus with an arbitrary height number - which I assume is going to break it.

@greg-szabo greg-szabo requested a review from romac November 28, 2024 01:30
@romac romac enabled auto-merge (squash) November 28, 2024 09:09
@romac
Copy link
Member

romac commented Nov 28, 2024

the application can send a StartHeight message to consensus with an arbitrary height number - which I assume is going to break it.

Consensus can handle non-consecutive heights just fine, though it would not make sense to re-run it at a lower height without some kind of reset protocol. We can revisit later, and perhaps change the API to only allow NextHeight but let's leave it as is for now.

@romac romac disabled auto-merge November 28, 2024 10:45
@romac romac merged commit 2de981b into main Nov 28, 2024
12 checks passed
@romac romac deleted the greg/app-channel branch November 28, 2024 10:46
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.

code: Introduce channel-based interface for building applications
2 participants