go-spacemesh
go-spacemesh copied to clipboard
Add positioning ATX to commitment for PoST initialisation
Description
- When starting a session in the
PostSetupManager
PoST is initialised with the VRF public key (orNodeId
). Instead it should be initialised with the hash digest of the concatenation of theID
of the positioning ATX and theNodeId
. - The chosen positioning ATX needs to be added to the initial ATX as part of the
NIPostChallenge
.- For incoming initial ATXs check that they have this field set and that it references an existing valid ATX. For all other ATXs ensure that this feed is not set.
- When verifying a PoST use the hash digest of the concatenation of the
ID
of the positioning ATX and theNodeId
as input instead of just theNodeId
.
Implementation hints
- PoST initialisation https://github.com/spacemeshos/go-spacemesh/blob/1c6c817f3797dedf65921cc87baf04c7c65b80d6/activation/post.go#L263
- PoST verification: https://github.com/spacemeshos/go-spacemesh/blob/1c6c817f3797dedf65921cc87baf04c7c65b80d6/activation/handler.go#L209
- Selecting an positioning ATX: https://github.com/spacemeshos/go-spacemesh/blob/1c6c817f3797dedf65921cc87baf04c7c65b80d6/activation/activation.go#L437
- ATX validation: https://github.com/spacemeshos/go-spacemesh/blob/1c6c817f3797dedf65921cc87baf04c7c65b80d6/activation/handler.go#L214