The module already called itself github.com/luxfi/node while containing no node in Go: cmd/luxd was twenty-one lines that printed the size of a few types, and the Go column of the matrix measured a VM plugin. A repo that fetches the thing it claims to be has not replaced it, so the Go sources move in — 1515 files, the daemon and everything under it — and the build reaches outside this module for nothing. Rust and C++ sit beside it unchanged and are still measured against it by the differential. That is the point of one repo: the reference implementation and the two ports are the same checkout, so parity is a thing you can run rather than a thing you assert. Verified: builds, and the closure carries no lux-private — checked at build time rather than believed. The daemon starts twelve chains on a local network (P X C Q Z A B G K M F, plus D through its plugin) and reports healthy.
1.0 KiB
Package executor
This package deals with state management for P-Chain blocks.
*Block
The *Block type implements the linear.Block interface.
This is the type that the platformvm deals with when it uses linear.Blocks.
*Block wraps a blocks.Block and a manager.
The *Block itself doesn't have any state.
The state is all held by the manager, and the *Block acts upon the manager to get/set the state.
Therefore, we don't need to worry about deduplicating *Block instances.
The platformvm uses the manager to create blocks and query block state because
the manager.GetBlock returns a stateful block (*Block), whereas state.State's GetStatelessBlock returns a blocks.Block.
Visitors
This package contains three implementations of blocks.Visitor: verifier, acceptor and rejector.
These implement the logic for verifying, accepting and rejecting blocks.
Each implementation has a reference to a shared *backend, which maintains state, etc.
(The manager has a reference to the shared *backend as well.)