Skip to content

Fix and restructure java-tron Core Modules doc#349

Open
abn2357 wants to merge 3 commits into
tronprotocol:masterfrom
abn2357:fix_core_module
Open

Fix and restructure java-tron Core Modules doc#349
abn2357 wants to merge 3 commits into
tronprotocol:masterfrom
abn2357:fix_core_module

Conversation

@abn2357

@abn2357 abn2357 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Two related changes to developers/code-structure.md and the developer docs:

1. Accuracy fixes (verified against java-tron source)

  • Attribute the TRON-layer handshake (P2P_HELLO) and keep-alive (P2P_PING/P2P_PONG) to core/net instead of libp2p; libp2p only covers low-level peer discovery and connection transport.
  • Narrow the Framework/libp2p wording to "low-level peer discovery and connection transport".
  • db/ provides the RevokingDatabase interface and TronStoreWithRevoking base class; the actual rollback implementation is db2/core/SnapshotManager (the old AbstractRevokingStore no longer exists).
  • Block writes: non-solidified state goes into rollbackable snapshot/session layers; only solidified layers are flushed/merged to persistent storage.
  • The state applied by a new block is not rolled back during pending-transaction cleanup, but may still be rolled back on a fork switch before solidification.
  • LevelDB is the default storage engine, but ARM64 forces RocksDB (LevelDB is deprecated on ARM).
  • Correct directory paths in code blocks (protocol/src/main/protos, common/src/main/java/org/tron, chainbase/src/main/java/org/tron) and align api/ / core/ descriptions with the code block.
  • Architecture diagram label: crypt -> crypto.

2. Restructure

The single page bundled three independent articles (each with its own summary). Split the two deep-dive sections into standalone pages:

  • developers/chainbase.md — ChainBase deep dive
  • developers/network.md — P2P Network deep dive

The overview page keeps the 7-module map and links out to both deep dives. The developer nav gains a ChainBase / P2P Network entry right after Core Modules, and the P2P Network deep dive is cross-linked with the operational "Connect to the TRON Network" guide.

Test plan

  • mkdocs build succeeds with no warnings or errors
  • The three pages (overview, ChainBase, P2P Network) render and appear in the nav
  • Internal anchors (#block-synchronization, #block-and-transaction-broadcast) resolve correctly
  • Cross-links between P2P Network deep dive and the Connect-to-TRON guide work

abn2357 added 2 commits June 24, 2026 17:09
- Attribute TRON-layer handshake (P2P_HELLO) and keep-alive (P2P_PING/PONG)
  to core/net instead of libp2p; libp2p only covers low-level peer discovery
  and connection transport
- Correct protocol/chainbase directory paths in code blocks
- Update network summary to reflect discovery/connection moved to libp2p
- Fix architecture diagram label: crypt -> crypto
…ives

The single code-structure page bundled three independent articles (each with
its own summary). Split the two deep-dive sections into standalone pages:

- developers/chainbase.md: ChainBase deep dive
- developers/network.md: P2P Network deep dive

The overview page keeps the 7-module map and links out to both deep dives.
Add a ChainBase/P2P Network entry to the developer nav (right after Core
Modules), and cross-link the P2P Network deep dive with the operational
'Connect to the TRON Network' guide.
Comment thread docs/developers/chainbase.md Outdated

节点接收到新区块后产生的变更不会直接存储到持久化存储中,而是首先存在 snapshotImpl 中,每接收一个区块对应产生一个snapshotImpl 不断的接收区块会导致 snapshotImpl 越来越多,什么时候会写入到持久化存储中呢?

SnapshotManager 中存在两个变量:size 和 maxSize,size 此处我们简单理解为目前内存中有多少层 snapshotImpl,maxSIze 则表示目前固化块和最新块高度的差值。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Original typo remains: maxSIze -> maxSize

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thx, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants