Problem
MinerCreateBlock (rpc/handlers/miner_block.go) produces a syntactically valid block with real Parents, Ticket, ElectionProof, BeaconEntries, and Messages. But ParentStateRoot is copied verbatim from the parent tipset because Lantern has no FVM. A published block with that state root is rejected by the network.
SyncSubmitBlock is gated by AllowBlockSubmit=true and returns ErrNotImpl by default. Correct posture today.
What's already there
vm/bridge/ is designed for this. The handler code (miner_block.go:294) already has:
if c.Bridge != nil && c.AllowBlockSubmit {
root, _, berr := c.Bridge.ComputeStateRoot(ctx, parentBlock.ParentStateRoot, int64(bt.Epoch-1), unsignedMessagesForBridge(bt.Messages))
...
}
The bridge interface is defined, but no concrete implementation ships in main today.
Proposed implementation
Path A: Forest/Lotus side-channel JSON-RPC client
- Implement
vm/bridge/forest.go as a thin JSON-RPC client that calls the upstream's StateCompute or equivalent method to obtain the post-execution state root for the candidate block's messages.
- Wire a
--vm-bridge-rpc=<url> flag on lantern daemon that constructs the bridge when set.
- Document that
AllowBlockSubmit=true is allowed only when --vm-bridge-rpc is also set; refuse to start otherwise.
For an SP backup use case, the operator already runs Lotus as primary. Pointing the bridge at the same Lotus instance is fine: the read path is trustless (everything verifiable via the F3-anchored state root), the production path delegates to local Lotus for state-root computation. If Lotus is down for the read path, Lantern serves chain head / state queries. If Lotus is up for the bridge, Lantern can produce blocks.
Acceptance
lantern daemon --allow-block-submit --vm-bridge-rpc=http://lotus:1234/rpc/v1 starts cleanly.
SyncSubmitBlock with a valid block produces a state root that matches what an upstream Lotus computes for the same messages.
SyncSubmitBlock actually publishes to /fil/blocks/testnetnet and the block is accepted by peers (validated by tailing peer logs).
Out of scope
- Pure-Go FVM port (Path B from the proposal). Multi-month, not realistic.
- Forest subprocess spawn (Path C). Punt to follow-up if anyone wants full local autonomy.
Related
- vm/bridge/doc.go
- rpc/handlers/miner_block.go
- net/blockpub/blockpub.go (the publish channel exists, just gated)
Problem
MinerCreateBlock(rpc/handlers/miner_block.go) produces a syntactically valid block with real Parents, Ticket, ElectionProof, BeaconEntries, and Messages. ButParentStateRootis copied verbatim from the parent tipset because Lantern has no FVM. A published block with that state root is rejected by the network.SyncSubmitBlockis gated byAllowBlockSubmit=trueand returnsErrNotImplby default. Correct posture today.What's already there
vm/bridge/is designed for this. The handler code (miner_block.go:294) already has:The bridge interface is defined, but no concrete implementation ships in main today.
Proposed implementation
Path A: Forest/Lotus side-channel JSON-RPC client
vm/bridge/forest.goas a thin JSON-RPC client that calls the upstream'sStateComputeor equivalent method to obtain the post-execution state root for the candidate block's messages.--vm-bridge-rpc=<url>flag onlantern daemonthat constructs the bridge when set.AllowBlockSubmit=trueis allowed only when--vm-bridge-rpcis also set; refuse to start otherwise.For an SP backup use case, the operator already runs Lotus as primary. Pointing the bridge at the same Lotus instance is fine: the read path is trustless (everything verifiable via the F3-anchored state root), the production path delegates to local Lotus for state-root computation. If Lotus is down for the read path, Lantern serves chain head / state queries. If Lotus is up for the bridge, Lantern can produce blocks.
Acceptance
lantern daemon --allow-block-submit --vm-bridge-rpc=http://lotus:1234/rpc/v1starts cleanly.SyncSubmitBlockwith a valid block produces a state root that matches what an upstream Lotus computes for the same messages.SyncSubmitBlockactually publishes to/fil/blocks/testnetnetand the block is accepted by peers (validated by tailing peer logs).Out of scope
Related