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

feat(spec): Proofs scheduling protocol, English specification #241

Merged
merged 14 commits into from
Jun 24, 2024

Conversation

cason
Copy link
Contributor

@cason cason commented Jun 17, 2024

Contributes to #237.

Rendered: https://github.com/informalsystems/malachite/blob/cason/proofs-english-spec/specs/english/proofs_scheduling.md

Main reference: https://docs.google.com/document/d/1qjngaq9GoMWa5UJOrTlKNqwi_pI0aHt8iULWD9Gy9hE/edit

There are some pending tasks:

  • How to relate the proofs scheduling with the validator set updates (epochs)
  • Maybe some suggestion to prevent blocking the algorithm when too many empty blocks are produced

Ideally, this spec should be aligned with the Quint spec of the same protocol: #198.


PR author checklist

@cason cason changed the title spec: Proofs scheduling protocol, English specification (WIP) feat(spec): Proofs scheduling protocol, English specification (WIP) Jun 18, 2024
@cason cason marked this pull request as ready for review June 18, 2024 16:48
@cason cason changed the title feat(spec): Proofs scheduling protocol, English specification (WIP) feat(spec): Proofs scheduling protocol, English specification Jun 18, 2024
@cason cason linked an issue Jun 18, 2024 that may be closed by this pull request
2 tasks
@cason cason mentioned this pull request Jun 18, 2024
2 tasks
Copy link
Member

@josef-widder josef-widder left a comment

Choose a reason for hiding this comment

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

I stopped reading just before the "Protocol" section and will continue later.

specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
Comment on lines +103 to +112
There is a deterministic function `proposer(H,R)` that defines from `valset(H)`
the validator that should propose a block in the round `R` of the instance `H`
Copy link
Member

Choose a reason for hiding this comment

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

I think mathematically this is not precise. I think there is one function for each epoch, or there is just one function proposer with additional parameters (some input that simulations randomness based on some hashes on L1).

Perhaps we should make it less explicit, and say that validators have a means to compute a unique proposers for each round, so that all validators agree on this proposer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is kind of disconnected here, but proposer computes from valset(H) the validator set. I will make this more explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding the second part, yes, we miss a subsection about epochs, in terms of how validator sets change and how long in the future we can compute the proposer of a height/round.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
Comment on lines 267 to 271
There is an exception for this mechanism intended to limit the number of
**empty blocks** in a strand.
So, if there are `P` empty blocks in the current strand `s`, namely if
`|unproven(s)| > P`, the proposer of **any round** of a height `H` with
`strand(H) == s` can only propose a block if it includes `expected_proofs(H)`.
Copy link
Member

Choose a reason for hiding this comment

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

Can we do some analysis here. Assume the proposer of round 0 is faulty, and doesn't have a prove, and no-one else does. This means that we will spend L time units going through unsuccessful consensus rounds, before someone comes up with a proof and becomes proposer. That is, Starknet doesn't generate blocks for a couple of minutes.

I wonder whether one should consider additional incentives to the proposer who adds a proof after P, so that it may pay of that multiple parties start producing the block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, agree.

This is another point it is missing, it is present on the PR description. We need, first, describe this scenario here, then, propose some form of mitigation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@cason cason left a comment

Choose a reason for hiding this comment

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

Fixing minor typos, someone can commit the suggested changes?

specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
specs/english/proofs_scheduling.md Outdated Show resolved Hide resolved
Copy link
Member

@josef-widder josef-widder left a comment

Choose a reason for hiding this comment

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

As discussed with @cason we can merge and leave to clearly defined open points as #245 and #246

@cason cason force-pushed the cason/proofs-english-spec branch from c1e0638 to f0497d2 Compare June 24, 2024 13:35
@cason cason self-assigned this Jun 24, 2024
@cason cason added phase2 spec Related to specifications labels Jun 24, 2024
@cason cason merged commit 158ec63 into main Jun 24, 2024
2 checks passed
@cason cason deleted the cason/proofs-english-spec branch June 24, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Related to specifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spec: proof generation and strands
2 participants