-
Notifications
You must be signed in to change notification settings - Fork 1
feat: ported system contracts #459
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
Conversation
Thanks for the update to the system contracts docs. This PR focuses on Findings (8)High (1)[HIGH] Incorrect link anchor for ConfigParam 15Description: Suggestion: - The fine is deducted from the validator's `frozen` stake in the relevant `past_elections` record if approved. These funds stay locked for the period defined by [**ConfigParam 15**](https://tonviewer.com/config#0) (`stake_held_for`).
+ The fine is deducted from the validator's `frozen` stake in the relevant `past_elections` record if approved. These funds stay locked for the period defined by [**ConfigParam 15**](https://tonviewer.com/config#15) (`stake_held_for`). Medium (6)Click to expand[MEDIUM] H1 not in sentence case and does not match titleDescription: Suggestion: -# System Contracts overview
+# System contracts [MEDIUM] Misused Caution callout and hedging/future tenseDescription: Suggestion: -<Aside type="caution">
- This is a very low-level internals of TON Blockchain. You will probably never need to write and deploy any of this contracts.
-</Aside>
+<Aside type="important">
+ This page covers low‑level TON internals. You typically do not need to write or deploy these contracts.
+</Aside> [MEDIUM] Unclear/grammatical issues in Aside; passive and conversational toneDescription: Suggestion: -<Aside>
- In TON, system contracts are nearly the same that user contracts, so they surely has their addresses. Those addresses can be checked in [config parameters 1-4](https://tonviewer.com/config). (Yes, config account address is saved in config account). To maintain current address of config you may inspect the proposals, coming to current config.
-</Aside>
+<Aside>
+ System contracts are smart contracts and have on‑chain addresses. See [config parameters 1–4](https://tonviewer.com/config). The Config account stores the Config contract address. To track changes, review proposals to the Config contract.
+</Aside> [MEDIUM] Fenced code block missing languageDescription: Suggestion: -```
+```text
min(stake[i] * max_factor[j], stake[j])
[MEDIUM] Non‑ISO dates and ambiguous number abbreviationDescription: Suggestion: - - **Key retired** on Nov 22, 2023 (**block 34312810**), replaced with zeros.
+ - **Key retired** on 2023-11-22 (**block 34312810**), replaced with zeros.
- - **Apr 2022**: Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
+ - 2022-04: Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
- - **Mar 2023**: Raised `special_gas_limit` to 25M (**block 27747086**) for election throughput.
+ - 2023-03: Raised `special_gas_limit` to 25,000,000 (**block 27747086**) for election throughput. Low (1)Click to expand[LOW] Colloquial “10k” abbreviations in exampleDescription: Suggestion: - - _Without the 10k candidate_: TES = 900,000.
- - _With the 10k candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
- - **Result**: 10k candidates are excluded.
+ - _Without the 10,000‑stake candidate_: TES = 900,000.
+ - _With the 10,000‑stake candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
+ - **Result**: 10,000‑stake candidates are excluded. |
/review |
Thanks for the updates to the TON system contracts doc. I reviewed the changes in ton/system-contracts.mdx; a handful of style, clarity, and accuracy fixes are needed to align with the guide and avoid confusion. Findings (15)High (2)[HIGH] Misused caution aside; hedging, future tense, and grammarDescription: Suggestion: -<Aside type="caution">
- This is a very low-level internals of TON Blockchain. You will probably never need to write and deploy any of this contracts.
-</Aside>
+<Aside type="important">
+ These are low-level TON Blockchain internals. You typically do not need to write or deploy these contracts.
+</Aside> Alternative wording that also expands TON on first use: -<Aside type="caution">
- This is a very low-level internals of TON Blockchain. You will probably never need to write and deploy any of this contracts.
-</Aside>
+<Aside type="important">
+ This page covers low-level system contract internals of The Open Network (TON). You rarely need to write or deploy these contracts.
+</Aside> Or, if keeping the aside type unchanged, at minimum fix tone and grammar: - This is a very low-level internals of TON Blockchain. You will probably never need to write and deploy any of this contracts.
+ This section covers low‑level internals of the TON Blockchain. Most developers won’t need to write or deploy these contracts. [HIGH] Misleading example result and numeric shorthandDescription: Suggestion: -- _Without the 10k candidate_: TES = 900,000.
-- _With the 10k candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
-- **Result**: 10k candidates are excluded.
+- _Without the 10,000-stake candidate_: TES = 900,000.
+- _With the 10,000-stake candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
+- **Result**: The 10,000-stake candidate is excluded. Medium (10)Click to expand[MEDIUM] Overlong sentence, inconsistent dashes, and DNS misclassifiedDescription: Suggestion: -In TON, a set of special smart contracts controls consensus parameters for node operation—including TVM, catchain, fees, and chain topology - and how these parameters are stored and updated. Unlike older blockchains that hardcode these parameters, TON enables transparent on-chain governance. The current governance contracts include the **Elector**, **Config**, and **DNS** contracts, with expansion plans (e.g., extra-currency **Minter**).
+In TON, a set of special smart contracts controls consensus parameters for node operation — including TVM, catchain, fees, and chain topology — and how these parameters are stored and updated. Unlike older blockchains that hardcode these parameters, TON enables transparent on‑chain governance. The current governance contracts include the **Elector** and **Config** contracts, with expansion plans (for example, the extra‑currency **Minter**). [MEDIUM] Unexpanded acronyms (TVM, DNS) at first mentionDescription: Suggestion: -In TON, a set of special smart contracts controls consensus parameters for node operation—including TVM, catchain, fees, and chain topology - and how these parameters are stored and updated. Unlike older blockchains that hardcode these parameters, TON enables transparent on-chain governance. The current governance contracts include the **Elector**, **Config**, and **DNS** contracts, with expansion plans (e.g., extra-currency **Minter**).
+In TON, a set of special smart contracts controls consensus parameters for node operation—including TON Virtual Machine (TVM), catchain, fees, and chain topology - and how these parameters are stored and updated. Unlike older blockchains that hardcode these parameters, TON enables transparent on-chain governance. The current governance contracts include the **Elector**, **Config**, and Domain Name System (DNS) contracts, with expansion plans (e.g., extra-currency **Minter**). [MEDIUM] ADNL not expanded and MasterChain capitalizationDescription: Suggestion: -1. Send a message to the Elector with their ADNL address, public key, `max_factor`, and stake (TON amount).
+1. Send a message to the Elector with their Abstract Datagram Network Layer (ADNL) address, public key, `max_factor`, and stake (TON amount).
@@
-_Note:_ Only masterchain addresses can apply.
+_Note:_ Only MasterChain addresses can apply. [MEDIUM] Partial snippet not labeled “Not runnable”Description: Suggestion: -```python
+Not runnable
+```python
min(stake[i] * max_factor[j], stake[j])
[MEDIUM] Use code font for identifiers (“ConfigParam …”)Description: Suggestion: -2. **Config** stores it in **ConfigParam 36** (_next validators_).
-3. At the scheduled time (`utime_since`), **Config**:
-- Moves the old set to **ConfigParam 32** (_previous validators_).
-- Promotes **ConfigParam 36** to **ConfigParam 34** (_current validators_).
+2. **Config** stores it in `ConfigParam 36` (_next validators_).
+3. At the scheduled time (`utime_since`), **Config**:
+- Moves the old set to `ConfigParam 32` (_previous validators_).
+- Promotes `ConfigParam 36` to `ConfigParam 34` (_current validators_). [MEDIUM] Normalize dates and numeric formattingDescription: Suggestion: -**Key retired** on Nov 22, 2023 (**block 34312810**), replaced with zeros.
+**Key retired** on 2023-11-22 (**block 34,312,810**), replaced with zeros.
@@
-- **Apr 2022**: Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
-- **Mar 2023**: Raised `special_gas_limit` to 25M (**block 27747086**) for election throughput.
+- **2022-04**: Increased gas limits (**blocks 19,880,281 / 19,880,300**) to unblock elections.
+- **2023-03**: Raised `special_gas_limit` to 25,000,000 (**block 27,747,086**) for election throughput. Option B (ISO date; keep blocks as-is; remove month-name dates in bullets and expand number): -- **Key retired** on Nov 22, 2023 (**block 34312810**), replaced with zeros.
+- **Key retired** on 2023-11-22 (**block 34312810**), replaced with zeros.
@@
-- **Apr 2022**: Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
-- **Mar 2023**: Raised `special_gas_limit` to 25M (**block 27747086**) for election throughput.
+- Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
+- Raised `special_gas_limit` to 25,000,000 (**block 27747086**) for election throughput. Option C (ISO dates in bullets; expand number): -**Key retired** on Nov 22, 2023 (**block 34312810**), replaced with zeros.
+**Key retired** on 2023-11-22 (**block 34312810**), replaced with zeros.
-**Apr 2022**: Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
-**Mar 2023**: Raised `special_gas_limit` to 25M (**block 27747086**) for election throughput.
+2022-04: Increased gas limits (**blocks 19880281/19880300**) to unblock elections.
+2023-03: Raised `special_gas_limit` to 25,000,000 (**block 27747086**) for election throughput. [MEDIUM] Gerund used in procedural headingDescription: Suggestion: -### Process of reporting validator misbehavior
+### Report validator misbehavior [MEDIUM] Voice not in second person (application procedure)Description: Suggestion: -To apply, a validator must:
+To apply, you must: [MEDIUM] Voice not in second person (misbehavior reporting)Description: Suggestion: -To report misbehavior, a user must:
+To report misbehavior, you must: Low (3)Click to expand[LOW] List fragments end with periodsDescription: Suggestion: -- Non-withdrawn Toncoin in the `credits` hashmap.
-- New validator applications in the `elect` hashmap.
-- Past election data in the `past_elections` hashmap (including complaints and `frozen` stakes held for `stake_held_for` periods, defined in [**ConfigParam 15**](https://tonviewer.com/config#15)).
+- Non-withdrawn Toncoin in the `credits` hashmap
+- New validator applications in the `elect` hashmap
+- Past election data in the `past_elections` hashmap (including complaints and `frozen` stakes held for `stake_held_for` periods, defined in [**ConfigParam 15**](https://tonviewer.com/config#15)) [LOW] Inconsistent numeric style and missing units in examplesDescription: Suggestion: -- _Without the 10k candidate_: TES = 900,000.
-- _With the 10k candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
+- _Without the 10,000 TON candidate_: TES = 900,000.
+- _With the 10,000 TON candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
- **Result**: 10k candidates are excluded.
+
+- **Case 2**: 1 candidate stakes 100,000 TON (`max_factor=2.7`), 9 stake 10,000 TON.
+- Effective stake for the 100,000 TON candidate: `10,000 * 2.7 = 27,000`. [LOW] Inconsistent list punctuation in “Election constraints”Description: Suggestion: -- `min_stake` ≤ stake ≤ `max_stake`
-- `min_total_stake` ≤ total stake ≤ `max_total_stake`
+- `min_stake` ≤ stake ≤ `max_stake`.
+- `min_total_stake` ≤ total stake ≤ `max_total_stake`. |
Thanks for the doc updates here. I focused on the changes in ton/system-contracts.mdx and found several style and clarity issues that need fixes. Findings (11)High (1)[HIGH] Partial snippet label and fence format violate ruleDescription: Suggestion: -```python not runnable
-min(stake[i] * max_factor[j], stake[j])
-```
+Not runnable
+```python
+min(stake[i] * max_factor[j], stake[j])
+``` Medium (8)Click to expand[MEDIUM] Incorrect TON term casing (“masterchain”)Description: Suggestion: -_Note:_ Only masterchain addresses can apply.
+_Note:_ Only MasterChain addresses can apply. [MEDIUM] Mid‑sentence capitalization of generic termDescription: Suggestion: -The Elector is a special smart contract triggered by **Tick and Tock transactions** (forced executions at the start and end of each block). It checks whether it’s time to conduct a new election during each block.
+The Elector is a special smart contract triggered by **tick‑tock transactions** (forced executions at the start and end of each block). It checks whether it’s time to conduct a new election during each block. [MEDIUM] Gerund in H3 headingDescription: Suggestion: -### Conducting elections
+### Election process [MEDIUM] Missing canonical links for first mentions of ConfigParamsDescription: Suggestion: -2. **Config** stores it in `ConfigParam 36` (_next validators_).
+2. **Config** stores it in [**ConfigParam 36**](https://tonviewer.com/config#36) (_next validators_).
@@
-- Moves the old set to `ConfigParam 32` (_previous validators_).
+- Moves the old set to [**ConfigParam 32**](https://tonviewer.com/config#32) (_previous validators_).
@@
-- Promotes `ConfigParam 36` to `ConfigParam 34` (_current validators_).
+- Promotes [**ConfigParam 36**](https://tonviewer.com/config#36) to [**ConfigParam 34**](https://tonviewer.com/config#34) (_current validators_).
@@
-2. **Vote**: Validators (from **ConfigParam 34**) sign approval messages.
+2. **Vote**: Validators (from [**ConfigParam 34**](https://tonviewer.com/config#34)) sign approval messages.
@@
-- **Approved**: After `min_wins` rounds (**ConfigParam 11**) with ≥3/4 weighted votes.
+- **Approved**: After `min_wins` rounds ([**ConfigParam 11**](https://tonviewer.com/config#11)) with ≥3/4 weighted votes.
@@
-- _Critical parameters_ (**ConfigParam 10**) require more rounds.
+- _Critical parameters_ ([**ConfigParam 10**](https://tonviewer.com/config#10)) require more rounds. [MEDIUM] Use numerals for technical thresholds (“two‑thirds”)Description: Suggestion: -Approval requires agreement from over **two-thirds of the total validator weight** (not just a majority of participants).
+Approval requires agreement from over **2/3 of the total validator weight** (not just a majority of participants). [MEDIUM] Non‑ISO date format for specific dateDescription: Suggestion: -- **Key retired** on Nov 22, 2023 (**block 34312810**), replaced with zeros.
+- **Key retired** on 2023-11-22 (**block 34312810**), replaced with zeros. [MEDIUM] Missing TON units and grammar error in Case 1 exampleDescription: Suggestion: -- **Case 1**: 9 candidates stake 100,000 TON (`max_factor=2.7`), 1 candidate stakes 10,000.
+- **Case 1**: 9 candidates stake 100,000 TON (`max_factor=2.7`), 1 candidate stakes 10,000 TON.
-
-- _Without the 10,000-stake candidate_: TES = 900,000.
-- _With the 10,000-stake candidate_: TES = 9 \* 27,000 + 10,000 = 253,000.
-- **Result**: 10,000-stake candidate are excluded.
+- _Without the 10,000-stake candidate_: TES = 900,000 TON.
+- _With the 10,000-stake candidate_: TES = 9 \* 27,000 TON + 10,000 TON = 253,000 TON.
+- **Result**: The 10,000-stake candidate is excluded. [MEDIUM] Unclear phrasing and missing TON units in Case 2 exampleDescription: Suggestion: -- **Case 2**: 1 candidate stakes 100,000-stake (`max_factor=2.7`), 9 stake 10,000.
- - Effective stake for the 100,000-stake candidate: `10,000 * 2.7 = 27,000`.
- - Excess: `100,000 - 27,000 = 73,000` → sent to `credits`.
+- **Case 2**: 1 candidate stakes 100,000 TON (`max_factor=2.7`); 9 stake 10,000 TON.
+- Effective stake for the 100,000-stake candidate: 27,000 TON.
+- Excess: 73,000 TON → sent to `credits`. Low (2)Click to expand[LOW] Numbered list used for non‑procedural itemsDescription: Suggestion: -1. **Process validator applications**
-2. **Conduct elections**
-3. **Handle validator misbehavior reports**
-4. **Distribute validation rewards**
+- **Process validator applications**
+- **Conduct elections**
+- **Handle validator misbehavior reports**
+- **Distribute validation rewards** [LOW] Time‑relative phrasing (“expansion plans”)Description: Suggestion: -In TON, a set of special smart contracts controls consensus parameters for node operation — including TVM, catchain, fees, and chain topology — and how these parameters are stored and updated. Unlike older blockchains that hardcode these parameters, TON enables transparent on‑chain governance. The current governance contracts include the **Elector** and **Config** contracts, with expansion plans (for example, the extra‑currency **Minter**).
+In TON, a set of special smart contracts controls consensus parameters for node operation — including TVM, catchain, fees, and chain topology — and how these parameters are stored and updated. Unlike older blockchains that hardcode these parameters, TON enables transparent on‑chain governance. The current governance contracts include the **Elector** and **Config** contracts. |
Closes #107