-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
263 additions
and
133 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,150 @@ | ||
@startuml | ||
component "HotShot Sequencer" as Seq | ||
package "Layer 2s" as L2 { | ||
component "Rollup 1" as L2_1 { | ||
component "API (e.g. JSON-RPC)" as L2_1_RPC | ||
component Executor as L2_1_Exec | ||
component Prover as L2_1_Prover | ||
component "State DB" as L2_1_State | ||
|
||
package "Espresso Sequencer Network" as Network #MistyRose { | ||
component "Other\nSequencer\nNodes" as Nodes | ||
package CDN { | ||
component Broker | ||
component Marshal | ||
database KeyDB | ||
} | ||
component "Rollup 2" as L2_2 | ||
component "Rollup N" as L2_N | ||
} | ||
package "Layer 1" as L1 { | ||
component "Sequencer Contract" as Seq_L1 | ||
package "Rollup Contracts" as L2_L1 { | ||
component "Rollup 1\nContract" as L2_1_L1 | ||
component "Rollup 2\nContract" as L2_2_L1 | ||
component "Rollup N\nContract" as L2_N_L1 | ||
|
||
'CDN Layout | ||
Broker -> KeyDB: state | ||
KeyDB -> Marshal: state | ||
|
||
component "Sequencer Node" as Seq #Bisque { | ||
database "Postgres" as DB | ||
package APIs #LightCyan { | ||
component "Submit" as Submit | ||
component "Hotshot\nEvents\nStream\n" as EventsStream | ||
component "Catchup" as Catchup | ||
component "Status" | ||
component "Query" as Query | ||
} | ||
package HotShot { | ||
component "Networking"{ | ||
component Libp2p | ||
component "CDN Client" | ||
} | ||
component "HotShot Events" as Events | ||
} | ||
|
||
package State as State { | ||
component "State Signer" as Signer | ||
component "ValidatedState" as Validated | ||
} | ||
} | ||
component "HotShot state\nprover service" as HSProver | ||
component "HotShot state\nrelay service" as Relay | ||
component "Builder" as Builder | ||
} | ||
|
||
Client -up-> L2_1_RPC : Transactions\nState queries | ||
note right of link | ||
1. Many clients submit transactions | ||
to each L2 simultaneously (for | ||
clarity only one is shown) | ||
' Network | ||
Nodes <-up- Catchup: "missing\nstate" " " | ||
Nodes <-> Libp2p: consensus\nmessages | ||
"CDN Client" <--> CDN: consensus\nmessages | ||
Nodes <--> CDN: consensus\nmessages | ||
note top of link | ||
4. HotShot consensus | ||
end note | ||
|
||
L2_1_RPC -> Seq : Transaction\nRollup 1 ID | ||
' HotShot state | ||
Signer --> Relay: state, signature | ||
note top of link | ||
2. L2s forward transactions to sequencer. | ||
6. HotShot proving | ||
end note | ||
Relay -> HSProver: state,\nsignature bundle | ||
|
||
Seq -down-> L2_1_Exec : Block | ||
Seq -down-> L2_2 : Block | ||
Seq -down-> L2_N : Block | ||
note right of link | ||
3. Sequencer produces blocks -- | ||
ordered lists of transactions. | ||
L2s receive blocks and execute | ||
transactions for their rollup. | ||
' Builder | ||
Builder --> HotShot: Espresso block | ||
note top of link | ||
3. Leader | ||
obtains | ||
Espresso | ||
block | ||
end note | ||
EventsStream -> Builder: transactions | ||
|
||
Seq -down-> Seq_L1 : Block Commitment\nQC | ||
note right of link | ||
4. Sequencer posts succinct commitment | ||
to block to L1. Contract verifies proof | ||
of sequencing (Quorum Certificate) | ||
then stores the block commitment. | ||
' Events | ||
Networking <-up-> Events | ||
Events -up-> EventsStream: events | ||
Events -down-> Validated | ||
|
||
' Storage | ||
Query --> DB | ||
Validated -up-> DB | ||
DB --> Catchup: missing\nstate | ||
|
||
package "Layer 2s / Rollups" as L2s #LightYellow { | ||
component "zk Rollup Z" as ZK #LightBlue { | ||
component "API (e.g. JSON-RPC)" as ZK_RPC | ||
component Executor as ZK_Exec | ||
component Prover as ZK_Prover | ||
ZK_RPC --[hidden]> ZK_Exec | ||
ZK_RPC --[hidden]> ZK_Prover | ||
} | ||
component "Optimistic Rollup O" #LightGreen { | ||
component "API (e.g. JSON-RPC)" as OR_RPC | ||
component Proposer | ||
component Challenger | ||
OR_RPC --[hidden]> Proposer | ||
OR_RPC --[hidden]> Challenger | ||
} | ||
} | ||
package "Ethereum Layer 1" as L1 #LightGray { | ||
package "Espresso Contracts" as Esp_L1 { | ||
component "Light Client\nContract" as LC_L1 | ||
component "Fee\nContract" as Fee_L1 | ||
} | ||
package "Rollup Contracts" { | ||
component "zk Rollup Z\nContract" as ZK_L1 | ||
component "OR Rollup O\nContract" as OR_L1 | ||
} | ||
} | ||
|
||
' Transaction submission | ||
entity User | ||
User --> ZK_RPC : rollup transaction,\nstate queries | ||
note top of link | ||
2. Transaction submission | ||
end note | ||
User --> OR_RPC | ||
|
||
L2_1_Prover -> L2_1_L1 : State\nProof | ||
L2_2 -down-> L2_2_L1 : State\nProof | ||
L2_N -down-> L2_N_L1 : State\nProof | ||
note right of link | ||
5. Rollups post updated state to L1. | ||
ZK-rollups include a proof. | ||
ZK_RPC --> Submit : "transaction" " " | ||
Submit -> Events: transaction | ||
Query -up-> ZK_Exec : " " "Espresso\nheader,\nnamespace\ntransactions" | ||
note top of link | ||
5. Rollup | ||
block | ||
production | ||
end note | ||
Query -up-> Proposer: " " "Espresso\nheader,\nnamespace\ntransactions" | ||
|
||
Seq_L1 -> L2_L1 | ||
note bottom of link | ||
6. Rollup contracts read certified sequence | ||
of block commitments from sequencer | ||
contract. Verify state transition proofs | ||
against this sequence (ZKR) or wait for | ||
fraud proof against this sequence (ORU). | ||
|
||
' L1 details | ||
HSProver -up-> LC_L1 : HotShot\nstate\nproof | ||
LC_L1 -up-> ZK_L1 : " " "HotShot\ncommitment" | ||
LC_L1 -up-> OR_L1 : " " "HotShot\ncommitment" | ||
|
||
' ZK proof | ||
ZK_Prover --> ZK_L1 : rollup state proof | ||
note top of link | ||
7. ZK Rollup | ||
proving | ||
end note | ||
|
||
' OR dispute | ||
Proposer --> OR_L1: respond | ||
Challenger --> OR_L1: challenge | ||
note top of link | ||
8. OR dispute | ||
end note | ||
|
||
Builder -> Fee_L1: deposit\nether | ||
note top of link | ||
1. Fee | ||
deposit | ||
end note | ||
Fee_L1 --> Validated: fee\ndeposits | ||
|
||
' L2 1 details | ||
L2_1_RPC <-down- L2_1_State : Read state | ||
L2_1_Exec -down-> L2_1_State : Write state | ||
L2_1_Prover <-down- L2_1_State : Read State | ||
|
||
' Layout | ||
L2_1_RPC -[hidden]r-> L2_1_Exec | ||
L2_1 -[hidden]r-> L2_2 | ||
L2_2 -[hidden]r-> L2_N | ||
L2_1_L1 -[hidden]r-> L2_2_L1 | ||
L2_2_L1 -[hidden]r-> L2_N_L1 | ||
L2 -[hidden]d-> L1 | ||
Seq -[hidden]d-> L2 | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
@startuml | ||
!pragma teoz true | ||
actor User | ||
|
||
box Layer 2s / Rollups #LightYellow | ||
box "Optimistic Rollup O" #LightGreen | ||
participant "API\n(RPC)" as orrpc | ||
participant Proposer | ||
participant Challenger | ||
end box | ||
box "ZK Rollup Z" #LightBlue | ||
participant "API\n(RPC)" as zkrpc | ||
participant "Prover" as rprover | ||
participant "Executor" as executor | ||
end box | ||
end box | ||
|
||
box "Ethereum L1" #LightGrey | ||
participant "Rollup\nContract" as RC | ||
participant "Light\nClient\nContract" as LC | ||
participant "Fee\nContract" as fee | ||
end box | ||
|
||
box Espresso Sequencer Network #MistyRose | ||
box Sequencer Node #Bisque | ||
box APIs #LightCyan | ||
participant "Submit\nAPI" as submit | ||
participant "Query\nAPI" as query | ||
end box | ||
participant "HotShot\nEvents\nStream" as events | ||
participant "Validated\nState" as ValidatedState | ||
participant "State\nSigner" as signer | ||
end box | ||
|
||
participant Builder | ||
participant "HotShot\nLeader" as leader | ||
participant CDN | ||
participant Libp2p | ||
participant "HotShot\nreplicas" as replicas | ||
participant "HotShot\nstate\nrelay\nservice" as relay | ||
participant "HotShot\nstate\nprover\nservice" as prover | ||
end box | ||
|
||
group 1. Fee deposit | ||
Builder -> fee: fee deposit | ||
end group | ||
|
||
group 2. Transaction submisssion | ||
User -> orrpc: rollup O transaction | ||
orrpc -> submit: transaction | ||
User -> zkrpc: rollup Z transaction | ||
zkrpc -> submit: transaction | ||
events -> Builder: transactions | ||
end group | ||
|
||
group 3. Leader obtains Espresso block | ||
Builder -> leader: available blocks | ||
leader -> Builder: claim block | ||
end group | ||
|
||
group 4. HotShot consensus | ||
leader <-> replicas: consensus messages | ||
& leader <-> Libp2p: | ||
& Libp2p <-> replicas: | ||
& replicas -> CDN: | ||
fee -> ValidatedState: credit fee deposit | ||
ValidatedState -> ValidatedState: apply header\ncharge fee | ||
end group | ||
|
||
group 5. Rollup block production | ||
query -> executor: Espresso header,\ntransactions in namespace | ||
executor -> executor: verify\nnamespace\nproof | ||
executor -> rprover: rollup block | ||
end group | ||
|
||
group 6. HotShot proving | ||
signer -> relay: state, signature | ||
relay -> prover: state,\nsignature bundle | ||
prover -> "Light\nClient\nContract" as LC: proof | ||
LC -> LC: verify | ||
end group | ||
|
||
group 7. ZK Rollup proving | ||
rprover -> RC: rollup state proof | ||
group verify | ||
LC -> "Rollup\nContract" as RC: HotShot\ncommitment | ||
end group | ||
end group | ||
|
||
group 8. Optimistic Rollup dispute | ||
Challenger -> RC: challenge | ||
loop until dispute resolved | ||
Proposer -> RC: respond | ||
LC --> RC: HotShot\ncommitment | ||
Challenger -> RC: respond | ||
end group | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.