Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Initial consensus rules #89

Merged
merged 52 commits into from
Nov 27, 2020
Merged

Conversation

adlerjohn
Copy link
Member

@adlerjohn adlerjohn commented Oct 27, 2020

Initial pass of the consensus rules, covering block structure and state transitions.

@adlerjohn adlerjohn added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 27, 2020
@adlerjohn adlerjohn added this to the Pre-implementation draft milestone Oct 27, 2020
@adlerjohn adlerjohn self-assigned this Oct 27, 2020
@adlerjohn adlerjohn requested review from liamsi and musalbas November 18, 2020 23:58
rationale/message_block_layout.md Outdated Show resolved Hide resolved
rationale/message_block_layout.md Outdated Show resolved Hide resolved
rationale/message_block_layout.md Outdated Show resolved Hide resolved
rationale/message_block_layout.md Outdated Show resolved Hide resolved
specs/consensus.md Show resolved Hide resolved
specs/consensus.md Outdated Show resolved Hide resolved
specs/consensus.md Show resolved Hide resolved
@adlerjohn
Copy link
Member Author

Since the last review, the major change has been reverting the change that were previously made for #86 in 6d9648a as per #89 (comment), and adding the corresponding state transition rules for the transaction that pays for padding.

@adlerjohn adlerjohn requested a review from musalbas November 25, 2020 00:39
specs/consensus.md Outdated Show resolved Hide resolved
GRAFFITI_BYTES -> MAX_GRAFFITI_BYTES

Co-authored-by: Ismail Khoffi <[email protected]>
specs/consensus.md Outdated Show resolved Hide resolved

### `block.header`

The [block header](./data_structures.md#header) `block.header` (`header` for short) is the first thing that is downloaded from the new block, and commits to everything inside the block in some way. For previous block `prev` (if `prev` is not known, then the block is ignored), and previous block header `prev.header`, the following checks must be `true`:
Copy link
Member

@liamsi liamsi Nov 26, 2020

Choose a reason for hiding this comment

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

The block header block.header (header for short) is the first thing that is downloaded from the new block

If it is actively downloaded or received (e.g. via some gossip routine etc) should go in the network spec. Maybe say "processed"; this implies that you have it at hand.

Copy link
Member Author

Choose a reason for hiding this comment

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

The plan is actually to move that entire paragraph to the networking section, since a node won't even accept a block header unless it passes those checks.

Comment on lines +214 to +223
#### SignedTransactionDataPayForPadding

1. `tx.type` == [`TransactionType.PayForPadding`](./data_structures.md#signedtransactiondata).
1. The `ceil(tx.messageSize / SHARE_SIZE)` shares starting at index `wrappedTransactions.messageStartIndex` must:
1. Have namespace ID `tx.messageNamespaceID`.

Apply the following to the state:

```
```
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we remove this type together with the paragraph under Caveats?
(https://github.com/lazyledger/lazyledger-specs/pull/89/files#r531078625)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to be overzealous with the scope of this PR, so I filed #98 to follow up on how padding should be handled. For now I'd rather just leave the PayForPadding tx type as it was. #89 (comment)

@adlerjohn adlerjohn dismissed musalbas’s stale review November 27, 2020 15:56

Approved, issues filed for change requests.

@adlerjohn adlerjohn merged commit af28721 into master Nov 27, 2020
@adlerjohn adlerjohn deleted the adlerjohn-initial_consensus_rules branch November 27, 2020 15:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
consensus documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Padding shares should be deterministic and consensus-enforced
3 participants