mirror of
https://github.com/luxfi/platformvm.git
synced 2026-10-30 15:22:12 +00:00
- 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
2.0 KiB
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:
- 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.
- Reward expiring stakers. Walk any stakers whose staking period has
ended at the new chain time and issue a
RewardValidatorTxinto a Proposal Block per staker. - 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.