The node/ceremony.json file contains the results of the powers of tau ceremony for KZG polynomial commitments. The node/retroactive_peers.json file contains the retroactive rewards for nodes.
When starting a node, these files are currently loaded from disk using a relative path to the repository. This has two drawbacks:
Nodes cannot be started outside of the node directory.
The json files are not signed for releases.
Solution
This PR fixes both by embedding the json files in the Go binary.
Testing
Running the full node test suite fails for me both with and without this change, so I tested by running the KZG-related related tests (node/crypto/kzg_inclusion_prover_test.go and node/crypto/kzg/kzg_test.go). Both of these pass. I couldn't find tests that would load retroactive_peers.json.
I also tested by building a node binary in the node directory with GOEXPERIMENT=arenas go build -o node main.go and moving it outside the repository and running it there. For testing, I forced the recreation of the genesis file so that the retroactive_peers.json file is utilized.
Update
This PR originally embedded only the ceremony.json file. Thanks to feedback from TG, I also added the retroactive_peers.json file and updated this message to reflect that.
Problem
The
node/ceremony.json
file contains the results of the powers of tau ceremony for KZG polynomial commitments. Thenode/retroactive_peers.json
file contains the retroactive rewards for nodes.When starting a node, these files are currently loaded from disk using a relative path to the repository. This has two drawbacks:
node
directory.Solution
This PR fixes both by embedding the json files in the Go binary.
Testing
Running the full
node
test suite fails for me both with and without this change, so I tested by running the KZG-related related tests (node/crypto/kzg_inclusion_prover_test.go
andnode/crypto/kzg/kzg_test.go
). Both of these pass. I couldn't find tests that would loadretroactive_peers.json
.I also tested by building a node binary in the
node
directory withGOEXPERIMENT=arenas go build -o node main.go
and moving it outside the repository and running it there. For testing, I forced the recreation of the genesis file so that theretroactive_peers.json
file is utilized.Update
This PR originally embedded only the
ceremony.json
file. Thanks to feedback from TG, I also added theretroactive_peers.json
file and updated this message to reflect that.