-
Notifications
You must be signed in to change notification settings - Fork 1
add TON consensus doc #475
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the substantial update to ton/consensus.mdx. I found a few clarity and style items plus one terminology inconsistency to address before this merges cleanly. Findings (14)High (1)[HIGH] “three-phase commit” contradicts five-step listDescription: Suggestion: -BCP is structured as a **three-phase commit**:
+BCP is structured as a five‑step flow: Medium (10)Click to expand[MEDIUM] Fenced code blocks lack required language tagsDescription: Suggestion: --- a/ton/consensus.mdx
+++ b/ton/consensus.mdx
@@
-```
+```text
f < n/3
q ≥ 2n/3 @@
@@
[MEDIUM] Headings are not in sentence caseDescription: Suggestion: -## Consensus Model
-### Byzantine Fault Tolerance
-## Catchain Protocol
-## Block Consensus Protocol (BCP)
-## Rounds and Attempts
-## Validator Elections
-## Incentives and Penalties
-## Validator Guidelines
-## Extended Fault Tolerance Analysis
+## Consensus model
+### Byzantine fault tolerance
+## Catchain protocol
+## Block consensus protocol (BCP)
+## Rounds and attempts
+## Validator elections
+## Incentives and penalties
+## Validator guidelines
+## Extended fault tolerance analysis [MEDIUM] Generic “Introduction” heading should be specificDescription: Suggestion: -## Introduction
+## Overview [MEDIUM] Code identifiers not formatted in code fontDescription: Suggestion: -4. **PreCommit** – once ≥ `q` votes are collected, validators broadcast PreCommit.
-5. **Commit** – once ≥ `q` PreCommits are observed, validators issue CommitSign and the block is finalized.
+4. **PreCommit** – once ≥ `q` votes are collected, validators broadcast `PreCommit`.
+5. **Commit** – once ≥ `q` `PreCommit` messages are observed, validators issue `CommitSign` and the block is finalized.
@@
-- - Finalization requires ≥ `2n/3` CommitSigns.
+- - Finalization requires ≥ `2n/3` `CommitSign` messages. [MEDIUM] TON-specific chain names use non-canonical casingDescription: Suggestion: -### Set sizes
-- **Masterchain** – ~100 validators.
-- **Shardchains** – ~23 validators each.
+### Set sizes
+- **MasterChain** — ~100 validators.
+- **ShardChain** — ~23 validators each.
@@
- - ~1.7 TON per masterchain block.
- - ~1 TON per shardchain block.
+ - ~1.7 TON per MasterChain block.
+ - ~1 TON per ShardChain block. [MEDIUM] Inconsistent and non‑SI time units (“seconds” vs “s”; missing space)Description: Suggestion: -This separation allows TON to finalize blocks in **3–6 seconds** with **hundreds of validators** across the globe.
+This separation allows TON to finalize blocks in **3–6 s** with **hundreds of validators** across the globe. -Block latency is typically **3–6s**, bounded by attempt timers.
+Block latency is typically **3–6 s**, bounded by attempt timers. [MEDIUM] Words instead of numerals for a technical quantityDescription: Suggestion: -...security against up to one-third malicious validators**.
+...security against up to 1/3 malicious validators**. [MEDIUM] Non‑standard numeric shorthand without separatorsDescription: Suggestion: -If the smallest validator stakes 100k TON, then:
-- The largest counted stake = 300k TON.
-- A validator staking 1M TON still only contributes 300k TON effectively.
+If the smallest validator stakes 100,000 TON, then:
+- The largest counted stake = 300,000 TON.
+- A validator staking 1,000,000 TON still only contributes 300,000 TON effectively. [MEDIUM] Non‑ISO date formatDescription: Suggestion: -- Since June 2023, part of the subsidy is burned, introducing deflationary pressure as usage grows.
+- Since 2023-06, part of the subsidy is burned, introducing deflationary pressure as usage grows. [MEDIUM] Promotional tone in closing sentenceDescription: Suggestion: -This architecture enables TON to deliver **fast finality, decentralization, and strong BFT guarantees** at global scale.
+This architecture finalizes blocks in 3–6 seconds and preserves Byzantine fault tolerance with a decentralized validator set. Low (3)Click to expand[LOW] Mid-sentence capitalization and missing hyphen in “Byzantine Fault Tolerant”Description: Suggestion: -The TON Blockchain achieves consensus through a layered Byzantine Fault Tolerant (BFT) protocol designed for **high throughput, low latency, and security against up to one-third malicious validators**.
+The TON Blockchain achieves consensus through a layered Byzantine fault-tolerant (BFT) protocol designed for **high throughput, low latency, and security against up to one-third malicious validators**. [LOW] Vague quantity “hundreds of validators”Description: Suggestion: -This separation allows TON to finalize blocks in **3–6 seconds** with **hundreds of validators** across the globe.
+This separation allows TON to finalize blocks in **3–6 seconds** with a decentralized validator set. [LOW] List punctuation inconsistent for non‑sentence itemsDescription: Suggestion: -- **Transaction fees** (gas costs).
- - ~1.7 TON per MasterChain block.
- - ~1 TON per ShardChain block.
+- **Transaction fees** (gas costs)
+ - ~1.7 TON per MasterChain block
+ - ~1 TON per ShardChain block |
To fix the formatting issues:
npx remark -o --quiet --silently-ignore ton/consensus.mdx |
To fix the formatting issues:
npx remark -o --quiet --silently-ignore ton/consensus.mdx |
@laviniat1996 please add "closes #..." to your original post, so we know which task this PR is solving |
Added link to issue |
To fix the formatting issues:
npx remark -o --quiet --silently-ignore ton/consensus.mdx |
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.
This seems to be AI generated.
|
||
--- | ||
|
||
## Summary |
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.
Why does it have a summary?
@laviniat1996 Please, take into account the following info AudienceThis page is designed for individuals (developers) seeking to understand how consensus is maintained in TON and how security is guaranteed. We can gain additional insights from the top-performing pages of other chains. I noticed that readers who seek this typically acknowledge this for other chains. Scope of work
Technical insights for reworkHere is the feedback and suggestions I collected from TON Core. 1. Explain what Catchain is?The Catchain core thing is to build a DAG tree of options, catch deviation events (that’s why it was initially called catch chain), and adjust the difference. Catchain Overview
Catchain is a communication protocol between validators. It does not execute the consensus algorithm itself but prepares data required for the decision-making of a higher-level component: validator-session (BCP). Essential catchain tasks are:
- setting up a network overlay on the top of ADNL ensuring communication between validators;
- setting up and updating a list of neighbor nodes for direct communications inside the overlay;
- receiving catchain blocks from other validators and sending back decisions of the current validator;
- controlling blocks dependencies;
- managing an internal database holding current catchain session results
- restoring catchain session state after a validator restart;
- detecting forks and blaming validators;
- maintaining the consensus algorithm. 2. Make a clear definition and roles of Catchain and BCP in TONUnlike Classic three-phase BFT(pre-prepare, prepare, commit) in current PR, TON uses Catchain DAG. Overall this works according the following steps:
3. Explain the definition and the difference between a catchain session and и validator session.Important references |
This PR adds an indepth doc about how consensus works in TON. The doc still needs improvements, but it is in good shape to be added as it is.
Closes: #171