LEARN
Block execution and consensus, step by step
Each step names its modules, inputs and outputs. The list below is the full text version; the buttons only move the highlight. Terms follow Inside the implementation. The order shows responsibilities, not a call graph. XDC uses XDPoS consensus inside the client. This page does not describe the Ethereum Engine API split between an execution client and a separate consensus client, and does not apply it to XDPoS.
Steps
Step 1 of 6. Receive a block
Receive a block
- Modules
- xone-net, xone-snap, xone-sync
- Inputs
- A block announced or served by network peers.
- Outputs
- A candidate block queued for validation.
Select the rules
- Modules
- xone-primitives, xone-chainspec
- Inputs
- The candidate block height and the chain specification.
- Outputs
- The fork rules that apply at that height.
Check XDPoS consensus
- Modules
- xone-consensus, xone-signer
- Inputs
- The block header, the XDPoS V1 or V2 rules and canonical state.
- Outputs
- The header is accepted or rejected under those rules.
Execute transactions
- Modules
- xone-evm, xone-executor, xone-state
- Inputs
- The block transactions and the parent state.
- Outputs
- A new state and receipts. XDC behavior is added to revm through protocol-specific hooks.
Publish state
- Modules
- xone-db, xone-node
- Inputs
- The executed state and receipts.
- Outputs
- Canonical state in storage. Storage publication has its own decision record (ADR-005).
Compare with the oracle
- Modules
- conformance harness
- Inputs
- Replay ranges and a pinned geth-XDC oracle.
- Outputs
- A replay record of the ranges and modes exercised. A record is evidence for those ranges only.