Skip to content

Commit

Permalink
refactor(offchain): remove claims from dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger committed Aug 24, 2023
1 parent 7fee56a commit bdd2837
Show file tree
Hide file tree
Showing 33 changed files with 169 additions and 1,338 deletions.
2 changes: 1 addition & 1 deletion .github/.scopes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
advance-runner [For every change inside the offchain/advance-runner service]
host-runner [For every change inside the offchain/host-runner service]
dispatcher [For every change inside the offchain/dispatcher service]
input-reader [For every change inside the offchain/eth-input-reader service]
graphql-server [For every change inside the offchain/graphql-server service]
indexer [For every change inside the offchain/indexer service]
inspect-server [For every change inside the offchain/inspect-server service]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ jobs:
org-name: ${{ github.repository_owner }}
token: ${{ secrets.GHCR_TOKEN }}

dispatcher:
eth-input-reader:
needs: build_docker
uses: ./.github/workflows/docker.yml
with:
target: dispatcher
image-name: rollups-dispatcher
target: eth-input-reader
image-name: rollups-eth-input-reader
secrets: inherit

state_server:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rm-closed-pr-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- rollups-advance-runner
- rollups-cli
- rollups-deployments
- rollups-dispatcher
- rollups-eth-input-reader
- rollups-graphql-server
- rollups-hardhat
- rollups-host-runner
Expand Down
6 changes: 3 additions & 3 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ group "default" {
targets = [
"advance-runner",
"cli",
"dispatcher",
"eth-input-reader",
"graphql-server",
"hardhat",
"host-runner",
Expand All @@ -30,10 +30,10 @@ target "state-server" {
context = "."
}

target "dispatcher" {
target "eth-input-reader" {
inherits = ["docker-metadata-action", "docker-platforms"]
dockerfile = "offchain/Dockerfile"
target = "dispatcher"
target = "eth-input-reader"
context = "."
}

Expand Down
4 changes: 2 additions & 2 deletions docker-bake.override.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ target "state-server" {
tags = ["${DOCKER_ORGANIZATION}/rollups-state-server:${TAG}"]
}

target "dispatcher" {
tags = ["${DOCKER_ORGANIZATION}/rollups-dispatcher:${TAG}"]
target "eth-input-reader" {
tags = ["${DOCKER_ORGANIZATION}/rollups-eth-input-reader:${TAG}"]
}

target "indexer" {
Expand Down
2 changes: 1 addition & 1 deletion grpc-interfaces
78 changes: 39 additions & 39 deletions offchain/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion offchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [
"authority-claimer",
"contracts",
"data",
"dispatcher",
"eth-input-reader",
"graphql-server",
"grpc-interfaces",
"host-runner",
Expand Down
6 changes: 3 additions & 3 deletions offchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ COPY --from=builder /usr/src/app/offchain/target/release/cartesi-rollups-indexer
USER cartesi
ENTRYPOINT ["/opt/cartesi/bin/cartesi-rollups-indexer"]

FROM runtime AS dispatcher
FROM runtime AS eth-input-reader
RUN <<EOF
apt-get update
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends ca-certificates
rm -rf /var/lib/apt/lists/*
EOF
COPY --from=builder /usr/src/app/offchain/target/release/cartesi-rollups-dispatcher /opt/cartesi/bin/cartesi-rollups-dispatcher
COPY --from=builder /usr/src/app/offchain/target/release/cartesi-rollups-eth-input-reader /opt/cartesi/bin/cartesi-rollups-eth-input-reader
COPY onchain/rollups/export/abi /opt/cartesi/share/deployments/
USER cartesi
ENTRYPOINT ["/opt/cartesi/bin/cartesi-rollups-dispatcher"]
ENTRYPOINT ["/opt/cartesi/bin/cartesi-rollups-eth-input-reader"]

FROM runtime AS advance_runner
RUN <<EOF
Expand Down
6 changes: 3 additions & 3 deletions offchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For details specific to the Broker and the available event streams, refer to the

The [**State-fold Server**](./state-server/README.md) is the component responsible for tracking blockchain state changes and deriving *Inputs* from them to be processed.

The [**Dispatcher**](./dispatcher/README.md) is the component that messages *Inputs* via the **Broker** to be processed elsewhere and submits *Claims* to the blockchain.
The [**Ethereum Input Reader**](./eth-input-reader/README.md) is the component that reads *Inputs* from the blockchain and sends them to the **Broker**.

The [**Advance Runner**](./advance-runner/README.md) is the one responsible for relaying *Inputs* to the **Server Manager** to be processed by the underlying DApp running in the embedded **Cartesi Machine**.
The **Advance Runner** obtains the resulting **Outputs** and **Claims** from the **Server Manager** and adds them to the **Broker**.
Expand All @@ -82,7 +82,7 @@ The Cartesi Node may act as a *User* (aka *Reader*) or *Validator* Node, hence p

### Reader Flow

In the Reader Flow, any *Input* read from the blockchain by the **State-fold Server** is received by the **Dispatcher** and relayed to the **Broker** through an input-specific stream.
In the Reader Flow, any *Input* read from the blockchain by the **State-fold Server** is received by the **Ethereum Input Reader** and relayed to the **Broker** through an input-specific stream.
The *Input* is eventually consumed by the **Advance Runner** and used to advance the state of the **Server Manager**, thus generating an *Advance* request to be processed by the underlying DApp.

After finishing the processing, the DApp may generate a number of *Outputs*, which are eventually retrieved by the **Advance Runner** and fed back into the **Broker** through an output-specific stream.
Expand All @@ -92,7 +92,7 @@ After finishing the processing, the DApp may generate a number of *Outputs*, whi
### Validator Flow

The Validator Flow may only be performed by *Validator* nodes.
It complements the Reader Flow by generating *Claims* at the end of *Epochs*, which are generated by the **Server Manager**, and sent to the **Broker** by the **Advance Runner** through a claims-specific stream to be eventually consumed by the **Dispatcher** for being submitted to the blockchain.
It complements the Reader Flow by generating *Claims* at the end of *Epochs*, which are generated by the **Server Manager**, and sent to the **Broker** by the **Advance Runner** through a claims-specific stream to be eventually consumed by the **Authority Claimer** for being submitted to the blockchain.

### Inspect Data Flow

Expand Down
102 changes: 0 additions & 102 deletions offchain/dispatcher/src/auth.rs

This file was deleted.

Loading

0 comments on commit bdd2837

Please sign in to comment.