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 8, 2023
1 parent c75563d commit d1482d2
Show file tree
Hide file tree
Showing 28 changed files with 155 additions and 1,324 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
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 @@ -3,7 +3,7 @@ members = [
"advance-runner",
"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 @@ -69,7 +69,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 messages *Inputs* via the **Broker** to be processed elsewhere.

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 @@ -84,7 +84,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 @@ -94,7 +94,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 d1482d2

Please sign in to comment.