-
Notifications
You must be signed in to change notification settings - Fork 206
Multi‐node Mining
JamesPiechota edited this page Jul 30, 2024
·
13 revisions
sequenceDiagram
participant Miner1
participant Miner2
participant Exit Node
Note over Miner1: Compute VDF
Note over Miner1: Compute H0
Note over Miner1: Compute H1 > Difficulty
Miner1->>Exit Node: POST Solution to /coordinated_mining/publish<br/>RESPONSE: empty
Note over Exit Node: Validate solution and gossip block
sequenceDiagram
participant Miner1
participant Miner2
participant Exit Node
Note over Miner1: Compute VDF
Note over Miner1: Compute H0
Note over Miner1: Compute H1 < Difficulty
Miner1->>Miner2: POST H0,H1 to /coordinated_mining/h1<br/>RESPONSE: empty
Note over Miner2: Compute H2 > Difficulty
Miner2->>Miner1: POST H2 to /coordinated_mining/h2<br/>RESPONSE: empty
Miner1->>Exit Node: POST Network Solution /coordinated_mining/publish<br/>RESPONSE: empty
Note over Exit Node: Validate solution and gossip block
sequenceDiagram
participant Miner
participant Pool Server
Miner->>Pool Server: GET /jobs<br/>RESPONSE: jobs{ VDF,PartialDifficulty }
Note over Miner: Compute H0
Note over Miner: Compute H1/H2 > PartialDifficulty
Miner->>Pool Server: POST Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale
Note over Pool Server: Validate solution and gossip block
sequenceDiagram
participant Miner1
participant Miner2
participant Exit Node
participant Pool Server
Exit Node->>Pool Server: GET /jobs<br/>RESPONSE: jobs{ VDF,PartialDifficulty }
Note over Exit Node: Cache jobs
Miner1->>Exit Node: GET /jobs<br/>RESPONSE: jobs{ VDF,PartialDifficulty }
Note over Miner1: Compute H1 < Difficulty, H1 > PartialDifficulty
Miner1->>Exit Node: POST Partial Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale
Exit Node->>Pool Server: POST Partial Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale
Miner1->>Miner2: POST H0,H1 to /coordinated_mining/h1<br/>RESPONSE: empty
Note over Miner2: Compute H2 > Difficulty
Miner2->>Miner1: POST H2 to /coordinated_mining/h2<br/>RESPONSE: empty
Miner1->>Exit Node: POST Network Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale
Exit Node->>Pool Server: POST Network Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale
Note over Pool Server: Validate solution and gossip block
sequenceDiagram
participant Miner A
participant Exit Node A
participant Miner B
participant Exit Node B
participant Pool Proxy
Exit Node A->>Miner A: GET /coordinated_mining/partition_table<br/>RESPONSE: Partitions
Exit Node A->>Pool Proxy: POST /coordinated_mining/partition_table<br/>RESPONSE: Partitions
Note over Exit Node A: Cache { Peer=>Partitions, Pool Proxy=>Partitions }
Exit Node B->>Miner B: GET /coordinated_mining/partition_table<br/>RESPONSE: Cluster Partitions
Exit Node B->>Pool Proxy: POST /coordinated_mining/partition_table<br/>RESPONSE: Pool Partitions
Note over Exit Node B: Cache { CM Peer=>Partitions, Pool Proxy=>Partitions }
Note over Pool Proxy: Cache { Pool Peers=>Partitions }
Miner A->>Exit Node A: GET /coordinated_mining/partition_table<br/>RESPONSE: [Local Partitions, Pool Partitions]
Note over Miner A: Cache Partitions
sequenceDiagram
participant Miner A
participant Exit Node A
participant Miner B
participant Exit Node B
participant Pool Proxy
Exit Node A->>Pool Proxy: GET /jobs<br/>RESPONSE: jobs{ VDF,PartialDifficulty }
Note over Exit Node A: Cache jobs
Miner A->>Exit Node A: GET /jobs<br/>RESPONSE: jobs{ VDF,PartialDifficulty }
Note over Miner A: Compute H1 < PartialDifficulty
Miner A->>Exit Node A: POST /coordinated_mining/h1
Exit Node A->>Pool Proxy: POST /pool_cm_jobs
Note over Pool Proxy: Cache pool_cm_jobs
Exit Node B->>Pool Proxy: GET /pool_cm_jobs<br/>RESPONSE: pool_cm_jobs
Exit Node B->>Miner B: POST /pool_cm_jobs
Note over Miner B: Process h1_to_h2 job
Note over Miner B: Compute H2 > PartialDifficulty
Miner B->>Exit Node B: POST /coordinated_mining/h2
Exit Node B->>Pool Proxy: POST /pool_cm_jobs
Note over Pool Proxy: Cache pool_cm_jobs
Exit Node A->>Pool Proxy: GET /pool_cm_jobs<br/>RESPONSE: pool_cm_jobs
Exit Node A->>Miner A: POST /pool_cm_jobs
Note over Miner A: Process h1_read job
Miner A->>Exit Node A: POST Partial Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale
Exit Node A->>Pool Proxy: POST Partial Solution to /partial_solution<br/>RESPONSE: accepted/rejected/stale