A simple standalone tool to check & verify a genesis file
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
src
test
.gitignore
LICENSE
README.md
Setup.hs
genesis-auditor.cabal
stack.yaml

README.md

genesis-auditor

Example Usage

When given a correct genesis file, it will spit out a bunch of checks passed:

$ stack exec -- genesis-auditor --target-sha <blake2b_256_sha> -s stakeholders.txt -i mainnet-genesis-dryrun-with-stakeholders.json -c vss-certs.txt -a inputGenesis.json
is-canonical-json-check -> Check Passed
delegation-stakeholders-match -> Check Passed
delegation-address-correspondence -> Check Passed
delegation-vss-correspondence -> Check Passed

When something is not correct, a failure will be reported:

$ stack exec -- genesis-auditor --target-sha <blake2b_256_sha> -s fake_stakeholders.txt -i mainnet-genesis-dryrun-with-stakeholders.json -c vss-certs.txt -a inputGenesis.json
is-canonical-json-check -> Check Passed
delegation-stakeholders-match -> Check Failed: Expecting stakeholders fromList ["a", "b", "c", "d"]
  missing stakeholders: fromList ["a"]
  unexpected stakeholders: fromList ["e"]
delegation-address-correspondence -> Check Passed
delegation-vss-correspondence -> Check Passed

Implemented Checks

The asserts the following properties of the genesis data:

  • The avvmDistr matches the output from the AVVM
  • the nonAvvmBalances is empty
  • The stakeholder addresses in the json file are exactly those provided in the stakeholders file
  • For each stakeholder address, there is a delegation certificate.
  • There are no delegation certificates that do not belong to one of the stakeholders
  • Each of the delegatePk from the delegation certificates corresponds to a signingKey in a vss certificate
  • There are no vss certificates where the signing key is not used as a delegatePk in one of the delegation certificates
  • Check that the number of stakeholders and the number of vss certificates are the same. This could be violated if multiple stakeholders delegated to the same core node
  • Converting to canonical JSON form and taking the blake2b_256_sha results in the specified hash.
  • Consistency checks on the vssCerts
  • Check that there are no duplicate JSON entries in the input