-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat(spec): Fork or Reset Protocol for Starknet #170
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,54 @@ | ||
# Fork Protocol | ||
|
||
TODO | ||
This is **WORK IN PROGRESS**. | ||
|
||
Summary: | ||
|
||
- The Fork Protocol is triggered by the expiration of deadlines in the | ||
[Validator Set Updates Protocol][valset-spec]. | ||
- The goal of this protocol is to **enforce** the adoption of a new validator | ||
set, produced by L1, by Starknet (L2) | ||
- This is why the Starkware team uses _reset_ to refer to this procedure, | ||
that resets the validator set | ||
- The "Rainy Day - Reset" scenario of the [Starknet specification][starkware-spec] | ||
illustrates the operation of the Fork Protocol | ||
- The validator set _reset_ is represented by orange (?) arrows in diagrams | ||
in the [Starknet specification][starkware-spec] | ||
- Notice, however, that there is no explicit signalization from L1 to start | ||
the reset protocol | ||
- Instead, validators that remain in the reset validator set and nodes that | ||
become validators in the reset validator set are expected to initiate the | ||
Fork Protocol, once they realize that it is needed | ||
- The reset of the validator set produces a fork of Starknet blockchain: | ||
- The initial state of the fork is derived from the latest block of the | ||
previous fork that has been successfully proven. | ||
By successfully here we mean that the produced proof was accepted by L1. | ||
- The validator set for the fork is the last validator set accepted by L1 | ||
plus all the "stale registrations", i.e., validator set updates produced by | ||
L1 but not included in Starknet blocks (L2) in due time. | ||
- This is not enough precise yet, for instance, how the validator set | ||
updates committed to blocks prior to the fork are handled. | ||
Namely, how the value of the state variable `S`, defined in | ||
the [Validator Set Updates Protocol][valset-spec] specification, | ||
in the first block `H_0` of the fork can be consistent with the latest | ||
state `S(H_0 - 1)` from the previous fork. | ||
A possibility is to add validator updates to block `H_0` in the new fork | ||
(playing the role of its "genesis") in order to preserve some consistency. | ||
- For all effects, it can be useful to consider the first block of a new fork | ||
as it was a genesis state or block. | ||
- The execution and state of the blockchain after the height, or the block | ||
from where the fork is derived is irrelevant. Refer to the Enforcement | ||
section of the [Validator Set Updates Protocol][valset-spec] for details. | ||
- It is assumed that nodes joining the validator set of a fork have access to | ||
all state they need to produce and validate blocks (i.e., make progress) in | ||
that fork. Should we blindly stick to this assumption? | ||
- Different forks are uniquely identified by a _ForkId_: | ||
- The _ForkId_ is set to the last "Ethereum Validator Epoch" _EVE_ which "has | ||
the most recent stale update". | ||
- Apparently, this should indeed produce unique *ForkId*s. | ||
- Consensus messages, and the Starknet communication in general, should | ||
include the _ForkId_, in order to distinguish content, messages, and data | ||
belonging to different executions, or forks. | ||
|
||
[valset-spec]: ./validator_set.md | ||
[starkware-spec]: https://docs.google.com/document/d/1OaYLh9o10DIsGpW0GTRhWl-IJiVyjRsy7UttHs9_1Fw |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this point seems a bit unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would we do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption here is that new validators are more trustworthy than the existing ones. The existing ones are probably maintained in the new validator set, but with lower voting power (they call this "dilution").
I think the assumption here is that most of the existing validator set is good, but the <1/3 assumption was broken by a "small amount" of voting power. In this case, adding new "good" validators would make the <1/3 assumption to hold again.