Uses ipfs-ethdb to validate completeness of IPFS Ethereum state data
Go to file
Ian Norden d5495e9648
Merge pull request #2 from vulcanize/validateTrie
Different modes; fix for geth 1.9.15 compatibility
2020-06-29 19:40:36 -05:00
cmd fix missing root node edge case and use nil snapshot to work with 1.9.15 2020-06-26 17:47:39 -05:00
environments fix missing root node edge case and use nil snapshot to work with 1.9.15 2020-06-26 17:47:39 -05:00
pkg remove depedency 2020-06-29 16:07:28 -05:00
.gitignore init repo 2020-06-25 15:11:39 -05:00
go.mod remove depedency 2020-06-29 16:07:28 -05:00
go.sum remove depedency 2020-06-29 16:07:28 -05:00
LICENSE init repo 2020-06-25 15:11:39 -05:00
main.go command 2020-06-25 15:12:02 -05:00
README.md remove depedency 2020-06-29 16:07:28 -05:00

eth-ipfs-state-validator

Uses pg-ipfs-ethdb to validate completeness of Ethereum state data on IPFS

Background

State data on Ethereum takes the form of Modified Merkle Patricia Tries. On disk each unique node of a trie is stored as a key-value pair between the Keccak256 hash of the RLP-encoded node and the RLP-encoded node. To prove the existence of a specific node in an MMPT with a known root hash, one provides a list of all of the nodes along the path descending from the root node to the node in question. To validate the completeness of a state database- to confirm every node for a state and/or storage trie(s) is present in a database- requires traversing the entire trie (or linked set of tries) and confirming the presence of every node in the database.

Usage

full validates completeness of the entire state corresponding to a provided state root, including both state and storage tries

./eth-ipfs-state-validator validateTrie --config={path to db config} --type=full --state-root={state root hex string}

state validates completeness of the state trie corresponding to a provided state root, excluding the storage tries

./eth-ipfs-state-validator validateTrie --config={path to db config} --type=state --state-root={state root hex string}

storage validates completeness of only the storage trie corresponding to a provided storage root and contract address

./eth-ipfs-state-validator validateTrie --config={path to db config} --type=storage --storage-root={state root hex string} --address={contract address hex string}

The config file holds the parameters for connecting to an IPFS-backing Postgres database.

[database]
    name     = "vulcanize_public"
    hostname = "localhost"
    user     = "postgres"
    password = ""
    port     = 5432

Maintainers

@vulcanize @AFDudley @i-norden

Contributing

Contributions are welcome!

VulcanizeDB follows the Contributor Covenant Code of Conduct.

License

AGPL-3.0 © Vulcanize Inc