Uses ipfs-ethdb to validate completeness of IPFS Ethereum state data
Go to file
Prathamesh Musale 56aa03028c Upgrade Go version to 1.21 (#6)
Part of [Upgrade Go to v1.21 in ipld-eth-server](https://www.notion.so/Upgrade-Go-to-v1-21-in-ipld-eth-server-b78717fc055a4fc38616e09621b32b9b)

- Upgrade `ipfs/kubo` to `v0.23.0` that supports build with Go version 1.21
- Use `ipfs/boxo` as `ipfs/go-blockservice` has been moved to `ipfs/boxo/blockservice`; `ipfs/kubo` has also moved on to use `ipfs/boxo`

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: #6
Co-authored-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
Co-committed-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
2023-10-13 07:56:59 +00:00
.github/workflows Refactor to use plugeth-statediff (#1) 2023-09-20 06:28:06 +00:00
cmd Fix signal handling (#3) 2023-10-03 13:32:32 +00:00
environments Refactor for v5 and IPFS v0 blockstore (#73) 2023-05-18 22:46:51 -05:00
pkg Upgrade Go version to 1.21 (#6) 2023-10-13 07:56:59 +00:00
test Fix signal handling (#3) 2023-10-03 13:32:32 +00:00
.gitignore init repo 2020-06-25 15:11:39 -05:00
go.mod Upgrade Go version to 1.21 (#6) 2023-10-13 07:56:59 +00:00
go.sum Upgrade Go version to 1.21 (#6) 2023-10-13 07:56:59 +00:00
LICENSE init repo 2020-06-25 15:11:39 -05:00
main.go Update to v5 schema (#72) 2023-04-29 01:40:03 -05:00
README.md Refactor for v5 and IPFS v0 blockstore (#73) 2023-05-18 22:46:51 -05:00

eth-ipfs-state-validator

Go Report Card

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

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 --ipfs-path={path to ipfs repo} --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 --ipfs-path={path to ipfs repo} --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 --ipfs-path={path to ipfs repo} --type=storage --storage-root={state root hex string} --address={contract address hex string}

If an IPFS path is provided with the --ipfs-path flag, the validator operates through an IPFS block-service and expects a configured IPFS repository at the provided path. In this case, the validator will vie for contention on the lockfile located at the ipfs path.

Alternatively, if no IPFS path is provided, the --config flag can be used to provide a path to a .toml config file with Postgres database connection parameters. In this case, the validator interfaces directly with the Postgres database and the database is assumed to be IPFS-backing.

Postgres DB config:

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

Maintainers

@cerc-io @AFDudley @i-norden

Contributing

Contributions are welcome!

VulcanizeDB follows the Contributor Covenant Code of Conduct.

License

AGPL-3.0 © Vulcanize Inc