> For the complete documentation index, see [llms.txt](https://andelf.gitbook.io/tron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andelf.gitbook.io/tron/internals/maintenance.md).

# 产块和维护周期

所有 Active Witness 按照排序，以严格时序依次产块，产块所在时间区间被称作 slot(槽)。每隔一段事件进入维护周期，暂停产块，进行重新计票和维护操作。

目前主网每 3 秒产一个块，每6小时进入一次维护周期。测试网维护周期间隔一般是 10 分钟。

{% hint style="info" %}
注意

若某一 Active Witness 在其 slot 时间内没有及时产块并广播，则该 slot 会被网络跳过，记为一次 block miss, 下一 Active Witness 在自己的 slot 继续产块。

Block number 不会被跳过，永远自增 1.
{% endhint %}

### 维护周期

维护周期时，节点进行如下操作：

* 处理提案（见下一节）
* 重新计票。目前实现只处理上一维护周期至当前事件的所有投票，以 diff 方式处理。
* 按计票数排序得到新 Active Witness 列表和 Schedule.
* 更新下次维护周期时间

维护逻辑结束后，网络暂停两个 slot 产快（本意是预留时间给维护周期处理逻辑）。

### Genesis Block

Genesis Block 由配置文件生成。指定了公链的初始账号及其资产分配，以及初始 Witness 情况。

{% hint style="info" %}
提示

Genesis Block 配置一般会包含一个负数余额的账号叫 `Blackhole` , 链上交易的所有手续费会默认加到这个账号的余额中。

私有链建议使用 `T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb` 作为 Blackhole 地址。即 `410000000000000000000000000000000000000000.`
{% endhint %}

而 Block #1 时并不按照 Genesis Block 所列 Witness 的顺序生成，而是由任一产快节点产出并广播(需要配置 needSyncCheck = false)，此时全网节点都会自动接受 Block #1, 并触发第一个维护周期，生成之后的 Active Witness Schedule.

{% hint style="info" %}
提示

`needSyncCheck = false` 选项除了产出 Block #1 之外，没有其他作用。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://andelf.gitbook.io/tron/internals/maintenance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
