{"id":24018757,"url":"https://github.com/jsign/eth-stateless","last_synced_at":"2025-05-07T04:23:57.783Z","repository":{"id":270750334,"uuid":"911344461","full_name":"jsign/eth-stateless","owner":"jsign","description":"Ethereum stateless tools","archived":false,"fork":false,"pushed_at":"2025-04-17T14:12:52.000Z","size":95,"stargazers_count":46,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T23:17:14.293Z","etag":null,"topics":["ethereum","ethereum-preimages","stateless"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-02T19:49:17.000Z","updated_at":"2025-04-17T14:12:56.000Z","dependencies_parsed_at":"2025-01-10T20:28:20.558Z","dependency_job_id":null,"html_url":"https://github.com/jsign/eth-stateless","commit_stats":null,"previous_names":["jsign/eth-stateless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsign%2Feth-stateless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsign%2Feth-stateless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsign%2Feth-stateless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsign%2Feth-stateless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsign","download_url":"https://codeload.github.com/jsign/eth-stateless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252811365,"owners_count":21807930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","ethereum-preimages","stateless"],"created_at":"2025-01-08T10:19:22.699Z","updated_at":"2025-05-07T04:23:57.735Z","avatar_url":"https://github.com/jsign.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eth-stateless\n\nA toolbox for various Ethereum stateless tasks, such as:\n\n- Merkle Patricia Trie preimages exporter, verifier and frequency analysis.\n\n## Prerequisites\n\n- Rust toolchain (stable)\n- Cargo\n- `--datadir` folder of a synced full-node Reth (i.e: archive node _not_ required)\n\n## Preimages\n\n```text\nUsage: preimages --datadir \u003cDATADIR\u003e \u003cCOMMAND\u003e\n\nCommands:\n  generate           Generate preimage file\n  verify             Verify preimage file\n  storage-slot-freq  Analyze storage-slot 29-byte prefix frequency and size impact\n  help               Print this message or the help of the given subcommand(s)\n\nOptions:\n  -d, --datadir \u003cDATADIR\u003e  Reth datadir path\n  -h, --help               Print help\n```\n\n### Commands\n\nThe tool provides two subcommands for preimages:\n\n- `generate`: Generate preimage file\n- `verify`: Verify preimage file\n- `storage-slot-freq` does a frequency analysis of the 29-byte prefix of storage slots\n\nFor the `generate` and `verify` commands, two ordering modes are supported:\n\n- `--plain`: Use plain ordering (i.e. unhashed)\n- `--eip7748`: Use EIP-7748 ordering (i.e. trie(s) DFS (hashed))\n\n### Generate\n\n```text\n$ cargo run -p preimages -- generate --help\nGenerate preimage file\n\nUsage: preimages --datadir \u003cDATADIR\u003e generate [OPTIONS] \u003c--plain|--eip7748\u003e\n\nOptions:\n      --output-path \u003cPATH\u003e  Preimages file output path [default: preimages.bin]\n      --plain               Use plain ordering\n      --eip7748             Use EIP-7748 ordering (i.e: hashed)\n  -h, --help                Print help\n```\n\nExamples:\n\n```text\n$ cargo run -p preimages --release -- --datadir=\u003creth datadir path\u003e generate --plain\nDatabase block number: 21547467\n[1/1] Generating preimage file...\n#####\u003e-------------------------------------------- 10% [eta: 32m] 0x19eaf81a0c1215b7e50524f42594d9496e0ec640\n```\n\n```text\n$ cargo run -p preimages --release -- --datadir=\u003creth datadir path\u003e generate --eip7748\nDatabase block number: 21547467\n[1/2] Ordering account addresses by hash...\n#################################################\u003e 100% [eta: 0s] fffec5f54c839fc4a744bebaede23b6e4904007c                                                                                                                \n[2/2] Generating preimage file...\n#####\u003e-------------------------------------------- 11% [eta: 49m] 1cb3c5ece6021f2d9bf63ba877f8dfc717db509ed66431bebb90c60fedb551ba\n```\n\n### Verify\n\n```text\nVerify preimage file\n\nUsage: preimages --datadir \u003cDATADIR\u003e verify [OPTIONS] \u003c--plain|--eip7748\u003e\n\nOptions:\n  -i, --preimages-file-path \u003cPATH\u003e  Preimages file path [default: preimages.bin]\n      --plain                       Use plain ordering\n      --eip7748                     Use EIP-7748 ordering (i.e: hashed)\n  -h, --help                        Print help\n```\n\nExample verifying a generated `--eip7748` preimage file:\n\n```text\n$ cargo run -p preimages --release -- --datadir=/fast/reth/reth_data verify --path preimages.bin --eip7748 \nDatabase block number: 21547467\n#\u003e------------------------------------------------ 2% [eta: 54m] 063f6a4b1968bd386869d8f9083e6d5b9525ccf980ab4d4d8d42d824dccaf1ab\n```\n\nIf we try to verify it with `--plain` it should obviously fail since the expected ordering is different:\n\n```text\n$ cargo run -p preimages --release -- --datadir=/fast/reth/reth_data verify --path preimages.bin --plain  \nDatabase block number: 21547467\n[1/2] Verifying provided preimage file...\nError: Address 0xEA46927B4Fc92248d052299FBFCC6778421930C6 preimage mismatch\n```\n\n### Storage slots 29-byte prefix frequency and size impact analysis\n\n```text\n$ cargo run -p preimages --release -- --datadir=/fast/reth/reth_data storage-slot-freq --help\nAnalyze top N storage slot frequency\n\nUsage: preimages --datadir \u003cDATADIR\u003e storage-slot-freq\n\nOptions:\n  -h, --help       Print help\n```\n\nExample:\n\n```text\n$ cargo run -p preimages --release -- --datadir=/fast/reth/reth_data storage-slot-freq\nDatabase block number: 21547467\n#################################################\u003e 100% [eta: 0s] fffffffff15abf397da76f1dcc1a1604f45126db                                                                                                                           \nTop 25 storage slot 29-byte prefix repetitions:\n0000000000000000000000000000000000000000000000000000000000: 56944638 (4.65%) ~1574MiB (cumm 1574MiB)\nf3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b: 13665589 (1.12%) ~377MiB (cumm 1952MiB)\n8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe3: 9425916 (0.77%) ~260MiB (cumm 2213MiB)\nf652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f37: 8546483 (0.70%) ~236MiB (cumm 2449MiB)\n405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3: 7701011 (0.63%) ~212MiB (cumm 2662MiB)\na66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a87: 3509056 (0.29%) ~97MiB (cumm 2759MiB)\n...\n```\n\n## LICENSE\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsign%2Feth-stateless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsign%2Feth-stateless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsign%2Feth-stateless/lists"}