Files
platformvm/docs/block_formation_logic.md
zeekay ede37547f6 refactor(platformvm): consolidate block code, drop atomic_block, add v0 lift
- Drop atomic_block.go + legacy *_block_test.go (consolidated)
- Add block/v0/ subdir + lift_v0.go for old version handling
- Copyright header: 'Lux Industries, Inc.' → 'Lux Industries Inc' (no comma)
- block_adapter.go: new adapter layer
2026-06-01 15:22:27 -07:00

2.0 KiB

Block Composition and Formation Logic

Lux's P-Chain always builds and verifies the latest block format. The post-upgrade block model is the only model that ever runs on a Lux network: all legacy upgrade gates resolve to "active" at chain birth, so block formation has exactly one shape.

Block Types

  • Standard Blocks may contain multiple transactions of the following types: CreateChainTx, CreateNetTx, ImportTx, ExportTx, AddValidatorTx, AddDelegatorTx, AddNetValidatorTx, RemoveNetValidatorTx, TransformNetTx, AddPermissionlessValidatorTx, AddPermissionlessDelegatorTx.
  • Proposal Blocks may contain a single transaction of type RewardValidatorTx.
  • Option Blocks (Commit Block, Abort Block) carry no transactions.

Every block header contains ParentID, Height, and Time.

Block Formation Logic

The P-Chain picks transactions to include in the next block in this order:

  1. Advance chain time. Try to move chain time forward to the current local time or the earliest staker-set change event, issuing a Standard or Proposal block as needed.
  2. Reward expiring stakers. Walk any stakers whose staking period has ended at the new chain time and issue a RewardValidatorTx into a Proposal Block per staker.
  3. Pack mempool decision transactions. Fill a Standard Block with mempool decision transactions up to the default block size.

Block formation terminates as soon as any step produces a block. If no step finds work the builder schedules a fresh attempt and returns.

Notes