From e1b3bb75779165d9d10b9969af2801d2670d0f8b Mon Sep 17 00:00:00 2001 From: Anne-Laure Date: Tue, 22 Oct 2024 15:41:43 +0200 Subject: [PATCH] Update with the new work selection method --- docs/berkeley-upgrade/flags-configs.mdx | 2 +- docs/mina-protocol/snark-workers.mdx | 2 +- docs/node-operators/flags-configs.mdx | 2 +- docs/node-operators/mina-cli-reference.mdx | 8 +++++--- docs/node-operators/snark-workers/getting-started.mdx | 2 +- docs/node-operators/troubleshooting.mdx | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/berkeley-upgrade/flags-configs.mdx b/docs/berkeley-upgrade/flags-configs.mdx index d41056df4..034dbbd09 100644 --- a/docs/berkeley-upgrade/flags-configs.mdx +++ b/docs/berkeley-upgrade/flags-configs.mdx @@ -63,7 +63,7 @@ mina daemon --peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt --run-snark-coordinator --snark-worker-fee 0.001 ---work-selection [seq|rand] +--work-selection [seq|rand|roffset] ENVIRONMENT VARIABLES MINA_LIBP2P_PASS diff --git a/docs/mina-protocol/snark-workers.mdx b/docs/mina-protocol/snark-workers.mdx index d3a4b0440..0cd7a1eb9 100644 --- a/docs/mina-protocol/snark-workers.mdx +++ b/docs/mina-protocol/snark-workers.mdx @@ -88,7 +88,7 @@ We anticipate the snarketplace to dynamically rebalance — eg. follow the simpl - 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. - 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. - 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. -- 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. +- 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. 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. diff --git a/docs/node-operators/flags-configs.mdx b/docs/node-operators/flags-configs.mdx index 8032de09a..0d2318c4e 100644 --- a/docs/node-operators/flags-configs.mdx +++ b/docs/node-operators/flags-configs.mdx @@ -63,7 +63,7 @@ mina daemon --peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt --run-snark-coordinator --snark-worker-fee 0.001 ---work-selection [seq|rand] +--work-selection [seq|rand|roffset] ENVIRONMENT VARIABLES MINA_LIBP2P_PASS diff --git a/docs/node-operators/mina-cli-reference.mdx b/docs/node-operators/mina-cli-reference.mdx index 58cca89bc..c3ba6a2e9 100644 --- a/docs/node-operators/mina-cli-reference.mdx +++ b/docs/node-operators/mina-cli-reference.mdx @@ -532,9 +532,11 @@ Mina daemon 420000ms) (alias: -work-reassignment-wait) - [--work-selection seq|rand] Choose work sequentially - (seq) or randomly (rand) - (default: rand) + [--work-selection seq|rand|roffset] Choose work sequentially + (seq), randomly (rand) or + sequentially with a random + offset (roffset) (default: + rand) (alias: -work-selection) [--working-dir PATH] path to chdir into before starting (useful for diff --git a/docs/node-operators/snark-workers/getting-started.mdx b/docs/node-operators/snark-workers/getting-started.mdx index 54d4fda02..8386c4a58 100644 --- a/docs/node-operators/snark-workers/getting-started.mdx +++ b/docs/node-operators/snark-workers/getting-started.mdx @@ -70,7 +70,7 @@ internal snark-worker --proof-level full --shutdown-on-disconnect false --daemon To start a SNARK-worker, run `mina daemon` with these flags: ```sh ---run-snark-worker \ --snark-worker-fee --work-selection +--run-snark-worker \ --snark-worker-fee --work-selection ``` Use the `--snark-worker-parallelism` flag to set the number of threads used in snark working, this does not affect block production. diff --git a/docs/node-operators/troubleshooting.mdx b/docs/node-operators/troubleshooting.mdx index 3fa5442d8..2422947d4 100644 --- a/docs/node-operators/troubleshooting.mdx +++ b/docs/node-operators/troubleshooting.mdx @@ -338,7 +338,7 @@ If you are running a SNARK worker and not seeing any work being included in bloc 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. -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. +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. For choosing fees, you can look at historical blocks to determine prices that have been bought.