Skip to content

Commit 20d8f81

Browse files
authored
Merge pull request MinaProtocol#1067 from o1-labs/al/work-selection-method
Update with the new work selection method
2 parents 62c4728 + e1b3bb7 commit 20d8f81

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

docs/berkeley-upgrade/flags-configs.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ mina daemon
6363
--peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt
6464
--run-snark-coordinator <public key>
6565
--snark-worker-fee 0.001
66-
--work-selection [seq|rand]
66+
--work-selection [seq|rand|roffset]
6767
6868
ENVIRONMENT VARIABLES
6969
MINA_LIBP2P_PASS

docs/mina-protocol/snark-workers.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ We anticipate the snarketplace to dynamically rebalance — eg. follow the simpl
8888
- if market price is X, it is likely effective to sell SNARK work for any price below X (eg. X - 1), provided it is profitable after operating expenses.
8989
- block producers are incentivized to purchase more units of SNARK work from the same SNARK worker because there will only be one _fee transfer_ transaction they have to include in the block.
9090
- Basically, the way a block producer pays a SNARK worker is through a special type of transaction called a fee transfer. The BP's incentive is to minimize the number of fee transfers, as each is a discrete transaction that needs to be added to a block (and consequently offset by more SNARK work). Thus, the best case scenario is to buy a bundle of SNARK work from the same SNARK worker.
91-
- some SNARK work will be more important to complete ahead of other work, as it would free up an entire tree worth of memory (see the video above for more details). This is made possible by different work selection methods. Currently, the two methods supported natively are sequential and random. Neither of these however takes advantage of dynamic markets, which is an area of improvement that the Mina community can develop solutions for.
91+
- some SNARK work will be more important to complete ahead of other work, as it would free up an entire tree worth of memory (see the video above for more details). This is made possible by different work selection methods. Currently, the three methods supported natively are sequential, random and sequential with a random offset. Neither of these however takes advantage of dynamic markets, which is an area of improvement that the Mina community can develop solutions for.
9292

9393
Since all the data around snarks and prices are public, there are several ways to inspect the snarketplace. One example is [using the GraphQL API](https://youtu.be/XQlfX-LnK_A), and other options include using the CLI, or rolling a custom solution that tracks snarks in the SNARK mempool.
9494

docs/node-operators/flags-configs.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ mina daemon
6363
--peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt
6464
--run-snark-coordinator <public key>
6565
--snark-worker-fee 0.001
66-
--work-selection [seq|rand]
66+
--work-selection [seq|rand|roffset]
6767
6868
ENVIRONMENT VARIABLES
6969
MINA_LIBP2P_PASS

docs/node-operators/mina-cli-reference.mdx

+5-3
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,11 @@ Mina daemon
532532
420000ms)
533533
(alias:
534534
-work-reassignment-wait)
535-
[--work-selection seq|rand] Choose work sequentially
536-
(seq) or randomly (rand)
537-
(default: rand)
535+
[--work-selection seq|rand|roffset] Choose work sequentially
536+
(seq), randomly (rand) or
537+
sequentially with a random
538+
offset (roffset) (default:
539+
rand)
538540
(alias: -work-selection)
539541
[--working-dir PATH] path to chdir into before
540542
starting (useful for

docs/node-operators/snark-workers/getting-started.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ internal snark-worker --proof-level full --shutdown-on-disconnect false --daemon
7070
To start a SNARK-worker, run `mina daemon` with these flags:
7171

7272
```sh
73-
--run-snark-worker <PUBLICKEY>\ --snark-worker-fee <FEE> --work-selection <seq|rand>
73+
--run-snark-worker <PUBLICKEY>\ --snark-worker-fee <FEE> --work-selection <seq|rand|roffset>
7474
```
7575

7676
Use the `--snark-worker-parallelism` flag to set the number of threads used in snark working, this does not affect block production.

docs/node-operators/troubleshooting.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ If you are running a SNARK worker and not seeing any work being included in bloc
338338

339339
Sometimes high fees will be included in blocks, and this is a function of how SNARK workers select which work to complete and which work is required to be purchased by the block producer.
340340

341-
By default, the work selection for a SNARK worker is random. You can change this by adding the `-work-selection seq` flag to the `mina daemon` command, which will work on jobs in the order required to be included from the scan state and will likely result in your snarks being included without a potentially lengthy delay.
341+
By default, the work selection for a SNARK worker is random. You can change this by adding the `-work-selection` flag to the `mina daemon` command: `-work-selection seq` will work on jobs in the order required to be included from the scan state and will likely result in your snarks being included without a potentially lengthy delay; `-work-selection roffset` functions similarly to the `seq` option, but it begins processing jobs from a random offset instead of starting with the first job indicated by the scan state.
342342

343343
For choosing fees, you can look at historical blocks to determine prices that have been bought.
344344

0 commit comments

Comments
 (0)