spacemeshos/poet

Clean up the structure of round state.bin

Aberta

#384 aberto em 11 de set. de 2023

 (1 comentário) (0 reação) (0 responsável)Go (15 forks)auto 404
area/poetgood first issuerefactor

Métricas do repositório

Stars
 (24 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

The round state file contains many fields that are not required anymore:

type persistedRoundState struct {
	SecurityParam uint8
	Members       [][]byte // Deprecated
	Statement     []byte
	ParkedNodes   [][]byte // Deprecated
	NumLeaves     uint64
	NIP           *shared.MerkleProof
}

To remove:

  • Members
  • ParkedNodes

Questionable fields:

  • NIP: The round data (including the state) is removed shortly after finishing,
  • SecurityParam: It's currently hardcoded in the PoET binary anyway, and it can be decided when the proof is created

Also, the serialization format could be changed to a human-readable format like JSON for:

  • easier maintenance (fixing hard failures),
  • easier structure changing without the need for extra migration code if not necessary.

💡 Migration will be required to make sure that already deployed poets can upgrade easily.

Guia do colaborador