go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

Add positioning ATX to commitment for PoST initialisation

Open fasmat opened this issue 2 years ago • 0 comments

Description

  • When starting a session in the PostSetupManager PoST is initialised with the VRF public key (or NodeId). Instead it should be initialised with the hash digest of the concatenation of the ID of the positioning ATX and the NodeId.
  • 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 the NodeId as input instead of just the NodeId.

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

fasmat avatar Sep 15 '22 13:09 fasmat