Skip to content

Commit

Permalink
Update nep-0509.md
Browse files Browse the repository at this point in the history
Add validator role change section
  • Loading branch information
walnut-the-cat authored Oct 23, 2023
1 parent abbf6f0 commit 229d1e2
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions neps/nep-0509.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ As a result, the team sought alternative approach and concluded that stateless v
## Specification

### Assumptions

Check failure on line 32 in neps/nep-0509.md

View workflow job for this annotation

GitHub Actions / markdown-lint

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Assumptions"]

neps/nep-0509.md:32 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Assumptions"]
* Post state root is enabled - [NEP-507](https://github.com/near/NEPs/pull/507)
* In memory trie is enabled - [REF](https://docs.google.com/document/d/1_X2z6CZbIsL68PiFvyrasjRdvKA_uucyIaDURziiH2U/edit?usp=sharing)

Check failure on line 33 in neps/nep-0509.md

View workflow job for this annotation

GitHub Actions / markdown-lint

Lists should be surrounded by blank lines [Context: "* In memory trie is enabled - ..."]

neps/nep-0509.md:33 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* In memory trie is enabled - ..."]
* State sync is enabled
* Merkle Patricia Trie is underlying data structure
Expand All @@ -46,6 +45,7 @@ As a result, the team sought alternative approach and concluded that stateless v
* Only chunk producers need to maintain state locally.
* State witness size should be small enough to delivered over network.
* Majority of undercharging issues should be mitigated.
* Validator roles are updated accordingly to reflect the necessary changes with stateless validation.
* [TBD] Resharding should work as expected after stateless validation in place.
* TBD

Expand All @@ -55,10 +55,10 @@ As a result, the team sought alternative approach and concluded that stateless v
* More shards
* ZK integration
* Underlying data structure change (e.g. verkle tree)
* Validator structure change (e.g. block only producer, Infertile validator (validator which does not produce any chunk or block))
* Validator reward change
* TBD

### High level flow
## High level flow

TBD. [Explain the proposal as if you were teaching it to another developer. This generally means describing the syntax and semantics, naming new concepts, and providing clear examples. The specification needs to include sufficient detail to allow interoperable implementations getting built by following only the provided specification. In cases where it is infeasible to specify all implementation details upfront, broadly describe what they are.]

Expand All @@ -74,6 +74,39 @@ TBD. [Explain the proposal as if you were teaching it to another developer. This

The section should return to the examples given in the previous section, and explain more fully how the detailed proposal makes those examples work.]

## Validatior role change
Currently, there are two different types of validators and their responsibilities are as follows:
| | Top ~50% validators | Remaining validatiors (Chunk only producers) |
|-----|:-----:|:----:|
| block production | Y | N |
| chunk production | Y | Y |
| block validation | Y | N |

With stateless validation, this structure does not make sense anymore for several reasons:
* Chunk production is the most resource consuming activity.
* (Only) chunk production needs state in memory while other responsibilities can be completed via acquiring state witness
* Chunk production does not have to be performed by all validators.

Hence, the most simple proposal is to change Chunk-only producers to Chunk-only validators as follows:
| | Top ~50% validators | Remaining validatiors (Chunk-only validators) |
|-----|:-----:|:----:|
| block production | Y | N |
| chunk production | Y | N |
| block validation | Y | N |
| chunk validation | Y | Y |

Block production and validation remain as responsibility of validators with more stake to maintain the same level of security.

This approach is the most straight forward as it maintains the same grouping as we have today.

Potential improvement to which can lower hardware requirement for more validators is limiting the responsibility of chunk production to top N validators, who are often equipped with powerful machines already.
| | Top N validatiors (Chunk proposers) | Top ~50% - N validators | Remaining validators (Chunk-only validators) |
|-----|:-----:|:----:|:----:|
| block production | Y | Y | N |
| chunk production | Y | N | N |
| block validation | Y | Y | N |
| chunk validation | Y | Y | N |

## Security Implications

[Explicitly outline any security concerns in relation to the NEP, and potential ways to resolve or mitigate them. At the very least, well-known relevant threats must be covered, e.g. person-in-the-middle, double-spend, XSS, CSRF, etc.]
Expand Down

0 comments on commit 229d1e2

Please sign in to comment.