Skip to main content
The write node is the only role in Leafage that takes part in P2P sync and block execution. It is the chain’s original execution client (ETH uses Chaintable/go-ethereum; other chains use their own forks), and Leafage only attaches a data export layer on top of it. For the client’s own usage, sync modes, and RPC, refer to the documentation of the corresponding upstream project. This page only covers the attached part.

Added integration points

Keeping the changes concentrated is deliberate: the fork has to follow upstream releases over the long term, and the fewer upstream files it touches, the smaller the merge conflicts. New capabilities go into the pipeline repository first; the client side keeps only the call sites.

Enabling the pipeline tracer

When topic is omitted, it is generated from the chain ID as nodex_pipeline_{chainID}. See pipeline configuration for the full field descriptions. Once the tracer is attached, collection and upload both happen inside pipeline; the client is only responsible for calling the hooks at the right time. See the pipeline component documentation for the collection logic.

trace_debankBlock

Returns the complete execution output of a single block on demand (BlockFile + Header + StateDiff + ValidationHash), without depending on Kafka or S3.
It has two uses:
  • leafage-evm’s HTTP fallback mode polls it directly.
  • Comparing the StateDiff of a given block when debugging.
trace must be included in --http.api. Height 0 returns the genesis block — the genesis allocation, which has no transactions, is synthesized into transactions and traces so that downstream sees the same format as a normal block.

Block change notifications

The Kafka notification is not sent from the tracer but from writeBlockAndSetHead in core/blockchain.go: it is only sent once the new canonical head is determined, so that reorgs can be expressed correctly.
Publishing requires all three preconditions to hold:
  • The tracer is initialized.
  • The current instance is the Leader.
  • The height of the last published block is not higher than the current head. Nothing is sent on a rollback; it waits to send together with newer blocks.

History pruning

--ancient.prune makes the write node continuously prune historical block data; it requires --syncmode full:
  • Bodies and receipts are dropped once they leave the window of the most recent 90000 blocks.
  • Existing ancient data is deleted gradually in the background.
  • Headers and canonical hashes are always kept.
This switch targets Leafage’s scenario — downstream consumers read S3 and do not depend on the write node keeping historical block bodies.

pipeline

The tracer’s collection logic and data distribution.

Adding a new chain

Attach pipeline to other execution clients.