跳至主要内容
此页面是从英文翻译而来的。请注意,与原始页面相比,可能会出现错误或差异。真实的文档来源应始终是英文版本。

lifecycle

The following diagram describes Leap block production, as implemented in libraries/chain/controller.cpp:

flowchart TD
pp[producer_plugin] --> D
A("replay()"):::fun --> B("replay_push_block()"):::fun
B --> E("maybe_switch_forks()"):::fun
C("init()"):::fun ---> E
C --> A
D("push_block()"):::fun ---> E
subgraph G["apply_block()"]
direction TB
start -- "stage = Ø" --> sb
sb("start_block()"):::fun -- "stage = building_block" --> et
et["execute transactions" ] -- "stage = building_block" --> fb("finish_block()"):::fun
fb -- "stage = assembled block" --> cb["add transaction metadata and create completed block"]
cb -- "stage = completed block" --> commit("commit_block() (where we [maybe] add to fork_db and mark valid)"):::fun

end
B ----> start
E --> G
D --> F("log_irreversible()"):::fun
commit -- "stage = Ø" --> F
F -- "if in irreversible mode" --> G

classDef fun fill:#f96