Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gemini 3h guide updates #401

Merged
merged 24 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
27bd9ee
Reflect PR 2408
EmilFattakhov Jan 16, 2024
36d3b94
Reflect PR 2412
EmilFattakhov Jan 16, 2024
0a21692
Add a block on NUMA support
EmilFattakhov Jan 16, 2024
93e2bd3
Reflect PR 2405
EmilFattakhov Jan 16, 2024
4774711
Update local_development section to reflect PR 2405
EmilFattakhov Jan 16, 2024
2e55384
Reflect PR 2414
EmilFattakhov Jan 17, 2024
516e519
Reflect directory changes PR 2377
EmilFattakhov Jan 17, 2024
3612e2c
Ensure guides enforse setting --base-path and --chain flag
EmilFattakhov Jan 17, 2024
ccb2086
Update operators guide to reflect node / domain CLI changes
EmilFattakhov Jan 17, 2024
027217d
Improve message on NUMA support
EmilFattakhov Jan 18, 2024
2ac349a
Reflect Subnomicon PR 16
EmilFattakhov Jan 18, 2024
4b7059b
Remove subspace folder structure description
EmilFattakhov Jan 22, 2024
56028ea
Updates after feedback and testing
EmilFattakhov Jan 25, 2024
d4647be
Reflect PR 2452
EmilFattakhov Jan 25, 2024
2a3d055
Make further adjustments after the review
EmilFattakhov Jan 29, 2024
e18b827
Merge up to date main
EmilFattakhov Jan 29, 2024
94c6fb4
Resolve merge conflict, improve grammar and wording
EmilFattakhov Jan 29, 2024
4e2020d
Add a few small clarifications
EmilFattakhov Jan 29, 2024
90daf3c
Adjust chain from 3g to 3h
EmilFattakhov Jan 30, 2024
1a5b412
Update stake withdraw instructions
EmilFattakhov Jan 30, 2024
356125a
Merge up-to-date master
EmilFattakhov Jan 31, 2024
7cc0b64
adjust the chain to 3h
EmilFattakhov Jan 31, 2024
2f76c38
Update Nova bootstrap nodes IPs
EmilFattakhov Jan 31, 2024
674dd34
Adjust chain for docker commands
EmilFattakhov Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docker-compose-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ services:
"--base-path", "/var/subspace",
"--blocks-pruning", "256",
"--state-pruning", "archive-canonical",
"--port", "30333",
"--listen-on", "30333",
"--dsn-listen-on", "/ip4/0.0.0.0/udp/30433/quic-v1",
"--dsn-listen-on", "/ip4/0.0.0.0/tcp/30433",
"--rpc-cors", "all",
"--rpc-methods", "unsafe",
"--rpc-external",
"--no-private-ipv4",
"--validator",
"--rpc-listen-on", "0.0.0.0:9944",
"--farmer",
# Replace `INSERT_YOUR_ID` with your node ID (will be shown in telemetry)
"--name", "INSERT_YOUR_ID"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/nova/local_development.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ After downloading both files that suit your system, start a node using your pref
You can do this with the following command:

```bash
./your_subspace_node_path --dev --alice --rpc-port 9444 -- --domain-id 3 --dev --rpc-port 8545
./your_subspace_node_path run --dev --rpc-listen-on 127.0.0.1:9944 -- --domain-id 3 --dev --rpc-listen-on 127.0.0.1:8545
```

This will create a local RPC on port **8545**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ You can use any file system with default settings, we advise against their use f
In order to disable **CoW** on **BTRFS**, run the command `chattr +C /your_farmer_directory/`.

In case of **ZFS**, you can try adjusting the **recordsize** by running `zfs set recordsize=128K tank/dataset`, or creating a separate **dataset** for the farmer with adjusted **recordsize** parameters.

41 changes: 30 additions & 11 deletions docs/farming-&-staking/farming/advanced-cli/cli-tips.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ In certain situations, especially when the farmer terminates unexpectedly or enc

Ensure to replace /path/to/your/plot with your actual plot path. Use this command cautiously as it modifies the plot state to recover from errors.

<<<<<<< HEAD
=======
### Specify Exact CPU Cores for Plotting/Replotting
This option will override any custom logic that the **subspace farmer** might otherwise use.
You can specify the plotting CPU cores by adding `--plotting-cpu-cores`, followed by the desired cores parameters. Cores should be listed as comma-separated values, with whitespace used to separate different thread pools or encoding instances.
Expand All @@ -69,31 +71,32 @@ To set your node to use a custom path all you will need to do is add the `--base
```
</TabItem>
</Tabs>
>>>>>>> origin

### Switching to a new snapshot from older/different versions of Subspace

:::info
Unless specifically mentioned by the Development team you should **NOT** have to wipe & purge your configuration on new releases.
Unless specifically mentioned by the Development team you should **NOT** have to wipe your configuration on new releases.
:::

In general you should be able to download the latest release, and re-start the Node & Farmer with the same commands as you started to prior version with no errors.

There are some cases where version updates will cause issue with your Node & Farmer and you may have to wipe & purge your node, typically when errors occur. If you have any issues you can always check our [Forums](https://forums.subspace.network) and hop in our [Discord](https://discord.gg/subspace-network) Server to ask for help.
There are some cases where version updates will cause issue with your Node & Farmer and you may have to wipe your node, typically when errors occur. If you have any issues you can always check our [Forums](https://forums.subspace.network) and hop in our [Discord](https://discord.gg/subspace-network) Server to ask for help.

### Wipe & Purge
### Wipe

If you were running a node previously, and want to switch to a new network, please perform these steps and then follow the guide again:
```bash
# Replace `FARMER_FILE_NAME` with the name of the farmer file you downloaded from releases
./FARMER_FILE_NAME wipe PATH_TO_FARM
# Replace `NODE_FILE_NAME` with the name of the node file you downloaded from releases
./NODE_FILE_NAME purge-chain --chain gemini-3g
./NODE_FILE_NAME wipe NODE_DATA_PATH
```
It does not matter if the node/farmer executable is the previous one or from the new snapshot, both will work :)
It does not matter if the node/farmer executable is the previous one or from the new snapshot, both will work.

Now follow installation guide.
Now follow the installation guide from the beginning.

### Docker Wipe & Purge
### Docker Wipe

In case of Docker setup run `docker compose down -v` (and manually delete custom directories if you have specified them).

Expand Down Expand Up @@ -137,8 +140,7 @@ For both the node and the farmer, here are some frequently used commands:
- Display farm information: `./FARMER_FILE_NAME info PATH_TO_FARM`
- Scrub the farm for errors: `./FARMER_FILE_NAME scrub PATH_TO_FARM`
- Erase all farmer-related data: `./FARMER_FILE_NAME wipe PATH_TO_FARM`
- Start the node with a custom data path: `./NODE_FILE_NAME --base-path NODE_DATA_PATH --chain gemini-3g`
- Erase all node-related data: `./NODE_FILE_NAME purge-chain --base-path NODE_DATA_PATH --chain gemini-3g`
- Erase all node-related data: `./NODE_FILE_NAME wipe NODE_DATA_PATH`

### Utilizing Multiple Disks

Expand All @@ -160,7 +162,6 @@ While it might be tempting to adjust certain parameters that seem related to DSN
```
--out-peers
--in-peers
--in-peers-light
--dsn-target-connections
--dsn-pending-in-connections
--dsn-in-connections
Expand All @@ -182,4 +183,22 @@ Increasing the values of the farmer parameters could increase the plotting speed
```
--out-connections
--pending-out-connections
```
```


### NUMA Support

:::note
NUMA support will benefit farmers with large, powerful CPUs and lots of RAM available. The required RAM amount depends on the processor and the number of threads.
:::

Previously plotting/replotting thread pools were created for each farm separately even though only a configured number of them can be used at a time (by default just one).
With the introduction of NUMA support, the farmer application has a thread pool manager that will create a necessary number of thread pools that will be allocated to currently plotting/replotting farms.
When a thread pool is created, it is assigned to a set of CPU cores and will only be able to use those cores. Pinning doesn’t pin threads to cores 1:1, instead, the OS is free to move threads between cores, but only within CPU cores allocated for the thread pool. This will ensure plotting for a particular sector only happens on a particular CPU/NUMA node.

#### Enabling NUMA on Windows/Linux machines

On Linux and Windows, the farmer will detect NUMA systems and create a number of thread pools that correspond to the number of NUMA nodes. This means the default behavior will change for large CPUs and consume more memory as a result, but that can be changed to the previous behavior with CLI options if desired.
To use NUMA, you need to enable it via the BIOS of your motherboard for the farmer to know it exists. This option is present in motherboards for **Threadripper/Epyc processors** but might exist in others too. If you don’t enable it, both OS and farmer will think you have a single UMA processor and will not be able to apply optimizations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To read more about NUMA support and benefits it provides for large CPUs read [this forum post](https://forum.subspace.network/t/numa-support-is-coming/2299?u=nazar-pc).
To read more about NUMA support and the benefits it provides for large CPUs read [this forum post](https://forum.subspace.network/t/numa-support-is-coming/2299?u=nazar-pc).

To read more about NUMA support and benefits it provides for large CPUs read [this forum post](https://forum.subspace.network/t/numa-support-is-coming/2299?u=nazar-pc).
10 changes: 7 additions & 3 deletions docs/farming-&-staking/farming/advanced-cli/platforms/_linux.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ import styles from '@site/src/pages/index.module.css';
--chain gemini-3g \
--blocks-pruning 256 \
--state-pruning archive-canonical \
--no-private-ipv4 \
--validator \
--farmer \
--name "INSERT_YOUR_ID"
```

:::note
Setting **--base-path** and specifying **--chain** became mandatory starting with Gemini 3h.
:::

4. You should see something similar in the terminal:
```
2022-02-03 10:52:23 Subspace
Expand Down Expand Up @@ -153,4 +157,4 @@ import styles from '@site/src/pages/index.module.css';
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=5
```

3. You are now Farming! Just wait for your node to fully sync, and for your farmer to fully plot.
3. You are now farming! Just wait for your node to fully sync, and for your farmer to fully plot.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ After this, simply repeat the step you prompted for (step 4 or 6). This time, cl
--chain gemini-3g \
--blocks-pruning 256 \
--state-pruning archive-canonical \
--no-private-ipv4 \
--validator \
--farmer \
--name "INSERT_YOUR_ID"
```

:::note
Setting **--base-path** and specifying **--chain** became mandatory starting with Gemini 3h.
:::

4. You should see something similar in the terminal:
```
2022-02-03 10:52:23 Subspace
Expand Down Expand Up @@ -124,4 +127,4 @@ After this, simply repeat the step you prompted for (step 4 or 6). This time, cl
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=5
```

3. You are now Farming! Just wait for your node to fully sync, and for your farmer to fully plot.
3. You are now farming! Just wait for your node to fully sync, and for your farmer to fully plot.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ This is because the application is trying to access the internet. This is expect
--chain gemini-3g `
--blocks-pruning 256 `
--state-pruning archive-canonical `
--no-private-ipv4 `
--validator `
--farmer `
--name "INSERT_YOUR_ID"
```

:::note
Setting **--base-path** and specifying **--chain** became mandatory starting with Gemini 3h.
:::

4. You should see something similar in the terminal:
```text
Expand Down Expand Up @@ -120,4 +123,4 @@ This is because the application is trying to access the internet. This is expect
2022-06-02T00:02:09.492868Z INFO subspace_farmer::archiving: Plotted segment segment_index=5
```

3. You are now Farming! Just wait for your node to fully sync, and for your farmer to fully plot.
3. You are now farming! Just wait for your node to fully sync, and for your farmer to fully plot.
24 changes: 15 additions & 9 deletions docs/farming-&-staking/staking/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,35 @@ Our suggested specs are not necessarily applicable to Stake Wars. We encourage a
**Network**:
- The minimum symmetric networking speed is set to 500 Mbit/s.

### Folder structure

Starting with Gemini 3h, **Subspace Node** will create the following directory structure:

- subspace-node/db
- subspace-node/domains/0/keystore
- subspace-node/domains/0/db
- subspace-node/domains/1/keystore
- subspace-node/domains/1/db
- subspace-node/network

For operators it means that you can no longer create a keystore in a random location, the keystore has to be located in a specific subfolder of the desired domain and will be
jim-counter marked this conversation as resolved.
Show resolved Hide resolved

### Staking

The Subspace Network relies on staking from both domain operators and farmers to secure the network and provide resources. Subspace implements a Nominated Proof-of-Stake algorithm where token holders endorse operators who execute transactions and produce blocks.

Our staking model consists of two tiers:

- Farmers earn rewards proportional to their pledged storage. Farmers can choose to nominate operators and back them with their own stake, increasing their chance of being elected as a slot leader. Farmers, who have earned storage rewards, nominate operators to execute transactions. This nomination system balances the power between farmers who nominate and operators and both parties share the rewards and the potential penalties (slashing).
- Farmers earn rewards proportional to their pledged storage. Farmers can choose to nominate operators and back them with their own stake, increasing their chance of being elected as a slot leader. Farmers, who have earned storage rewards, nominate operators to execute transactions. This nomination system balances the power between farmers who nominate and operators with both parties sharing the execution fees and the potential penalties (slashing).

- Operators stake to gain the right to produce bundles within a domain. They are responsible for validating and executing transactions, producing execution receipts, and applying state transitions and earn rewards for their work. The operator's chances to be elected as a slot leader and produce a bundle are weighted by their stake. Operators can be nominated by farmers or other SSC holders.
- Operators stake to gain the right to produce bundles within a domain. They are responsible for validating and executing transactions, producing execution receipts, applying state transitions, submitting a storage fee for bundle execution and earning fees for their work. The operator's chances to be elected as a slot leader and produce a bundle are weighted by their stake. Operators can be nominated by farmers or other SSC holders.

The nomination pools in Subspace are "lazy": any fees earned by the operator are assigned to the pool and are not deposited to the nominators wallet unless they ask for a withdrawal. Unless withdrawn, the fees are "auto-staked" - they count towards the total stake of the pool, increasing its chance of being elected to produce bundles.

### Stake epoch

Stake epoch is a designated period in domain blocks within a blockchain system that marks each stake allocation re-adjustment period. Occurring every `StakeEpochDuration` blocks (at the moment, it's set to every 100 blocks or ~10 minutes), an epoch transition triggers specific actions such as finalizing operator domain switches, deregistering operators, unlocking operators and their associated funds, and recalculating stake distribution for the Verifiable Random Function (VRF) election. These transitions are designed to adjust the stake distribution dynamically, finalize various staking-related operations, process rewards, and manage deposits and withdrawals. The uniform duration across all domains helps maintain consistency in the network, while the specific starting point for each domain's epoch transition may vary based on when it is registered, helping to amortize the load of these transitions.

:::note
Read [Subspace Subnomicon](https://subnomicon.subspace.network/docs/category/decoupled-execution) to get a full picture behind decoupled execution!
:::






:::
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ Alternatively, you can use the **PolkadotJS** portal to deregister operator.
7. Select `domains` under `selected contant query` and choose `stakeWithdrawalLockingPeriod`.
8. Click on `+` to run the query.

![Staking-15](/img/doc-imgs/operators-staking/Staking-15.png)

:::info
Number 256 above corresponds to the number of the domain blocks, and not the consensus chain blocks.
The current locking period is set to 14_400 blocks, or 24 hours.
:::


Expand Down
Loading
Loading