Full Code of WorldDbs/rust-fil-proofs for AI

master 9ad3b80a9702 cached
728 files
5.3 MB
1.4M tokens
8088 symbols
1 requests
Download .txt
Showing preview only (5,721K chars total). Download the full file or copy to clipboard to get everything.
Repository: WorldDbs/rust-fil-proofs
Branch: master
Commit: 9ad3b80a9702
Files: 728
Total size: 5.3 MB

Directory structure:
gitextract_z6s4fmui/

├── .circleci/
│   └── config.yml
├── .clippy.toml
├── .dockerignore
├── .gitignore
├── CHANGELOG.md
├── CODEOWNERS
├── CONTRIBUTING.md
├── COPYRIGHT
├── Cargo.toml
├── Dockerfile-ci
├── Dockerfile-profile
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── SECURITY.md
├── bench.config.toml
├── build.rs
├── console/
│   ├── bridge.go
│   ├── bridge_test.go
│   ├── console.go
│   ├── console_test.go
│   ├── prompt/
│   │   └── prompter.go
│   └── testdata/
│       ├── exec.js
│       └── preload.js
├── eth/
│   ├── api.go
│   ├── api_backend.go
│   ├── api_test.go
│   ├── backend.go
│   ├── bloombits.go
│   ├── discovery.go
│   ├── downloader/
│   │   ├── api.go
│   │   ├── downloader.go
│   │   ├── downloader_test.go
│   │   ├── events.go
│   │   ├── metrics.go
│   │   ├── modes.go
│   │   ├── peer.go
│   │   ├── peer_test.go
│   │   ├── queue.go
│   │   ├── queue_test.go
│   │   ├── resultstore.go
│   │   ├── statesync.go
│   │   ├── testchain_test.go
│   │   └── types.go
│   ├── ethconfig/
│   │   ├── config.go
│   │   └── gen_config.go
│   ├── fetcher/
│   │   ├── block_fetcher.go
│   │   ├── block_fetcher_test.go
│   │   ├── tx_fetcher.go
│   │   └── tx_fetcher_test.go
│   ├── filters/
│   │   ├── api.go
│   │   ├── api_test.go
│   │   ├── bench_test.go
│   │   ├── filter.go
│   │   ├── filter_system.go
│   │   ├── filter_system_test.go
│   │   └── filter_test.go
│   ├── gasprice/
│   │   ├── gasprice.go
│   │   └── gasprice_test.go
│   ├── handler.go
│   ├── handler_eth.go
│   ├── handler_eth_test.go
│   ├── handler_snap.go
│   ├── handler_test.go
│   ├── peer.go
│   ├── peerset.go
│   ├── protocols/
│   │   ├── eth/
│   │   │   ├── broadcast.go
│   │   │   ├── discovery.go
│   │   │   ├── handler.go
│   │   │   ├── handler_test.go
│   │   │   ├── handlers.go
│   │   │   ├── handshake.go
│   │   │   ├── handshake_test.go
│   │   │   ├── peer.go
│   │   │   ├── peer_test.go
│   │   │   ├── protocol.go
│   │   │   └── protocol_test.go
│   │   └── snap/
│   │       ├── discovery.go
│   │       ├── handler.go
│   │       ├── peer.go
│   │       ├── protocol.go
│   │       ├── sync.go
│   │       └── sync_test.go
│   ├── state_accessor.go
│   ├── sync.go
│   ├── sync_test.go
│   └── tracers/
│       ├── api.go
│       ├── api_test.go
│       ├── internal/
│       │   └── tracers/
│       │       ├── 4byte_tracer.js
│       │       ├── assets.go
│       │       ├── bigram_tracer.js
│       │       ├── call_tracer.js
│       │       ├── evmdis_tracer.js
│       │       ├── noop_tracer.js
│       │       ├── opcount_tracer.js
│       │       ├── prestate_tracer.js
│       │       ├── tracers.go
│       │       ├── trigram_tracer.js
│       │       └── unigram_tracer.js
│       ├── testdata/
│       │   ├── call_tracer_create.json
│       │   ├── call_tracer_deep_calls.json
│       │   ├── call_tracer_delegatecall.json
│       │   ├── call_tracer_inner_create_oog_outer_throw.json
│       │   ├── call_tracer_inner_instafail.json
│       │   ├── call_tracer_inner_throw_outer_revert.json
│       │   ├── call_tracer_oog.json
│       │   ├── call_tracer_revert.json
│       │   ├── call_tracer_revert_reason.json
│       │   ├── call_tracer_simple.json
│       │   └── call_tracer_throw.json
│       ├── tracer.go
│       ├── tracer_test.go
│       ├── tracers.go
│       └── tracers_test.go
├── ethclient/
│   ├── ethclient.go
│   ├── ethclient_test.go
│   └── signer.go
├── ethstats/
│   └── ethstats.go
├── ffi-toolkit/
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       └── lib.rs
├── fil-proofs-param/
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── scripts/
│   │   ├── pin-params.sh
│   │   └── verify-parameters-json.sh
│   ├── src/
│   │   ├── bin/
│   │   │   ├── fakeipfsadd.rs
│   │   │   ├── paramcache.rs
│   │   │   ├── paramfetch.rs
│   │   │   └── parampublish.rs
│   │   └── lib.rs
│   └── tests/
│       ├── paramfetch/
│       │   ├── mod.rs
│       │   ├── session.rs
│       │   └── support/
│       │       └── mod.rs
│       ├── parampublish/
│       │   ├── mod.rs
│       │   ├── prompts_to_publish.rs
│       │   ├── read_metadata_files.rs
│       │   ├── support/
│       │   │   ├── mod.rs
│       │   │   └── session.rs
│       │   └── write_json_manifest.rs
│       ├── suite.rs
│       └── support/
│           └── mod.rs
├── fil-proofs-tooling/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── release.toml
│   ├── scripts/
│   │   ├── aggregate-benchmarks.sh
│   │   ├── benchy.sh
│   │   ├── micro.sh
│   │   ├── retry.sh
│   │   ├── run-remote.sh
│   │   ├── with-dots.sh
│   │   └── with-lock.sh
│   └── src/
│       ├── bin/
│       │   ├── benchy/
│       │   │   ├── hash_fns.rs
│       │   │   ├── main.rs
│       │   │   ├── merkleproofs.rs
│       │   │   ├── prodbench.rs
│       │   │   ├── stacked.rs
│       │   │   ├── window_post.rs
│       │   │   └── winning_post.rs
│       │   ├── check_parameters/
│       │   │   └── main.rs
│       │   ├── circuitinfo/
│       │   │   └── main.rs
│       │   ├── fdlimit/
│       │   │   └── main.rs
│       │   ├── gen_graph_cache/
│       │   │   └── main.rs
│       │   ├── gpu-cpu-test/
│       │   │   ├── README.md
│       │   │   └── main.rs
│       │   ├── micro.rs
│       │   ├── settings/
│       │   │   └── main.rs
│       │   └── update_tree_r_cache/
│       │       └── main.rs
│       ├── lib.rs
│       ├── measure.rs
│       ├── metadata.rs
│       └── shared.rs
├── filecoin-hashers/
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       ├── blake2s.rs
│       ├── lib.rs
│       ├── poseidon.rs
│       ├── poseidon_types.rs
│       ├── sha256.rs
│       └── types.rs
├── filecoin-proofs/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   └── preprocessing.rs
│   ├── build.rs
│   ├── cbindgen.toml
│   ├── examples/
│   │   ├── beacon-post.rs
│   │   ├── drgporep-vanilla-disk.rs
│   │   ├── drgporep-vanilla.rs
│   │   ├── drgporep.rs
│   │   ├── encoding.rs
│   │   ├── ffi/
│   │   │   ├── .gitignore
│   │   │   └── main.rs
│   │   ├── merklepor.rs
│   │   └── zigzag.rs
│   ├── parameters.json
│   ├── src/
│   │   ├── api/
│   │   │   ├── fake_seal.rs
│   │   │   ├── internal.rs
│   │   │   ├── mod.rs
│   │   │   ├── post.rs
│   │   │   ├── post_util.rs
│   │   │   ├── responses.rs
│   │   │   ├── seal.rs
│   │   │   ├── sector_builder/
│   │   │   │   ├── errors.rs
│   │   │   │   ├── helpers/
│   │   │   │   │   ├── add_piece.rs
│   │   │   │   │   ├── get_seal_status.rs
│   │   │   │   │   ├── get_sectors_ready_for_sealing.rs
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   ├── retrieve_piece.rs
│   │   │   │   │   ├── seal.rs
│   │   │   │   │   └── snapshots.rs
│   │   │   │   ├── kv_store/
│   │   │   │   │   ├── fs.rs
│   │   │   │   │   └── mod.rs
│   │   │   │   ├── metadata.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── scheduler.rs
│   │   │   │   ├── sealer.rs
│   │   │   │   └── state.rs
│   │   │   ├── util.rs
│   │   │   ├── window_post.rs
│   │   │   └── winning_post.rs
│   │   ├── bin/
│   │   │   ├── fakeipfsadd.rs
│   │   │   ├── paramcache.rs
│   │   │   ├── paramfetch.rs
│   │   │   ├── paramgen.rs
│   │   │   ├── parampublish.rs
│   │   │   └── phase2.rs
│   │   ├── caches.rs
│   │   ├── commitment_reader.rs
│   │   ├── constants.rs
│   │   ├── error.rs
│   │   ├── fr32.rs
│   │   ├── fr32_reader.rs
│   │   ├── lib.rs
│   │   ├── param.rs
│   │   ├── parameters.rs
│   │   ├── pieces.rs
│   │   ├── serde_big_array.rs
│   │   ├── singletons.rs
│   │   └── types/
│   │       ├── bytes_amount.rs
│   │       ├── mod.rs
│   │       ├── piece_info.rs
│   │       ├── porep_config.rs
│   │       ├── porep_proof_partitions.rs
│   │       ├── post_config.rs
│   │       ├── post_proof_partitions.rs
│   │       ├── private_replica_info.rs
│   │       ├── public_replica_info.rs
│   │       ├── sector_class.rs
│   │       └── sector_size.rs
│   └── tests/
│       ├── api.rs
│       ├── constants.rs
│       ├── mod.rs
│       ├── paramfetch/
│       │   ├── mod.rs
│       │   ├── prompts_to_fetch.rs
│       │   └── support/
│       │       ├── mod.rs
│       │       └── session.rs
│       ├── parampublish/
│       │   ├── mod.rs
│       │   ├── prompts_to_publish.rs
│       │   ├── read_metadata_files.rs
│       │   ├── support/
│       │   │   ├── mod.rs
│       │   │   └── session.rs
│       │   └── write_json_manifest.rs
│       ├── pieces.rs
│       ├── suite.rs
│       └── support/
│           └── mod.rs
├── fr32/
│   ├── Cargo.toml
│   ├── benches/
│   │   └── fr.rs
│   └── src/
│       ├── convert.rs
│       ├── lib.rs
│       ├── padding.rs
│       └── reader.rs
├── graphql/
│   ├── graphiql.go
│   ├── graphql.go
│   ├── graphql_test.go
│   ├── schema.go
│   └── service.go
├── issue_template.md
├── les/
│   ├── api.go
│   ├── api_backend.go
│   ├── api_test.go
│   ├── bloombits.go
│   ├── checkpointoracle/
│   │   └── oracle.go
│   ├── client.go
│   ├── client_handler.go
│   ├── clientpool.go
│   ├── clientpool_test.go
│   ├── commons.go
│   ├── costtracker.go
│   ├── distributor.go
│   ├── distributor_test.go
│   ├── enr_entry.go
│   ├── fetcher.go
│   ├── fetcher_test.go
│   ├── flowcontrol/
│   │   ├── control.go
│   │   ├── manager.go
│   │   └── manager_test.go
│   ├── handler_test.go
│   ├── metrics.go
│   ├── odr.go
│   ├── odr_requests.go
│   ├── odr_test.go
│   ├── peer.go
│   ├── peer_test.go
│   ├── protocol.go
│   ├── pruner.go
│   ├── pruner_test.go
│   ├── request_test.go
│   ├── retrieve.go
│   ├── server.go
│   ├── server_handler.go
│   ├── server_requests.go
│   ├── servingqueue.go
│   ├── state_accessor.go
│   ├── sync.go
│   ├── sync_test.go
│   ├── test_helper.go
│   ├── txrelay.go
│   ├── ulc.go
│   ├── ulc_test.go
│   ├── utils/
│   │   ├── exec_queue.go
│   │   ├── exec_queue_test.go
│   │   ├── expiredvalue.go
│   │   ├── expiredvalue_test.go
│   │   ├── limiter.go
│   │   ├── limiter_test.go
│   │   ├── timeutils.go
│   │   ├── timeutils_test.go
│   │   ├── weighted_select.go
│   │   └── weighted_select_test.go
│   └── vflux/
│       ├── client/
│       │   ├── api.go
│       │   ├── fillset.go
│       │   ├── queueiterator.go
│       │   ├── queueiterator_test.go
│       │   ├── requestbasket.go
│       │   ├── requestbasket_test.go
│       │   ├── serverpool.go
│       │   ├── serverpool_test.go
│       │   ├── timestats.go
│       │   ├── timestats_test.go
│       │   ├── valuetracker.go
│       │   ├── valuetracker_test.go
│       │   ├── wrsiterator.go
│       │   └── wrsiterator_test.go
│       ├── requests.go
│       └── server/
│           ├── balance.go
│           ├── balance_test.go
│           ├── balance_tracker.go
│           ├── clientdb.go
│           ├── prioritypool.go
│           ├── prioritypool_test.go
│           └── service.go
├── liblangutil/
│   ├── CMakeLists.txt
│   ├── CharStream.cpp
│   ├── EVMVersion.cpp
│   ├── ErrorReporter.cpp
│   ├── Exceptions.cpp
│   ├── ParserBase.cpp
│   ├── Scanner.cpp
│   ├── SemVerHandler.cpp
│   ├── SourceLocation.cpp
│   ├── SourceReferenceExtractor.cpp
│   ├── SourceReferenceFormatter.cpp
│   └── Token.cpp
├── logging-toolkit/
│   ├── Cargo.toml
│   └── src/
│       └── lib.rs
├── parameters.json
├── proptest-regressions/
│   └── crypto/
│       └── sloth.txt
├── release.toml
├── rust-fil-proofs.config.toml.sample
├── rust-toolchain
├── scripts/
│   ├── bench-parser.sh
│   ├── package-release.sh
│   ├── pin-params.sh
│   ├── publish-release.sh
│   └── verify-parameters-json.sh
├── sector-base/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       ├── api/
│       │   ├── disk_backed_storage.rs
│       │   ├── errors.rs
│       │   ├── mod.rs
│       │   ├── sector_store.rs
│       │   └── util/
│       │       └── mod.rs
│       ├── error.rs
│       ├── io/
│       │   ├── fr32.rs
│       │   └── mod.rs
│       └── lib.rs
├── sha2raw/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── consts.rs
│       ├── lib.rs
│       ├── platform.rs
│       ├── sha256.rs
│       ├── sha256_intrinsics.rs
│       └── sha256_utils.rs
├── src/
│   ├── bin/
│   │   └── bencher.rs
│   └── lib.rs
├── storage-backend/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       └── lib.rs
├── storage-proofs/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   ├── blake2s.rs
│   │   ├── drgraph.rs
│   │   ├── pedersen.rs
│   │   ├── preprocessing.rs
│   │   ├── sha256.rs
│   │   └── sloth.rs
│   ├── build.rs
│   ├── core/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── benches/
│   │   │   ├── blake2s.rs
│   │   │   ├── drgraph.rs
│   │   │   ├── encode.rs
│   │   │   ├── fr.rs
│   │   │   ├── merkle.rs
│   │   │   ├── misc.rs
│   │   │   ├── pedersen.rs
│   │   │   ├── sha256.rs
│   │   │   └── xor.rs
│   │   └── src/
│   │       ├── cache_key.rs
│   │       ├── compound_proof.rs
│   │       ├── crypto/
│   │       │   ├── aes.rs
│   │       │   ├── feistel.rs
│   │       │   ├── mod.rs
│   │       │   ├── pedersen.rs
│   │       │   ├── sloth.rs
│   │       │   └── xor.rs
│   │       ├── data.rs
│   │       ├── drgraph.rs
│   │       ├── error.rs
│   │       ├── fr32.rs
│   │       ├── gadgets/
│   │       │   ├── bench/
│   │       │   │   └── mod.rs
│   │       │   ├── constraint.rs
│   │       │   ├── encode.rs
│   │       │   ├── insertion.rs
│   │       │   ├── metric/
│   │       │   │   └── mod.rs
│   │       │   ├── mod.rs
│   │       │   ├── multipack.rs
│   │       │   ├── pedersen.rs
│   │       │   ├── por.rs
│   │       │   ├── test/
│   │       │   │   └── mod.rs
│   │       │   ├── uint64.rs
│   │       │   ├── variables.rs
│   │       │   └── xor.rs
│   │       ├── hasher/
│   │       │   ├── blake2s.rs
│   │       │   ├── mod.rs
│   │       │   ├── pedersen.rs
│   │       │   ├── poseidon.rs
│   │       │   ├── sha256.rs
│   │       │   └── types.rs
│   │       ├── lib.rs
│   │       ├── measurements.rs
│   │       ├── merkle/
│   │       │   ├── builders.rs
│   │       │   ├── mod.rs
│   │       │   ├── proof.rs
│   │       │   └── tree.rs
│   │       ├── multi_proof.rs
│   │       ├── parameter_cache.rs
│   │       ├── partitions.rs
│   │       ├── pieces.rs
│   │       ├── por.rs
│   │       ├── proof.rs
│   │       ├── sector.rs
│   │       ├── settings.rs
│   │       ├── test_helper.rs
│   │       └── util.rs
│   ├── parameters.json
│   ├── porep/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── benches/
│   │   │   ├── batch_hasher.rs
│   │   │   ├── encode.rs
│   │   │   └── parents.rs
│   │   ├── parent_cache.json
│   │   └── src/
│   │       ├── drg/
│   │       │   ├── circuit.rs
│   │       │   ├── compound.rs
│   │       │   ├── mod.rs
│   │       │   └── vanilla.rs
│   │       ├── encode.rs
│   │       ├── lib.rs
│   │       ├── macros.rs
│   │       ├── nse/
│   │       │   ├── mod.rs
│   │       │   └── vanilla/
│   │       │       ├── batch_hasher.rs
│   │       │       ├── butterfly_graph.rs
│   │       │       ├── challenges.rs
│   │       │       ├── config.rs
│   │       │       ├── expander_graph.rs
│   │       │       ├── labels.rs
│   │       │       ├── mod.rs
│   │       │       ├── nse.rs
│   │       │       ├── porep.rs
│   │       │       └── proof_scheme.rs
│   │       └── stacked/
│   │           ├── circuit/
│   │           │   ├── column.rs
│   │           │   ├── column_proof.rs
│   │           │   ├── create_label.rs
│   │           │   ├── hash.rs
│   │           │   ├── mod.rs
│   │           │   ├── params.rs
│   │           │   └── proof.rs
│   │           ├── mod.rs
│   │           └── vanilla/
│   │               ├── cache.rs
│   │               ├── challenges.rs
│   │               ├── column.rs
│   │               ├── column_proof.rs
│   │               ├── create_label/
│   │               │   ├── mod.rs
│   │               │   ├── multi.rs
│   │               │   └── single.rs
│   │               ├── create_label.rs
│   │               ├── encoding_proof.rs
│   │               ├── graph.rs
│   │               ├── hash.rs
│   │               ├── labeling_proof.rs
│   │               ├── macros.rs
│   │               ├── memory_handling.rs
│   │               ├── mod.rs
│   │               ├── params.rs
│   │               ├── porep.rs
│   │               ├── proof.rs
│   │               ├── proof_scheme.rs
│   │               └── utils.rs
│   ├── post/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── election/
│   │       │   ├── circuit.rs
│   │       │   ├── compound.rs
│   │       │   ├── mod.rs
│   │       │   └── vanilla.rs
│   │       ├── fallback/
│   │       │   ├── circuit.rs
│   │       │   ├── compound.rs
│   │       │   ├── mod.rs
│   │       │   └── vanilla.rs
│   │       ├── lib.rs
│   │       └── rational/
│   │           ├── circuit.rs
│   │           ├── compound.rs
│   │           ├── mod.rs
│   │           └── vanilla.rs
│   └── src/
│       ├── batchpost.rs
│       ├── beacon_post.rs
│       ├── challenge_derivation.rs
│       ├── circuit/
│       │   ├── beacon_post.rs
│       │   ├── bench/
│       │   │   └── mod.rs
│       │   ├── constraint.rs
│       │   ├── drgporep.rs
│       │   ├── kdf.rs
│       │   ├── mod.rs
│       │   ├── multi_proof.rs
│       │   ├── pedersen.rs
│       │   ├── por.rs
│       │   ├── porc.rs
│       │   ├── ppor/
│       │   │   └── mod.rs
│       │   ├── sloth.rs
│       │   ├── test/
│       │   │   └── mod.rs
│       │   ├── variables.rs
│       │   ├── vdf_post.rs
│       │   ├── xor.rs
│       │   └── zigzag.rs
│       ├── compound_proof.rs
│       ├── crypto/
│       │   ├── aes.rs
│       │   ├── blake2s.rs
│       │   ├── feistel.rs
│       │   ├── kdf.rs
│       │   ├── mod.rs
│       │   ├── pedersen.rs
│       │   ├── sloth.rs
│       │   └── xor.rs
│       ├── drgporep.rs
│       ├── drgraph.rs
│       ├── error.rs
│       ├── example_helper.rs
│       ├── fr32.rs
│       ├── hasher/
│       │   ├── blake2s.rs
│       │   ├── digest.rs
│       │   ├── mod.rs
│       │   ├── pedersen.rs
│       │   ├── sha256.rs
│       │   └── types.rs
│       ├── layered_drgporep.rs
│       ├── lib.rs
│       ├── merkle.rs
│       ├── merklepor.rs
│       ├── parameter_cache.rs
│       ├── partitions.rs
│       ├── piece_inclusion_proof.rs
│       ├── porc.rs
│       ├── porep.rs
│       ├── proof.rs
│       ├── test_helper.rs
│       ├── util.rs
│       ├── vde.rs
│       ├── vdf.rs
│       ├── vdf_post.rs
│       ├── vdf_sloth.rs
│       ├── zigzag_drgporep.rs
│       └── zigzag_graph.rs
├── storage-proofs-core/
│   ├── Cargo.toml
│   ├── README.md
│   ├── benches/
│   │   ├── blake2s.rs
│   │   ├── drgraph.rs
│   │   ├── merkle.rs
│   │   ├── misc.rs
│   │   ├── sha256.rs
│   │   └── xor.rs
│   ├── src/
│   │   ├── api_version.rs
│   │   ├── cache_key.rs
│   │   ├── compound_proof.rs
│   │   ├── crypto/
│   │   │   ├── aes.rs
│   │   │   ├── feistel.rs
│   │   │   ├── mod.rs
│   │   │   ├── sloth.rs
│   │   │   └── xor.rs
│   │   ├── data.rs
│   │   ├── drgraph.rs
│   │   ├── error.rs
│   │   ├── gadgets/
│   │   │   ├── constraint.rs
│   │   │   ├── encode.rs
│   │   │   ├── insertion.rs
│   │   │   ├── mod.rs
│   │   │   ├── multipack.rs
│   │   │   ├── por.rs
│   │   │   ├── uint64.rs
│   │   │   ├── variables.rs
│   │   │   └── xor.rs
│   │   ├── lib.rs
│   │   ├── measurements.rs
│   │   ├── merkle/
│   │   │   ├── builders.rs
│   │   │   ├── mod.rs
│   │   │   ├── proof.rs
│   │   │   └── tree.rs
│   │   ├── multi_proof.rs
│   │   ├── parameter_cache.rs
│   │   ├── partitions.rs
│   │   ├── pieces.rs
│   │   ├── por.rs
│   │   ├── proof.rs
│   │   ├── sector.rs
│   │   ├── settings.rs
│   │   ├── test_helper.rs
│   │   └── util.rs
│   └── tests/
│       ├── por_circuit.rs
│       ├── por_compound.rs
│       └── por_vanilla.rs
├── storage-proofs-porep/
│   ├── Cargo.toml
│   ├── README.md
│   ├── benches/
│   │   ├── encode.rs
│   │   └── parents.rs
│   ├── parent_cache.json
│   ├── src/
│   │   ├── drg/
│   │   │   ├── circuit.rs
│   │   │   ├── compound.rs
│   │   │   ├── mod.rs
│   │   │   └── vanilla.rs
│   │   ├── encode.rs
│   │   ├── lib.rs
│   │   └── stacked/
│   │       ├── circuit/
│   │       │   ├── column.rs
│   │       │   ├── column_proof.rs
│   │       │   ├── create_label.rs
│   │       │   ├── hash.rs
│   │       │   ├── mod.rs
│   │       │   ├── params.rs
│   │       │   └── proof.rs
│   │       ├── mod.rs
│   │       └── vanilla/
│   │           ├── cache.rs
│   │           ├── challenges.rs
│   │           ├── column.rs
│   │           ├── column_proof.rs
│   │           ├── cores.rs
│   │           ├── create_label/
│   │           │   ├── mod.rs
│   │           │   ├── multi.rs
│   │           │   └── single.rs
│   │           ├── encoding_proof.rs
│   │           ├── graph.rs
│   │           ├── hash.rs
│   │           ├── labeling_proof.rs
│   │           ├── macros.rs
│   │           ├── memory_handling.rs
│   │           ├── mod.rs
│   │           ├── params.rs
│   │           ├── porep.rs
│   │           ├── proof.rs
│   │           ├── proof_scheme.rs
│   │           └── utils.rs
│   └── tests/
│       ├── drg_circuit.rs
│       ├── drg_compound.rs
│       ├── drg_vanilla.rs
│       ├── stacked_circuit.rs
│       ├── stacked_compound.rs
│       └── stacked_vanilla.rs
└── storage-proofs-post/
    ├── Cargo.toml
    ├── README.md
    ├── src/
    │   ├── election/
    │   │   ├── circuit.rs
    │   │   ├── compound.rs
    │   │   ├── mod.rs
    │   │   └── vanilla.rs
    │   ├── fallback/
    │   │   ├── circuit.rs
    │   │   ├── compound.rs
    │   │   ├── mod.rs
    │   │   └── vanilla.rs
    │   ├── lib.rs
    │   └── rational/
    │       ├── circuit.rs
    │       ├── compound.rs
    │       ├── mod.rs
    │       └── vanilla.rs
    └── tests/
        ├── election_circuit.rs
        ├── election_compound.rs
        ├── election_vanilla.rs
        ├── fallback_circuit.rs
        ├── fallback_compound.rs
        ├── fallback_vanilla.rs
        ├── rational_circuit.rs
        ├── rational_compound.rs
        └── rational_vanilla.rs

================================================
FILE CONTENTS
================================================

================================================
FILE: .circleci/config.yml
================================================
version: 2.1

parameters:
  nightly-toolchain:
    type: string
    default: "nightly-2021-04-24"

executors:
  default:
    docker:
      - image: filecoin/rust:latest
    working_directory: /mnt/crate
    resource_class: 2xlarge+
  gpu:
    machine:
      image: ubuntu-1604-cuda-10.1:201909-23
    working_directory: ~/gpuci
    resource_class: gpu.nvidia.medium
  arm:
    machine:
      image: ubuntu-2004:202101-01
    resource_class: arm.large

setup-env: &setup-env
  FIL_PROOFS_PARAMETER_CACHE: "/tmp/filecoin-proof-parameters/"
  RUST_LOG: info


jobs:
  ensure_groth_parameters_and_keys_linux:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - restore_parameter_cache
      - ensure_filecoin_parameters
      - save_parameter_cache

  cargo_fetch:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - run:
          name: Calculate dependencies
          command: cargo generate-lockfile
          no_output_timeout: 30m
      - restore_rustup_cache
      - run: rustup install $(cat rust-toolchain)
      - run: rustup default $(cat rust-toolchain)
      - run: rustup install << pipeline.parameters.nightly-toolchain >>
      - run: rustup component add rustfmt-preview
      - run: rustup component add clippy
      - run: cargo update
      - run: cargo fetch
      - run: rustc +$(cat rust-toolchain) --version
      - run: rustup toolchain list --verbose
      - persist_to_workspace:
          root: "."
          paths:
            - Cargo.lock
      - save_rustup_cache
  test:
    executor: default
    environment: *setup-env
    parameters:
      crate:
        type: string
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Test (<< parameters.crate >>)
          command: cargo +$(cat rust-toolchain) test --verbose --package << parameters.crate >>
          no_output_timeout: 30m

  test_release:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Test in release profile
          command: |
            ulimit -n 20000
            ulimit -u 20000
            ulimit -n 20000
            cargo +$(cat rust-toolchain) test --verbose --release --workspace
            RUSTFLAGS="-D warnings" cargo +$(cat rust-toolchain) build --examples --release --workspace
          no_output_timeout: 30m

  test_ignored_release:
    executor: default
    environment: *setup-env
    parameters:
      crate:
        type: string
      features:
        type: string
        default: ""
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Test ignored in release profile
          command: |
              ulimit -n 20000
              ulimit -u 20000
              ulimit -n 20000
              cd << parameters.crate >>
              cargo test --release << parameters.features >> -- --ignored --nocapture
          environment:
            RUST_TEST_THREADS: 1
          no_output_timeout: 30m


  # Running with `use_multicore_sdr=true` should be integrated directly into the test code. For now we
  # just re-run the lifecycle tests to exercise the use_multicore_sdr code path with that setting set.
  test_multicore_sdr:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Test with use_multicore_sdr pairing enabled
          command: |
            ulimit -n 20000
            ulimit -u 20000
            ulimit -n 20000
            cargo +<< pipeline.parameters.nightly-toolchain >> test --all --verbose --release lifecycle -- --ignored --nocapture
            cargo +<< pipeline.parameters.nightly-toolchain >> test -p storage-proofs-porep --features single-threaded --release checkout_cores -- --test-threads=1
          no_output_timeout: 30m
          environment:
            RUST_TEST_THREADS: 1
            FIL_PROOFS_USE_MULTICORE_SDR: true

      - run:
          name: Test with use_multicore_sdr and blst enabled
          command: |
            ulimit -n 20000
            ulimit -u 20000
            ulimit -n 20000
            cargo +<< pipeline.parameters.nightly-toolchain >> test --all --no-default-features --features gpu,blst --verbose --release  lifecycle -- --ignored --nocapture
          no_output_timeout: 30m
          environment:
            RUST_TEST_THREADS: 1
            FIL_PROOFS_USE_MULTICORE_SDR: true

  test_gpu_tree_building:
    executor: gpu
    environment: *setup-env
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Set the PATH env variable
          command: |
            echo 'export PATH="~/.cargo/bin:$PATH"' | tee --append $BASH_ENV
            source $BASH_ENV
      - run:
          name: Install required libraries for GPU support
          command: |
            sudo apt-get update -y
            sudo apt install -y ocl-icd-opencl-dev libhwloc-dev
      - run:
          name: Test with GPU column and tree builders.
          command: |
            ulimit -n 20000
            ulimit -u 20000
            ulimit -n 20000
            cargo +<< pipeline.parameters.nightly-toolchain >> test --all --no-default-features --features gpu,blst --verbose --release lifecycle -- --ignored --nocapture
          no_output_timeout: 30m
          environment:
            RUST_TEST_THREADS: 1
            FIL_PROOFS_USE_GPU_COLUMN_BUILDER: true
            FIL_PROOFS_USE_GPU_TREE_BUILDER: true

  test_no_gpu:
    executor: default
    environment: *setup-env
    parameters:
      features:
        type: string
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Test with no gpu (<< parameters.features >>)
          command: |
            cargo +<< pipeline.parameters.nightly-toolchain >> test --all --verbose --no-default-features --features << parameters.features >>
          no_output_timeout: 30m

  test_arm_no_gpu:
    executor: arm
    environment: *setup-env
    parameters:
      features:
        type: string
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Install Rust
          command: |
            curl https://sh.rustup.rs -sSf | sh -s -- -y
      - run: rustup install $(cat rust-toolchain)
      - run: rustup default $(cat rust-toolchain)
      - run: rustup install << pipeline.parameters.nightly-toolchain >>
      - run: cargo update
      - run: cargo fetch
      - run:
          name: Install required libraries
          command: |
            sudo apt-get update -y
            sudo apt install -y libhwloc-dev
      - run:
          name: Test arm with no gpu (<< parameters.features >>)
          command: |
            cargo +<< pipeline.parameters.nightly-toolchain >> -Zpackage-features test --release --all --verbose --no-default-features --features << parameters.features >>
          no_output_timeout: 90m

  test_blst:
    executor: default
    environment: *setup-env
    parameters:
      crate:
        type: string
      features:
        type: string
        default: "gpu,blst"
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Test ignored with blst enabled (<< parameters.crate >>)
          command: |
            ulimit -n 20000
            ulimit -u 20000
            ulimit -n 20000
            RUST_LOG=trace cargo +<< pipeline.parameters.nightly-toolchain >> test --no-default-features --features << parameters.features >> --verbose --release --package << parameters.crate >> -- --nocapture
          no_output_timeout: 30m
          environment:
            RUST_TEST_THREADS: 1

  test_blst_ignored:
    executor: default
    environment: *setup-env
    parameters:
      crate:
        type: string
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache

      - run:
          name: Test with blst enabled (<< parameters.crate >>)
          command: |
            ulimit -n 20000
            ulimit -u 20000
            ulimit -n 20000
            cargo +<< pipeline.parameters.nightly-toolchain >> test --no-default-features --features gpu,blst --verbose --package << parameters.crate >> --release -- --ignored --nocapture
          no_output_timeout: 30m


  bench:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - restore_parameter_cache
      - run:
          name: Benchmarks
          command: cargo +$(cat rust-toolchain) build --benches --verbose --workspace
          no_output_timeout: 15m

  rustfmt:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - run:
          name: Run cargo fmt
          command: cargo fmt --all -- --check

  clippy:
    executor: default
    environment: *setup-env
    steps:
      - checkout
      - attach_workspace:
          at: "."
      - restore_rustup_cache
      - run:
          name: Run cargo clippy
          command: cargo +$(cat rust-toolchain) clippy --workspace
  test_darwin:
    macos:
      xcode: "10.0.0"
    working_directory: ~/crate
    resource_class: large
    environment: *setup-env
    steps:
      - checkout
      - run:
          name: Install hwloc 2.3.0
          command: |
            cd /tmp
            curl https://download.open-mpi.org/release/hwloc/v2.3/hwloc-2.3.0.tar.gz --location --output /tmp/hwloc-2.3.0.tar.gz
            tar xzvf hwloc-2.3.0.tar.gz
            cd hwloc-2.3.0
            ./configure
            make
            sudo make install
      - run:
          name: Install Rust
          command: |
            curl https://sh.rustup.rs -sSf | sh -s -- -y
      - run: rustup install $(cat rust-toolchain)
      - run: rustup default $(cat rust-toolchain)
      - run: cargo update
      - run: cargo fetch
      - run:
          name: Test Darwin
          command: |
            sudo ulimit -n 20000
            sudo ulimit -u 20000
            ulimit -n 20000
            cargo +$(cat rust-toolchain) test --release --verbose --workspace -- --nocapture
          no_output_timeout: 2h

commands:
  ensure_filecoin_parameters:
    steps:
      - run:
          name: Build paramcache if it doesn't already exist
          command: |
            set -x; test -f /tmp/paramcache.awesome \
            || (cargo build --release --workspace && find . -type f -name paramcache | xargs -I {} mv {} /tmp/paramcache.awesome)
      - run:
          name: Obtain filecoin groth parameters
          command: /tmp/paramcache.awesome --sector-sizes='2048,4096,16384,32768'
          no_output_timeout: 60m
      - run:
          name: Make the parameters world readable
          command: chmod -R 755 ${FIL_PROOFS_PARAMETER_CACHE}
  save_rustup_cache:
    steps:
      # Move things from the home directory to `/tmp` first, so that it can be
      # restored on executors that have a different home directory.
      - run: cp -R ~/.cargo ~/.rustup /tmp/
      - save_cache:
          name: "Save rustup cache"
          key: cargo-v28-e-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
          paths:
            - /tmp/.cargo
            - /tmp/.rustup
  restore_rustup_cache:
    steps:
      - restore_cache:
          name: "Restore rustup cache"
          key: cargo-v28-e-{{ checksum "rust-toolchain" }}-{{ checksum "Cargo.toml" }}-{{ checksum "Cargo.lock" }}
      # Cache might not be created yet, hence ignore if the move fails
      - run: cp -R /tmp/.cargo /tmp/.rustup ~/ || true
  save_parameter_cache:
    steps:
      - save_cache:
          name: "Save parameter cache"
          key: proof-params-v28-e-{{ checksum "filecoin-proofs/parameters.json" }}
          paths:
            - "/tmp/paramcache.awesome"
            - "/tmp/filecoin-proof-parameters/"
  restore_parameter_cache:
    steps:
      - restore_cache:
          name: "Restore parameter cache"
          key: proof-params-v28-e-{{ checksum "filecoin-proofs/parameters.json" }}

workflows:
  version: 2.1
  test_all:
    jobs:
      - ensure_groth_parameters_and_keys_linux
      - cargo_fetch
      - rustfmt:
          requires:
            - cargo_fetch
      - clippy:
          requires:
            - cargo_fetch

      - test_release:
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux
            
      - test_ignored_release:
          name: test_ignored_release_storage_proofs_post
          crate: "storage-proofs-post"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux
            
      - test_ignored_release:
          name: test_ignored_release_storage_proofs_core
          crate: "storage-proofs-core"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux
            
      - test_ignored_release:
          name: test_ignored_release_storage_proofs_porep
          crate: "storage-proofs-porep"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux
            
      - test_ignored_release:
          name: test_ignored_release_filecoin_proofs
          crate: "filecoin-proofs"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_gpu_tree_building:
          requires:
            #- cargo_fetch_gpu
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_multicore_sdr:
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst:
          name: test_blst_filecoin_proofs
          crate: "filecoin-proofs"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst_ignored:
          name: test_blst_ignored_filecoin_proofs
          crate: "filecoin-proofs"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_filecoin_proofs
          crate: "filecoin-proofs"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst:
          name: test_blst_storage_proofs_core
          crate: "storage-proofs-core"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst_ignored:
          name: test_blst_ignored_storage_proofs_core
          crate: "storage-proofs-core"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_storage_proofs_core
          crate: "storage-proofs-core"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst:
          name: test_blst_storage_proofs_post
          crate: "storage-proofs-post"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst_ignored:
          name: test_blst_ignored_storage_proofs_post
          crate: "storage-proofs-post"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_storage_proofs_post
          crate: "storage-proofs-post"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux


      - test_blst:
          name: test_blst_storage_proofs_porep
          crate: "storage-proofs-porep"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_blst_ignored:
          name: test_blst_ignored_storage_proofs_porep
          crate: "storage-proofs-porep"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_storage_proofs_porep
          crate: "storage-proofs-porep"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux


      - test_blst:
          name: test_blst_fil_proofs_tooling
          crate: "fil-proofs-tooling"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_fil_proofs_tooling
          crate: "fil-proofs-tooling"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_sha2raw
          crate: "sha2raw"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

            
      - test_blst:
          name: test_blst_filecoin_hashers
          crate: "filecoin-hashers"
          features: "blst,gpu,poseidon,sha256,blake2s"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_filecoin_hashers
          crate: "filecoin-hashers"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux


      - test_blst:
          name: test_blst_fil_proofs_param
          crate: "fil-proofs-param"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test:
          name: test_fil_proofs_param
          crate: "fil-proofs-param"
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_no_gpu:
          name: test_no_gpu_pairing
          features: 'pairing'
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_no_gpu:
          name: test_no_gpu_blst
          features: 'blst'
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_arm_no_gpu:
          name: test_arm_no_gpu_pairing
          features: 'pairing'
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - test_arm_no_gpu:
          name: test_arm_no_gpu_blst
          features: 'blst'
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux

      - bench:
          requires:
            - cargo_fetch
            - ensure_groth_parameters_and_keys_linux
      - test_darwin

      - test:
          name: test_fr32
          crate: "fr32"
          requires:
            - cargo_fetch

      - test_blst:
          name: test_blst_fr32
          crate: "fr32"
          requires:
            - cargo_fetch


================================================
FILE: .clippy.toml
================================================
type-complexity-threshold = 400

================================================
FILE: .dockerignore
================================================
.git
/target/*


================================================
FILE: .gitignore
================================================
/target
**/*.rs.bk
Cargo.lock
.criterion
**/*.h
heaptrack*
.bencher
*.profile
*.heap
rust-fil-proofs.config.toml


================================================
FILE: CHANGELOG.md
================================================
# Changelog

All notable changes to rust-fil-proofs will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://book.async.rs/overview/stability-guarantees.html).

## Unreleased

## [7.0.1] - 2021-05-06

- Added Apple M1 asm support via updated sha2 dependency [#1457](https://github.com/filecoin-project/rust-fil-proofs/pull/1457)
- Remove additional build warnings and update CI nightly toolchain [#1456](https://github.com/filecoin-project/rust-fil-proofs/pull/1456)
- Fix aarch64/Linux build regression [#1455](https://github.com/filecoin-project/rust-fil-proofs/pull/1455)
- Fix changelog errors and typos [#1451](https://github.com/filecoin-project/rust-fil-proofs/pull/1451)
- Fix initial value for cache_count [#1454](https://github.com/filecoin-project/rust-fil-proofs/pull/1454)

## [7.0.0] - 2021-04-28

- Split up non-gpu tests for improved CI [#1448](https://github.com/filecoin-project/rust-fil-proofs/pull/1448)
- Use latest version of dialoguer [#1447](https://github.com/filecoin-project/rust-fil-proofs/pull/1447)
- Fix circuitinfo's binary name [#1443](https://github.com/filecoin-project/rust-fil-proofs/pull/1443)
- Remove deprecated calls and clean-up warnings; add parallelization [#1436](https://github.com/filecoin-project/rust-fil-proofs/pull/1436)
- Migrate gpu2 to default gpu code; Update rust toolchain to 1.51.0 [#1441](https://github.com/filecoin-project/rust-fil-proofs/pull/1441)
- Improve unsealing memory performance [#1401](https://github.com/filecoin-project/rust-fil-proofs/pull/1401)
- Update codeowners to current [#1432](https://github.com/filecoin-project/rust-fil-proofs/pull/1432)
- Update config.json for the benches [#1431](https://github.com/filecoin-project/rust-fil-proofs/pull/1431)

## [6.1.0] - 2021-03-09

- Update bellperson to the latest version [#1430](https://github.com/filecoin-project/rust-fil-proofs/pull/1430)
- Remove unused metrics capture CI job [#1428](https://github.com/filecoin-project/rust-fil-proofs/pull/1428)
- Split up pc1/pc2 in the Window PoSt bench [#1427](https://github.com/filecoin-project/rust-fil-proofs/pull/1427)
- Use `compress,asm` features of sha2 for aarch64 [#1404](https://github.com/filecoin-project/rust-fil-proofs/pull/1404)
- Add gpu2, an optional feature that uses `neptune`'s opencl backend [#1397](https://github.com/filecoin-project/rust-fil-proofs/pull/1397)
- Clean-up imports and remove globs [#1394](https://github.com/filecoin-project/rust-fil-proofs/pull/1394)
- Remove `storage-proofs` sub-crate [#1393](https://github.com/filecoin-project/rust-fil-proofs/pull/1393)
- Re-factor parameter related binaries [#1392](https://github.com/filecoin-project/rust-fil-proofs/pull/1392)
- Fix merkle bench for poseidon hashing [#1389](https://github.com/filecoin-project/rust-fil-proofs/pull/1389)
- Move `phase2` code into its own crate [#1388](https://github.com/filecoin-project/rust-fil-proofs/pull/1388)
- Move `fr32` into its own crate [#1387](https://github.com/filecoin-project/rust-fil-proofs/pull/1387)
- Ensure that builds without gpu support work [#1386](https://github.com/filecoin-project/rust-fil-proofs/pull/1386)
- Increase parallelism in fallback PoSt [#1384](https://github.com/filecoin-project/rust-fil-proofs/pull/1384)
- Move checkout_cores test behing a single-threaded feature [#1383](https://github.com/filecoin-project/rust-fil-proofs/pull/1383)
- Improve the cache preservation in Window PoSt bench [#1382](https://github.com/filecoin-project/rust-fil-proofs/pull/1382)
- Correct some typos in the Changelog [#1381](https://github.com/filecoin-project/rust-fil-proofs/pull/1381)

## [6.0.0] - 2020-12-01

- Add PoR gadget that does not add a public input [#1374](https://github.com/filecoin-project/rust-fil-proofs/pull/1374)
- Update README and fix some typos [#1377](https://github.com/filecoin-project/rust-fil-proofs/pull/1377)
- Update bellperson using new blstrs, which in turn now uses`blst@0.3.2` [#1376](https://github.com/filecoin-project/rust-fil-proofs/pull/1376)
- Fix tree_c and tree_r_last generation in GPU mode [#1375](https://github.com/filecoin-project/rust-fil-proofs/pull/1375)
- Add API version enum for determining runtime behaviour [#1362](https://github.com/filecoin-project/rust-fil-proofs/pull/1362)
- Parallelize CI test runs across packages [#1358](https://github.com/filecoin-project/rust-fil-proofs/pull/1358)
- Update paramcache run for metrics capture CI job [#1363](https://github.com/filecoin-project/rust-fil-proofs/pull/1363)
- Re-organize filecoin-proofs source [#1352](https://github.com/filecoin-project/rust-fil-proofs/pull/1352)
- Move hashers into `filecoin-hashers` crate [#1356](https://github.com/filecoin-project/rust-fil-proofs/pull/1356)
- Speed up Fr32Reader [#1341](https://github.com/filecoin-project/rust-fil-proofs/pull/1341)
- Serialize GPU tree building with GPU lock [#1335](https://github.com/filecoin-project/rust-fil-proofs/pull/1335)
- Disable `phase2` tests that require external files [#1342](https://github.com/filecoin-project/rust-fil-proofs/pull/1342)
- Move `phase2` into its own crate [#1340](https://github.com/filecoin-project/rust-fil-proofs/pull/1340)
- Raise soft fdlimit to max at runtime (OS X/Linux) [#1338](https://github.com/filecoin-project/rust-fil-proofs/pull/1338)
- Improve clippy lints (rust 2018 idioms) [#1337](https://github.com/filecoin-project/rust-fil-proofs/pull/1337)

## [5.4.0] - 2020-11-02

- Fix graph generation [#1336](https://github.com/filecoin-project/rust-fil-proofs/pull/1336)

## [5.3.0] - 2020-10-29

- Integrate blst backend and proof verification optimizations [#1332](https://github.com/filecoin-project/rust-fil-proofs/pull/1332)
- Remove unused pedersen hasher [#1331](https://github.com/filecoin-project/rust-fil-proofs/pull/1331)
- Sanity check commitments [#1330](https://github.com/filecoin-project/rust-fil-proofs/pull/1330)
- Install hwloc to fix metrics capture on CI [#1328](https://github.com/filecoin-project/rust-fil-proofs/pull/1328)
- Remove no longer used exports [#1315](https://github.com/filecoin-project/rust-fil-proofs/pull/1315)
- Add tests for resumable sealing [#1309](https://github.com/filecoin-project/rust-fil-proofs/pull/1309)
- Add circuitinfo CLI tool to count circuit constraints [#1325](https://github.com/filecoin-project/rust-fil-proofs/pull/1325)
- Remove mutex from settings access [#1321](https://github.com/filecoin-project/rust-fil-proofs/pull/1321)
- Add SECURITY.md [#1317](https://github.com/filecoin-project/rust-fil-proofs/pull/1317)
- Update hwloc dependency for CI [#1316](https://github.com/filecoin-project/rust-fil-proofs/pull/1316)

## [5.2.3] - 2020-10-13

- Update neptune dependency version

## [5.2.2] - 2020-10-13

- Add notes about param and cache verification [#1313](https://github.com/filecoin-project/rust-fil-proofs/pull/1313)
- Update incorrect log message [#1312](https://github.com/filecoin-project/rust-fil-proofs/pull/1312)
- Bind threads to cores in multicore SDR [#1305](https://github.com/filecoin-project/rust-fil-proofs/pull/1305)
- Add hwloc dependency to CI [#1307](https://github.com/filecoin-project/rust-fil-proofs/pull/1307)

## [5.2.1] - 2020-10-01

- Pin neptune to version 1.2.x [#1302](https://github.com/filecoin-project/rust-fil-proofs/pull/1302)
- Add correct sizes for metrics capture CI [#1301](https://github.com/filecoin-project/rust-fil-proofs/pull/1301)
- Ensure all PoSt code paths are tested [#1299](https://github.com/filecoin-project/rust-fil-proofs/pull/1299)
- Add byte_unit dep for handling benchy input sizes [#1297](https://github.com/filecoin-project/rust-fil-proofs/pull/1297)
- Implement prefetch macro for aarch64 [#1294](https://github.com/filecoin-project/rust-fil-proofs/pull/1294)

## [5.2.0] - 2020-09-28

- Add Seal resume by skipping existing layers [#1292](https://github.com/filecoin-project/rust-fil-proofs/pull/1292)
- Use two producers in all layers [#1296](https://github.com/filecoin-project/rust-fil-proofs/pull/1296)
- Re-export some methods that moved for api access [#1291](https://github.com/filecoin-project/rust-fil-proofs/pull/1291)
- Update rustc to 1.46.0 [#1290](https://github.com/filecoin-project/rust-fil-proofs/pull/1290)
- Optimize Phase 1 (Replication) [#1289](https://github.com/filecoin-project/rust-fil-proofs/pull/1289)
- Add Seal resume testing to the Window PoSt bench [#1288](https://github.com/filecoin-project/rust-fil-proofs/pull/1288)
- Add labeling test vectors [#1285](https://github.com/filecoin-project/rust-fil-proofs/pull/1285)
- Remove artificial requirement that sector count be 1 for single vanilla proof [#1283](https://github.com/filecoin-project/rust-fil-proofs/pull/1283)
- Add Parent Cache and parameter verification and settings to enable [#1265](https://github.com/filecoin-project/rust-fil-proofs/pull/1265)
- Improve SectorId logging [#1280](https://github.com/filecoin-project/rust-fil-proofs/pull/1280)
- Split up Window PoSt API into separate calls [#1278](https://github.com/filecoin-project/rust-fil-proofs/pull/1278)
- Destructure settings [#1273](https://github.com/filecoin-project/rust-fil-proofs/pull/1273)

## [5.1.4] - 2020-09-08

- Add FaultySectors error to Fallback PoSt [#1274](https://github.com/filecoin-project/rust-fil-proofs/pull/1274)

## [5.1.3] - 2020-09-07

- Make fil-blst usage in Window PoSt possible [#1272](https://github.com/filecoin-project/rust-fil-proofs/pull/1272)

## [5.1.2] - 2020-09-03

- Accelerate SNARK verification [#1271](https://github.com/filecoin-project/rust-fil-proofs/pull/1271)
- Decompress proofs in parallel [#1268](https://github.com/filecoin-project/rust-fil-proofs/pull/1268)
- Eliminate wasteful public-input conversions [#1267](https://github.com/filecoin-project/rust-fil-proofs/pull/1267)
- Remove usage of unwrap [#1260](https://github.com/filecoin-project/rust-fil-proofs/pull/1260)
- Pin params to the filecoin collab cluster [#1263](https://github.com/filecoin-project/rust-fil-proofs/pull/1263)

## [5.1.1] - 2020-08-12

- Only perform subgroup check on 'after' params [#1258](https://github.com/filecoin-project/rust-fil-proofs/pull/1258)

## [5.1.0] - 2020-08-12

- Add Phase2 cli verify raw g1 point command [#1256](https://github.com/filecoin-project/rust-fil-proofs/pull/1256)

## [5.0.0] - 2020-08-10

- Publish v28 parameters and update Changelog for release [#1254](https://github.com/filecoin-project/rust-fil-proofs/pull/1254)
- Fix benchmark examples in README [#1253](https://github.com/filecoin-project/rust-fil-proofs/pull/1253)
- Remove unused dependencies [#1124](https://github.com/filecoin-project/rust-fil-proofs/pull/1124) and [#1252](https://github.com/filecoin-project/rust-fil-proofs/pull/1252)
- Add script to validate parameter checksums in parameters.json [#1251](https://github.com/filecoin-project/rust-fil-proofs/pull/1251)
- phase2-cli force small-raw contributions [#1248](https://github.com/filecoin-project/rust-fil-proofs/pull/1248)
- phase2-cli parse command [#1247](https://github.com/filecoin-project/rust-fil-proofs/pull/1247)
- phase2-cli merge command [#1242](https://github.com/filecoin-project/rust-fil-proofs/pull/1242)
- phase2-cli paramgen and filename parsing [#1240](https://github.com/filecoin-project/rust-fil-proofs/pull/1240)
- Verify transitions from non-raw to raw parameters in phase2-cli [#1239](https://github.com/filecoin-project/rust-fil-proofs/pull/1239)
- Add a check parameter command that maps parameter files [#1238](https://github.com/filecoin-project/rust-fil-proofs/pull/1238)
- Add tool to split phase2 parameters [#1235](https://github.com/filecoin-project/rust-fil-proofs/pull/1235)

## [4.0.5] - 2020-07-28

- Include proofs and snark security audit documents, with updated references [#1233](https://github.com/filecoin-project/rust-fil-proofs/pull/1233)
- Remove `stacked` benchmark from benchy (broken) [#1229](https://github.com/filecoin-project/rust-fil-proofs/pull/1229)
- Update range for feistel tests [#1228](https://github.com/filecoin-project/rust-fil-proofs/pull/1228)
- Allow for compilation on aarch64 [#1204](https://github.com/filecoin-project/rust-fil-proofs/pull/1204)
- Implement `fauxrep2`: a testable fake replication API [#1218](https://github.com/filecoin-project/rust-fil-proofs/pull/1218)
- Fix CI `metrics_capture` jobs from consistently failing [#1215](https://github.com/filecoin-project/rust-fil-proofs/pull/1215)
- Correct `rows_to_discard` value during post [#1220](https://github.com/filecoin-project/rust-fil-proofs/pull/1220)

## [4.0.4] - 2020-07-15

- Default parent cache path to use FIL_PROOFS_CACHE_DIR if set [#1207](https://github.com/filecoin-project/rust-fil-proofs/pull/1207)
- Investigate CI metrics capture [#1212](https://github.com/filecoin-project/rust-fil-proofs/pull/1212) and [#1213](https://github.com/filecoin-project/rust-fil-proofs/pull/1213)
- Additional README updates and corrections [#1211](https://github.com/filecoin-project/rust-fil-proofs/pull/1211)
- Update README [#1208](https://github.com/filecoin-project/rust-fil-proofs/pull/1208)
- Swap buffers instead of memcpy in generate_labels [#1197](https://github.com/filecoin-project/rust-fil-proofs/pull/1197)
- Apply suggested security audit fixes [#1196](https://github.com/filecoin-project/rust-fil-proofs/pull/1196)
- Make pieces::Stack methods private [#1202](https://github.com/filecoin-project/rust-fil-proofs/pull/1202)
- Remove dead code [#1201](https://github.com/filecoin-project/rust-fil-proofs/pull/1201)
- Test feistel implementation is a valid permutation [#1193](https://github.com/filecoin-project/rust-fil-proofs/pull/1193)

## [4.0.3] - 2020-07-01

- Add fauxrep to API for fake sealing [#1194](https://github.com/filecoin-project/rust-fil-proofs/pull/1194)
- Streaming phase2 contribution and fast I/O [#1188](https://github.com/filecoin-project/rust-fil-proofs/pull/1188)
- Add omitted changelog updates [#1190](https://github.com/filecoin-project/rust-fil-proofs/pull/1190)

## [4.0.2] - 2020-06-25

- Allow parameters map to be accessible externally [#1186](https://github.com/filecoin-project/rust-fil-proofs/pull/1186)
- Extend update_tree_r_cache command with new features [#1175](https://github.com/filecoin-project/rust-fil-proofs/pull/1175)
- Add OpenCL to the build instructions [#1112](https://github.com/filecoin-project/rust-fil-proofs/pull/1112)
- Use file locking for cache generation [#1179](https://github.com/filecoin-project/rust-fil-proofs/pull/1179)
- Add logging to all public API functions [#1137](https://github.com/filecoin-project/rust-fil-proofs/pull/1137)
- Upgrade some dependencies [#1126](https://github.com/filecoin-project/rust-fil-proofs/pull/1126)
- Fix clippy warnings [#1147](https://github.com/filecoin-project/rust-fil-proofs/pull/1147)
- Partial caching for SDR [#1163](https://github.com/filecoin-project/rust-fil-proofs/pull/1163)
- Add tool to rebuild tree_r_last from a replica [#1170](https://github.com/filecoin-project/rust-fil-proofs/pull/1170)
- Verify consistent use of porep_id when sealing [#1167](https://github.com/filecoin-project/rust-fil-proofs/pull/1167)

## [4.0.1] - 2020-06-22

- This release is a hotfix that pinned dependencies to avoid a build break [#1182](https://github.com/filecoin-project/rust-fil-proofs/pull/1182)

## [4.0.0] - 2020-06-15

- Change default rows_to_discard for cached oct-trees [#1165](https://github.com/filecoin-project/rust-fil-proofs/pull/1165)
- Remove validate commit message [#1164](https://github.com/filecoin-project/rust-fil-proofs/pull/1164)
- Modularized window-post bench [#1162](https://github.com/filecoin-project/rust-fil-proofs/pull/1162)
- Updated reported PoSt constraints (in comments) [#1161](https://github.com/filecoin-project/rust-fil-proofs/pull/1161)

## [3.0.0] - 2020-06-08

- Publish v27 parameters: [#1158](https://github.com/filecoin-project/rust-fil-proofs/pull/1158)
- Update toolchain to rust stable: [#1149](https://github.com/filecoin-project/rust-fil-proofs/pull/1149)
- Allow tree_r_last to be built on the GPU: [#1138](https://github.com/filecoin-project/rust-fil-proofs/pull/1138)
  - Improve performance of building tree_c on the GPU
  - Properly remove tree_c when no longer needed
  - Update circuit test constraints
- Update neptune dependency version: [#1159](https://github.com/filecoin-project/rust-fil-proofs/pull/1159)
- Update total challenge count and increase partitions: [#1153](https://github.com/filecoin-project/rust-fil-proofs/pull/1153)
- Improve UX of paramcache: [#1152](https://github.com/filecoin-project/rust-fil-proofs/pull/1152)
- Add porep_id to construct replica_id and graph seeds: [#1144](https://github.com/filecoin-project/rust-fil-proofs/pull/1144)
- Include layer index before node when creating label preimage: [#1139](https://github.com/filecoin-project/rust-fil-proofs/pull/1139)
- Circuit optimizations for oct/quad insertion: [#1125](https://github.com/filecoin-project/rust-fil-proofs/pull/1125)

## [2.0.0] - 2020-05-27

- Add a method 'unseal_range' to unseal a sector to a file descriptor
- Calculate required config count based on tree shape
- Update merkle tree cached tree usage (fixing an incorrect size usage)
- Replace merkle_light 'height' property usage with 'row_count'
- Update stacked bench usage of recent replica changes

## [1.0.0] - 2020-05-19

- Initial stable release

[Unreleased]: https://github.com/filecoin-project/rust-fil-proofs/compare/v7.0.1...HEAD
[7.0.1]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v7.0.1
[7.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v7.0.0
[6.1.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v6.1.0
[6.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v6.0.0
[5.4.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.4.0
[5.3.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.3.0
[5.2.3]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.2.3
[5.2.2]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.2.2
[5.2.1]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.2.1
[5.2.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.2.0
[5.1.4]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.1.4
[5.1.3]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.1.3
[5.1.2]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.1.2
[5.1.1]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.1.1
[5.1.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.1.0
[5.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v5.0.0
[4.0.5]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v4.0.5
[4.0.4]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v4.0.4
[4.0.3]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v4.0.3
[4.0.2]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v4.0.2
[4.0.1]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v4.0.0
[3.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v3.0.0
[2.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v2.0.0
[1.0.0]: https://github.com/filecoin-project/rust-fil-proofs/tree/releases/v1.0.0


================================================
FILE: CODEOWNERS
================================================
# Global Owners
* @dignifiedquire


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

Welcome, it is great that you found your way here. In order to make the best of all our time, we have gathered some notes
below which we think can be helpful when contributing to this project.

## Getting Started

Please start by reviewing this file.

## Coding Standards

- No compiler warnings.
- No [clippy](https://github.com/rust-lang/rust-clippy) warnings.
- Minimize use of `unsafe` and justify usage in comments.
- Prefer `expect` with a good description to `unwrap`.
- Write unit tests in the same file.
- Format your code with `rustfmt`
- Code should compile on `stable` and `nightly`. If adding `nightly` only features they should be behind a flag.
- Write benchmarks for performance sensitive areas. We use [criterion.rs](https://github.com/japaric/criterion.rs).


## General Guidelines
- PRs require code owner approval to merge.
- Please scope PRs to areas in which you have expertise. This code is still close to research.
- Please follow our commit guideline described below.
- Welcome contribution areas might include:
  - SNARKs
  - Proof-of-replication
  - Rust improvements
  - Optimizations
  - Documentation (expertise would require careful reading of the code)


## PR Merge Policy (Git topology)

### Allowed (white list)
 - Single fast-forward merge commit, with all internal commits squashed.
 - Non-fast-forward merge commit, with all internal commits squashed -- rebased to branch from the previous commit to master.
 - Non-fast-forward merge commit, with curated (as appropriate), linear, internal commits preserved -- rebased to branch from the previous commit to master.

### Disallowed (black list)
 - Non-rebased merge commits which branch from anywhere but the previous commit to master.
 - Merge commits whose internal history contains merge commits (except in rare circumstances).
 - Multiple fast-forward merge commits for a single PR.
 - Internal junk commits — (e.g. strings of WIP).

### In Practice
 - In general, please rebase PRs before merging.
 - To avoid having approvals dismissed by rebasing, authors may instead choose to:
   - First use GitHub's 'resolve conflicts' button;
   - Then merge with GitHub's 'squash and merge' button.

If automated conflict resolution is not possible, you will need to rebase and seek re-approval. In any event, please note the guidelines and prefer either a single commit or a usefully curated set of commits.

## Resources for learning Rust

- Beginners
  - [The Rust Book](https://doc.rust-lang.org/book/)
  - [Rust Playground](https://play.rust-lang.org/)
  - [Rust Docs](https://doc.rust-lang.org/)
  - [Clippy](https://github.com/rust-lang/rust-clippy)
  - [Rustfmt](https://github.com/rust-lang/rustfmt)
- Advanced
  - What does the Rust compiler do with my code? [Godbolt compiler explorer](https://rust.godbolt.org/)
  - How to safely write unsafe Rust: [The Rustonomicon](https://doc.rust-lang.org/nomicon/)
  - Did someone say macros? [The Little Book of Rust Macros](https://danielkeep.github.io/tlborm/book/index.html)


## Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the change log programmatically**.

### Commit Message Format

Each commit message consists of a **header**, a **body** and a **footer**.  The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.

The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.

Samples: (even more [samples](https://github.com/filecoin-project/rust-fil-proofs/commits/master))

```
docs(changelog): update changelog to beta.5
```
```
fix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
```

### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.

### Type
Must be one of the following:

* **build**: Changes that affect the build system or external dependencies (example scopes: cargo, benchmarks)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle)
* **docs**: Documentation only changes
* **feat**: A new feature
* **fix**: A bug fix
* **perf**: A code change that improves performance
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* **test**: Adding missing tests or correcting existing tests
* **revert**: Used only for `git revert` commits.

### Scope
The scope should be the name of the crate affected (as perceived by the person reading the changelog generated from commit messages.

The following is the list of supported scopes:

* **fil-proofs-tooling**
* **filecoin-proofs**
* **storage-proofs**

There are currently a few exceptions to the "use package name" rule:

* **cargo**: used for changes that change the cargo workspace layout, e.g.
  public path changes, Cargo.toml changes done to all packages, etc.
* **changelog**: used for updating the release notes in CHANGELOG.md
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all
  packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a
  specific package (e.g. `docs: fix typo in tutorial`).

> If you find yourself wanting to use other scopes regularly, please open an issue so we can discuss and extend this list.

### Subject
The subject contains a succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize the first letter
* no dot (.) at the end

### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

This guideline was adopted from the [Angular project](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit).

## Licensing

As mentioned in the [readme](README.md) all contributions are dual licensed under Apache 2 and MIT.


================================================
FILE: COPYRIGHT
================================================
This library is dual-licensed under Apache 2.0 and MIT terms.


================================================
FILE: Cargo.toml
================================================
[workspace]

members = [
  "filecoin-proofs",
  "storage-proofs-core",
  "storage-proofs-porep",
  "storage-proofs-post",
  "fil-proofs-tooling",
  "fil-proofs-param",
  "fr32",
  "sha2raw",
  "filecoin-hashers",
]


================================================
FILE: Dockerfile-ci
================================================
# Dockerfile for CircleCI
# build with
# `docker build -t filecoin/rust:latest -f ./Dockerfile-ci .`
# rebuild: `docker build --pull --no-cache -t filecoin/rust:latest -f ./Dockerfile-ci .`

FROM debian:stretch

# Some of the dependencies I need to build a few libraries,
# personalize to your needs. You can use multi-stage builds
# to produce a lightweight image.
RUN apt-get update && \
    apt-get install -y curl file gcc g++ git make openssh-client \
    autoconf automake cmake libtool libcurl4-openssl-dev libssl-dev \
    libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \
    xz-utils pkg-config python clang ocl-icd-opencl-dev libhwloc-dev

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

ENV PATH "$PATH:/root/.cargo/bin"
ENV RUSTFLAGS "-C link-dead-code"
ENV CFG_RELEASE_CHANNEL "nightly"

RUN bash -l -c 'echo $(rustc --print sysroot)/lib >> /etc/ld.so.conf'
RUN bash -l -c 'echo /usr/local/lib >> /etc/ld.so.conf'
RUN ldconfig


================================================
FILE: Dockerfile-profile
================================================
# How to build and run this Dockerfile:
#
# ```
# RUST_FIL_PROOFS=`pwd` # path to `rust-fil-proofs`
# docker --log-level debug build --progress tty --file Dockerfile-profile --tag rust-cpu-profile .
# docker run -it -v $RUST_FIL_PROOFS:/code/ rust-cpu-profile
# ```

FROM rust

# Get all the dependencies
# ------------------------

# Copied from: github.com/filecoin-project/rust-fil-proofs/blob/master/Dockerfile-ci
RUN apt-get update && \
    apt-get install -y curl file gcc g++ git make openssh-client \
    autoconf automake cmake libtool libcurl4-openssl-dev libssl-dev \
    libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \
    xz-utils pkg-config python clang

# `gperftools` and dependencies (`libunwind`)
# -------------------------------------------

ENV GPERFTOOLS_VERSION="2.7"
ENV LIBUNWIND_VERSION="0.99-beta"

ENV HOME="/root"
ENV DOWNLOADS=${HOME}/downloads
RUN mkdir -p ${DOWNLOADS}
RUN echo ${DOWNLOADS}
WORKDIR ${DOWNLOADS}

RUN wget http://download.savannah.gnu.org/releases/libunwind/libunwind-${LIBUNWIND_VERSION}.tar.gz --output-document ${DOWNLOADS}/libunwind-${LIBUNWIND_VERSION}.tar.gz
RUN tar -xvf ${DOWNLOADS}/libunwind-${LIBUNWIND_VERSION}.tar.gz
WORKDIR ${DOWNLOADS}/libunwind-${LIBUNWIND_VERSION}
RUN ./configure
RUN make
RUN make install
WORKDIR ${DOWNLOADS}

RUN wget https://github.com/gperftools/gperftools/releases/download/gperftools-${GPERFTOOLS_VERSION}/gperftools-${GPERFTOOLS_VERSION}.tar.gz  --output-document ${DOWNLOADS}/gperftools-${GPERFTOOLS_VERSION}.tar.gz
RUN tar -xvf ${DOWNLOADS}/gperftools-${GPERFTOOLS_VERSION}.tar.gz
WORKDIR ${DOWNLOADS}/gperftools-${GPERFTOOLS_VERSION}
RUN ./configure
RUN make install
WORKDIR ${DOWNLOADS}

ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
# FIXME: `gperftools` installs the library (`make install`) in
# `/usr/local/lib` by default but Debian/Ubuntu don't look there
# now, the correct `--prefix` should be added to the command.

# Install latest toolchain used by `rust-fil-proofs`
# --------------------------------------------------

RUN rustup default nightly-2019-07-15
# FIXME: The lastest version used should be dynamically obtained form the `rust-fil-proofs` repo
# and not hard-coded here.

# Ready to run
# ------------

WORKDIR /code

CMD                                                                           \
cargo update                                                                  \
&&                                                                            \
cargo build                                                                   \
  -p filecoin-proofs                                                          \
  --release                                                                   \
  --example stacked                                                            \
  --features                                                                  \
    cpu-profile                                                               \
  -Z package-features                                                         \
&&                                                                            \
RUST_BACKTRACE=full                                                           \
RUST_LOG=trace                                                                \
target/release/examples/stacked                                                \
  --size 1024                                                                 \
&&                                                                            \
pprof target/release/examples/stacked replicate.profile || bash


================================================
FILE: LICENSE-APACHE
================================================
                         Copyright (c) 2018 Filecoin Project

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


================================================
FILE: LICENSE-MIT
================================================
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

================================================
FILE: README.md
================================================
# worlddatabase Proving Subsystem


================================================
FILE: SECURITY.md
================================================
# Security Policy

## Reporting a Vulnerability

For reporting *critical* and *security* bugs, please consult our [Security Policy and Responsible Disclosure Program information](https://github.com/filecoin-project/community/blob/master/SECURITY.md)

## Reporting a non security bug

For non-critical bugs, please simply file a GitHub issue on this repo.


================================================
FILE: bench.config.toml
================================================

[merklepor]
challenges = [ 1 ] #, 10, 50, 100, 200 ]
size = [ "1 KiB" ] #, "64 MiB", "128 MiB", "256 MiB", "512 MiB", "1024 MiB"]
command = "groth"
sloth = [ 0 ]
m = [ 6 ]

[drgporep]
challenges = [ 1 ] #, 10, 50, 100, 200 ]
size = [ "1 KiB" ] #, "64 MiB", "128 MiB", "256 MiB", "512 MiB", "1024 MiB"]
command = "groth"
sloth = [ 0 ]
m = [ 6 ]

[drgporep-vanilla]
challenges = [ 1 ] #, 10, 50, 100, 200 ]
size = [ "1 KiB" ] #, "64 MiB", "128 MiB", "256 MiB", "512 MiB", "1024 MiB"]
hasher = [ "pedersen", "blake2s", "sha256"]
sloth = [ 0 ]
m = [ 6 ]

[zigzag]
challenges = [ 1 ]
size = ["1 KiB"]
hasher = ["pedersen"]
command = "--groth"
sloth  = [ 0 ]
m = [ 5 ]
expansion = [ 6 ]


================================================
FILE: build.rs
================================================
fn is_compiled_for_64_bit_arch() -> bool {
    cfg!(target_pointer_width = "64")
}

fn main() {
    assert!(
        is_compiled_for_64_bit_arch(),
        "must be built for 64-bit architectures"
    );
}


================================================
FILE: console/bridge.go
================================================
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package console

import (
	"encoding/json"
	"fmt"
	"io"
	"reflect"
	"strings"
	"time"

	"github.com/dop251/goja"
	"github.com/ethereum/go-ethereum/accounts/scwallet"
	"github.com/ethereum/go-ethereum/accounts/usbwallet"
	"github.com/ethereum/go-ethereum/common/hexutil"
	"github.com/ethereum/go-ethereum/console/prompt"
	"github.com/ethereum/go-ethereum/internal/jsre"
	"github.com/ethereum/go-ethereum/rpc"
)

// bridge is a collection of JavaScript utility methods to bride the .js runtime
// environment and the Go RPC connection backing the remote method calls.
type bridge struct {
	client   *rpc.Client         // RPC client to execute Ethereum requests through
	prompter prompt.UserPrompter // Input prompter to allow interactive user feedback
	printer  io.Writer           // Output writer to serialize any display strings to
}

// newBridge creates a new JavaScript wrapper around an RPC client.
func newBridge(client *rpc.Client, prompter prompt.UserPrompter, printer io.Writer) *bridge {
	return &bridge{
		client:   client,
		prompter: prompter,
		printer:  printer,
	}
}

func getJeth(vm *goja.Runtime) *goja.Object {
	jeth := vm.Get("jeth")
	if jeth == nil {
		panic(vm.ToValue("jeth object does not exist"))
	}
	return jeth.ToObject(vm)
}

// NewAccount is a wrapper around the personal.newAccount RPC method that uses a
// non-echoing password prompt to acquire the passphrase and executes the original
// RPC method (saved in jeth.newAccount) with it to actually execute the RPC call.
func (b *bridge) NewAccount(call jsre.Call) (goja.Value, error) {
	var (
		password string
		confirm  string
		err      error
	)
	switch {
	// No password was specified, prompt the user for it
	case len(call.Arguments) == 0:
		if password, err = b.prompter.PromptPassword("Passphrase: "); err != nil {
			return nil, err
		}
		if confirm, err = b.prompter.PromptPassword("Repeat passphrase: "); err != nil {
			return nil, err
		}
		if password != confirm {
			return nil, fmt.Errorf("passwords don't match!")
		}
	// A single string password was specified, use that
	case len(call.Arguments) == 1 && call.Argument(0).ToString() != nil:
		password = call.Argument(0).ToString().String()
	default:
		return nil, fmt.Errorf("expected 0 or 1 string argument")
	}
	// Password acquired, execute the call and return
	newAccount, callable := goja.AssertFunction(getJeth(call.VM).Get("newAccount"))
	if !callable {
		return nil, fmt.Errorf("jeth.newAccount is not callable")
	}
	ret, err := newAccount(goja.Null(), call.VM.ToValue(password))
	if err != nil {
		return nil, err
	}
	return ret, nil
}

// OpenWallet is a wrapper around personal.openWallet which can interpret and
// react to certain error messages, such as the Trezor PIN matrix request.
func (b *bridge) OpenWallet(call jsre.Call) (goja.Value, error) {
	// Make sure we have a wallet specified to open
	if call.Argument(0).ToObject(call.VM).ClassName() != "String" {
		return nil, fmt.Errorf("first argument must be the wallet URL to open")
	}
	wallet := call.Argument(0)

	var passwd goja.Value
	if goja.IsUndefined(call.Argument(1)) || goja.IsNull(call.Argument(1)) {
		passwd = call.VM.ToValue("")
	} else {
		passwd = call.Argument(1)
	}
	// Open the wallet and return if successful in itself
	openWallet, callable := goja.AssertFunction(getJeth(call.VM).Get("openWallet"))
	if !callable {
		return nil, fmt.Errorf("jeth.openWallet is not callable")
	}
	val, err := openWallet(goja.Null(), wallet, passwd)
	if err == nil {
		return val, nil
	}

	// Wallet open failed, report error unless it's a PIN or PUK entry
	switch {
	case strings.HasSuffix(err.Error(), usbwallet.ErrTrezorPINNeeded.Error()):
		val, err = b.readPinAndReopenWallet(call)
		if err == nil {
			return val, nil
		}
		val, err = b.readPassphraseAndReopenWallet(call)
		if err != nil {
			return nil, err
		}

	case strings.HasSuffix(err.Error(), scwallet.ErrPairingPasswordNeeded.Error()):
		// PUK input requested, fetch from the user and call open again
		input, err := b.prompter.PromptPassword("Please enter the pairing password: ")
		if err != nil {
			return nil, err
		}
		passwd = call.VM.ToValue(input)
		if val, err = openWallet(goja.Null(), wallet, passwd); err != nil {
			if !strings.HasSuffix(err.Error(), scwallet.ErrPINNeeded.Error()) {
				return nil, err
			}
			// PIN input requested, fetch from the user and call open again
			input, err := b.prompter.PromptPassword("Please enter current PIN: ")
			if err != nil {
				return nil, err
			}
			if val, err = openWallet(goja.Null(), wallet, call.VM.ToValue(input)); err != nil {
				return nil, err
			}
		}

	case strings.HasSuffix(err.Error(), scwallet.ErrPINUnblockNeeded.Error()):
		// PIN unblock requested, fetch PUK and new PIN from the user
		var pukpin string
		input, err := b.prompter.PromptPassword("Please enter current PUK: ")
		if err != nil {
			return nil, err
		}
		pukpin = input
		input, err = b.prompter.PromptPassword("Please enter new PIN: ")
		if err != nil {
			return nil, err
		}
		pukpin += input

		if val, err = openWallet(goja.Null(), wallet, call.VM.ToValue(pukpin)); err != nil {
			return nil, err
		}

	case strings.HasSuffix(err.Error(), scwallet.ErrPINNeeded.Error()):
		// PIN input requested, fetch from the user and call open again
		input, err := b.prompter.PromptPassword("Please enter current PIN: ")
		if err != nil {
			return nil, err
		}
		if val, err = openWallet(goja.Null(), wallet, call.VM.ToValue(input)); err != nil {
			return nil, err
		}

	default:
		// Unknown error occurred, drop to the user
		return nil, err
	}
	return val, nil
}

func (b *bridge) readPassphraseAndReopenWallet(call jsre.Call) (goja.Value, error) {
	wallet := call.Argument(0)
	input, err := b.prompter.PromptPassword("Please enter your passphrase: ")
	if err != nil {
		return nil, err
	}
	openWallet, callable := goja.AssertFunction(getJeth(call.VM).Get("openWallet"))
	if !callable {
		return nil, fmt.Errorf("jeth.openWallet is not callable")
	}
	return openWallet(goja.Null(), wallet, call.VM.ToValue(input))
}

func (b *bridge) readPinAndReopenWallet(call jsre.Call) (goja.Value, error) {
	wallet := call.Argument(0)
	// Trezor PIN matrix input requested, display the matrix to the user and fetch the data
	fmt.Fprintf(b.printer, "Look at the device for number positions\n\n")
	fmt.Fprintf(b.printer, "7 | 8 | 9\n")
	fmt.Fprintf(b.printer, "--+---+--\n")
	fmt.Fprintf(b.printer, "4 | 5 | 6\n")
	fmt.Fprintf(b.printer, "--+---+--\n")
	fmt.Fprintf(b.printer, "1 | 2 | 3\n\n")

	input, err := b.prompter.PromptPassword("Please enter current PIN: ")
	if err != nil {
		return nil, err
	}
	openWallet, callable := goja.AssertFunction(getJeth(call.VM).Get("openWallet"))
	if !callable {
		return nil, fmt.Errorf("jeth.openWallet is not callable")
	}
	return openWallet(goja.Null(), wallet, call.VM.ToValue(input))
}

// UnlockAccount is a wrapper around the personal.unlockAccount RPC method that
// uses a non-echoing password prompt to acquire the passphrase and executes the
// original RPC method (saved in jeth.unlockAccount) with it to actually execute
// the RPC call.
func (b *bridge) UnlockAccount(call jsre.Call) (goja.Value, error) {
	if len(call.Arguments) < 1 {
		return nil, fmt.Errorf("usage: unlockAccount(account, [ password, duration ])")
	}

	account := call.Argument(0)
	// Make sure we have an account specified to unlock.
	if goja.IsUndefined(account) || goja.IsNull(account) || account.ExportType().Kind() != reflect.String {
		return nil, fmt.Errorf("first argument must be the account to unlock")
	}

	// If password is not given or is the null value, prompt the user for it.
	var passwd goja.Value
	if goja.IsUndefined(call.Argument(1)) || goja.IsNull(call.Argument(1)) {
		fmt.Fprintf(b.printer, "Unlock account %s\n", account)
		input, err := b.prompter.PromptPassword("Passphrase: ")
		if err != nil {
			return nil, err
		}
		passwd = call.VM.ToValue(input)
	} else {
		if call.Argument(1).ExportType().Kind() != reflect.String {
			return nil, fmt.Errorf("password must be a string")
		}
		passwd = call.Argument(1)
	}

	// Third argument is the duration how long the account should be unlocked.
	duration := goja.Null()
	if !goja.IsUndefined(call.Argument(2)) && !goja.IsNull(call.Argument(2)) {
		if !isNumber(call.Argument(2)) {
			return nil, fmt.Errorf("unlock duration must be a number")
		}
		duration = call.Argument(2)
	}

	// Send the request to the backend and return.
	unlockAccount, callable := goja.AssertFunction(getJeth(call.VM).Get("unlockAccount"))
	if !callable {
		return nil, fmt.Errorf("jeth.unlockAccount is not callable")
	}
	return unlockAccount(goja.Null(), account, passwd, duration)
}

// Sign is a wrapper around the personal.sign RPC method that uses a non-echoing password
// prompt to acquire the passphrase and executes the original RPC method (saved in
// jeth.sign) with it to actually execute the RPC call.
func (b *bridge) Sign(call jsre.Call) (goja.Value, error) {
	if nArgs := len(call.Arguments); nArgs < 2 {
		return nil, fmt.Errorf("usage: sign(message, account, [ password ])")
	}
	var (
		message = call.Argument(0)
		account = call.Argument(1)
		passwd  = call.Argument(2)
	)

	if goja.IsUndefined(message) || message.ExportType().Kind() != reflect.String {
		return nil, fmt.Errorf("first argument must be the message to sign")
	}
	if goja.IsUndefined(account) || account.ExportType().Kind() != reflect.String {
		return nil, fmt.Errorf("second argument must be the account to sign with")
	}

	// if the password is not given or null ask the user and ensure password is a string
	if goja.IsUndefined(passwd) || goja.IsNull(passwd) {
		fmt.Fprintf(b.printer, "Give password for account %s\n", account)
		input, err := b.prompter.PromptPassword("Password: ")
		if err != nil {
			return nil, err
		}
		passwd = call.VM.ToValue(input)
	} else if passwd.ExportType().Kind() != reflect.String {
		return nil, fmt.Errorf("third argument must be the password to unlock the account")
	}

	// Send the request to the backend and return
	sign, callable := goja.AssertFunction(getJeth(call.VM).Get("sign"))
	if !callable {
		return nil, fmt.Errorf("jeth.sign is not callable")
	}
	return sign(goja.Null(), message, account, passwd)
}

// Sleep will block the console for the specified number of seconds.
func (b *bridge) Sleep(call jsre.Call) (goja.Value, error) {
	if nArgs := len(call.Arguments); nArgs < 1 {
		return nil, fmt.Errorf("usage: sleep(<number of seconds>)")
	}
	sleepObj := call.Argument(0)
	if goja.IsUndefined(sleepObj) || goja.IsNull(sleepObj) || !isNumber(sleepObj) {
		return nil, fmt.Errorf("usage: sleep(<number of seconds>)")
	}
	sleep := sleepObj.ToFloat()
	time.Sleep(time.Duration(sleep * float64(time.Second)))
	return call.VM.ToValue(true), nil
}

// SleepBlocks will block the console for a specified number of new blocks optionally
// until the given timeout is reached.
func (b *bridge) SleepBlocks(call jsre.Call) (goja.Value, error) {
	// Parse the input parameters for the sleep.
	var (
		blocks = int64(0)
		sleep  = int64(9999999999999999) // indefinitely
	)
	nArgs := len(call.Arguments)
	if nArgs == 0 {
		return nil, fmt.Errorf("usage: sleepBlocks(<n blocks>[, max sleep in seconds])")
	}
	if nArgs >= 1 {
		if goja.IsNull(call.Argument(0)) || goja.IsUndefined(call.Argument(0)) || !isNumber(call.Argument(0)) {
			return nil, fmt.Errorf("expected number as first argument")
		}
		blocks = call.Argument(0).ToInteger()
	}
	if nArgs >= 2 {
		if goja.IsNull(call.Argument(1)) || goja.IsUndefined(call.Argument(1)) || !isNumber(call.Argument(1)) {
			return nil, fmt.Errorf("expected number as second argument")
		}
		sleep = call.Argument(1).ToInteger()
	}

	// Poll the current block number until either it or a timeout is reached.
	deadline := time.Now().Add(time.Duration(sleep) * time.Second)
	var lastNumber hexutil.Uint64
	if err := b.client.Call(&lastNumber, "eth_blockNumber"); err != nil {
		return nil, err
	}
	for time.Now().Before(deadline) {
		var number hexutil.Uint64
		if err := b.client.Call(&number, "eth_blockNumber"); err != nil {
			return nil, err
		}
		if number != lastNumber {
			lastNumber = number
			blocks--
		}
		if blocks <= 0 {
			break
		}
		time.Sleep(time.Second)
	}
	return call.VM.ToValue(true), nil
}

type jsonrpcCall struct {
	ID     int64
	Method string
	Params []interface{}
}

// Send implements the web3 provider "send" method.
func (b *bridge) Send(call jsre.Call) (goja.Value, error) {
	// Remarshal the request into a Go value.
	reqVal, err := call.Argument(0).ToObject(call.VM).MarshalJSON()
	if err != nil {
		return nil, err
	}

	var (
		rawReq = string(reqVal)
		dec    = json.NewDecoder(strings.NewReader(rawReq))
		reqs   []jsonrpcCall
		batch  bool
	)
	dec.UseNumber() // avoid float64s
	if rawReq[0] == '[' {
		batch = true
		dec.Decode(&reqs)
	} else {
		batch = false
		reqs = make([]jsonrpcCall, 1)
		dec.Decode(&reqs[0])
	}

	// Execute the requests.
	var resps []*goja.Object
	for _, req := range reqs {
		resp := call.VM.NewObject()
		resp.Set("jsonrpc", "2.0")
		resp.Set("id", req.ID)

		var result json.RawMessage
		if err = b.client.Call(&result, req.Method, req.Params...); err == nil {
			if result == nil {
				// Special case null because it is decoded as an empty
				// raw message for some reason.
				resp.Set("result", goja.Null())
			} else {
				JSON := call.VM.Get("JSON").ToObject(call.VM)
				parse, callable := goja.AssertFunction(JSON.Get("parse"))
				if !callable {
					return nil, fmt.Errorf("JSON.parse is not a function")
				}
				resultVal, err := parse(goja.Null(), call.VM.ToValue(string(result)))
				if err != nil {
					setError(resp, -32603, err.Error(), nil)
				} else {
					resp.Set("result", resultVal)
				}
			}
		} else {
			code := -32603
			var data interface{}
			if err, ok := err.(rpc.Error); ok {
				code = err.ErrorCode()
			}
			if err, ok := err.(rpc.DataError); ok {
				data = err.ErrorData()
			}
			setError(resp, code, err.Error(), data)
		}
		resps = append(resps, resp)
	}
	// Return the responses either to the callback (if supplied)
	// or directly as the return value.
	var result goja.Value
	if batch {
		result = call.VM.ToValue(resps)
	} else {
		result = resps[0]
	}
	if fn, isFunc := goja.AssertFunction(call.Argument(1)); isFunc {
		fn(goja.Null(), goja.Null(), result)
		return goja.Undefined(), nil
	}
	return result, nil
}

func setError(resp *goja.Object, code int, msg string, data interface{}) {
	err := make(map[string]interface{})
	err["code"] = code
	err["message"] = msg
	if data != nil {
		err["data"] = data
	}
	resp.Set("error", err)
}

// isNumber returns true if input value is a JS number.
func isNumber(v goja.Value) bool {
	k := v.ExportType().Kind()
	return k >= reflect.Int && k <= reflect.Float64
}

func getObject(vm *goja.Runtime, name string) *goja.Object {
	v := vm.Get(name)
	if v == nil {
		return nil
	}
	return v.ToObject(vm)
}


================================================
FILE: console/bridge_test.go
================================================
// Copyright 2020 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package console

import (
	"testing"

	"github.com/dop251/goja"
	"github.com/ethereum/go-ethereum/internal/jsre"
)

// TestUndefinedAsParam ensures that personal functions can receive
// `undefined` as a parameter.
func TestUndefinedAsParam(t *testing.T) {
	b := bridge{}
	call := jsre.Call{}
	call.Arguments = []goja.Value{goja.Undefined()}

	b.UnlockAccount(call)
	b.Sign(call)
	b.Sleep(call)
}

// TestNullAsParam ensures that personal functions can receive
// `null` as a parameter.
func TestNullAsParam(t *testing.T) {
	b := bridge{}
	call := jsre.Call{}
	call.Arguments = []goja.Value{goja.Null()}

	b.UnlockAccount(call)
	b.Sign(call)
	b.Sleep(call)
}


================================================
FILE: console/console.go
================================================
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package console

import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"os/signal"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
	"syscall"

	"github.com/dop251/goja"
	"github.com/ethereum/go-ethereum/console/prompt"
	"github.com/ethereum/go-ethereum/internal/jsre"
	"github.com/ethereum/go-ethereum/internal/jsre/deps"
	"github.com/ethereum/go-ethereum/internal/web3ext"
	"github.com/ethereum/go-ethereum/rpc"
	"github.com/mattn/go-colorable"
	"github.com/peterh/liner"
)

var (
	// u: unlock, s: signXX, sendXX, n: newAccount, i: importXX
	passwordRegexp = regexp.MustCompile(`personal.[nusi]`)
	onlyWhitespace = regexp.MustCompile(`^\s*$`)
	exit           = regexp.MustCompile(`^\s*exit\s*;*\s*$`)
)

// HistoryFile is the file within the data directory to store input scrollback.
const HistoryFile = "history"

// DefaultPrompt is the default prompt line prefix to use for user input querying.
const DefaultPrompt = "> "

// Config is the collection of configurations to fine tune the behavior of the
// JavaScript console.
type Config struct {
	DataDir  string              // Data directory to store the console history at
	DocRoot  string              // Filesystem path from where to load JavaScript files from
	Client   *rpc.Client         // RPC client to execute Ethereum requests through
	Prompt   string              // Input prompt prefix string (defaults to DefaultPrompt)
	Prompter prompt.UserPrompter // Input prompter to allow interactive user feedback (defaults to TerminalPrompter)
	Printer  io.Writer           // Output writer to serialize any display strings to (defaults to os.Stdout)
	Preload  []string            // Absolute paths to JavaScript files to preload
}

// Console is a JavaScript interpreted runtime environment. It is a fully fledged
// JavaScript console attached to a running node via an external or in-process RPC
// client.
type Console struct {
	client   *rpc.Client         // RPC client to execute Ethereum requests through
	jsre     *jsre.JSRE          // JavaScript runtime environment running the interpreter
	prompt   string              // Input prompt prefix string
	prompter prompt.UserPrompter // Input prompter to allow interactive user feedback
	histPath string              // Absolute path to the console scrollback history
	history  []string            // Scroll history maintained by the console
	printer  io.Writer           // Output writer to serialize any display strings to
}

// New initializes a JavaScript interpreted runtime environment and sets defaults
// with the config struct.
func New(config Config) (*Console, error) {
	// Handle unset config values gracefully
	if config.Prompter == nil {
		config.Prompter = prompt.Stdin
	}
	if config.Prompt == "" {
		config.Prompt = DefaultPrompt
	}
	if config.Printer == nil {
		config.Printer = colorable.NewColorableStdout()
	}

	// Initialize the console and return
	console := &Console{
		client:   config.Client,
		jsre:     jsre.New(config.DocRoot, config.Printer),
		prompt:   config.Prompt,
		prompter: config.Prompter,
		printer:  config.Printer,
		histPath: filepath.Join(config.DataDir, HistoryFile),
	}
	if err := os.MkdirAll(config.DataDir, 0700); err != nil {
		return nil, err
	}
	if err := console.init(config.Preload); err != nil {
		return nil, err
	}
	return console, nil
}

// init retrieves the available APIs from the remote RPC provider and initializes
// the console's JavaScript namespaces based on the exposed modules.
func (c *Console) init(preload []string) error {
	c.initConsoleObject()

	// Initialize the JavaScript <-> Go RPC bridge.
	bridge := newBridge(c.client, c.prompter, c.printer)
	if err := c.initWeb3(bridge); err != nil {
		return err
	}
	if err := c.initExtensions(); err != nil {
		return err
	}

	// Add bridge overrides for web3.js functionality.
	c.jsre.Do(func(vm *goja.Runtime) {
		c.initAdmin(vm, bridge)
		c.initPersonal(vm, bridge)
	})

	// Preload JavaScript files.
	for _, path := range preload {
		if err := c.jsre.Exec(path); err != nil {
			failure := err.Error()
			if gojaErr, ok := err.(*goja.Exception); ok {
				failure = gojaErr.String()
			}
			return fmt.Errorf("%s: %v", path, failure)
		}
	}

	// Configure the input prompter for history and tab completion.
	if c.prompter != nil {
		if content, err := ioutil.ReadFile(c.histPath); err != nil {
			c.prompter.SetHistory(nil)
		} else {
			c.history = strings.Split(string(content), "\n")
			c.prompter.SetHistory(c.history)
		}
		c.prompter.SetWordCompleter(c.AutoCompleteInput)
	}
	return nil
}

func (c *Console) initConsoleObject() {
	c.jsre.Do(func(vm *goja.Runtime) {
		console := vm.NewObject()
		console.Set("log", c.consoleOutput)
		console.Set("error", c.consoleOutput)
		vm.Set("console", console)
	})
}

func (c *Console) initWeb3(bridge *bridge) error {
	bnJS := string(deps.MustAsset("bignumber.js"))
	web3JS := string(deps.MustAsset("web3.js"))
	if err := c.jsre.Compile("bignumber.js", bnJS); err != nil {
		return fmt.Errorf("bignumber.js: %v", err)
	}
	if err := c.jsre.Compile("web3.js", web3JS); err != nil {
		return fmt.Errorf("web3.js: %v", err)
	}
	if _, err := c.jsre.Run("var Web3 = require('web3');"); err != nil {
		return fmt.Errorf("web3 require: %v", err)
	}
	var err error
	c.jsre.Do(func(vm *goja.Runtime) {
		transport := vm.NewObject()
		transport.Set("send", jsre.MakeCallback(vm, bridge.Send))
		transport.Set("sendAsync", jsre.MakeCallback(vm, bridge.Send))
		vm.Set("_consoleWeb3Transport", transport)
		_, err = vm.RunString("var web3 = new Web3(_consoleWeb3Transport)")
	})
	return err
}

// initExtensions loads and registers web3.js extensions.
func (c *Console) initExtensions() error {
	// Compute aliases from server-provided modules.
	apis, err := c.client.SupportedModules()
	if err != nil {
		return fmt.Errorf("api modules: %v", err)
	}
	aliases := map[string]struct{}{"eth": {}, "personal": {}}
	for api := range apis {
		if api == "web3" {
			continue
		}
		aliases[api] = struct{}{}
		if file, ok := web3ext.Modules[api]; ok {
			if err = c.jsre.Compile(api+".js", file); err != nil {
				return fmt.Errorf("%s.js: %v", api, err)
			}
		}
	}

	// Apply aliases.
	c.jsre.Do(func(vm *goja.Runtime) {
		web3 := getObject(vm, "web3")
		for name := range aliases {
			if v := web3.Get(name); v != nil {
				vm.Set(name, v)
			}
		}
	})
	return nil
}

// initAdmin creates additional admin APIs implemented by the bridge.
func (c *Console) initAdmin(vm *goja.Runtime, bridge *bridge) {
	if admin := getObject(vm, "admin"); admin != nil {
		admin.Set("sleepBlocks", jsre.MakeCallback(vm, bridge.SleepBlocks))
		admin.Set("sleep", jsre.MakeCallback(vm, bridge.Sleep))
		admin.Set("clearHistory", c.clearHistory)
	}
}

// initPersonal redirects account-related API methods through the bridge.
//
// If the console is in interactive mode and the 'personal' API is available, override
// the openWallet, unlockAccount, newAccount and sign methods since these require user
// interaction. The original web3 callbacks are stored in 'jeth'. These will be called
// by the bridge after the prompt and send the original web3 request to the backend.
func (c *Console) initPersonal(vm *goja.Runtime, bridge *bridge) {
	personal := getObject(vm, "personal")
	if personal == nil || c.prompter == nil {
		return
	}
	jeth := vm.NewObject()
	vm.Set("jeth", jeth)
	jeth.Set("openWallet", personal.Get("openWallet"))
	jeth.Set("unlockAccount", personal.Get("unlockAccount"))
	jeth.Set("newAccount", personal.Get("newAccount"))
	jeth.Set("sign", personal.Get("sign"))
	personal.Set("openWallet", jsre.MakeCallback(vm, bridge.OpenWallet))
	personal.Set("unlockAccount", jsre.MakeCallback(vm, bridge.UnlockAccount))
	personal.Set("newAccount", jsre.MakeCallback(vm, bridge.NewAccount))
	personal.Set("sign", jsre.MakeCallback(vm, bridge.Sign))
}

func (c *Console) clearHistory() {
	c.history = nil
	c.prompter.ClearHistory()
	if err := os.Remove(c.histPath); err != nil {
		fmt.Fprintln(c.printer, "can't delete history file:", err)
	} else {
		fmt.Fprintln(c.printer, "history file deleted")
	}
}

// consoleOutput is an override for the console.log and console.error methods to
// stream the output into the configured output stream instead of stdout.
func (c *Console) consoleOutput(call goja.FunctionCall) goja.Value {
	var output []string
	for _, argument := range call.Arguments {
		output = append(output, fmt.Sprintf("%v", argument))
	}
	fmt.Fprintln(c.printer, strings.Join(output, " "))
	return goja.Null()
}

// AutoCompleteInput is a pre-assembled word completer to be used by the user
// input prompter to provide hints to the user about the methods available.
func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, string) {
	// No completions can be provided for empty inputs
	if len(line) == 0 || pos == 0 {
		return "", nil, ""
	}
	// Chunck data to relevant part for autocompletion
	// E.g. in case of nested lines eth.getBalance(eth.coinb<tab><tab>
	start := pos - 1
	for ; start > 0; start-- {
		// Skip all methods and namespaces (i.e. including the dot)
		if line[start] == '.' || (line[start] >= 'a' && line[start] <= 'z') || (line[start] >= 'A' && line[start] <= 'Z') {
			continue
		}
		// Handle web3 in a special way (i.e. other numbers aren't auto completed)
		if start >= 3 && line[start-3:start] == "web3" {
			start -= 3
			continue
		}
		// We've hit an unexpected character, autocomplete form here
		start++
		break
	}
	return line[:start], c.jsre.CompleteKeywords(line[start:pos]), line[pos:]
}

// Welcome show summary of current Geth instance and some metadata about the
// console's available modules.
func (c *Console) Welcome() {
	message := "Welcome to the Geth JavaScript console!\n\n"

	// Print some generic Geth metadata
	if res, err := c.jsre.Run(`
		var message = "instance: " + web3.version.node + "\n";
		try {
			message += "coinbase: " + eth.coinbase + "\n";
		} catch (err) {}
		message += "at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")\n";
		try {
			message += " datadir: " + admin.datadir + "\n";
		} catch (err) {}
		message
	`); err == nil {
		message += res.String()
	}
	// List all the supported modules for the user to call
	if apis, err := c.client.SupportedModules(); err == nil {
		modules := make([]string, 0, len(apis))
		for api, version := range apis {
			modules = append(modules, fmt.Sprintf("%s:%s", api, version))
		}
		sort.Strings(modules)
		message += " modules: " + strings.Join(modules, " ") + "\n"
	}
	message += "\nTo exit, press ctrl-d"
	fmt.Fprintln(c.printer, message)
}

// Evaluate executes code and pretty prints the result to the specified output
// stream.
func (c *Console) Evaluate(statement string) {
	defer func() {
		if r := recover(); r != nil {
			fmt.Fprintf(c.printer, "[native] error: %v\n", r)
		}
	}()
	c.jsre.Evaluate(statement, c.printer)
}

// Interactive starts an interactive user session, where input is propted from
// the configured user prompter.
func (c *Console) Interactive() {
	var (
		prompt      = c.prompt             // the current prompt line (used for multi-line inputs)
		indents     = 0                    // the current number of input indents (used for multi-line inputs)
		input       = ""                   // the current user input
		inputLine   = make(chan string, 1) // receives user input
		inputErr    = make(chan error, 1)  // receives liner errors
		requestLine = make(chan string)    // requests a line of input
		interrupt   = make(chan os.Signal, 1)
	)

	// Monitor Ctrl-C. While liner does turn on the relevant terminal mode bits to avoid
	// the signal, a signal can still be received for unsupported terminals. Unfortunately
	// there is no way to cancel the line reader when this happens. The readLines
	// goroutine will be leaked in this case.
	signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM)
	defer signal.Stop(interrupt)

	// The line reader runs in a separate goroutine.
	go c.readLines(inputLine, inputErr, requestLine)
	defer close(requestLine)

	for {
		// Send the next prompt, triggering an input read.
		requestLine <- prompt

		select {
		case <-interrupt:
			fmt.Fprintln(c.printer, "caught interrupt, exiting")
			return

		case err := <-inputErr:
			if err == liner.ErrPromptAborted {
				// When prompting for multi-line input, the first Ctrl-C resets
				// the multi-line state.
				prompt, indents, input = c.prompt, 0, ""
				continue
			}
			return

		case line := <-inputLine:
			// User input was returned by the prompter, handle special cases.
			if indents <= 0 && exit.MatchString(line) {
				return
			}
			if onlyWhitespace.MatchString(line) {
				continue
			}
			// Append the line to the input and check for multi-line interpretation.
			input += line + "\n"
			indents = countIndents(input)
			if indents <= 0 {
				prompt = c.prompt
			} else {
				prompt = strings.Repeat(".", indents*3) + " "
			}
			// If all the needed lines are present, save the command and run it.
			if indents <= 0 {
				if len(input) > 0 && input[0] != ' ' && !passwordRegexp.MatchString(input) {
					if command := strings.TrimSpace(input); len(c.history) == 0 || command != c.history[len(c.history)-1] {
						c.history = append(c.history, command)
						if c.prompter != nil {
							c.prompter.AppendHistory(command)
						}
					}
				}
				c.Evaluate(input)
				input = ""
			}
		}
	}
}

// readLines runs in its own goroutine, prompting for input.
func (c *Console) readLines(input chan<- string, errc chan<- error, prompt <-chan string) {
	for p := range prompt {
		line, err := c.prompter.PromptInput(p)
		if err != nil {
			errc <- err
		} else {
			input <- line
		}
	}
}

// countIndents returns the number of identations for the given input.
// In case of invalid input such as var a = } the result can be negative.
func countIndents(input string) int {
	var (
		indents     = 0
		inString    = false
		strOpenChar = ' '   // keep track of the string open char to allow var str = "I'm ....";
		charEscaped = false // keep track if the previous char was the '\' char, allow var str = "abc\"def";
	)

	for _, c := range input {
		switch c {
		case '\\':
			// indicate next char as escaped when in string and previous char isn't escaping this backslash
			if !charEscaped && inString {
				charEscaped = true
			}
		case '\'', '"':
			if inString && !charEscaped && strOpenChar == c { // end string
				inString = false
			} else if !inString && !charEscaped { // begin string
				inString = true
				strOpenChar = c
			}
			charEscaped = false
		case '{', '(':
			if !inString { // ignore brackets when in string, allow var str = "a{"; without indenting
				indents++
			}
			charEscaped = false
		case '}', ')':
			if !inString {
				indents--
			}
			charEscaped = false
		default:
			charEscaped = false
		}
	}

	return indents
}

// Execute runs the JavaScript file specified as the argument.
func (c *Console) Execute(path string) error {
	return c.jsre.Exec(path)
}

// Stop cleans up the console and terminates the runtime environment.
func (c *Console) Stop(graceful bool) error {
	if err := ioutil.WriteFile(c.histPath, []byte(strings.Join(c.history, "\n")), 0600); err != nil {
		return err
	}
	if err := os.Chmod(c.histPath, 0600); err != nil { // Force 0600, even if it was different previously
		return err
	}
	c.jsre.Stop(graceful)
	return nil
}


================================================
FILE: console/console_test.go
================================================
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package console

import (
	"bytes"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"strings"
	"testing"
	"time"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/consensus/ethash"
	"github.com/ethereum/go-ethereum/console/prompt"
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/eth"
	"github.com/ethereum/go-ethereum/eth/ethconfig"
	"github.com/ethereum/go-ethereum/internal/jsre"
	"github.com/ethereum/go-ethereum/miner"
	"github.com/ethereum/go-ethereum/node"
)

const (
	testInstance = "console-tester"
	testAddress  = "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
)

// hookedPrompter implements UserPrompter to simulate use input via channels.
type hookedPrompter struct {
	scheduler chan string
}

func (p *hookedPrompter) PromptInput(prompt string) (string, error) {
	// Send the prompt to the tester
	select {
	case p.scheduler <- prompt:
	case <-time.After(time.Second):
		return "", errors.New("prompt timeout")
	}
	// Retrieve the response and feed to the console
	select {
	case input := <-p.scheduler:
		return input, nil
	case <-time.After(time.Second):
		return "", errors.New("input timeout")
	}
}

func (p *hookedPrompter) PromptPassword(prompt string) (string, error) {
	return "", errors.New("not implemented")
}
func (p *hookedPrompter) PromptConfirm(prompt string) (bool, error) {
	return false, errors.New("not implemented")
}
func (p *hookedPrompter) SetHistory(history []string)                     {}
func (p *hookedPrompter) AppendHistory(command string)                    {}
func (p *hookedPrompter) ClearHistory()                                   {}
func (p *hookedPrompter) SetWordCompleter(completer prompt.WordCompleter) {}

// tester is a console test environment for the console tests to operate on.
type tester struct {
	workspace string
	stack     *node.Node
	ethereum  *eth.Ethereum
	console   *Console
	input     *hookedPrompter
	output    *bytes.Buffer
}

// newTester creates a test environment based on which the console can operate.
// Please ensure you call Close() on the returned tester to avoid leaks.
func newTester(t *testing.T, confOverride func(*ethconfig.Config)) *tester {
	// Create a temporary storage for the node keys and initialize it
	workspace, err := ioutil.TempDir("", "console-tester-")
	if err != nil {
		t.Fatalf("failed to create temporary keystore: %v", err)
	}

	// Create a networkless protocol stack and start an Ethereum service within
	stack, err := node.New(&node.Config{DataDir: workspace, UseLightweightKDF: true, Name: testInstance})
	if err != nil {
		t.Fatalf("failed to create node: %v", err)
	}
	ethConf := &ethconfig.Config{
		Genesis: core.DeveloperGenesisBlock(15, common.Address{}),
		Miner: miner.Config{
			Etherbase: common.HexToAddress(testAddress),
		},
		Ethash: ethash.Config{
			PowMode: ethash.ModeTest,
		},
	}
	if confOverride != nil {
		confOverride(ethConf)
	}
	ethBackend, err := eth.New(stack, ethConf)
	if err != nil {
		t.Fatalf("failed to register Ethereum protocol: %v", err)
	}
	// Start the node and assemble the JavaScript console around it
	if err = stack.Start(); err != nil {
		t.Fatalf("failed to start test stack: %v", err)
	}
	client, err := stack.Attach()
	if err != nil {
		t.Fatalf("failed to attach to node: %v", err)
	}
	prompter := &hookedPrompter{scheduler: make(chan string)}
	printer := new(bytes.Buffer)

	console, err := New(Config{
		DataDir:  stack.DataDir(),
		DocRoot:  "testdata",
		Client:   client,
		Prompter: prompter,
		Printer:  printer,
		Preload:  []string{"preload.js"},
	})
	if err != nil {
		t.Fatalf("failed to create JavaScript console: %v", err)
	}
	// Create the final tester and return
	return &tester{
		workspace: workspace,
		stack:     stack,
		ethereum:  ethBackend,
		console:   console,
		input:     prompter,
		output:    printer,
	}
}

// Close cleans up any temporary data folders and held resources.
func (env *tester) Close(t *testing.T) {
	if err := env.console.Stop(false); err != nil {
		t.Errorf("failed to stop embedded console: %v", err)
	}
	if err := env.stack.Close(); err != nil {
		t.Errorf("failed to tear down embedded node: %v", err)
	}
	os.RemoveAll(env.workspace)
}

// Tests that the node lists the correct welcome message, notably that it contains
// the instance name, coinbase account, block number, data directory and supported
// console modules.
func TestWelcome(t *testing.T) {
	tester := newTester(t, nil)
	defer tester.Close(t)

	tester.console.Welcome()

	output := tester.output.String()
	if want := "Welcome"; !strings.Contains(output, want) {
		t.Fatalf("console output missing welcome message: have\n%s\nwant also %s", output, want)
	}
	if want := fmt.Sprintf("instance: %s", testInstance); !strings.Contains(output, want) {
		t.Fatalf("console output missing instance: have\n%s\nwant also %s", output, want)
	}
	if want := fmt.Sprintf("coinbase: %s", testAddress); !strings.Contains(output, want) {
		t.Fatalf("console output missing coinbase: have\n%s\nwant also %s", output, want)
	}
	if want := "at block: 0"; !strings.Contains(output, want) {
		t.Fatalf("console output missing sync status: have\n%s\nwant also %s", output, want)
	}
	if want := fmt.Sprintf("datadir: %s", tester.workspace); !strings.Contains(output, want) {
		t.Fatalf("console output missing coinbase: have\n%s\nwant also %s", output, want)
	}
}

// Tests that JavaScript statement evaluation works as intended.
func TestEvaluate(t *testing.T) {
	tester := newTester(t, nil)
	defer tester.Close(t)

	tester.console.Evaluate("2 + 2")
	if output := tester.output.String(); !strings.Contains(output, "4") {
		t.Fatalf("statement evaluation failed: have %s, want %s", output, "4")
	}
}

// Tests that the console can be used in interactive mode.
func TestInteractive(t *testing.T) {
	// Create a tester and run an interactive console in the background
	tester := newTester(t, nil)
	defer tester.Close(t)

	go tester.console.Interactive()

	// Wait for a prompt and send a statement back
	select {
	case <-tester.input.scheduler:
	case <-time.After(time.Second):
		t.Fatalf("initial prompt timeout")
	}
	select {
	case tester.input.scheduler <- "2+2":
	case <-time.After(time.Second):
		t.Fatalf("input feedback timeout")
	}
	// Wait for the second prompt and ensure first statement was evaluated
	select {
	case <-tester.input.scheduler:
	case <-time.After(time.Second):
		t.Fatalf("secondary prompt timeout")
	}
	if output := tester.output.String(); !strings.Contains(output, "4") {
		t.Fatalf("statement evaluation failed: have %s, want %s", output, "4")
	}
}

// Tests that preloaded JavaScript files have been executed before user is given
// input.
func TestPreload(t *testing.T) {
	tester := newTester(t, nil)
	defer tester.Close(t)

	tester.console.Evaluate("preloaded")
	if output := tester.output.String(); !strings.Contains(output, "some-preloaded-string") {
		t.Fatalf("preloaded variable missing: have %s, want %s", output, "some-preloaded-string")
	}
}

// Tests that JavaScript scripts can be executes from the configured asset path.
func TestExecute(t *testing.T) {
	tester := newTester(t, nil)
	defer tester.Close(t)

	tester.console.Execute("exec.js")

	tester.console.Evaluate("execed")
	if output := tester.output.String(); !strings.Contains(output, "some-executed-string") {
		t.Fatalf("execed variable missing: have %s, want %s", output, "some-executed-string")
	}
}

// Tests that the JavaScript objects returned by statement executions are properly
// pretty printed instead of just displaying "[object]".
func TestPrettyPrint(t *testing.T) {
	tester := newTester(t, nil)
	defer tester.Close(t)

	tester.console.Evaluate("obj = {int: 1, string: 'two', list: [3, 3, 3], obj: {null: null, func: function(){}}}")

	// Define some specially formatted fields
	var (
		one   = jsre.NumberColor("1")
		two   = jsre.StringColor("\"two\"")
		three = jsre.NumberColor("3")
		null  = jsre.SpecialColor("null")
		fun   = jsre.FunctionColor("function()")
	)
	// Assemble the actual output we're after and verify
	want := `{
  int: ` + one + `,
  list: [` + three + `, ` + three + `, ` + three + `],
  obj: {
    null: ` + null + `,
    func: ` + fun + `
  },
  string: ` + two + `
}
`
	if output := tester.output.String(); output != want {
		t.Fatalf("pretty print mismatch: have %s, want %s", output, want)
	}
}

// Tests that the JavaScript exceptions are properly formatted and colored.
func TestPrettyError(t *testing.T) {
	tester := newTester(t, nil)
	defer tester.Close(t)
	tester.console.Evaluate("throw 'hello'")

	want := jsre.ErrorColor("hello") + "\n\tat <eval>:1:7(1)\n\n"
	if output := tester.output.String(); output != want {
		t.Fatalf("pretty error mismatch: have %s, want %s", output, want)
	}
}

// Tests that tests if the number of indents for JS input is calculated correct.
func TestIndenting(t *testing.T) {
	testCases := []struct {
		input               string
		expectedIndentCount int
	}{
		{`var a = 1;`, 0},
		{`"some string"`, 0},
		{`"some string with (parenthesis`, 0},
		{`"some string with newline
		("`, 0},
		{`function v(a,b) {}`, 0},
		{`function f(a,b) { var str = "asd("; };`, 0},
		{`function f(a) {`, 1},
		{`function f(a, function(b) {`, 2},
		{`function f(a, function(b) {
		     var str = "a)}";
		  });`, 0},
		{`function f(a,b) {
		   var str = "a{b(" + a, ", " + b;
		   }`, 0},
		{`var str = "\"{"`, 0},
		{`var str = "'("`, 0},
		{`var str = "\\{"`, 0},
		{`var str = "\\\\{"`, 0},
		{`var str = 'a"{`, 0},
		{`var obj = {`, 1},
		{`var obj = { {a:1`, 2},
		{`var obj = { {a:1}`, 1},
		{`var obj = { {a:1}, b:2}`, 0},
		{`var obj = {}`, 0},
		{`var obj = {
			a: 1, b: 2
		}`, 0},
		{`var test = }`, -1},
		{`var str = "a\""; var obj = {`, 1},
	}

	for i, tt := range testCases {
		counted := countIndents(tt.input)
		if counted != tt.expectedIndentCount {
			t.Errorf("test %d: invalid indenting: have %d, want %d", i, counted, tt.expectedIndentCount)
		}
	}
}


================================================
FILE: console/prompt/prompter.go
================================================
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package prompt

import (
	"fmt"
	"strings"

	"github.com/peterh/liner"
)

// Stdin holds the stdin line reader (also using stdout for printing prompts).
// Only this reader may be used for input because it keeps an internal buffer.
var Stdin = newTerminalPrompter()

// UserPrompter defines the methods needed by the console to prompt the user for
// various types of inputs.
type UserPrompter interface {
	// PromptInput displays the given prompt to the user and requests some textual
	// data to be entered, returning the input of the user.
	PromptInput(prompt string) (string, error)

	// PromptPassword displays the given prompt to the user and requests some textual
	// data to be entered, but one which must not be echoed out into the terminal.
	// The method returns the input provided by the user.
	PromptPassword(prompt string) (string, error)

	// PromptConfirm displays the given prompt to the user and requests a boolean
	// choice to be made, returning that choice.
	PromptConfirm(prompt string) (bool, error)

	// SetHistory sets the input scrollback history that the prompter will allow
	// the user to scroll back to.
	SetHistory(history []string)

	// AppendHistory appends an entry to the scrollback history. It should be called
	// if and only if the prompt to append was a valid command.
	AppendHistory(command string)

	// ClearHistory clears the entire history
	ClearHistory()

	// SetWordCompleter sets the completion function that the prompter will call to
	// fetch completion candidates when the user presses tab.
	SetWordCompleter(completer WordCompleter)
}

// WordCompleter takes the currently edited line with the cursor position and
// returns the completion candidates for the partial word to be completed. If
// the line is "Hello, wo!!!" and the cursor is before the first '!', ("Hello,
// wo!!!", 9) is passed to the completer which may returns ("Hello, ", {"world",
// "Word"}, "!!!") to have "Hello, world!!!".
type WordCompleter func(line string, pos int) (string, []string, string)

// terminalPrompter is a UserPrompter backed by the liner package. It supports
// prompting the user for various input, among others for non-echoing password
// input.
type terminalPrompter struct {
	*liner.State
	warned     bool
	supported  bool
	normalMode liner.ModeApplier
	rawMode    liner.ModeApplier
}

// newTerminalPrompter creates a liner based user input prompter working off the
// standard input and output streams.
func newTerminalPrompter() *terminalPrompter {
	p := new(terminalPrompter)
	// Get the original mode before calling NewLiner.
	// This is usually regular "cooked" mode where characters echo.
	normalMode, _ := liner.TerminalMode()
	// Turn on liner. It switches to raw mode.
	p.State = liner.NewLiner()
	rawMode, err := liner.TerminalMode()
	if err != nil || !liner.TerminalSupported() {
		p.supported = false
	} else {
		p.supported = true
		p.normalMode = normalMode
		p.rawMode = rawMode
		// Switch back to normal mode while we're not prompting.
		normalMode.ApplyMode()
	}
	p.SetCtrlCAborts(true)
	p.SetTabCompletionStyle(liner.TabPrints)
	p.SetMultiLineMode(true)
	return p
}

// PromptInput displays the given prompt to the user and requests some textual
// data to be entered, returning the input of the user.
func (p *terminalPrompter) PromptInput(prompt string) (string, error) {
	if p.supported {
		p.rawMode.ApplyMode()
		defer p.normalMode.ApplyMode()
	} else {
		// liner tries to be smart about printing the prompt
		// and doesn't print anything if input is redirected.
		// Un-smart it by printing the prompt always.
		fmt.Print(prompt)
		prompt = ""
		defer fmt.Println()
	}
	return p.State.Prompt(prompt)
}

// PromptPassword displays the given prompt to the user and requests some textual
// data to be entered, but one which must not be echoed out into the terminal.
// The method returns the input provided by the user.
func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err error) {
	if p.supported {
		p.rawMode.ApplyMode()
		defer p.normalMode.ApplyMode()
		return p.State.PasswordPrompt(prompt)
	}
	if !p.warned {
		fmt.Println("!! Unsupported terminal, password will be echoed.")
		p.warned = true
	}
	// Just as in Prompt, handle printing the prompt here instead of relying on liner.
	fmt.Print(prompt)
	passwd, err = p.State.Prompt("")
	fmt.Println()
	return passwd, err
}

// PromptConfirm displays the given prompt to the user and requests a boolean
// choice to be made, returning that choice.
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
	input, err := p.Prompt(prompt + " [y/n] ")
	if len(input) > 0 && strings.ToUpper(input[:1]) == "Y" {
		return true, nil
	}
	return false, err
}

// SetHistory sets the input scrollback history that the prompter will allow
// the user to scroll back to.
func (p *terminalPrompter) SetHistory(history []string) {
	p.State.ReadHistory(strings.NewReader(strings.Join(history, "\n")))
}

// AppendHistory appends an entry to the scrollback history.
func (p *terminalPrompter) AppendHistory(command string) {
	p.State.AppendHistory(command)
}

// ClearHistory clears the entire history
func (p *terminalPrompter) ClearHistory() {
	p.State.ClearHistory()
}

// SetWordCompleter sets the completion function that the prompter will call to
// fetch completion candidates when the user presses tab.
func (p *terminalPrompter) SetWordCompleter(completer WordCompleter) {
	p.State.SetWordCompleter(liner.WordCompleter(completer))
}


================================================
FILE: console/testdata/exec.js
================================================
var execed = "some-executed-string";


================================================
FILE: console/testdata/preload.js
================================================
var preloaded = "some-preloaded-string";


================================================
FILE: eth/api.go
================================================
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package eth

import (
	"compress/gzip"
	"context"
	"errors"
	"fmt"
	"io"
	"math/big"
	"os"
	"runtime"
	"strings"
	"time"

	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/common/hexutil"
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/core/rawdb"
	"github.com/ethereum/go-ethereum/core/state"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/internal/ethapi"
	"github.com/ethereum/go-ethereum/rlp"
	"github.com/ethereum/go-ethereum/rpc"
	"github.com/ethereum/go-ethereum/trie"
)

// PublicEthereumAPI provides an API to access Ethereum full node-related
// information.
type PublicEthereumAPI struct {
	e *Ethereum
}

// NewPublicEthereumAPI creates a new Ethereum protocol API for full nodes.
func NewPublicEthereumAPI(e *Ethereum) *PublicEthereumAPI {
	return &PublicEthereumAPI{e}
}

// Etherbase is the address that mining rewards will be send to
func (api *PublicEthereumAPI) Etherbase() (common.Address, error) {
	return api.e.Etherbase()
}

// Coinbase is the address that mining rewards will be send to (alias for Etherbase)
func (api *PublicEthereumAPI) Coinbase() (common.Address, error) {
	return api.Etherbase()
}

// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (api *PublicEthereumAPI) ChainId() (hexutil.Uint64, error) {
	// if current block is at or past the EIP-155 replay-protection fork block, return chainID from config
	if config := api.e.blockchain.Config(); config.IsEIP155(api.e.blockchain.CurrentBlock().Number()) {
		return (hexutil.Uint64)(config.ChainID.Uint64()), nil
	}
	return hexutil.Uint64(0), fmt.Errorf("chain not synced beyond EIP-155 replay-protection fork block")
}

// PublicMinerAPI provides an API to control the miner.
// It offers only methods that operate on data that pose no security risk when it is publicly accessible.
type PublicMinerAPI struct {
	e *Ethereum
}

// NewPublicMinerAPI create a new PublicMinerAPI instance.
func NewPublicMinerAPI(e *Ethereum) *PublicMinerAPI {
	return &PublicMinerAPI{e}
}

// Mining returns an indication if this node is currently mining.
func (api *PublicMinerAPI) Mining() bool {
	return api.e.IsMining()
}

// PrivateMinerAPI provides private RPC methods to control the miner.
// These methods can be abused by external users and must be considered insecure for use by untrusted users.
type PrivateMinerAPI struct {
	e *Ethereum
}

// NewPrivateMinerAPI create a new RPC service which controls the miner of this node.
func NewPrivateMinerAPI(e *Ethereum) *PrivateMinerAPI {
	return &PrivateMinerAPI{e: e}
}

// Start starts the miner with the given number of threads. If threads is nil,
// the number of workers started is equal to the number of logical CPUs that are
// usable by this process. If mining is already running, this method adjust the
// number of threads allowed to use and updates the minimum price required by the
// transaction pool.
func (api *PrivateMinerAPI) Start(threads *int) error {
	if threads == nil {
		return api.e.StartMining(runtime.NumCPU())
	}
	return api.e.StartMining(*threads)
}

// Stop terminates the miner, both at the consensus engine level as well as at
// the block creation level.
func (api *PrivateMinerAPI) Stop() {
	api.e.StopMining()
}

// SetExtra sets the extra data string that is included when this miner mines a block.
func (api *PrivateMinerAPI) SetExtra(extra string) (bool, error) {
	if err := api.e.Miner().SetExtra([]byte(extra)); err != nil {
		return false, err
	}
	return true, nil
}

// SetGasPrice sets the minimum accepted gas price for the miner.
func (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool {
	api.e.lock.Lock()
	api.e.gasPrice = (*big.Int)(&gasPrice)
	api.e.lock.Unlock()

	api.e.txPool.SetGasPrice((*big.Int)(&gasPrice))
	return true
}

// SetEtherbase sets the etherbase of the miner
func (api *PrivateMinerAPI) SetEtherbase(etherbase common.Address) bool {
	api.e.SetEtherbase(etherbase)
	return true
}

// SetRecommitInterval updates the interval for miner sealing work recommitting.
func (api *PrivateMinerAPI) SetRecommitInterval(interval int) {
	api.e.Miner().SetRecommitInterval(time.Duration(interval) * time.Millisecond)
}

// PrivateAdminAPI is the collection of Ethereum full node-related APIs
// exposed over the private admin endpoint.
type PrivateAdminAPI struct {
	eth *Ethereum
}

// NewPrivateAdminAPI creates a new API definition for the full node private
// admin methods of the Ethereum service.
func NewPrivateAdminAPI(eth *Ethereum) *PrivateAdminAPI {
	return &PrivateAdminAPI{eth: eth}
}

// ExportChain exports the current blockchain into a local file,
// or a range of blocks if first and last are non-nil
func (api *PrivateAdminAPI) ExportChain(file string, first *uint64, last *uint64) (bool, error) {
	if first == nil && last != nil {
		return false, errors.New("last cannot be specified without first")
	}
	if first != nil && last == nil {
		head := api.eth.BlockChain().CurrentHeader().Number.Uint64()
		last = &head
	}
	if _, err := os.Stat(file); err == nil {
		// File already exists. Allowing overwrite could be a DoS vecotor,
		// since the 'file' may point to arbitrary paths on the drive
		return false, errors.New("location would overwrite an existing file")
	}
	// Make sure we can create the file to export into
	out, err := os.OpenFile(file, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm)
	if err != nil {
		return false, err
	}
	defer out.Close()

	var writer io.Writer = out
	if strings.HasSuffix(file, ".gz") {
		writer = gzip.NewWriter(writer)
		defer writer.(*gzip.Writer).Close()
	}

	// Export the blockchain
	if first != nil {
		if err := api.eth.BlockChain().ExportN(writer, *first, *last); err != nil {
			return false, err
		}
	} else if err := api.eth.BlockChain().Export(writer); err != nil {
		return false, err
	}
	return true, nil
}

func hasAllBlocks(chain *core.BlockChain, bs []*types.Block) bool {
	for _, b := range bs {
		if !chain.HasBlock(b.Hash(), b.NumberU64()) {
			return false
		}
	}

	return true
}

// ImportChain imports a blockchain from a local file.
func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
	// Make sure the can access the file to import
	in, err := os.Open(file)
	if err != nil {
		return false, err
	}
	defer in.Close()

	var reader io.Reader = in
	if strings.HasSuffix(file, ".gz") {
		if reader, err = gzip.NewReader(reader); err != nil {
			return false, err
		}
	}

	// Run actual the import in pre-configured batches
	stream := rlp.NewStream(reader, 0)

	blocks, index := make([]*types.Block, 0, 2500), 0
	for batch := 0; ; batch++ {
		// Load a batch of blocks from the input file
		for len(blocks) < cap(blocks) {
			block := new(types.Block)
			if err := stream.Decode(block); err == io.EOF {
				break
			} else if err != nil {
				return false, fmt.Errorf("block %d: failed to parse: %v", index, err)
			}
			blocks = append(blocks, block)
			index++
		}
		if len(blocks) == 0 {
			break
		}

		if hasAllBlocks(api.eth.BlockChain(), blocks) {
			blocks = blocks[:0]
			continue
		}
		// Import the batch and reset the buffer
		if _, err := api.eth.BlockChain().InsertChain(blocks); err != nil {
			return false, fmt.Errorf("batch %d: failed to insert: %v", batch, err)
		}
		blocks = blocks[:0]
	}
	return true, nil
}

// PublicDebugAPI is the collection of Ethereum full node APIs exposed
// over the public debugging endpoint.
type PublicDebugAPI struct {
	eth *Ethereum
}

// NewPublicDebugAPI creates a new API definition for the full node-
// related public debug methods of the Ethereum service.
func NewPublicDebugAPI(eth *Ethereum) *PublicDebugAPI {
	return &PublicDebugAPI{eth: eth}
}

// DumpBlock retrieves the entire state of the database at a given block.
func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.Dump, error) {
	if blockNr == rpc.PendingBlockNumber {
		// If we're dumping the pending state, we need to request
		// both the pending block as well as the pending state from
		// the miner and operate on those
		_, stateDb := api.eth.miner.Pending()
		return stateDb.RawDump(false, false, true), nil
	}
	var block *types.Block
	if blockNr == rpc.LatestBlockNumber {
		block = api.eth.blockchain.CurrentBlock()
	} else {
		block = api.eth.blockchain.GetBlockByNumber(uint64(blockNr))
	}
	if block == nil {
		return state.Dump{}, fmt.Errorf("block #%d not found", blockNr)
	}
	stateDb, err := api.eth.BlockChain().StateAt(block.Root())
	if err != nil {
		return state.Dump{}, err
	}
	return stateDb.RawDump(false, false, true), nil
}

// PrivateDebugAPI is the collection of Ethereum full node APIs exposed over
// the private debugging endpoint.
type PrivateDebugAPI struct {
	eth *Ethereum
}

// NewPrivateDebugAPI creates a new API definition for the full node-related
// private debug methods of the Ethereum service.
func NewPrivateDebugAPI(eth *Ethereum) *PrivateDebugAPI {
	return &PrivateDebugAPI{eth: eth}
}

// Preimage is a debug API function that returns the preimage for a sha3 hash, if known.
func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error) {
	if preimage := rawdb.ReadPreimage(api.eth.ChainDb(), hash); preimage != nil {
		return preimage, nil
	}
	return nil, errors.New("unknown preimage")
}

// BadBlockArgs represents the entries in the list returned when bad blocks are queried.
type BadBlockArgs struct {
	Hash  common.Hash            `json:"hash"`
	Block map[string]interface{} `json:"block"`
	RLP   string                 `json:"rlp"`
}

// GetBadBlocks returns a list of the last 'bad blocks' that the client has seen on the network
// and returns them as a JSON list of block-hashes
func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadBlockArgs, error) {
	var (
		err     error
		blocks  = rawdb.ReadAllBadBlocks(api.eth.chainDb)
		results = make([]*BadBlockArgs, 0, len(blocks))
	)
	for _, block := range blocks {
		var (
			blockRlp  string
			blockJSON map[string]interface{}
		)
		if rlpBytes, err := rlp.EncodeToBytes(block); err != nil {
			blockRlp = err.Error() // Hacky, but hey, it works
		} else {
			blockRlp = fmt.Sprintf("0x%x", rlpBytes)
		}
		if blockJSON, err = ethapi.RPCMarshalBlock(block, true, true); err != nil {
			blockJSON = map[string]interface{}{"error": err.Error()}
		}
		results = append(results, &BadBlockArgs{
			Hash:  block.Hash(),
			RLP:   blockRlp,
			Block: blockJSON,
		})
	}
	return results, nil
}

// AccountRangeMaxResults is the maximum number of results to be returned per call
const AccountRangeMaxResults = 256

// AccountRange enumerates all accounts in the given block and start point in paging request
func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberOrHash, start []byte, maxResults int, nocode, nostorage, incompletes bool) (state.IteratorDump, error) {
	var stateDb *state.StateDB
	var err error

	if number, ok := blockNrOrHash.Number(); ok {
		if number == rpc.PendingBlockNumber {
			// If we're dumping the pending state, we need to request
			// both the pending block as well as the pending state from
			// the miner and operate on those
			_, stateDb = api.eth.miner.Pending()
		} else {
			var block *types.Block
			if number == rpc.LatestBlockNumber {
				block = api.eth.blockchain.CurrentBlock()
			} else {
				block = api.eth.blockchain.GetBlockByNumber(uint64(number))
			}
			if block == nil {
				return state.IteratorDump{}, fmt.Errorf("block #%d not found", number)
			}
			stateDb, err = api.eth.BlockChain().StateAt(block.Root())
			if err != nil {
				return state.IteratorDump{}, err
			}
		}
	} else if hash, ok := blockNrOrHash.Hash(); ok {
		block := api.eth.blockchain.GetBlockByHash(hash)
		if block == nil {
			return state.IteratorDump{}, fmt.Errorf("block %s not found", hash.Hex())
		}
		stateDb, err = api.eth.BlockChain().StateAt(block.Root())
		if err != nil {
			return state.IteratorDump{}, err
		}
	} else {
		return state.IteratorDump{}, errors.New("either block number or block hash must be specified")
	}

	if maxResults > AccountRangeMaxResults || maxResults <= 0 {
		maxResults = AccountRangeMaxResults
	}
	return stateDb.IteratorDump(nocode, nostorage, incompletes, start, maxResults), nil
}

// StorageRangeResult is the result of a debug_storageRangeAt API call.
type StorageRangeResult struct {
	Storage storageMap   `json:"storage"`
	NextKey *common.Hash `json:"nextKey"` // nil if Storage includes the last key in the trie.
}

type storageMap map[common.Hash]storageEntry

type storageEntry struct {
	Key   *common.Hash `json:"key"`
	Value common.Hash  `json:"value"`
}

// StorageRangeAt returns the storage at the given block height and transaction index.
func (api *PrivateDebugAPI) StorageRangeAt(blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error) {
	// Retrieve the block
	block := api.eth.blockchain.GetBlockByHash(blockHash)
	if block == nil {
		return StorageRangeResult{}, fmt.Errorf("block %#x not found", blockHash)
	}
	_, _, statedb, release, err := api.eth.stateAtTransaction(block, txIndex, 0)
	if err != nil {
		return StorageRangeResult{}, err
	}
	defer release()
	st := statedb.StorageTrie(contractAddress)
	if st == nil {
		return StorageRangeResult{}, fmt.Errorf("account %x doesn't exist", contractAddress)
	}
	return storageRangeAt(st, keyStart, maxResult)
}

func storageRangeAt(st state.Trie, start []byte, maxResult int) (StorageRangeResult, error) {
	it := trie.NewIterator(st.NodeIterator(start))
	result := StorageRangeResult{Storage: storageMap{}}
	for i := 0; i < maxResult && it.Next(); i++ {
		_, content, _, err := rlp.Split(it.Value)
		if err != nil {
			return StorageRangeResult{}, err
		}
		e := storageEntry{Value: common.BytesToHash(content)}
		if preimage := st.GetKey(it.Key); preimage != nil {
			preimage := common.BytesToHash(preimage)
			e.Key = &preimage
		}
		result.Storage[common.BytesToHash(it.Key)] = e
	}
	// Add the 'next key' so clients can continue downloading.
	if it.Next() {
		next := common.BytesToHash(it.Key)
		result.NextKey = &next
	}
	return result, nil
}

// GetModifiedAccountsByNumber returns all accounts that have changed between the
// two blocks specified. A change is defined as a difference in nonce, balance,
// code hash, or storage hash.
//
// With one parameter, returns the list of accounts modified in the specified block.
func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error) {
	var startBlock, endBlock *types.Block

	startBlock = api.eth.blockchain.GetBlockByNumber(startNum)
	if startBlock == nil {
		return nil, fmt.Errorf("start block %x not found", startNum)
	}

	if endNum == nil {
		endBlock = startBlock
		startBlock = api.eth.blockchain.GetBlockByHash(startBlock.ParentHash())
		if startBlock == nil {
			return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
		}
	} else {
		endBlock = api.eth.blockchain.GetBlockByNumber(*endNum)
		if endBlock == nil {
			return nil, fmt.Errorf("end block %d not found", *endNum)
		}
	}
	return api.getModifiedAccounts(startBlock, endBlock)
}

// GetModifiedAccountsByHash returns all accounts that have changed between the
// two blocks specified. A change is defined as a difference in nonce, balance,
// code hash, or storage hash.
//
// With one parameter, returns the list of accounts modified in the specified block.
func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error) {
	var startBlock, endBlock *types.Block
	startBlock = api.eth.blockchain.GetBlockByHash(startHash)
	if startBlock == nil {
		return nil, fmt.Errorf("start block %x not found", startHash)
	}

	if endHash == nil {
		endBlock = startBlock
		startBlock = api.eth.blockchain.GetBlockByHash(startBlock.ParentHash())
		if startBlock == nil {
			return nil, fmt.Errorf("block %x has no parent", endBlock.Number())
		}
	} else {
		endBlock = api.eth.blockchain.GetBlockByHash(*endHash)
		if endBlock == nil {
			return nil, fmt.Errorf("end block %x not found", *endHash)
		}
	}
	return api.getModifiedAccounts(startBlock, endBlock)
}

func (api *PrivateDebugAPI) getModifiedAccounts(startBlock, endBlock *types.Block) ([]common.Address, error) {
	if startBlock.Number().Uint64() >= endBlock.Number().Uint64() {
		return nil, fmt.Errorf("start block height (%d) must be less than end block height (%d)", startBlock.Number().Uint64(), endBlock.Number().Uint64())
	}
	triedb := api.eth.BlockChain().StateCache().TrieDB()

	oldTrie, err := trie.NewSecure(startBlock.Root(), triedb)
	if err != nil {
		return nil, err
	}
	newTrie, err := trie.NewSecure(endBlock.Root(), triedb)
	if err != nil {
		return nil, err
	}
	diff, _ := trie.NewDifferenceIterator(oldTrie.NodeIterator([]byte{}), newTrie.NodeIterator([]byte{}))
	iter := trie.NewIterator(diff)

	var dirty []common.Address
	for iter.Next() {
		key := newTrie.GetKey(iter.Key)
		if key == nil {
			return nil, fmt.Errorf("no preimage found for hash %x", iter.Key)
		}
		dirty = append(dirty, common.BytesToAddress(key))
	}
	return dirty, nil
}


================================================
FILE: eth/api_backend.go
================================================
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package eth

import (
	"context"
	"errors"
	"math/big"

	"github.com/ethereum/go-ethereum/accounts"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/consensus"
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/core/bloombits"
	"github.com/ethereum/go-ethereum/core/rawdb"
	"github.com/ethereum/go-ethereum/core/state"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/core/vm"
	"github.com/ethereum/go-ethereum/eth/downloader"
	"github.com/ethereum/go-ethereum/eth/gasprice"
	"github.com/ethereum/go-ethereum/ethdb"
	"github.com/ethereum/go-ethereum/event"
	"github.com/ethereum/go-ethereum/miner"
	"github.com/ethereum/go-ethereum/params"
	"github.com/ethereum/go-ethereum/rpc"
)

// EthAPIBackend implements ethapi.Backend for full nodes
type EthAPIBackend struct {
	extRPCEnabled       bool
	allowUnprotectedTxs bool
	eth                 *Ethereum
	gpo                 *gasprice.Oracle
}

// ChainConfig returns the active chain configuration.
func (b *EthAPIBackend) ChainConfig() *params.ChainConfig {
	return b.eth.blockchain.Config()
}

func (b *EthAPIBackend) CurrentBlock() *types.Block {
	return b.eth.blockchain.CurrentBlock()
}

func (b *EthAPIBackend) SetHead(number uint64) {
	b.eth.handler.downloader.Cancel()
	b.eth.blockchain.SetHead(number)
}

func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
	// Pending block is only known by the miner
	if number == rpc.PendingBlockNumber {
		block := b.eth.miner.PendingBlock()
		return block.Header(), nil
	}
	// Otherwise resolve and return the block
	if number == rpc.LatestBlockNumber {
		return b.eth.blockchain.CurrentBlock().Header(), nil
	}
	return b.eth.blockchain.GetHeaderByNumber(uint64(number)), nil
}

func (b *EthAPIBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error) {
	if blockNr, ok := blockNrOrHash.Number(); ok {
		return b.HeaderByNumber(ctx, blockNr)
	}
	if hash, ok := blockNrOrHash.Hash(); ok {
		header := b.eth.blockchain.GetHeaderByHash(hash)
		if header == nil {
			return nil, errors.New("header for hash not found")
		}
		if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash {
			return nil, errors.New("hash is not currently canonical")
		}
		return header, nil
	}
	return nil, errors.New("invalid arguments; neither block nor hash specified")
}

func (b *EthAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
	return b.eth.blockchain.GetHeaderByHash(hash), nil
}

func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) {
	// Pending block is only known by the miner
	if number == rpc.PendingBlockNumber {
		block := b.eth.miner.PendingBlock()
		return block, nil
	}
	// Otherwise resolve and return the block
	if number == rpc.LatestBlockNumber {
		return b.eth.blockchain.CurrentBlock(), nil
	}
	return b.eth.blockchain.GetBlockByNumber(uint64(number)), nil
}

func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) {
	return b.eth.blockchain.GetBlockByHash(hash), nil
}

func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error) {
	if blockNr, ok := blockNrOrHash.Number(); ok {
		return b.BlockByNumber(ctx, blockNr)
	}
	if hash, ok := blockNrOrHash.Hash(); ok {
		header := b.eth.blockchain.GetHeaderByHash(hash)
		if header == nil {
			return nil, errors.New("header for hash not found")
		}
		if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash {
			return nil, errors.New("hash is not currently canonical")
		}
		block := b.eth.blockchain.GetBlock(hash, header.Number.Uint64())
		if block == nil {
			return nil, errors.New("header found, but block body is missing")
		}
		return block, nil
	}
	return nil, errors.New("invalid arguments; neither block nor hash specified")
}

func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) {
	// Pending state is only known by the miner
	if number == rpc.PendingBlockNumber {
		block, state := b.eth.miner.Pending()
		return state, block.Header(), nil
	}
	// Otherwise resolve the block number and return its state
	header, err := b.HeaderByNumber(ctx, number)
	if err != nil {
		return nil, nil, err
	}
	if header == nil {
		return nil, nil, errors.New("header not found")
	}
	stateDb, err := b.eth.BlockChain().StateAt(header.Root)
	return stateDb, header, err
}

func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error) {
	if blockNr, ok := blockNrOrHash.Number(); ok {
		return b.StateAndHeaderByNumber(ctx, blockNr)
	}
	if hash, ok := blockNrOrHash.Hash(); ok {
		header, err := b.HeaderByHash(ctx, hash)
		if err != nil {
			return nil, nil, err
		}
		if header == nil {
			return nil, nil, errors.New("header for hash not found")
		}
		if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash {
			return nil, nil, errors.New("hash is not currently canonical")
		}
		stateDb, err := b.eth.BlockChain().StateAt(header.Root)
		return stateDb, header, err
	}
	return nil, nil, errors.New("invalid arguments; neither block nor hash specified")
}

func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
	return b.eth.blockchain.GetReceiptsByHash(hash), nil
}

func (b *EthAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
	receipts := b.eth.blockchain.GetReceiptsByHash(hash)
	if receipts == nil {
		return nil, nil
	}
	logs := make([][]*types.Log, len(receipts))
	for i, receipt := range receipts {
		logs[i] = receipt.Logs
	}
	return logs, nil
}

func (b *EthAPIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
	return b.eth.blockchain.GetTdByHash(hash)
}

func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) {
	vmError := func() error { return nil }

	txContext := core.NewEVMTxContext(msg)
	context := core.NewEVMBlockContext(header, b.eth.BlockChain(), nil)
	return vm.NewEVM(context, txContext, state, b.eth.blockchain.Config(), *b.eth.blockchain.GetVMConfig()), vmError, nil
}

func (b *EthAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
	return b.eth.BlockChain().SubscribeRemovedLogsEvent(ch)
}

func (b *EthAPIBackend) SubscribePendingLogsEvent(ch chan<- []*types.Log) event.Subscription {
	return b.eth.miner.SubscribePendingLogs(ch)
}

func (b *EthAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
	return b.eth.BlockChain().SubscribeChainEvent(ch)
}

func (b *EthAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription {
	return b.eth.BlockChain().SubscribeChainHeadEvent(ch)
}

func (b *EthAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription {
	return b.eth.BlockChain().SubscribeChainSideEvent(ch)
}

func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription {
	return b.eth.BlockChain().SubscribeLogsEvent(ch)
}

func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
	return b.eth.txPool.AddLocal(signedTx)
}

func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, error) {
	pending, err := b.eth.txPool.Pending()
	if err != nil {
		return nil, err
	}
	var txs types.Transactions
	for _, batch := range pending {
		txs = append(txs, batch...)
	}
	return txs, nil
}

func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction {
	return b.eth.txPool.Get(hash)
}

func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
	tx, blockHash, blockNumber, index := rawdb.ReadTransaction(b.eth.ChainDb(), txHash)
	return tx, blockHash, blockNumber, index, nil
}

func (b *EthAPIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
	return b.eth.txPool.Nonce(addr), nil
}

func (b *EthAPIBackend) Stats() (pending int, queued int) {
	return b.eth.txPool.Stats()
}

func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) {
	return b.eth.TxPool().Content()
}

func (b *EthAPIBackend) TxPool() *core.TxPool {
	return b.eth.TxPool()
}

func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription {
	return b.eth.TxPool().SubscribeNewTxsEvent(ch)
}

func (b *EthAPIBackend) Downloader() *downloader.Downloader {
	return b.eth.Downloader()
}

func (b *EthAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error) {
	return b.gpo.SuggestPrice(ctx)
}

func (b *EthAPIBackend) ChainDb() ethdb.Database {
	return b.eth.ChainDb()
}

func (b *EthAPIBackend) EventMux() *event.TypeMux {
	return b.eth.EventMux()
}

func (b *EthAPIBackend) AccountManager() *accounts.Manager {
	return b.eth.AccountManager()
}

func (b *EthAPIBackend) ExtRPCEnabled() bool {
	return b.extRPCEnabled
}

func (b *EthAPIBackend) UnprotectedAllowed() bool {
	return b.allowUnprotectedTxs
}

func (b *EthAPIBackend) RPCGasCap() uint64 {
	return b.eth.config.RPCGasCap
}

func (b *EthAPIBackend) RPCTxFeeCap() float64 {
	return b.eth.config.RPCTxFeeCap
}

func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
	sections, _, _ := b.eth.bloomIndexer.Sections()
	return params.BloomBitsBlocks, sections
}

func (b *EthAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) {
	for i := 0; i < bloomFilterThreads; i++ {
		go session.Multiplex(bloomRetrievalBatch, bloomRetrievalWait, b.eth.bloomRequests)
	}
}

func (b *EthAPIBackend) Engine() consensus.Engine {
	return b.eth.engine
}

func (b *EthAPIBackend) CurrentHeader() *types.Header {
	return b.eth.blockchain.CurrentHeader()
}

func (b *EthAPIBackend) Miner() *miner.Miner {
	return b.eth.Miner()
}

func (b *EthAPIBackend) StartMining(threads int) error {
	return b.eth.StartMining(threads)
}

func (b *EthAPIBackend) StateAtBlock(ctx context.Context, block *types.Block, reexec uint64) (*state.StateDB, func(), error) {
	return b.eth.stateAtBlock(block, reexec)
}

func (b *EthAPIBackend) StatesInRange(ctx context.Context, fromBlock *types.Block, toBlock *types.Block, reexec uint64) ([]*state.StateDB, func(), error) {
	return b.eth.statesInRange(fromBlock, toBlock, reexec)
}

func (b *EthAPIBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (core.Message, vm.BlockContext, *state.StateDB, func(), error) {
	return b.eth.stateAtTransaction(block, txIndex, reexec)
}


================================================
FILE: eth/api_test.go
================================================
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package eth

import (
	"bytes"
	"fmt"
	"math/big"
	"reflect"
	"sort"
	"testing"

	"github.com/davecgh/go-spew/spew"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/rawdb"
	"github.com/ethereum/go-ethereum/core/state"
	"github.com/ethereum/go-ethereum/crypto"
)

var dumper = spew.ConfigState{Indent: "    "}

func accountRangeTest(t *testing.T, trie *state.Trie, statedb *state.StateDB, start common.Hash, requestedNum int, expectedNum int) state.IteratorDump {
	result := statedb.IteratorDump(true, true, false, start.Bytes(), requestedNum)

	if len(result.Accounts) != expectedNum {
		t.Fatalf("expected %d results, got %d", expectedNum, len(result.Accounts))
	}
	for address := range result.Accounts {
		if address == (common.Address{}) {
			t.Fatalf("empty address returned")
		}
		if !statedb.Exist(address) {
			t.Fatalf("account not found in state %s", address.Hex())
		}
	}
	return result
}

type resultHash []common.Hash

func (h resultHash) Len() int           { return len(h) }
func (h resultHash) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }
func (h resultHash) Less(i, j int) bool { return bytes.Compare(h[i].Bytes(), h[j].Bytes()) < 0 }

func TestAccountRange(t *testing.T) {
	t.Parallel()

	var (
		statedb  = state.NewDatabaseWithConfig(rawdb.NewMemoryDatabase(), nil)
		state, _ = state.New(common.Hash{}, statedb, nil)
		addrs    = [AccountRangeMaxResults * 2]common.Address{}
		m        = map[common.Address]bool{}
	)

	for i := range addrs {
		hash := common.HexToHash(fmt.Sprintf("%x", i))
		addr := common.BytesToAddress(crypto.Keccak256Hash(hash.Bytes()).Bytes())
		addrs[i] = addr
		state.SetBalance(addrs[i], big.NewInt(1))
		if _, ok := m[addr]; ok {
			t.Fatalf("bad")
		} else {
			m[addr] = true
		}
	}
	state.Commit(true)
	root := state.IntermediateRoot(true)

	trie, err := statedb.OpenTrie(root)
	if err != nil {
		t.Fatal(err)
	}
	accountRangeTest(t, &trie, state, common.Hash{}, AccountRangeMaxResults/2, AccountRangeMaxResults/2)
	// test pagination
	firstResult := accountRangeTest(t, &trie, state, common.Hash{}, AccountRangeMaxResults, AccountRangeMaxResults)
	secondResult := accountRangeTest(t, &trie, state, common.BytesToHash(firstResult.Next), AccountRangeMaxResults, AccountRangeMaxResults)

	hList := make(resultHash, 0)
	for addr1 := range firstResult.Accounts {
		// If address is empty, then it makes no sense to compare
		// them as they might be two different accounts.
		if addr1 == (common.Address{}) {
			continue
		}
		if _, duplicate := secondResult.Accounts[addr1]; duplicate {
			t.Fatalf("pagination test failed:  results should not overlap")
		}
		hList = append(hList, crypto.Keccak256Hash(addr1.Bytes()))
	}
	// Test to see if it's possible to recover from the middle of the previous
	// set and get an even split between the first and second sets.
	sort.Sort(hList)
	middleH := hList[AccountRangeMaxResults/2]
	middleResult := accountRangeTest(t, &trie, state, middleH, AccountRangeMaxResults, AccountRangeMaxResults)
	missing, infirst, insecond := 0, 0, 0
	for h := range middleResult.Accounts {
		if _, ok := firstResult.Accounts[h]; ok {
			infirst++
		} else if _, ok := secondResult.Accounts[h]; ok {
			insecond++
		} else {
			missing++
		}
	}
	if missing != 0 {
		t.Fatalf("%d hashes in the 'middle' set were neither in the first not the second set", missing)
	}
	if infirst != AccountRangeMaxResults/2 {
		t.Fatalf("Imbalance in the number of first-test results: %d != %d", infirst, AccountRangeMaxResults/2)
	}
	if insecond != AccountRangeMaxResults/2 {
		t.Fatalf("Imbalance in the number of second-test results: %d != %d", insecond, AccountRangeMaxResults/2)
	}
}

func TestEmptyAccountRange(t *testing.T) {
	t.Parallel()

	var (
		statedb  = state.NewDatabase(rawdb.NewMemoryDatabase())
		state, _ = state.New(common.Hash{}, statedb, nil)
	)
	state.Commit(true)
	state.IntermediateRoot(true)
	results := state.IteratorDump(true, true, true, (common.Hash{}).Bytes(), AccountRangeMaxResults)
	if bytes.Equal(results.Next, (common.Hash{}).Bytes()) {
		t.Fatalf("Empty results should not return a second page")
	}
	if len(results.Accounts) != 0 {
		t.Fatalf("Empty state should not return addresses: %v", results.Accounts)
	}
}

func TestStorageRangeAt(t *testing.T) {
	t.Parallel()

	// Create a state where account 0x010000... has a few storage entries.
	var (
		state, _ = state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()), nil)
		addr     = common.Address{0x01}
		keys     = []common.Hash{ // hashes of Keys of storage
			common.HexToHash("340dd630ad21bf010b4e676dbfa9ba9a02175262d1fa356232cfde6cb5b47ef2"),
			common.HexToHash("426fcb404ab2d5d8e61a3d918108006bbb0a9be65e92235bb10eefbdb6dcd053"),
			common.HexToHash("48078cfed56339ea54962e72c37c7f588fc4f8e5bc173827ba75cb10a63a96a5"),
			common.HexToHash("5723d2c3a83af9b735e3b7f21531e5623d183a9095a56604ead41f3582fdfb75"),
		}
		storage = storageMap{
			keys[0]: {Key: &common.Hash{0x02}, Value: common.Hash{0x01}},
			keys[1]: {Key: &common.Hash{0x04}, Value: common.Hash{0x02}},
			keys[2]: {Key: &common.Hash{0x01}, Value: common.Hash{0x03}},
			keys[3]: {Key: &common.Hash{0x03}, Value: common.Hash{0x04}},
		}
	)
	for _, entry := range storage {
		state.SetState(addr, *entry.Key, entry.Value)
	}

	// Check a few combinations of limit and start/end.
	tests := []struct {
		start []byte
		limit int
		want  StorageRangeResult
	}{
		{
			start: []byte{}, limit: 0,
			want: StorageRangeResult{storageMap{}, &keys[0]},
		},
		{
			start: []byte{}, limit: 100,
			want: StorageRangeResult{storage, nil},
		},
		{
			start: []byte{}, limit: 2,
			want: StorageRangeResult{storageMap{keys[0]: storage[keys[0]], keys[1]: storage[keys[1]]}, &keys[2]},
		},
		{
			start: []byte{0x00}, limit: 4,
			want: StorageRangeResult{storage, nil},
		},
		{
			start: []byte{0x40}, limit: 2,
			want: StorageRangeResult{storageMap{keys[1]: storage[keys[1]], keys[2]: storage[keys[2]]}, &keys[3]},
		},
	}
	for _, test := range tests {
		result, err := storageRangeAt(state.StorageTrie(addr), test.start, test.limit)
		if err != nil {
			t.Error(err)
		}
		if !reflect.DeepEqual(result, test.want) {
			t.Fatalf("wrong result for range 0x%x.., limit %d:\ngot %s\nwant %s",
				test.start, test.limit, dumper.Sdump(result), dumper.Sdump(&test.want))
		}
	}
}


================================================
FILE: eth/backend.go
================================================
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Package eth implements the Ethereum protocol.
package eth

import (
	"errors"
	"fmt"
	"math/big"
	"runtime"
	"sync"
	"sync/atomic"
	"time"

	"github.com/ethereum/go-ethereum/accounts"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/common/hexutil"
	"github.com/ethereum/go-ethereum/consensus"
	"github.com/ethereum/go-ethereum/consensus/clique"
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/core/bloombits"
	"github.com/ethereum/go-ethereum/core/rawdb"
	"github.com/ethereum/go-ethereum/core/state/pruner"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/core/vm"
	"github.com/ethereum/go-ethereum/eth/downloader"
	"github.com/ethereum/go-ethereum/eth/ethconfig"
	"github.com/ethereum/go-ethereum/eth/filters"
	"github.com/ethereum/go-ethereum/eth/gasprice"
	"github.com/ethereum/go-ethereum/eth/protocols/eth"
	"github.com/ethereum/go-ethereum/eth/protocols/snap"
	"github.com/ethereum/go-ethereum/ethdb"
	"github.com/ethereum/go-ethereum/event"
	"github.com/ethereum/go-ethereum/internal/ethapi"
	"github.com/ethereum/go-ethereum/log"
	"github.com/ethereum/go-ethereum/miner"
	"github.com/ethereum/go-ethereum/node"
	"github.com/ethereum/go-ethereum/p2p"
	"github.com/ethereum/go-ethereum/p2p/enode"
	"github.com/ethereum/go-ethereum/params"
	"github.com/ethereum/go-ethereum/rlp"
	"github.com/ethereum/go-ethereum/rpc"
)

// Config contains the configuration options of the ETH protocol.
// Deprecated: use ethconfig.Config instead.
type Config = ethconfig.Config

// Ethereum implements the Ethereum full node service.
type Ethereum struct {
	config *ethconfig.Config

	// Handlers
	txPool             *core.TxPool
	blockchain         *core.BlockChain
	handler            *handler
	ethDialCandidates  enode.Iterator
	snapDialCandidates enode.Iterator

	// DB interfaces
	chainDb ethdb.Database // Block chain database

	eventMux       *event.TypeMux
	engine         consensus.Engine
	accountManager *accounts.Manager

	bloomRequests     chan chan *bloombits.Retrieval // Channel receiving bloom data retrieval requests
	bloomIndexer      *core.ChainIndexer             // Bloom indexer operating during block imports
	closeBloomHandler chan struct{}

	APIBackend *EthAPIBackend

	miner     *miner.Miner
	gasPrice  *big.Int
	etherbase common.Address

	networkID     uint64
	netRPCService *ethapi.PublicNetAPI

	p2pServer *p2p.Server

	lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase)
}

// New creates a new Ethereum object (including the
// initialisation of the common Ethereum object)
func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
	// Ensure configuration values are compatible and sane
	if config.SyncMode == downloader.LightSync {
		return nil, errors.New("can't run eth.Ethereum in light sync mode, use les.LightEthereum")
	}
	if !config.SyncMode.IsValid() {
		return nil, fmt.Errorf("invalid sync mode %d", config.SyncMode)
	}
	if config.Miner.GasPrice == nil || config.Miner.GasPrice.Cmp(common.Big0) <= 0 {
		log.Warn("Sanitizing invalid miner gas price", "provided", config.Miner.GasPrice, "updated", ethconfig.Defaults.Miner.GasPrice)
		config.Miner.GasPrice = new(big.Int).Set(ethconfig.Defaults.Miner.GasPrice)
	}
	if config.NoPruning && config.TrieDirtyCache > 0 {
		if config.SnapshotCache > 0 {
			config.TrieCleanCache += config.TrieDirtyCache * 3 / 5
			config.SnapshotCache += config.TrieDirtyCache * 2 / 5
		} else {
			config.TrieCleanCache += config.TrieDirtyCache
		}
		config.TrieDirtyCache = 0
	}
	log.Info("Allocated trie memory caches", "clean", common.StorageSize(config.TrieCleanCache)*1024*1024, "dirty", common.StorageSize(config.TrieDirtyCache)*1024*1024)

	// Transfer mining-related config to the ethash config.
	ethashConfig := config.Ethash
	ethashConfig.NotifyFull = config.Miner.NotifyFull

	// Assemble the Ethereum object
	chainDb, err := stack.OpenDatabaseWithFreezer("chaindata", config.DatabaseCache, config.DatabaseHandles, config.DatabaseFreezer, "eth/db/chaindata/", false)
	if err != nil {
		return nil, err
	}
	chainConfig, genesisHash, genesisErr := core.SetupGenesisBlockWithOverride(chainDb, config.Genesis, config.OverrideBerlin)
	if _, ok := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !ok {
		return nil, genesisErr
	}
	log.Info("Initialised chain configuration", "config", chainConfig)

	if err := pruner.RecoverPruning(stack.ResolvePath(""), chainDb, stack.ResolvePath(config.TrieCleanCacheJournal)); err != nil {
		log.Error("Failed to recover state", "error", err)
	}
	eth := &Ethereum{
		config:            config,
		chainDb:           chainDb,
		eventMux:          stack.EventMux(),
		accountManager:    stack.AccountManager(),
		engine:            ethconfig.CreateConsensusEngine(stack, chainConfig, &ethashConfig, config.Miner.Notify, config.Miner.Noverify, chainDb),
		closeBloomHandler: make(chan struct{}),
		networkID:         config.NetworkId,
		gasPrice:          config.Miner.GasPrice,
		etherbase:         config.Miner.Etherbase,
		bloomRequests:     make(chan chan *bloombits.Retrieval),
		bloomIndexer:      core.NewBloomIndexer(chainDb, params.BloomBitsBlocks, params.BloomConfirms),
		p2pServer:         stack.Server(),
	}

	bcVersion := rawdb.ReadDatabaseVersion(chainDb)
	var dbVer = "<nil>"
	if bcVersion != nil {
		dbVer = fmt.Sprintf("%d", *bcVersion)
	}
	log.Info("Initialising Ethereum protocol", "network", config.NetworkId, "dbversion", dbVer)

	if !config.SkipBcVersionCheck {
		if bcVersion != nil && *bcVersion > core.BlockChainVersion {
			return nil, fmt.Errorf("database version is v%d, Geth %s only supports v%d", *bcVersion, params.VersionWithMeta, core.BlockChainVersion)
		} else if bcVersion == nil || *bcVersion < core.BlockChainVersion {
			log.Warn("Upgrade blockchain database version", "from", dbVer, "to", core.BlockChainVersion)
			rawdb.WriteDatabaseVersion(chainDb, core.BlockChainVersion)
		}
	}
	var (
		vmConfig = vm.Config{
			EnablePreimageRecording: config.EnablePreimageRecording,
			EWASMInterpreter:        config.EWASMInterpreter,
			EVMInterpreter:          config.EVMInterpreter,
		}
		cacheConfig = &core.CacheConfig{
			TrieCleanLimit:      config.TrieCleanCache,
			TrieCleanJournal:    stack.ResolvePath(config.TrieCleanCacheJournal),
			TrieCleanRejournal:  config.TrieCleanCacheRejournal,
			TrieCleanNoPrefetch: config.NoPrefetch,
			TrieDirtyLimit:      config.TrieDirtyCache,
			TrieDirtyDisabled:   config.NoPruning,
			TrieTimeLimit:       config.TrieTimeout,
			SnapshotLimit:       config.SnapshotCache,
			Preimages:           config.Preimages,
		}
	)
	eth.blockchain, err = core.NewBlockChain(chainDb, cacheConfig, chainConfig, eth.engine, vmConfig, eth.shouldPreserve, &config.TxLookupLimit)
	if err != nil {
		return nil, err
	}
	// Rewind the chain in case of an incompatible config upgrade.
	if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
		log.Warn("Rewinding chain to upgrade configuration", "err", compat)
		eth.blockchain.SetHead(compat.RewindTo)
		rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig)
	}
	eth.bloomIndexer.Start(eth.blockchain)

	if config.TxPool.Journal != "" {
		config.TxPool.Journal = stack.ResolvePath(config.TxPool.Journal)
	}
	eth.txPool = core.NewTxPool(config.TxPool, chainConfig, eth.blockchain)

	// Permit the downloader to use the trie cache allowance during fast sync
	cacheLimit := cacheConfig.TrieCleanLimit + cacheConfig.TrieDirtyLimit + cacheConfig.SnapshotLimit
	checkpoint := config.Checkpoint
	if checkpoint == nil {
		checkpoint = params.TrustedCheckpoints[genesisHash]
	}
	if eth.handler, err = newHandler(&handlerConfig{
		Database:   chainDb,
		Chain:      eth.blockchain,
		TxPool:     eth.txPool,
		Network:    config.NetworkId,
		Sync:       config.SyncMode,
		BloomCache: uint64(cacheLimit),
		EventMux:   eth.eventMux,
		Checkpoint: checkpoint,
		Whitelist:  config.Whitelist,
	}); err != nil {
		return nil, err
	}
	eth.miner = miner.New(eth, &config.Miner, chainConfig, eth.EventMux(), eth.engine, eth.isLocalBlock)
	eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData))

	eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil}
	if eth.APIBackend.allowUnprotectedTxs {
		log.Info("Unprotected transactions allowed")
	}
	gpoParams := config.GPO
	if gpoParams.Default == nil {
		gpoParams.Default = config.Miner.GasPrice
	}
	eth.APIBackend.gpo = gasprice.NewOracle(eth.APIBackend, gpoParams)

	eth.ethDialCandidates, err = setupDiscovery(eth.config.EthDiscoveryURLs)
	if err != nil {
		return nil, err
	}
	eth.snapDialCandidates, err = setupDiscovery(eth.config.SnapDiscoveryURLs)
	if err != nil {
		return nil, err
	}
	// Start the RPC service
	eth.netRPCService = ethapi.NewPublicNetAPI(eth.p2pServer, config.NetworkId)

	// Register the backend on the node
	stack.RegisterAPIs(eth.APIs())
	stack.RegisterProtocols(eth.Protocols())
	stack.RegisterLifecycle(eth)
	// Check for unclean shutdown
	if uncleanShutdowns, discards, err := rawdb.PushUncleanShutdownMarker(chainDb); err != nil {
		log.Error("Could not update unclean-shutdown-marker list", "error", err)
	} else {
		if discards > 0 {
			log.Warn("Old unclean shutdowns found", "count", discards)
		}
		for _, tstamp := range uncleanShutdowns {
			t := time.Unix(int64(tstamp), 0)
			log.Warn("Unclean shutdown detected", "booted", t,
				"age", common.PrettyAge(t))
		}
	}
	return eth, nil
}

func makeExtraData(extra []byte) []byte {
	if len(extra) == 0 {
		// create default extradata
		extra, _ = rlp.EncodeToBytes([]interface{}{
			uint(params.VersionMajor<<16 | params.VersionMinor<<8 | params.VersionPatch),
			"geth",
			runtime.Version(),
			runtime.GOOS,
		})
	}
	if uint64(len(extra)) > params.MaximumExtraDataSize {
		log.Warn("Miner extra data exceed limit", "extra", hexutil.Bytes(extra), "limit", params.MaximumExtraDataSize)
		extra = nil
	}
	return extra
}

// APIs return the collection of RPC services the ethereum package offers.
// NOTE, some of these services probably need to be moved to somewhere else.
func (s *Ethereum) APIs() []rpc.API {
	apis := ethapi.GetAPIs(s.APIBackend)

	// Append any APIs exposed explicitly by the consensus engine
	apis = append(apis, s.engine.APIs(s.BlockChain())...)

	// Append all the local APIs and return
	return append(apis, []rpc.API{
		{
			Namespace: "eth",
			Version:   "1.0",
			Service:   NewPublicEthereumAPI(s),
			Public:    true,
		}, {
			Namespace: "eth",
			Version:   "1.0",
			Service:   NewPublicMinerAPI(s),
			Public:    true,
		}, {
			Namespace: "eth",
			Version:   "1.0",
			Service:   downloader.NewPublicDownloaderAPI(s.handler.downloader, s.eventMux),
			Public:    true,
		}, {
			Namespace: "miner",
			Version:   "1.0",
			Service:   NewPrivateMinerAPI(s),
			Public:    false,
		}, {
			Namespace: "eth",
			Version:   "1.0",
			Service:   filters.NewPublicFilterAPI(s.APIBackend, false, 5*time.Minute),
			Public:    true,
		}, {
			Namespace: "admin",
			Version:   "1.0",
			Service:   NewPrivateAdminAPI(s),
		}, {
			Namespace: "debug",
			Version:   "1.0",
			Service:   NewPublicDebugAPI(s),
			Public:    true,
		}, {
			Namespace: "debug",
			Version:   "1.0",
			Service:   NewPrivateDebugAPI(s),
		}, {
			Namespace: "net",
			Version:   "1.0",
			Service:   s.netRPCService,
			Public:    true,
		},
	}...)
}

func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
	s.blockchain.ResetWithGenesisBlock(gb)
}

func (s *Ethereum) Etherbase() (eb common.Address, err error) {
	s.lock.RLock()
	etherbase := s.etherbase
	s.lock.RUnlock()

	if etherbase != (common.Address{}) {
		return etherbase, nil
	}
	if wallets := s.AccountManager().Wallets(); len(wallets) > 0 {
		if accounts := wallets[0].Accounts(); len(accounts) > 0 {
			etherbase := accounts[0].Address

			s.lock.Lock()
			s.etherbase = etherbase
			s.lock.Unlock()

			log.Info("Etherbase automatically configured", "address", etherbase)
			return etherbase, nil
		}
	}
	return common.Address{}, fmt.Errorf("etherbase must be explicitly specified")
}

// isLocalBlock checks whether the specified block is mined
// by local miner accounts.
//
// We regard two types of accounts as local miner account: etherbase
// and accounts specified via `txpool.locals` flag.
func (s *Ethereum) isLocalBlock(block *types.Block) bool {
	author, err := s.engine.Author(block.Header())
	if err != nil {
		log.Warn("Failed to retrieve block author", "number", block.NumberU64(), "hash", block.Hash(), "err", err)
		return false
	}
	// Check whether the given address is etherbase.
	s.lock.RLock()
	etherbase := s.etherbase
	s.lock.RUnlock()
	if author == etherbase {
		return true
	}
	// Check whether the given address is specified by `txpool.local`
	// CLI flag.
	for _, account := range s.config.TxPool.Locals {
		if account == author {
			return true
		}
	}
	return false
}

// shouldPreserve checks whether we should preserve the given block
// during the chain reorg depending on whether the author of block
// is a local account.
func (s *Ethereum) shouldPreserve(block *types.Block) bool {
	// The reason we need to disable the self-reorg preserving for clique
	// is it can be probable to introduce a deadlock.
	//
	// e.g. If there are 7 available signers
	//
	// r1   A
	// r2     B
	// r3       C
	// r4         D
	// r5   A      [X] F G
	// r6    [X]
	//
	// In the round5, the inturn signer E is offline, so the worst case
	// is A, F and G sign the block of round5 and reject the block of opponents
	// and in the round6, the last available signer B is offline, the whole
	// network is stuck.
	if _, ok := s.engine.(*clique.Clique); ok {
		return false
	}
	return s.isLocalBlock(block)
}

// SetEtherbase sets the mining reward address.
func (s *Ethereum) SetEtherbase(etherbase common.Address) {
	s.lock.Lock()
	s.etherbase = etherbase
	s.lock.Unlock()

	s.miner.SetEtherbase(etherbase)
}

// StartMining starts the miner with the given number of CPU threads. If mining
// is already running, this method adjust the number of threads allowed to use
// and updates the minimum price required by the transaction pool.
func (s *Ethereum) StartMining(threads int) error {
	// Update the thread count within the consensus engine
	type threaded interface {
		SetThreads(threads int)
	}
	if th, ok := s.engine.(threaded); ok {
		log.Info("Updated mining threads", "threads", threads)
		if threads == 0 {
			threads = -1 // Disable the miner from within
		}
		th.SetThreads(threads)
	}
	// If the miner was not running, initialize it
	if !s.IsMining() {
		// Propagate the initial price point to the transaction pool
		s.lock.RLock()
		price := s.gasPrice
		s.lock.RUnlock()
		s.txPool.SetGasPrice(price)

		// Configure the local mining address
		eb, err := s.Etherbase()
		if err != nil {
			log.Error("Cannot start mining without etherbase", "err", err)
			return fmt.Errorf("etherbase missing: %v", err)
		}
		if clique, ok := s.engine.(*clique.Clique); ok {
			wallet, err := s.accountManager.Find(accounts.Account{Address: eb})
			if wallet == nil || err != nil {
				log.Error("Etherbase account unavailable locally", "err", err)
				return fmt.Errorf("signer missing: %v", err)
			}
			clique.Authorize(eb, wallet.SignData)
		}
		// If mining is started, we can disable the transaction rejection mechanism
		// introduced to speed sync times.
		atomic.StoreUint32(&s.handler.acceptTxs, 1)

		go s.miner.Start(eb)
	}
	return nil
}

// StopMining terminates the miner, both at the consensus engine level as well as
// at the block creation level.
func (s *Ethereum) StopMining() {
	// Update the thread count within the consensus engine
	type threaded interface {
		SetThreads(threads int)
	}
	if th, ok := s.engine.(threaded); ok {
		th.SetThreads(-1)
	}
	// Stop the block creating itself
	s.miner.Stop()
}

func (s *Ethereum) IsMining() bool      { return s.miner.Mining() }
func (s *Ethereum) Miner() *miner.Miner { return s.miner }

func (s *Ethereum) AccountManager() *accounts.Manager  { return s.accountManager }
func (s *Ethereum) BlockChain() *core.BlockChain       { return s.blockchain }
func (s *Ethereum) TxPool() *core.TxPool               { return s.txPool }
func (s *Ethereum) EventMux() *event.TypeMux           { return s.eventMux }
func (s *Ethereum) Engine() consensus.Engine           { return s.engine }
func (s *Ethereum) ChainDb() ethdb.Database            { return s.chainDb }
func (s *Ethereum) IsListening() bool                  { return true } // Always listening
func (s *Ethereum) Downloader() *downloader.Downloader { return s.handler.downloader }
func (s *Ethereum) Synced() bool                       { return atomic.LoadUint32(&s.handler.acceptTxs) == 1 }
func (s *Ethereum) ArchiveMode() bool                  { return s.config.NoPruning }
func (s *Ethereum) BloomIndexer() *core.ChainIndexer   { return s.bloomIndexer }

// Protocols returns all the currently configured
// network protocols to start.
func (s *Ethereum) Protocols() []p2p.Protocol {
	protos := eth.MakeProtocols((*ethHandler)(s.handler), s.networkID, s.ethDialCandidates)
	if s.config.SnapshotCache > 0 {
		protos = append(protos, snap.MakeProtocols((*snapHandler)(s.handler), s.snapDialCandidates)...)
	}
	return protos
}

// Start implements node.Lifecycle, starting all internal goroutines needed by the
// Ethereum protocol implementation.
func (s *Ethereum) Start() error {
	eth.StartENRUpdater(s.blockchain, s.p2pServer.LocalNode())

	// Start the bloom bits servicing goroutines
	s.startBloomHandlers(params.BloomBitsBlocks)

	// Figure out a max peers count based on the server limits
	maxPeers := s.p2pServer.MaxPeers
	if s.config.LightServ > 0 {
		if s.config.LightPeers >= s.p2pServer.MaxPeers {
			return fmt.Errorf("invalid peer config: light peer count (%d) >= total peer count (%d)", s.config.LightPeers, s.p2pServer.MaxPeers)
		}
		maxPeers -= s.config.LightPeers
	}
	// Start the networking layer and the light server if requested
	s.handler.Start(maxPeers)
	return nil
}

// Stop implements node.Lifecycle, terminating all internal goroutines used by the
// Ethereum protocol.
func (s *Ethereum) Stop() error {
	// Stop all the peer-related stuff first.
	s.handler.Stop()

	// Then stop everything else.
	s.bloomIndexer.Close()
	close(s.closeBloomHandler)
	s.txPool.Stop()
	s.miner.Stop()
	s.blockchain.Stop()
	s.engine.Close()
	rawdb.PopUncleanShutdownMarker(s.chainDb)
	s.chainDb.Close()
	s.eventMux.Stop()

	return nil
}


================================================
FILE: eth/bloombits.go
================================================
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package eth

import (
	"time"

	"github.com/ethereum/go-ethereum/common/bitutil"
	"github.com/ethereum/go-ethereum/core/rawdb"
)

const (
	// bloomServiceThreads is the number of goroutines used globally by an Ethereum
	// instance to service bloombits lookups for all running filters.
	bloomServiceThreads = 16

	// bloomFilterThreads is the number of goroutines used locally per filter to
	// multiplex requests onto the global servicing goroutines.
	bloomFilterThreads = 3

	// bloomRetrievalBatch is the maximum number of bloom bit retrievals to service
	// in a single batch.
	bloomRetrievalBatch = 16

	// bloomRetrievalWait is the maximum time to wait for enough bloom bit requests
	// to accumulate request an entire batch (avoiding hysteresis).
	bloomRetrievalWait = time.Duration(0)
)

// startBloomHandlers starts a batch of goroutines to accept bloom bit database
// retrievals from possibly a range of filters and serving the data to satisfy.
func (eth *Ethereum) startBloomHandlers(sectionSize uint64) {
	for i := 0; i < bloomServiceThreads; i++ {
		go func() {
			for {
				select {
				case <-eth.closeBloomHandler:
					return

				case request := <-eth.bloomRequests:
					task := <-request
					task.Bitsets = make([][]byte, len(task.Sections))
					for i, section := range task.Sections {
						head := rawdb.ReadCanonicalHash(eth.chainDb, (section+1)*sectionSize-1)
						if compVector, err := rawdb.ReadBloomBits(eth.chainDb, task.Bit, section, head); err == nil {
							if blob, err := bitutil.DecompressBytes(compVector, int(sectionSize/8)); err == nil {
								task.Bitsets[i] = blob
							} else {
								task.Error = err
							}
						} else {
							task.Error = err
						}
					}
					request <- task
				}
			}
		}()
	}
}


================================================
FILE: eth/discovery.go
================================================
// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package eth

import (
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/core/forkid"
	"github.com/ethereum/go-ethereum/p2p/dnsdisc"
	"github.com/ethereum/go-ethereum/p2p/enode"
	"github.com/ethereum/go-ethereum/rlp"
)

// ethEntry is the "eth" ENR entry which advertises eth protocol
// on the discovery network.
type ethEntry struct {
	ForkID forkid.ID // Fork identifier per EIP-2124

	// Ignore additional fields (for forward compatibility).
	Rest []rlp.RawValue `rlp:"tail"`
}

// ENRKey implements enr.Entry.
func (e ethEntry) ENRKey() string {
	return "eth"
}

// startEthEntryUpdate starts the ENR updater loop.
func (eth *Ethereum) startEthEntryUpdate(ln *enode.LocalNode) {
	var newHead = make(chan core.ChainHeadEvent, 10)
	sub := eth.blockchain.SubscribeChainHeadEvent(newHead)

	go func() {
		defer sub.Unsubscribe()
		for {
			select {
			case <-newHead:
				ln.Set(eth.currentEthEntry())
			case <-sub.Err():
				// Would be nice to sync with eth.Stop, but there is no
				// good way to do that.
				return
			}
		}
	}()
}

func (eth *Ethereum) currentEthEntry() *ethEntry {
	return &ethEntry{ForkID: forkid.NewID(eth.blockchain.Config(), eth.blockchain.Genesis().Hash(),
		eth.blockchain.CurrentHeader().Number.Uint64())}
}

// setupDiscovery creates the node discovery source for the `eth` and `snap`
// protocols.
func setupDiscovery(urls []string) (enode.Iterator, error) {
	if len(urls) == 0 {
		return nil, nil
	}
	client := dnsdisc.NewClient(dnsdisc.Config{})
	return client.NewIterator(urls...)
}


================================================
FILE: eth/downloader/api.go
================================================
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package downloader

import (
	"context"
	"sync"

	"github.com/ethereum/go-ethereum"
	"github.com/ethereum/go-ethereum/event"
	"github.com/ethereum/go-ethereum/rpc"
)

// PublicDownloaderAPI provides an API which gives information about the current synchronisation status.
// It offers only methods that operates on data that can be available to anyone without security risks.
type PublicDownloaderAPI struct {
	d                         *Downloader
	mux                       *event.TypeMux
	installSyncSubscription   chan chan interface{}
	uninstallSyncSubscription chan *uninstallSyncSubscriptionRequest
}

// NewPublicDownloaderAPI create a new PublicDownloaderAPI. The API has an internal event loop that
// listens for events from the downloader through the global event mux. In case it receives one of
// these events it broadcasts it to all syncing subscriptions that are installed through the
// installSyncSubscription channel.
func NewPublicDownloaderAPI(d *Downloader, m *event.TypeMux) *PublicDownloaderAPI {
	api := &PublicDownloaderAPI{
		d:                         d,
		mux:                       m,
		installSyncSubscription:   make(chan chan interface{}),
		uninstallSyncSubscription: make(chan *uninstallSyncSubscriptionRequest),
	}

	go api.eventLoop()

	return api
}

// eventLoop runs a loop until the event mux closes. It will install and uninstall new
// sync subscriptions and broadcasts sync status updates to the installed sync subscriptions.
func (api *PublicDownloaderAPI) eventLoop() {
	var (
		sub               = api.mux.Subscribe(StartEvent{}, DoneEvent{}, FailedEvent{})
		syncSubscriptions = make(map[chan interface{}]struct{})
	)

	for {
		select {
		case i := <-api.installSyncSubscription:
			syncSubscriptions[i] = struct{}{}
		case u := <-api.uninstallSyncSubscription:
			delete(syncSubscriptions, u.c)
			close(u.uninstalled)
		case event := <-sub.Chan():
			if event == nil {
				return
			}

			var notification interface{}
			switch event.Data.(type) {
			case StartEvent:
				notification = &SyncingResult{
					Syncing: true,
					Status:  api.d.Progress(),
				}
			case DoneEvent, FailedEvent:
				notification = false
			}
			// broadcast
			for c := range syncSubscriptions {
				c <- notification
			}
		}
	}
}

// Syncing provides information when this nodes starts synchronising with the Ethereum network and when it's finished.
func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Subscription, error) {
	notifier, supported := rpc.NotifierFromContext(ctx)
	if !supported {
		return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
	}

	rpcSub := notifier.CreateSubscription()

	go func() {
		statuses := make(chan interface{})
		sub := api.SubscribeSyncStatus(statuses)

		for {
			select {
			case status := <-statuses:
				notifier.Notify(rpcSub.ID, status)
			case <-rpcSub.Err():
				sub.Unsubscribe()
				return
			case <-notifier.Closed():
				sub.Unsubscribe()
				return
			}
		}
	}()

	return rpcSub, nil
}

// SyncingResult provides information about the current synchronisation status for this node.
type SyncingResult struct {
	Syncing bool                  `json:"syncing"`
	Status  ethereum.SyncProgress `json:"status"`
}

// uninstallSyncSubscriptionRequest uninstalles a syncing subscription in the API event loop.
type uninstallSyncSubscriptionRequest struct {
	c           chan interface{}
	uninstalled chan interface{}
}

// SyncStatusSubscription represents a syncing subscription.
type SyncStatusSubscription struct {
	api       *PublicDownloaderAPI // register subscription in event loop of this api instance
	c         chan interface{}     // channel where events are broadcasted to
	unsubOnce sync.Once            // make sure unsubscribe logic is executed once
}

// Unsubscribe uninstalls the subscription from the DownloadAPI event loop.
// The status channel that was passed to subscribeSyncStatus isn't used anymore
// after this method returns.
func (s *SyncStatusSubscription) Unsubscribe() {
	s.unsubOnce.Do(func() {
		req := uninstallSyncSubscriptionRequest{s.c, make(chan interface{})}
		s.api.uninstallSyncSubscription <- &req

		for {
			select {
			case <-s.c:
				// drop new status events until uninstall confirmation
				continue
			case <-req.uninstalled:
				return
			}
		}
	})
}

// SubscribeSyncStatus creates a subscription that will broadcast new synchronisation updates.
// The given channel must receive interface values, the result can either
func (api *PublicDownloaderAPI) SubscribeSyncStatus(status chan interface{}) *SyncStatusSubscription {
	api.installSyncSubscription <- status
	return &SyncStatusSubscription{api: api, c: status}
}


================================================
FILE: eth/downloader/downloader.go
================================================
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Package downloader contains the manual full chain synchronisation.
package downloader

import (
	"errors"
	"fmt"
	"math/big"
	"sync"
	"sync/atomic"
	"time"

	"github.com/ethereum/go-ethereum"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/rawdb"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/eth/protocols/snap"
	"github.com/ethereum/go-ethereum/ethdb"
	"github.com/ethereum/go-ethereum/event"
	"github.com/ethereum/go-ethereum/log"
	"github.com/ethereum/go-ethereum/metrics"
	"github.com/ethereum/go-ethereum/params"
	"github.com/ethereum/go-ethereum/trie"
)

var (
	MaxBlockFetch   = 128 // Amount of blocks to be fetched per retrieval request
	MaxHeaderFetch  = 192 // Amount of block headers to be fetched per retrieval request
	MaxSkeletonSize = 128 // Number of header fetches to need for a skeleton assembly
	MaxReceiptFetch = 256 // Amount of transaction receipts to allow fetching per request
	MaxStateFetch   = 384 // Amount of node state values to allow fetching per request

	rttMinEstimate   = 2 * time.Second  // Minimum round-trip time to target for download requests
	rttMaxEstimate   = 20 * time.Second // Maximum round-trip time to target for download requests
	rttMinConfidence = 0.1              // Worse confidence factor in our estimated RTT value
	ttlScaling       = 3                // Constant scaling factor for RTT -> TTL conversion
	ttlLimit         = time.Minute      // Maximum TTL allowance to prevent reaching crazy timeouts

	qosTuningPeers   = 5    // Number of peers to tune based on (best peers)
	qosConfidenceCap = 10   // Number of peers above which not to modify RTT confidence
	qosTuningImpact  = 0.25 // Impact that a new tuning target has on the previous value

	maxQueuedHeaders            = 32 * 1024                         // [eth/62] Maximum number of headers to queue for import (DOS protection)
	maxHeadersProcess           = 2048                              // Number of header download results to import at once into the chain
	maxResultsProcess           = 2048                              // Number of content download results to import at once into the chain
	fullMaxForkAncestry  uint64 = params.FullImmutabilityThreshold  // Maximum chain reorganisation (locally redeclared so tests can reduce it)
	lightMaxForkAncestry uint64 = params.LightImmutabilityThreshold // Maximum chain reorganisation (locally redeclared so tests can reduce it)

	reorgProtThreshold   = 48 // Threshold number of recent blocks to disable mini reorg protection
	reorgProtHeaderDelay = 2  // Number of headers to delay delivering to cover mini reorgs

	fsHeaderCheckFrequency = 100             // Verification frequency of the downloaded headers during fast sync
	fsHeaderSafetyNet      = 2048            // Number of headers to discard in case a chain violation is detected
	fsHeaderForceVerify    = 24              // Number of headers to verify before and after the pivot to accept it
	fsHeaderContCheck      = 3 * time.Second // Time interval to check for header continuations during state download
	fsMinFullBlocks        = 64              // Number of blocks to retrieve fully even in fast sync
)

var (
	errBusy                    = errors.New("busy")
	errUnknownPeer             = errors.New("peer is unknown or unhealthy")
	errBadPeer                 = errors.New("action from bad peer ignored")
	errStallingPeer            = errors.New("peer is stalling")
	errUnsyncedPeer            = errors.New("unsynced peer")
	errNoPeers                 = errors.New("no peers to keep download active")
	errTimeout                 = errors.New("timeout")
	errEmptyHeaderSet          = errors.New("empty header set by peer")
	errPeersUnavailable        = errors.New("no peers available or all tried for download")
	errInvalidAncestor         = errors.New("retrieved ancestor is invalid")
	errInvalidChain            = errors.New("retrieved hash chain is invalid")
	errInvalidBody             = errors.New("retrieved block body is invalid")
	errInvalidReceipt          = errors.New("retrieved receipt is invalid")
	errCancelStateFetch        = errors.New("state data download canceled (requested)")
	errCancelContentProcessing = errors.New("content processing canceled (requested)")
	errCanceled                = errors.New("syncing canceled (requested)")
	errNoSyncActive            = errors.New("no sync active")
	errTooOld                  = errors.New("peer's protocol version too old")
	errNoAncestorFound         = errors.New("no common ancestor found")
)

type Downloader struct {
	// WARNING: The `rttEstimate` and `rttConfidence` fields are accessed atomically.
	// On 32 bit platforms, only 64-bit aligned fields can be atomic. The struct is
	// guaranteed to be so aligned, so take advantage of that. For more information,
	// see https://golang.org/pkg/sync/atomic/#pkg-note-BUG.
	rttEstimate   uint64 // Round trip time to target for download requests
	rttConfidence uint64 // Confidence in the estimated RTT (unit: millionths to allow atomic ops)

	mode uint32         // Synchronisation mode defining the strategy used (per sync cycle), use d.getMode() to get the SyncMode
	mux  *event.TypeMux // Event multiplexer to announce sync operation events

	checkpoint uint64   // Checkpoint block number to enforce head against (e.g. fast sync)
	genesis    uint64   // Genesis block number to limit sync to (e.g. light client CHT)
	queue      *queue   // Scheduler for selecting the hashes to download
	peers      *peerSet // Set of active peers from which download can proceed

	stateDB    ethdb.Database  // Database to state sync into (and deduplicate via)
	stateBloom *trie.SyncBloom // Bloom filter for fast trie node and contract code existence checks

	// Statistics
	syncStatsChainOrigin uint64 // Origin block number where syncing started at
	syncStatsChainHeight uint64 // Highest block number known when syncing started
	syncStatsState       stateSyncStats
	syncStatsLock        sync.RWMutex // Lock protecting the sync stats fields

	lightchain LightChain
	blockchain BlockChain

	// Callbacks
	dropPeer peerDropFn // Drops a peer for misbehaving

	// Status
	synchroniseMock func(id string, hash common.Hash) error // Replacement for synchronise during testing
	synchronising   int32
	notified        int32
	committed       int32
	ancientLimit    uint64 // The maximum block number which can be regarded as ancient data.

	// Channels
	headerCh      chan dataPack        // Channel receiving inbound block headers
	bodyCh        chan dataPack        // Channel receiving inbound block bodies
	receiptCh     chan dataPack        // Channel receiving inbound receipts
	bodyWakeCh    chan bool            // Channel to signal the block body fetcher of new tasks
	receiptWakeCh chan bool            // Channel to signal the receipt fetcher of new tasks
	headerProcCh  chan []*types.Header // Channel to feed the header processor new tasks

	// State sync
	pivotHeader *types.Header // Pivot block header to dynamically push the syncing state root
	pivotLock   sync.RWMutex  // Lock protecting pivot header reads from updates

	snapSync       bool         // Whether to run state sync over the snap protocol
	SnapSyncer     *snap.Syncer // TODO(karalabe): make private! hack for now
	stateSyncStart chan *stateSync
	trackStateReq  chan *stateReq
	stateCh        chan dataPack // Channel receiving inbound node state data

	// Cancellation and termination
	cancelPeer string         // Identifier of the peer currently being used as the master (cancel on drop)
	cancelCh   chan struct{}  // Channel to cancel mid-flight syncs
	cancelLock sync.RWMutex   // Lock to protect the cancel channel and peer in delivers
	cancelWg   sync.WaitGroup // Make sure all fetcher goroutines have exited.

	quitCh   chan struct{} // Quit channel to signal termination
	quitLock sync.Mutex    // Lock to prevent double closes

	// Testing hooks
	syncInitHook     func(uint64, uint64)  // Method to call upon initiating a new sync run
	bodyFetchHook    func([]*types.Header) // Method to call upon starting a block body fetch
	receiptFetchHook func([]*types.Header) // Method to call upon starting a receipt fetch
	chainInsertHook  func([]*fetchResult)  // Method to call upon inserting a chain of blocks (possibly in multiple invocations)
}

// LightChain encapsulates functions required to synchronise a light chain.
type LightChain interface {
	// HasHeader verifies a header's presence in the local chain.
	HasHeader(common.Hash, uint64) bool

	// GetHeaderByHash retrieves a header from the local chain.
	GetHeaderByHash(common.Hash) *types.Header

	// CurrentHeader retrieves the head header from the local chain.
	CurrentHeader() *types.Header

	// GetTd returns the total difficulty of a local block.
	GetTd(common.Hash, uint64) *big.Int

	// InsertHeaderChain inserts a batch of headers into the local chain.
	InsertHeaderChain([]*types.Header, int) (int, error)

	// SetHead rewinds the local chain to a new head.
	SetHead(uint64) error
}

// BlockChain encapsulates functions required to sync a (full or fast) blockchain.
type BlockChain interface {
	LightChain

	// HasBlock verifies a block's presence in the local chain.
	HasBlock(common.Hash, uint64) bool

	// HasFastBlock verifies a fast block's presence in the local chain.
	HasFastBlock(common.Hash, uint64) bool

	// GetBlockByHash retrieves a block from the local chain.
	GetBlockByHash(common.Hash) *types.Block

	// CurrentBlock retrieves the head block from the local chain.
	CurrentBlock() *types.Block

	// CurrentFastBlock retrieves the head fast block from the local chain.
	CurrentFastBlock() *types.Block

	// FastSyncCommitHead directly commits the head block to a certain entity.
	FastSyncCommitHead(common.Hash) error

	// InsertChain inserts a batch of blocks into the local chain.
	InsertChain(types.Blocks) (int, error)

	// InsertReceiptChain inserts a batch of receipts into the local chain.
	InsertReceiptChain(types.Blocks, []types.Receipts, uint64) (int, error)
}

// New creates a new downloader to fetch hashes and blocks from remote peers.
func New(checkpoint uint64, stateDb ethdb.Database, stateBloom *trie.SyncBloom, mux *event.TypeMux, chain BlockChain, lightchain LightChain, dropPeer peerDropFn) *Downloader {
	if lightchain == nil {
		lightchain = chain
	}
	dl := &Downloader{
		stateDB:        stateDb,
		stateBloom:     stateBloom,
		mux:            mux,
		checkpoint:     checkpoint,
		queue:          newQueue(blockCacheMaxItems, blockCacheInitialItems),
		peers:          newPeerSet(),
		rttEstimate:    uint64(rttMaxEstimate),
		rttConfidence:  uint64(1000000),
		blockchain:     chain,
		lightchain:     lightchain,
		dropPeer:       dropPeer,
		headerCh:       make(chan dataPack, 1),
		bodyCh:         make(chan dataPack, 1),
		receiptCh:      make(chan dataPack, 1),
		bodyWakeCh:     make(chan bool, 1),
		receiptWakeCh:  make(chan bool, 1),
		headerProcCh:   make(chan []*types.Header, 1),
		quitCh:         make(chan struct{}),
		stateCh:        make(chan dataPack),
		SnapSyncer:     snap.NewSyncer(stateDb),
		stateSyncStart: make(chan *stateSync),
		syncStatsState: stateSyncStats{
			processed: rawdb.ReadFastTrieProgress(stateDb),
		},
		trackStateReq: make(chan *stateReq),
	}
	go dl.qosTuner()
	go dl.stateFetcher()
	return dl
}

// Progress retrieves the synchronisation boundaries, specifically the origin
// block where synchronisation started at (may have failed/suspended); the block
// or header sync is currently at; and the latest known block which the sync targets.
//
// In addition, during the state download phase of fast synchronisation the number
// of processed and the total number of known states are also returned. Otherwise
// these are zero.
func (d *Downloader) Progress() ethereum.SyncProgress {
	// Lock the current stats and return the progress
	d.syncStatsLock.RLock()
	defer d.syncStatsLock.RUnlock()

	current := uint64(0)
	mode := d.getMode()
	switch {
	case d.blockchain != nil && mode == FullSync:
		current = d.blockchain.CurrentBlock().NumberU64()
	case d.blockchain != nil && mode == FastSync:
		current = d.blockchain.CurrentFastBlock().NumberU64()
	case d.lightchain != nil:
		current = d.lightchain.CurrentHeader().Number.Uint64()
	default:
		log.Error("Unknown downloader chain/mode combo", "light", d.lightchain != nil, "full", d.blockchain != nil, "mode", mode)
	}
	return ethereum.SyncProgress{
		StartingBlock: d.syncStatsChainOrigin,
		CurrentBlock:  current,
		HighestBlock:  d.syncStatsChainHeight,
		PulledStates:  d.syncStatsState.processed,
		KnownStates:   d.syncStatsState.processed + d.syncStatsState.pending,
	}
}

// Synchronising returns whether the downloader is currently retrieving blocks.
func (d *Downloader) Synchronising() bool {
	return atomic.LoadInt32(&d.synchronising) > 0
}

// RegisterPeer injects a new download peer into the set of block source to be
// used for fetching hashes and blocks from.
func (d *Downloader) RegisterPeer(id string, version uint, peer Peer) error {
	var logger log.Logger
	if len(id) < 16 {
		// Tests use short IDs, don't choke on them
		logger = log.New("peer", id)
	} else {
		logger = log.New("peer", id[:8])
	}
	logger.Trace("Registering sync peer")
	if err := d.peers.Register(newPeerConnection(id, version, peer, logger)); err != nil {
		logger.Error("Failed to register sync peer", "err", err)
		return err
	}
	d.qosReduceConfidence()

	return nil
}

// RegisterLightPeer injects a light client peer, wrapping it so it appears as a regular peer.
func (d *Downloader) RegisterLightPeer(id string, version uint, peer LightPeer) error {
	return d.RegisterPeer(id, version, &lightPeerWrapper{peer})
}

// UnregisterPeer remove a peer from the known list, preventing any action from
// the specified peer. An effort is also made to return any pending fetches into
// the queue.
func (d *Downloader) UnregisterPeer(id string) error {
	// Unregister the peer from the active peer set and revoke any fetch tasks
	var logger log.Logger
	if len(id) < 16 {
		// Tests use short IDs, don't choke on them
		logger = log.New("peer", id)
	} else {
		logger = log.New("peer", id[:8])
	}
	logger.Trace("Unregistering sync peer")
	if err := d.peers.Unregister(id); err != nil {
		logger.Error("Failed to unregister sync peer", "err", err)
		return err
	}
	d.queue.Revoke(id)

	return nil
}

// Synchronise tries to sync up our local block chain with a remote peer, both
// adding various sanity checks as well as wrapping it with various log entries.
func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode SyncMode) error {
	err := d.synchronise(id, head, td, mode)

	switch err {
	case nil, errBusy, errCanceled:
		return err
	}
	if errors.Is(err, errInvalidChain) || errors.Is(err, errBadPeer) || errors.Is(err, errTimeout) ||
		errors.Is(err, errStallingPeer) || errors.Is(err, errUnsyncedPeer) || errors.Is(err, errEmptyHeaderSet) ||
		errors.Is(err, errPeersUnavailable) || errors.Is(err, errTooOld) || errors.Is(err, errInvalidAncestor) {
		log.Warn("Synchronisation failed, dropping peer", "peer", id, "err", err)
		if d.dropPeer == nil {
			// The dropPeer method is nil when `--copydb` is used for a local copy.
			// Timeouts can occur if e.g. compaction hits at the wrong time, and can be ignored
			log.Warn("Downloader wants to drop peer, but peerdrop-function is not set", "peer", id)
		} else {
			d.dropPeer(id)
		}
		return err
	}
	log.Warn("Synchronisation failed, retrying", "err", err)
	return err
}

// synchronise will select the peer and use it for synchronising. If an empty string is given
// it will use the best peer possible and synchronize if its TD is higher than our own. If any of the
// checks fail an error will be returned. This method is synchronous
func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode SyncMode) error {
	// Mock out the synchronisation if testing
	if d.synchroniseMock != nil {
		return d.synchroniseMock(id, hash)
	}
	// Make sure only one goroutine is ever allowed past this point at once
	if !atomic.CompareAndSwapInt32(&d.synchronising, 0, 1) {
		return errBusy
	}
	defer atomic.StoreInt32(&d.synchronising, 0)

	// Post a user notification of the sync (only once per session)
	if atomic.CompareAndSwapInt32(&d.notified, 0, 1) {
		log.Info("Block synchronisation started")
	}
	// If we are already full syncing, but have a fast-sync bloom filter laying
	// around, make sure it doesn't use memory any more. This is a special case
	// when the user attempts to fast sync a new empty network.
	if mode == FullSync && d.stateBloom != nil {
		d.stateBloom.Close()
	}
	// If snap sync was requested, create the snap scheduler and switch to fast
	// sync mode. Long term we could drop fast sync or merge the two together,
	// but until snap becomes prevalent, we should support both. TODO(karalabe).
	if mode == SnapSync {
		if !d.snapSync {
			log.Warn("Enabling snapshot sync prototype")
			d.snapSync = true
		}
		mode = FastSync
	}
	// Reset the queue, peer set and wake channels to clean any internal leftover state
	d.queue.Reset(blockCacheMaxItems, blockCacheInitialItems)
	d.peers.Reset()

	for _, ch := range []chan bool{d.bodyWakeCh, d.receiptWakeCh} {
		select {
		case <-ch:
		default:
		}
	}
	for _, ch := range []chan dataPack{d.headerCh, d.bodyCh, d.receiptCh} {
		for empty := false; !empty; {
			select {
			case <-ch:
			default:
				empty = true
			}
		}
	}
	for empty := false; !empty; {
		select {
		case <-d.headerProcCh:
		default:
			empty = true
		}
	}
	// Create cancel channel for aborting mid-flight and mark the master peer
	d.cancelLock.Lock()
	d.cancelCh = make(chan struct{})
	d.cancelPeer = id
	d.cancelLock.Unlock()

	defer d.Cancel() // No matter what, we can't leave the cancel channel open

	// Atomically set the requested sync mode
	atomic.StoreUint32(&d.mode, uint32(mode))

	// Retrieve the origin peer and initiate the downloading process
	p := d.peers.Peer(id)
	if p == nil {
		return errUnknownPeer
	}
	return d.syncWithPeer(p, hash, td)
}

func (d *Downloader) getMode() SyncMode {
	return SyncMode(atomic.LoadUint32(&d.mode))
}

// syncWithPeer starts a block synchronization based on the hash chain from the
// specified peer and head hash.
func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.Int) (err error) {
	d.mux.Post(StartEvent{})
	defer func() {
		// reset on error
		if err != nil {
			d.mux.Post(FailedEvent{err})
		} else {
			latest := d.lightchain.CurrentHeader()
			d.mux.Post(DoneEvent{latest})
		}
	}()
	if p.version < 64 {
		return fmt.Errorf("%w: advertized %d < required %d", errTooOld, p.version, 64)
	}
	mode := d.getMode()

	log.Debug("Synchronising with the network", "peer", p.id, "eth", p.version, "head", hash, "td", td, "mode", mode)
	defer func(start time.Time) {
		log.Debug("Synchronisation terminated", "elapsed", common.PrettyDuration(time.Since(start)))
	}(time.Now())

	// Look up the sync boundaries: the common ancestor and the target block
	latest, pivot, err := d.fetchHead(p)
	if err != nil {
		return err
	}
	if mode == FastSync && pivot == nil {
		// If no pivot block was returned, the head is below the min full block
		// threshold (i.e. new chian). In that case we won't really fast sync
		// anyway, but still need a valid pivot block to avoid some code hitting
		// nil panics on an access.
		pivot = d.blockchain.CurrentBlock().Header()
	}
	height := latest.Number.Uint64()

	origin, err := d.findAncestor(p, latest)
	if err != nil {
		return err
	}
	d.syncStatsLock.Lock()
	if d.syncStatsChainHeight <= origin || d.syncStatsChainOrigin > origin {
		d.syncStatsChainOrigin = origin
	}
	d.syncStatsChainHeight = height
	d.syncStatsLock.Unlock()

	// Ensure our origin point is below any fast sync pivot point
	if mode == FastSync {
		if height <= uint64(fsMinFullBlocks) {
			origin = 0
		} else {
			pivotNumber := pivot.Number.Uint64()
			if pivotNumber <= origin {
				origin = pivotNumber - 1
			}
			// Write out the pivot into the database so a rollback beyond it will
			// reenable fast sync
			rawdb.WriteLastPivotNumber(d.stateDB, pivotNumber)
		}
	}
	d.committed = 1
	if mode == FastSync && pivot.Number.Uint64() != 0 {
		d.committed = 0
	}
	if mode == FastSync {
		// Set the ancient data limitation.
		// If we are running fast sync, all block data older than ancientLimit will be
		// written to the ancient store. More recent data will be written to the active
		// database and will wait for the freezer to migrate.
		//
		// If there is a checkpoint available, then calculate the ancientLimit through
		// that. Otherwise calculate the ancient limit through the advertised height
		// of the remote peer.
		//
		// The reason for picking checkpoint first is that a malicious peer can give us
		// a fake (very high) height, forcing the ancient limit to also be very high.
		// The peer would start to feed us valid blocks until head, resulting in all of
		// the blocks might be written into the ancient store. A following mini-reorg
		// could cause issues.
		if d.checkpoint != 0 && d.checkpoint > fullMaxForkAncestry+1 {
			d.ancientLimit = d.checkpoint
		} else if height > fullMaxForkAncestry+1 {
			d.ancientLimit = height - fullMaxForkAncestry - 1
		} else {
			d.ancientLimit = 0
		}
		frozen, _ := d.stateDB.Ancients() // Ignore the error here since light client can also hit here.

		// If a part of blockchain data has already been written into active store,
		// disable the ancient style insertion explicitly.
		if origin >= frozen && frozen != 0 {
			d.ancientLimit = 0
			log.Info("Disabling direct-ancient mode", "origin", origin, "ancient", frozen-1)
		} else if d.ancientLimit > 0 {
			log.Debug("Enabling direct-ancient mode", "ancient", d.ancientLimit)
		}
		// Rewind the ancient store and blockchain if reorg happens.
		if origin+1 < frozen {
			if err := d.lightchain.SetHead(origin + 1); err != nil {
				return err
			}
		}
	}
	// Initiate the sync using a concurrent header and content retrieval algorithm
	d.queue.Prepare(origin+1, mode)
	if d.syncInitHook != nil {
		d.syncInitHook(origin, height)
	}
	fetchers := []func() error{
		func() error { return d.fetchHeaders(p, origin+1) }, // Headers are always retrieved
		func() error { return d.fetchBodies(origin + 1) },   // Bodies are retrieved during normal and fast sync
		func() error { return d.fetchReceipts(origin + 1) }, // Receipts are retrieved during fast sync
		func() error { return d.processHeaders(origin+1, td) },
	}
	if mode == FastSync {
		d.pivotLock.Lock()
		d.pivotHeader = pivot
		d.pivotLock.Unlock()

		fetchers = append(fetchers, func() error { return d.processFastSyncContent() })
	} else if mode == FullSync {
		fetchers = append(fetchers, d.processFullSyncContent)
	}
	return d.spawnSync(fetchers)
}

// spawnSync runs d.process and all given fetcher functions to completion in
// separate goroutines, returning the first error that appears.
func (d *Downloader) spawnSync(fetchers []func() error) error {
	errc := make(chan error, len(fetchers))
	d.cancelWg.Add(len(fetchers))
	for _, fn := range fetchers {
		fn := fn
		go func() { defer d.cancelWg.Done(); errc <- fn() }()
	}
	// Wait for the first error, then terminate the others.
	var err error
	for i := 0; i < len(fetchers); i++ {
		if i == len(fetchers)-1 {
			// Close the queue when all fetchers have exited.
			// This will cause the block processor to end when
			// it has processed the queue.
			d.queue.Close()
		}
		if err = <-errc; err != nil && err != errCanceled {
			break
		}
	}
	d.queue.Close()
	d.Cancel()
	return err
}

// cancel aborts all of the operations and resets the queue. However, cancel does
// not wait for the running download goroutines to finish. This method should be
// used when cancelling the downloads from inside the downloader.
func (d *Downloader) cancel() {
	// Close the current cancel channel
	d.cancelLock.Lock()
	defer d.cancelLock.Unlock()

	if d.cancelCh != nil {
		select {
		case <-d.cancelCh:
			// Channel was already closed
		default:
			close(d.cancelCh)
		}
	}
}

// Cancel aborts all of the operations and waits for all download goroutines to
// finish before returning.
func (d *Downloader) Cancel() {
	d.cancel()
	d.cancelWg.Wait()
}

// Terminate interrupts the downloader, canceling all pending operations.
// The downloader cannot be reused after calling Terminate.
func (d *Downloader) Terminate() {
	// Close the termination channel (make sure double close is all
Download .txt
gitextract_z6s4fmui/

├── .circleci/
│   └── config.yml
├── .clippy.toml
├── .dockerignore
├── .gitignore
├── CHANGELOG.md
├── CODEOWNERS
├── CONTRIBUTING.md
├── COPYRIGHT
├── Cargo.toml
├── Dockerfile-ci
├── Dockerfile-profile
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── SECURITY.md
├── bench.config.toml
├── build.rs
├── console/
│   ├── bridge.go
│   ├── bridge_test.go
│   ├── console.go
│   ├── console_test.go
│   ├── prompt/
│   │   └── prompter.go
│   └── testdata/
│       ├── exec.js
│       └── preload.js
├── eth/
│   ├── api.go
│   ├── api_backend.go
│   ├── api_test.go
│   ├── backend.go
│   ├── bloombits.go
│   ├── discovery.go
│   ├── downloader/
│   │   ├── api.go
│   │   ├── downloader.go
│   │   ├── downloader_test.go
│   │   ├── events.go
│   │   ├── metrics.go
│   │   ├── modes.go
│   │   ├── peer.go
│   │   ├── peer_test.go
│   │   ├── queue.go
│   │   ├── queue_test.go
│   │   ├── resultstore.go
│   │   ├── statesync.go
│   │   ├── testchain_test.go
│   │   └── types.go
│   ├── ethconfig/
│   │   ├── config.go
│   │   └── gen_config.go
│   ├── fetcher/
│   │   ├── block_fetcher.go
│   │   ├── block_fetcher_test.go
│   │   ├── tx_fetcher.go
│   │   └── tx_fetcher_test.go
│   ├── filters/
│   │   ├── api.go
│   │   ├── api_test.go
│   │   ├── bench_test.go
│   │   ├── filter.go
│   │   ├── filter_system.go
│   │   ├── filter_system_test.go
│   │   └── filter_test.go
│   ├── gasprice/
│   │   ├── gasprice.go
│   │   └── gasprice_test.go
│   ├── handler.go
│   ├── handler_eth.go
│   ├── handler_eth_test.go
│   ├── handler_snap.go
│   ├── handler_test.go
│   ├── peer.go
│   ├── peerset.go
│   ├── protocols/
│   │   ├── eth/
│   │   │   ├── broadcast.go
│   │   │   ├── discovery.go
│   │   │   ├── handler.go
│   │   │   ├── handler_test.go
│   │   │   ├── handlers.go
│   │   │   ├── handshake.go
│   │   │   ├── handshake_test.go
│   │   │   ├── peer.go
│   │   │   ├── peer_test.go
│   │   │   ├── protocol.go
│   │   │   └── protocol_test.go
│   │   └── snap/
│   │       ├── discovery.go
│   │       ├── handler.go
│   │       ├── peer.go
│   │       ├── protocol.go
│   │       ├── sync.go
│   │       └── sync_test.go
│   ├── state_accessor.go
│   ├── sync.go
│   ├── sync_test.go
│   └── tracers/
│       ├── api.go
│       ├── api_test.go
│       ├── internal/
│       │   └── tracers/
│       │       ├── 4byte_tracer.js
│       │       ├── assets.go
│       │       ├── bigram_tracer.js
│       │       ├── call_tracer.js
│       │       ├── evmdis_tracer.js
│       │       ├── noop_tracer.js
│       │       ├── opcount_tracer.js
│       │       ├── prestate_tracer.js
│       │       ├── tracers.go
│       │       ├── trigram_tracer.js
│       │       └── unigram_tracer.js
│       ├── testdata/
│       │   ├── call_tracer_create.json
│       │   ├── call_tracer_deep_calls.json
│       │   ├── call_tracer_delegatecall.json
│       │   ├── call_tracer_inner_create_oog_outer_throw.json
│       │   ├── call_tracer_inner_instafail.json
│       │   ├── call_tracer_inner_throw_outer_revert.json
│       │   ├── call_tracer_oog.json
│       │   ├── call_tracer_revert.json
│       │   ├── call_tracer_revert_reason.json
│       │   ├── call_tracer_simple.json
│       │   └── call_tracer_throw.json
│       ├── tracer.go
│       ├── tracer_test.go
│       ├── tracers.go
│       └── tracers_test.go
├── ethclient/
│   ├── ethclient.go
│   ├── ethclient_test.go
│   └── signer.go
├── ethstats/
│   └── ethstats.go
├── ffi-toolkit/
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       └── lib.rs
├── fil-proofs-param/
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── scripts/
│   │   ├── pin-params.sh
│   │   └── verify-parameters-json.sh
│   ├── src/
│   │   ├── bin/
│   │   │   ├── fakeipfsadd.rs
│   │   │   ├── paramcache.rs
│   │   │   ├── paramfetch.rs
│   │   │   └── parampublish.rs
│   │   └── lib.rs
│   └── tests/
│       ├── paramfetch/
│       │   ├── mod.rs
│       │   ├── session.rs
│       │   └── support/
│       │       └── mod.rs
│       ├── parampublish/
│       │   ├── mod.rs
│       │   ├── prompts_to_publish.rs
│       │   ├── read_metadata_files.rs
│       │   ├── support/
│       │   │   ├── mod.rs
│       │   │   └── session.rs
│       │   └── write_json_manifest.rs
│       ├── suite.rs
│       └── support/
│           └── mod.rs
├── fil-proofs-tooling/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── release.toml
│   ├── scripts/
│   │   ├── aggregate-benchmarks.sh
│   │   ├── benchy.sh
│   │   ├── micro.sh
│   │   ├── retry.sh
│   │   ├── run-remote.sh
│   │   ├── with-dots.sh
│   │   └── with-lock.sh
│   └── src/
│       ├── bin/
│       │   ├── benchy/
│       │   │   ├── hash_fns.rs
│       │   │   ├── main.rs
│       │   │   ├── merkleproofs.rs
│       │   │   ├── prodbench.rs
│       │   │   ├── stacked.rs
│       │   │   ├── window_post.rs
│       │   │   └── winning_post.rs
│       │   ├── check_parameters/
│       │   │   └── main.rs
│       │   ├── circuitinfo/
│       │   │   └── main.rs
│       │   ├── fdlimit/
│       │   │   └── main.rs
│       │   ├── gen_graph_cache/
│       │   │   └── main.rs
│       │   ├── gpu-cpu-test/
│       │   │   ├── README.md
│       │   │   └── main.rs
│       │   ├── micro.rs
│       │   ├── settings/
│       │   │   └── main.rs
│       │   └── update_tree_r_cache/
│       │       └── main.rs
│       ├── lib.rs
│       ├── measure.rs
│       ├── metadata.rs
│       └── shared.rs
├── filecoin-hashers/
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       ├── blake2s.rs
│       ├── lib.rs
│       ├── poseidon.rs
│       ├── poseidon_types.rs
│       ├── sha256.rs
│       └── types.rs
├── filecoin-proofs/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   └── preprocessing.rs
│   ├── build.rs
│   ├── cbindgen.toml
│   ├── examples/
│   │   ├── beacon-post.rs
│   │   ├── drgporep-vanilla-disk.rs
│   │   ├── drgporep-vanilla.rs
│   │   ├── drgporep.rs
│   │   ├── encoding.rs
│   │   ├── ffi/
│   │   │   ├── .gitignore
│   │   │   └── main.rs
│   │   ├── merklepor.rs
│   │   └── zigzag.rs
│   ├── parameters.json
│   ├── src/
│   │   ├── api/
│   │   │   ├── fake_seal.rs
│   │   │   ├── internal.rs
│   │   │   ├── mod.rs
│   │   │   ├── post.rs
│   │   │   ├── post_util.rs
│   │   │   ├── responses.rs
│   │   │   ├── seal.rs
│   │   │   ├── sector_builder/
│   │   │   │   ├── errors.rs
│   │   │   │   ├── helpers/
│   │   │   │   │   ├── add_piece.rs
│   │   │   │   │   ├── get_seal_status.rs
│   │   │   │   │   ├── get_sectors_ready_for_sealing.rs
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   ├── retrieve_piece.rs
│   │   │   │   │   ├── seal.rs
│   │   │   │   │   └── snapshots.rs
│   │   │   │   ├── kv_store/
│   │   │   │   │   ├── fs.rs
│   │   │   │   │   └── mod.rs
│   │   │   │   ├── metadata.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── scheduler.rs
│   │   │   │   ├── sealer.rs
│   │   │   │   └── state.rs
│   │   │   ├── util.rs
│   │   │   ├── window_post.rs
│   │   │   └── winning_post.rs
│   │   ├── bin/
│   │   │   ├── fakeipfsadd.rs
│   │   │   ├── paramcache.rs
│   │   │   ├── paramfetch.rs
│   │   │   ├── paramgen.rs
│   │   │   ├── parampublish.rs
│   │   │   └── phase2.rs
│   │   ├── caches.rs
│   │   ├── commitment_reader.rs
│   │   ├── constants.rs
│   │   ├── error.rs
│   │   ├── fr32.rs
│   │   ├── fr32_reader.rs
│   │   ├── lib.rs
│   │   ├── param.rs
│   │   ├── parameters.rs
│   │   ├── pieces.rs
│   │   ├── serde_big_array.rs
│   │   ├── singletons.rs
│   │   └── types/
│   │       ├── bytes_amount.rs
│   │       ├── mod.rs
│   │       ├── piece_info.rs
│   │       ├── porep_config.rs
│   │       ├── porep_proof_partitions.rs
│   │       ├── post_config.rs
│   │       ├── post_proof_partitions.rs
│   │       ├── private_replica_info.rs
│   │       ├── public_replica_info.rs
│   │       ├── sector_class.rs
│   │       └── sector_size.rs
│   └── tests/
│       ├── api.rs
│       ├── constants.rs
│       ├── mod.rs
│       ├── paramfetch/
│       │   ├── mod.rs
│       │   ├── prompts_to_fetch.rs
│       │   └── support/
│       │       ├── mod.rs
│       │       └── session.rs
│       ├── parampublish/
│       │   ├── mod.rs
│       │   ├── prompts_to_publish.rs
│       │   ├── read_metadata_files.rs
│       │   ├── support/
│       │   │   ├── mod.rs
│       │   │   └── session.rs
│       │   └── write_json_manifest.rs
│       ├── pieces.rs
│       ├── suite.rs
│       └── support/
│           └── mod.rs
├── fr32/
│   ├── Cargo.toml
│   ├── benches/
│   │   └── fr.rs
│   └── src/
│       ├── convert.rs
│       ├── lib.rs
│       ├── padding.rs
│       └── reader.rs
├── graphql/
│   ├── graphiql.go
│   ├── graphql.go
│   ├── graphql_test.go
│   ├── schema.go
│   └── service.go
├── issue_template.md
├── les/
│   ├── api.go
│   ├── api_backend.go
│   ├── api_test.go
│   ├── bloombits.go
│   ├── checkpointoracle/
│   │   └── oracle.go
│   ├── client.go
│   ├── client_handler.go
│   ├── clientpool.go
│   ├── clientpool_test.go
│   ├── commons.go
│   ├── costtracker.go
│   ├── distributor.go
│   ├── distributor_test.go
│   ├── enr_entry.go
│   ├── fetcher.go
│   ├── fetcher_test.go
│   ├── flowcontrol/
│   │   ├── control.go
│   │   ├── manager.go
│   │   └── manager_test.go
│   ├── handler_test.go
│   ├── metrics.go
│   ├── odr.go
│   ├── odr_requests.go
│   ├── odr_test.go
│   ├── peer.go
│   ├── peer_test.go
│   ├── protocol.go
│   ├── pruner.go
│   ├── pruner_test.go
│   ├── request_test.go
│   ├── retrieve.go
│   ├── server.go
│   ├── server_handler.go
│   ├── server_requests.go
│   ├── servingqueue.go
│   ├── state_accessor.go
│   ├── sync.go
│   ├── sync_test.go
│   ├── test_helper.go
│   ├── txrelay.go
│   ├── ulc.go
│   ├── ulc_test.go
│   ├── utils/
│   │   ├── exec_queue.go
│   │   ├── exec_queue_test.go
│   │   ├── expiredvalue.go
│   │   ├── expiredvalue_test.go
│   │   ├── limiter.go
│   │   ├── limiter_test.go
│   │   ├── timeutils.go
│   │   ├── timeutils_test.go
│   │   ├── weighted_select.go
│   │   └── weighted_select_test.go
│   └── vflux/
│       ├── client/
│       │   ├── api.go
│       │   ├── fillset.go
│       │   ├── queueiterator.go
│       │   ├── queueiterator_test.go
│       │   ├── requestbasket.go
│       │   ├── requestbasket_test.go
│       │   ├── serverpool.go
│       │   ├── serverpool_test.go
│       │   ├── timestats.go
│       │   ├── timestats_test.go
│       │   ├── valuetracker.go
│       │   ├── valuetracker_test.go
│       │   ├── wrsiterator.go
│       │   └── wrsiterator_test.go
│       ├── requests.go
│       └── server/
│           ├── balance.go
│           ├── balance_test.go
│           ├── balance_tracker.go
│           ├── clientdb.go
│           ├── prioritypool.go
│           ├── prioritypool_test.go
│           └── service.go
├── liblangutil/
│   ├── CMakeLists.txt
│   ├── CharStream.cpp
│   ├── EVMVersion.cpp
│   ├── ErrorReporter.cpp
│   ├── Exceptions.cpp
│   ├── ParserBase.cpp
│   ├── Scanner.cpp
│   ├── SemVerHandler.cpp
│   ├── SourceLocation.cpp
│   ├── SourceReferenceExtractor.cpp
│   ├── SourceReferenceFormatter.cpp
│   └── Token.cpp
├── logging-toolkit/
│   ├── Cargo.toml
│   └── src/
│       └── lib.rs
├── parameters.json
├── proptest-regressions/
│   └── crypto/
│       └── sloth.txt
├── release.toml
├── rust-fil-proofs.config.toml.sample
├── rust-toolchain
├── scripts/
│   ├── bench-parser.sh
│   ├── package-release.sh
│   ├── pin-params.sh
│   ├── publish-release.sh
│   └── verify-parameters-json.sh
├── sector-base/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       ├── api/
│       │   ├── disk_backed_storage.rs
│       │   ├── errors.rs
│       │   ├── mod.rs
│       │   ├── sector_store.rs
│       │   └── util/
│       │       └── mod.rs
│       ├── error.rs
│       ├── io/
│       │   ├── fr32.rs
│       │   └── mod.rs
│       └── lib.rs
├── sha2raw/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── consts.rs
│       ├── lib.rs
│       ├── platform.rs
│       ├── sha256.rs
│       ├── sha256_intrinsics.rs
│       └── sha256_utils.rs
├── src/
│   ├── bin/
│   │   └── bencher.rs
│   └── lib.rs
├── storage-backend/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   └── src/
│       └── lib.rs
├── storage-proofs/
│   ├── .gitignore
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   ├── blake2s.rs
│   │   ├── drgraph.rs
│   │   ├── pedersen.rs
│   │   ├── preprocessing.rs
│   │   ├── sha256.rs
│   │   └── sloth.rs
│   ├── build.rs
│   ├── core/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── benches/
│   │   │   ├── blake2s.rs
│   │   │   ├── drgraph.rs
│   │   │   ├── encode.rs
│   │   │   ├── fr.rs
│   │   │   ├── merkle.rs
│   │   │   ├── misc.rs
│   │   │   ├── pedersen.rs
│   │   │   ├── sha256.rs
│   │   │   └── xor.rs
│   │   └── src/
│   │       ├── cache_key.rs
│   │       ├── compound_proof.rs
│   │       ├── crypto/
│   │       │   ├── aes.rs
│   │       │   ├── feistel.rs
│   │       │   ├── mod.rs
│   │       │   ├── pedersen.rs
│   │       │   ├── sloth.rs
│   │       │   └── xor.rs
│   │       ├── data.rs
│   │       ├── drgraph.rs
│   │       ├── error.rs
│   │       ├── fr32.rs
│   │       ├── gadgets/
│   │       │   ├── bench/
│   │       │   │   └── mod.rs
│   │       │   ├── constraint.rs
│   │       │   ├── encode.rs
│   │       │   ├── insertion.rs
│   │       │   ├── metric/
│   │       │   │   └── mod.rs
│   │       │   ├── mod.rs
│   │       │   ├── multipack.rs
│   │       │   ├── pedersen.rs
│   │       │   ├── por.rs
│   │       │   ├── test/
│   │       │   │   └── mod.rs
│   │       │   ├── uint64.rs
│   │       │   ├── variables.rs
│   │       │   └── xor.rs
│   │       ├── hasher/
│   │       │   ├── blake2s.rs
│   │       │   ├── mod.rs
│   │       │   ├── pedersen.rs
│   │       │   ├── poseidon.rs
│   │       │   ├── sha256.rs
│   │       │   └── types.rs
│   │       ├── lib.rs
│   │       ├── measurements.rs
│   │       ├── merkle/
│   │       │   ├── builders.rs
│   │       │   ├── mod.rs
│   │       │   ├── proof.rs
│   │       │   └── tree.rs
│   │       ├── multi_proof.rs
│   │       ├── parameter_cache.rs
│   │       ├── partitions.rs
│   │       ├── pieces.rs
│   │       ├── por.rs
│   │       ├── proof.rs
│   │       ├── sector.rs
│   │       ├── settings.rs
│   │       ├── test_helper.rs
│   │       └── util.rs
│   ├── parameters.json
│   ├── porep/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── benches/
│   │   │   ├── batch_hasher.rs
│   │   │   ├── encode.rs
│   │   │   └── parents.rs
│   │   ├── parent_cache.json
│   │   └── src/
│   │       ├── drg/
│   │       │   ├── circuit.rs
│   │       │   ├── compound.rs
│   │       │   ├── mod.rs
│   │       │   └── vanilla.rs
│   │       ├── encode.rs
│   │       ├── lib.rs
│   │       ├── macros.rs
│   │       ├── nse/
│   │       │   ├── mod.rs
│   │       │   └── vanilla/
│   │       │       ├── batch_hasher.rs
│   │       │       ├── butterfly_graph.rs
│   │       │       ├── challenges.rs
│   │       │       ├── config.rs
│   │       │       ├── expander_graph.rs
│   │       │       ├── labels.rs
│   │       │       ├── mod.rs
│   │       │       ├── nse.rs
│   │       │       ├── porep.rs
│   │       │       └── proof_scheme.rs
│   │       └── stacked/
│   │           ├── circuit/
│   │           │   ├── column.rs
│   │           │   ├── column_proof.rs
│   │           │   ├── create_label.rs
│   │           │   ├── hash.rs
│   │           │   ├── mod.rs
│   │           │   ├── params.rs
│   │           │   └── proof.rs
│   │           ├── mod.rs
│   │           └── vanilla/
│   │               ├── cache.rs
│   │               ├── challenges.rs
│   │               ├── column.rs
│   │               ├── column_proof.rs
│   │               ├── create_label/
│   │               │   ├── mod.rs
│   │               │   ├── multi.rs
│   │               │   └── single.rs
│   │               ├── create_label.rs
│   │               ├── encoding_proof.rs
│   │               ├── graph.rs
│   │               ├── hash.rs
│   │               ├── labeling_proof.rs
│   │               ├── macros.rs
│   │               ├── memory_handling.rs
│   │               ├── mod.rs
│   │               ├── params.rs
│   │               ├── porep.rs
│   │               ├── proof.rs
│   │               ├── proof_scheme.rs
│   │               └── utils.rs
│   ├── post/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── election/
│   │       │   ├── circuit.rs
│   │       │   ├── compound.rs
│   │       │   ├── mod.rs
│   │       │   └── vanilla.rs
│   │       ├── fallback/
│   │       │   ├── circuit.rs
│   │       │   ├── compound.rs
│   │       │   ├── mod.rs
│   │       │   └── vanilla.rs
│   │       ├── lib.rs
│   │       └── rational/
│   │           ├── circuit.rs
│   │           ├── compound.rs
│   │           ├── mod.rs
│   │           └── vanilla.rs
│   └── src/
│       ├── batchpost.rs
│       ├── beacon_post.rs
│       ├── challenge_derivation.rs
│       ├── circuit/
│       │   ├── beacon_post.rs
│       │   ├── bench/
│       │   │   └── mod.rs
│       │   ├── constraint.rs
│       │   ├── drgporep.rs
│       │   ├── kdf.rs
│       │   ├── mod.rs
│       │   ├── multi_proof.rs
│       │   ├── pedersen.rs
│       │   ├── por.rs
│       │   ├── porc.rs
│       │   ├── ppor/
│       │   │   └── mod.rs
│       │   ├── sloth.rs
│       │   ├── test/
│       │   │   └── mod.rs
│       │   ├── variables.rs
│       │   ├── vdf_post.rs
│       │   ├── xor.rs
│       │   └── zigzag.rs
│       ├── compound_proof.rs
│       ├── crypto/
│       │   ├── aes.rs
│       │   ├── blake2s.rs
│       │   ├── feistel.rs
│       │   ├── kdf.rs
│       │   ├── mod.rs
│       │   ├── pedersen.rs
│       │   ├── sloth.rs
│       │   └── xor.rs
│       ├── drgporep.rs
│       ├── drgraph.rs
│       ├── error.rs
│       ├── example_helper.rs
│       ├── fr32.rs
│       ├── hasher/
│       │   ├── blake2s.rs
│       │   ├── digest.rs
│       │   ├── mod.rs
│       │   ├── pedersen.rs
│       │   ├── sha256.rs
│       │   └── types.rs
│       ├── layered_drgporep.rs
│       ├── lib.rs
│       ├── merkle.rs
│       ├── merklepor.rs
│       ├── parameter_cache.rs
│       ├── partitions.rs
│       ├── piece_inclusion_proof.rs
│       ├── porc.rs
│       ├── porep.rs
│       ├── proof.rs
│       ├── test_helper.rs
│       ├── util.rs
│       ├── vde.rs
│       ├── vdf.rs
│       ├── vdf_post.rs
│       ├── vdf_sloth.rs
│       ├── zigzag_drgporep.rs
│       └── zigzag_graph.rs
├── storage-proofs-core/
│   ├── Cargo.toml
│   ├── README.md
│   ├── benches/
│   │   ├── blake2s.rs
│   │   ├── drgraph.rs
│   │   ├── merkle.rs
│   │   ├── misc.rs
│   │   ├── sha256.rs
│   │   └── xor.rs
│   ├── src/
│   │   ├── api_version.rs
│   │   ├── cache_key.rs
│   │   ├── compound_proof.rs
│   │   ├── crypto/
│   │   │   ├── aes.rs
│   │   │   ├── feistel.rs
│   │   │   ├── mod.rs
│   │   │   ├── sloth.rs
│   │   │   └── xor.rs
│   │   ├── data.rs
│   │   ├── drgraph.rs
│   │   ├── error.rs
│   │   ├── gadgets/
│   │   │   ├── constraint.rs
│   │   │   ├── encode.rs
│   │   │   ├── insertion.rs
│   │   │   ├── mod.rs
│   │   │   ├── multipack.rs
│   │   │   ├── por.rs
│   │   │   ├── uint64.rs
│   │   │   ├── variables.rs
│   │   │   └── xor.rs
│   │   ├── lib.rs
│   │   ├── measurements.rs
│   │   ├── merkle/
│   │   │   ├── builders.rs
│   │   │   ├── mod.rs
│   │   │   ├── proof.rs
│   │   │   └── tree.rs
│   │   ├── multi_proof.rs
│   │   ├── parameter_cache.rs
│   │   ├── partitions.rs
│   │   ├── pieces.rs
│   │   ├── por.rs
│   │   ├── proof.rs
│   │   ├── sector.rs
│   │   ├── settings.rs
│   │   ├── test_helper.rs
│   │   └── util.rs
│   └── tests/
│       ├── por_circuit.rs
│       ├── por_compound.rs
│       └── por_vanilla.rs
├── storage-proofs-porep/
│   ├── Cargo.toml
│   ├── README.md
│   ├── benches/
│   │   ├── encode.rs
│   │   └── parents.rs
│   ├── parent_cache.json
│   ├── src/
│   │   ├── drg/
│   │   │   ├── circuit.rs
│   │   │   ├── compound.rs
│   │   │   ├── mod.rs
│   │   │   └── vanilla.rs
│   │   ├── encode.rs
│   │   ├── lib.rs
│   │   └── stacked/
│   │       ├── circuit/
│   │       │   ├── column.rs
│   │       │   ├── column_proof.rs
│   │       │   ├── create_label.rs
│   │       │   ├── hash.rs
│   │       │   ├── mod.rs
│   │       │   ├── params.rs
│   │       │   └── proof.rs
│   │       ├── mod.rs
│   │       └── vanilla/
│   │           ├── cache.rs
│   │           ├── challenges.rs
│   │           ├── column.rs
│   │           ├── column_proof.rs
│   │           ├── cores.rs
│   │           ├── create_label/
│   │           │   ├── mod.rs
│   │           │   ├── multi.rs
│   │           │   └── single.rs
│   │           ├── encoding_proof.rs
│   │           ├── graph.rs
│   │           ├── hash.rs
│   │           ├── labeling_proof.rs
│   │           ├── macros.rs
│   │           ├── memory_handling.rs
│   │           ├── mod.rs
│   │           ├── params.rs
│   │           ├── porep.rs
│   │           ├── proof.rs
│   │           ├── proof_scheme.rs
│   │           └── utils.rs
│   └── tests/
│       ├── drg_circuit.rs
│       ├── drg_compound.rs
│       ├── drg_vanilla.rs
│       ├── stacked_circuit.rs
│       ├── stacked_compound.rs
│       └── stacked_vanilla.rs
└── storage-proofs-post/
    ├── Cargo.toml
    ├── README.md
    ├── src/
    │   ├── election/
    │   │   ├── circuit.rs
    │   │   ├── compound.rs
    │   │   ├── mod.rs
    │   │   └── vanilla.rs
    │   ├── fallback/
    │   │   ├── circuit.rs
    │   │   ├── compound.rs
    │   │   ├── mod.rs
    │   │   └── vanilla.rs
    │   ├── lib.rs
    │   └── rational/
    │       ├── circuit.rs
    │       ├── compound.rs
    │       ├── mod.rs
    │       └── vanilla.rs
    └── tests/
        ├── election_circuit.rs
        ├── election_compound.rs
        ├── election_vanilla.rs
        ├── fallback_circuit.rs
        ├── fallback_compound.rs
        ├── fallback_vanilla.rs
        ├── rational_circuit.rs
        ├── rational_compound.rs
        └── rational_vanilla.rs
Download .txt
Showing preview only (717K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (8088 symbols across 555 files)

FILE: build.rs
  function is_compiled_for_64_bit_arch (line 1) | fn is_compiled_for_64_bit_arch() -> bool {
  function main (line 5) | fn main() {

FILE: console/bridge.go
  type bridge (line 38) | type bridge struct
    method NewAccount (line 64) | func (b *bridge) NewAccount(call jsre.Call) (goja.Value, error) {
    method OpenWallet (line 102) | func (b *bridge) OpenWallet(call jsre.Call) (goja.Value, error) {
    method readPassphraseAndReopenWallet (line 193) | func (b *bridge) readPassphraseAndReopenWallet(call jsre.Call) (goja.V...
    method readPinAndReopenWallet (line 206) | func (b *bridge) readPinAndReopenWallet(call jsre.Call) (goja.Value, e...
    method UnlockAccount (line 231) | func (b *bridge) UnlockAccount(call jsre.Call) (goja.Value, error) {
    method Sign (line 278) | func (b *bridge) Sign(call jsre.Call) (goja.Value, error) {
    method Sleep (line 316) | func (b *bridge) Sleep(call jsre.Call) (goja.Value, error) {
    method SleepBlocks (line 331) | func (b *bridge) SleepBlocks(call jsre.Call) (goja.Value, error) {
    method Send (line 384) | func (b *bridge) Send(call jsre.Call) (goja.Value, error) {
  function newBridge (line 45) | func newBridge(client *rpc.Client, prompter prompt.UserPrompter, printer...
  function getJeth (line 53) | func getJeth(vm *goja.Runtime) *goja.Object {
  type jsonrpcCall (line 377) | type jsonrpcCall struct
  function setError (line 461) | func setError(resp *goja.Object, code int, msg string, data interface{}) {
  function isNumber (line 472) | func isNumber(v goja.Value) bool {
  function getObject (line 477) | func getObject(vm *goja.Runtime, name string) *goja.Object {

FILE: console/bridge_test.go
  function TestUndefinedAsParam (line 28) | func TestUndefinedAsParam(t *testing.T) {
  function TestNullAsParam (line 40) | func TestNullAsParam(t *testing.T) {

FILE: console/console.go
  constant HistoryFile (line 49) | HistoryFile = "history"
  constant DefaultPrompt (line 52) | DefaultPrompt = "> "
  type Config (line 56) | type Config struct
  type Console (line 69) | type Console struct
    method init (line 113) | func (c *Console) init(preload []string) error {
    method initConsoleObject (line 155) | func (c *Console) initConsoleObject() {
    method initWeb3 (line 164) | func (c *Console) initWeb3(bridge *bridge) error {
    method initExtensions (line 188) | func (c *Console) initExtensions() error {
    method initAdmin (line 220) | func (c *Console) initAdmin(vm *goja.Runtime, bridge *bridge) {
    method initPersonal (line 234) | func (c *Console) initPersonal(vm *goja.Runtime, bridge *bridge) {
    method clearHistory (line 251) | func (c *Console) clearHistory() {
    method consoleOutput (line 263) | func (c *Console) consoleOutput(call goja.FunctionCall) goja.Value {
    method AutoCompleteInput (line 274) | func (c *Console) AutoCompleteInput(line string, pos int) (string, []s...
    method Welcome (line 301) | func (c *Console) Welcome() {
    method Evaluate (line 333) | func (c *Console) Evaluate(statement string) {
    method Interactive (line 344) | func (c *Console) Interactive() {
    method readLines (line 418) | func (c *Console) readLines(input chan<- string, errc chan<- error, pr...
    method Execute (line 473) | func (c *Console) Execute(path string) error {
    method Stop (line 478) | func (c *Console) Stop(graceful bool) error {
  function New (line 81) | func New(config Config) (*Console, error) {
  function countIndents (line 431) | func countIndents(input string) int {

FILE: console/console_test.go
  constant testInstance (line 41) | testInstance = "console-tester"
  constant testAddress (line 42) | testAddress  = "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
  type hookedPrompter (line 46) | type hookedPrompter struct
    method PromptInput (line 50) | func (p *hookedPrompter) PromptInput(prompt string) (string, error) {
    method PromptPassword (line 66) | func (p *hookedPrompter) PromptPassword(prompt string) (string, error) {
    method PromptConfirm (line 69) | func (p *hookedPrompter) PromptConfirm(prompt string) (bool, error) {
    method SetHistory (line 72) | func (p *hookedPrompter) SetHistory(history []string)                 ...
    method AppendHistory (line 73) | func (p *hookedPrompter) AppendHistory(command string)                ...
    method ClearHistory (line 74) | func (p *hookedPrompter) ClearHistory()                               ...
    method SetWordCompleter (line 75) | func (p *hookedPrompter) SetWordCompleter(completer prompt.WordComplet...
  type tester (line 78) | type tester struct
    method Close (line 151) | func (env *tester) Close(t *testing.T) {
  function newTester (line 89) | func newTester(t *testing.T, confOverride func(*ethconfig.Config)) *test...
  function TestWelcome (line 164) | func TestWelcome(t *testing.T) {
  function TestEvaluate (line 189) | func TestEvaluate(t *testing.T) {
  function TestInteractive (line 200) | func TestInteractive(t *testing.T) {
  function TestPreload (line 231) | func TestPreload(t *testing.T) {
  function TestExecute (line 242) | func TestExecute(t *testing.T) {
  function TestPrettyPrint (line 256) | func TestPrettyPrint(t *testing.T) {
  function TestPrettyError (line 287) | func TestPrettyError(t *testing.T) {
  function TestIndenting (line 299) | func TestIndenting(t *testing.T) {

FILE: console/prompt/prompter.go
  type UserPrompter (line 32) | type UserPrompter interface
  type WordCompleter (line 67) | type WordCompleter
  type terminalPrompter (line 72) | type terminalPrompter struct
    method PromptInput (line 107) | func (p *terminalPrompter) PromptInput(prompt string) (string, error) {
    method PromptPassword (line 125) | func (p *terminalPrompter) PromptPassword(prompt string) (passwd strin...
    method PromptConfirm (line 144) | func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
    method SetHistory (line 154) | func (p *terminalPrompter) SetHistory(history []string) {
    method AppendHistory (line 159) | func (p *terminalPrompter) AppendHistory(command string) {
    method ClearHistory (line 164) | func (p *terminalPrompter) ClearHistory() {
    method SetWordCompleter (line 170) | func (p *terminalPrompter) SetWordCompleter(completer WordCompleter) {
  function newTerminalPrompter (line 82) | func newTerminalPrompter() *terminalPrompter {

FILE: eth/api.go
  type PublicEthereumAPI (line 45) | type PublicEthereumAPI struct
    method Etherbase (line 55) | func (api *PublicEthereumAPI) Etherbase() (common.Address, error) {
    method Coinbase (line 60) | func (api *PublicEthereumAPI) Coinbase() (common.Address, error) {
    method ChainId (line 65) | func (api *PublicEthereumAPI) ChainId() (hexutil.Uint64, error) {
  function NewPublicEthereumAPI (line 50) | func NewPublicEthereumAPI(e *Ethereum) *PublicEthereumAPI {
  type PublicMinerAPI (line 75) | type PublicMinerAPI struct
    method Mining (line 85) | func (api *PublicMinerAPI) Mining() bool {
  function NewPublicMinerAPI (line 80) | func NewPublicMinerAPI(e *Ethereum) *PublicMinerAPI {
  type PrivateMinerAPI (line 91) | type PrivateMinerAPI struct
    method Start (line 105) | func (api *PrivateMinerAPI) Start(threads *int) error {
    method Stop (line 114) | func (api *PrivateMinerAPI) Stop() {
    method SetExtra (line 119) | func (api *PrivateMinerAPI) SetExtra(extra string) (bool, error) {
    method SetGasPrice (line 127) | func (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool {
    method SetEtherbase (line 137) | func (api *PrivateMinerAPI) SetEtherbase(etherbase common.Address) bool {
    method SetRecommitInterval (line 143) | func (api *PrivateMinerAPI) SetRecommitInterval(interval int) {
  function NewPrivateMinerAPI (line 96) | func NewPrivateMinerAPI(e *Ethereum) *PrivateMinerAPI {
  type PrivateAdminAPI (line 149) | type PrivateAdminAPI struct
    method ExportChain (line 161) | func (api *PrivateAdminAPI) ExportChain(file string, first *uint64, la...
    method ImportChain (line 209) | func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
  function NewPrivateAdminAPI (line 155) | func NewPrivateAdminAPI(eth *Ethereum) *PrivateAdminAPI {
  function hasAllBlocks (line 198) | func hasAllBlocks(chain *core.BlockChain, bs []*types.Block) bool {
  type PublicDebugAPI (line 259) | type PublicDebugAPI struct
    method DumpBlock (line 270) | func (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber) (state.D...
    method AccountRange (line 355) | func (api *PublicDebugAPI) AccountRange(blockNrOrHash rpc.BlockNumberO...
  function NewPublicDebugAPI (line 265) | func NewPublicDebugAPI(eth *Ethereum) *PublicDebugAPI {
  type PrivateDebugAPI (line 296) | type PrivateDebugAPI struct
    method Preimage (line 307) | func (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common....
    method GetBadBlocks (line 323) | func (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]*BadB...
    method StorageRangeAt (line 413) | func (api *PrivateDebugAPI) StorageRangeAt(blockHash common.Hash, txIn...
    method GetModifiedAccountsByNumber (line 459) | func (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint6...
    method GetModifiedAccountsByHash (line 487) | func (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common...
    method getModifiedAccounts (line 509) | func (api *PrivateDebugAPI) getModifiedAccounts(startBlock, endBlock *...
  function NewPrivateDebugAPI (line 302) | func NewPrivateDebugAPI(eth *Ethereum) *PrivateDebugAPI {
  type BadBlockArgs (line 315) | type BadBlockArgs struct
  constant AccountRangeMaxResults (line 352) | AccountRangeMaxResults = 256
  type StorageRangeResult (line 400) | type StorageRangeResult struct
  type storageMap (line 405) | type storageMap
  type storageEntry (line 407) | type storageEntry struct
  function storageRangeAt (line 431) | func storageRangeAt(st state.Trie, start []byte, maxResult int) (Storage...

FILE: eth/api_backend.go
  type EthAPIBackend (line 43) | type EthAPIBackend struct
    method ChainConfig (line 51) | func (b *EthAPIBackend) ChainConfig() *params.ChainConfig {
    method CurrentBlock (line 55) | func (b *EthAPIBackend) CurrentBlock() *types.Block {
    method SetHead (line 59) | func (b *EthAPIBackend) SetHead(number uint64) {
    method HeaderByNumber (line 64) | func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc...
    method HeaderByNumberOrHash (line 77) | func (b *EthAPIBackend) HeaderByNumberOrHash(ctx context.Context, bloc...
    method HeaderByHash (line 94) | func (b *EthAPIBackend) HeaderByHash(ctx context.Context, hash common....
    method BlockByNumber (line 98) | func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc....
    method BlockByHash (line 111) | func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.H...
    method BlockByNumberOrHash (line 115) | func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, block...
    method StateAndHeaderByNumber (line 136) | func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, nu...
    method StateAndHeaderByNumberOrHash (line 154) | func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Conte...
    method GetReceipts (line 175) | func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.H...
    method GetLogs (line 179) | func (b *EthAPIBackend) GetLogs(ctx context.Context, hash common.Hash)...
    method GetTd (line 191) | func (b *EthAPIBackend) GetTd(ctx context.Context, hash common.Hash) *...
    method GetEVM (line 195) | func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, ...
    method SubscribeRemovedLogsEvent (line 203) | func (b *EthAPIBackend) SubscribeRemovedLogsEvent(ch chan<- core.Remov...
    method SubscribePendingLogsEvent (line 207) | func (b *EthAPIBackend) SubscribePendingLogsEvent(ch chan<- []*types.L...
    method SubscribeChainEvent (line 211) | func (b *EthAPIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent)...
    method SubscribeChainHeadEvent (line 215) | func (b *EthAPIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHe...
    method SubscribeChainSideEvent (line 219) | func (b *EthAPIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSi...
    method SubscribeLogsEvent (line 223) | func (b *EthAPIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) eve...
    method SendTx (line 227) | func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Tr...
    method GetPoolTransactions (line 231) | func (b *EthAPIBackend) GetPoolTransactions() (types.Transactions, err...
    method GetPoolTransaction (line 243) | func (b *EthAPIBackend) GetPoolTransaction(hash common.Hash) *types.Tr...
    method GetTransaction (line 247) | func (b *EthAPIBackend) GetTransaction(ctx context.Context, txHash com...
    method GetPoolNonce (line 252) | func (b *EthAPIBackend) GetPoolNonce(ctx context.Context, addr common....
    method Stats (line 256) | func (b *EthAPIBackend) Stats() (pending int, queued int) {
    method TxPoolContent (line 260) | func (b *EthAPIBackend) TxPoolContent() (map[common.Address]types.Tran...
    method TxPool (line 264) | func (b *EthAPIBackend) TxPool() *core.TxPool {
    method SubscribeNewTxsEvent (line 268) | func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEven...
    method Downloader (line 272) | func (b *EthAPIBackend) Downloader() *downloader.Downloader {
    method SuggestPrice (line 276) | func (b *EthAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, e...
    method ChainDb (line 280) | func (b *EthAPIBackend) ChainDb() ethdb.Database {
    method EventMux (line 284) | func (b *EthAPIBackend) EventMux() *event.TypeMux {
    method AccountManager (line 288) | func (b *EthAPIBackend) AccountManager() *accounts.Manager {
    method ExtRPCEnabled (line 292) | func (b *EthAPIBackend) ExtRPCEnabled() bool {
    method UnprotectedAllowed (line 296) | func (b *EthAPIBackend) UnprotectedAllowed() bool {
    method RPCGasCap (line 300) | func (b *EthAPIBackend) RPCGasCap() uint64 {
    method RPCTxFeeCap (line 304) | func (b *EthAPIBackend) RPCTxFeeCap() float64 {
    method BloomStatus (line 308) | func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
    method ServiceFilter (line 313) | func (b *EthAPIBackend) ServiceFilter(ctx context.Context, session *bl...
    method Engine (line 319) | func (b *EthAPIBackend) Engine() consensus.Engine {
    method CurrentHeader (line 323) | func (b *EthAPIBackend) CurrentHeader() *types.Header {
    method Miner (line 327) | func (b *EthAPIBackend) Miner() *miner.Miner {
    method StartMining (line 331) | func (b *EthAPIBackend) StartMining(threads int) error {
    method StateAtBlock (line 335) | func (b *EthAPIBackend) StateAtBlock(ctx context.Context, block *types...
    method StatesInRange (line 339) | func (b *EthAPIBackend) StatesInRange(ctx context.Context, fromBlock *...
    method StateAtTransaction (line 343) | func (b *EthAPIBackend) StateAtTransaction(ctx context.Context, block ...

FILE: eth/api_test.go
  function accountRangeTest (line 36) | func accountRangeTest(t *testing.T, trie *state.Trie, statedb *state.Sta...
  type resultHash (line 53) | type resultHash
    method Len (line 55) | func (h resultHash) Len() int           { return len(h) }
    method Swap (line 56) | func (h resultHash) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }
    method Less (line 57) | func (h resultHash) Less(i, j int) bool { return bytes.Compare(h[i].By...
  function TestAccountRange (line 59) | func TestAccountRange(t *testing.T) {
  function TestEmptyAccountRange (line 130) | func TestEmptyAccountRange(t *testing.T) {
  function TestStorageRangeAt (line 148) | func TestStorageRangeAt(t *testing.T) {

FILE: eth/backend.go
  type Ethereum (line 64) | type Ethereum struct
    method APIs (line 289) | func (s *Ethereum) APIs() []rpc.API {
    method ResetWithGenesisBlock (line 344) | func (s *Ethereum) ResetWithGenesisBlock(gb *types.Block) {
    method Etherbase (line 348) | func (s *Ethereum) Etherbase() (eb common.Address, err error) {
    method isLocalBlock (line 376) | func (s *Ethereum) isLocalBlock(block *types.Block) bool {
    method shouldPreserve (line 402) | func (s *Ethereum) shouldPreserve(block *types.Block) bool {
    method SetEtherbase (line 426) | func (s *Ethereum) SetEtherbase(etherbase common.Address) {
    method StartMining (line 437) | func (s *Ethereum) StartMining(threads int) error {
    method StopMining (line 482) | func (s *Ethereum) StopMining() {
    method IsMining (line 494) | func (s *Ethereum) IsMining() bool      { return s.miner.Mining() }
    method Miner (line 495) | func (s *Ethereum) Miner() *miner.Miner { return s.miner }
    method AccountManager (line 497) | func (s *Ethereum) AccountManager() *accounts.Manager  { return s.acco...
    method BlockChain (line 498) | func (s *Ethereum) BlockChain() *core.BlockChain       { return s.bloc...
    method TxPool (line 499) | func (s *Ethereum) TxPool() *core.TxPool               { return s.txPo...
    method EventMux (line 500) | func (s *Ethereum) EventMux() *event.TypeMux           { return s.even...
    method Engine (line 501) | func (s *Ethereum) Engine() consensus.Engine           { return s.engi...
    method ChainDb (line 502) | func (s *Ethereum) ChainDb() ethdb.Database            { return s.chai...
    method IsListening (line 503) | func (s *Ethereum) IsListening() bool                  { return true }
    method Downloader (line 504) | func (s *Ethereum) Downloader() *downloader.Downloader { return s.hand...
    method Synced (line 505) | func (s *Ethereum) Synced() bool                       { return atomic...
    method ArchiveMode (line 506) | func (s *Ethereum) ArchiveMode() bool                  { return s.conf...
    method BloomIndexer (line 507) | func (s *Ethereum) BloomIndexer() *core.ChainIndexer   { return s.bloo...
    method Protocols (line 511) | func (s *Ethereum) Protocols() []p2p.Protocol {
    method Start (line 521) | func (s *Ethereum) Start() error {
    method Stop (line 542) | func (s *Ethereum) Stop() error {
  function New (line 101) | func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
  function makeExtraData (line 270) | func makeExtraData(extra []byte) []byte {

FILE: eth/bloombits.go
  constant bloomServiceThreads (line 29) | bloomServiceThreads = 16
  constant bloomFilterThreads (line 33) | bloomFilterThreads = 3
  constant bloomRetrievalBatch (line 37) | bloomRetrievalBatch = 16
  constant bloomRetrievalWait (line 41) | bloomRetrievalWait = time.Duration(0)
  method startBloomHandlers (line 46) | func (eth *Ethereum) startBloomHandlers(sectionSize uint64) {

FILE: eth/discovery.go
  type ethEntry (line 29) | type ethEntry struct
    method ENRKey (line 37) | func (e ethEntry) ENRKey() string {
  method startEthEntryUpdate (line 42) | func (eth *Ethereum) startEthEntryUpdate(ln *enode.LocalNode) {
  method currentEthEntry (line 61) | func (eth *Ethereum) currentEthEntry() *ethEntry {
  function setupDiscovery (line 68) | func setupDiscovery(urls []string) (enode.Iterator, error) {

FILE: eth/downloader/api.go
  type PublicDownloaderAPI (line 30) | type PublicDownloaderAPI struct
    method eventLoop (line 56) | func (api *PublicDownloaderAPI) eventLoop() {
    method Syncing (line 93) | func (api *PublicDownloaderAPI) Syncing(ctx context.Context) (*rpc.Sub...
    method SubscribeSyncStatus (line 163) | func (api *PublicDownloaderAPI) SubscribeSyncStatus(status chan interf...
  function NewPublicDownloaderAPI (line 41) | func NewPublicDownloaderAPI(d *Downloader, m *event.TypeMux) *PublicDown...
  type SyncingResult (line 123) | type SyncingResult struct
  type uninstallSyncSubscriptionRequest (line 129) | type uninstallSyncSubscriptionRequest struct
  type SyncStatusSubscription (line 135) | type SyncStatusSubscription struct
    method Unsubscribe (line 144) | func (s *SyncStatusSubscription) Unsubscribe() {

FILE: eth/downloader/downloader.go
  type Downloader (line 96) | type Downloader struct
    method Progress (line 262) | func (d *Downloader) Progress() ethereum.SyncProgress {
    method Synchronising (line 289) | func (d *Downloader) Synchronising() bool {
    method RegisterPeer (line 295) | func (d *Downloader) RegisterPeer(id string, version uint, peer Peer) ...
    method RegisterLightPeer (line 314) | func (d *Downloader) RegisterLightPeer(id string, version uint, peer L...
    method UnregisterPeer (line 321) | func (d *Downloader) UnregisterPeer(id string) error {
    method Synchronise (line 342) | func (d *Downloader) Synchronise(id string, head common.Hash, td *big....
    method synchronise (line 369) | func (d *Downloader) synchronise(id string, hash common.Hash, td *big....
    method getMode (line 445) | func (d *Downloader) getMode() SyncMode {
    method syncWithPeer (line 451) | func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash,...
    method spawnSync (line 579) | func (d *Downloader) spawnSync(fetchers []func() error) error {
    method cancel (line 607) | func (d *Downloader) cancel() {
    method Cancel (line 624) | func (d *Downloader) Cancel() {
    method Terminate (line 631) | func (d *Downloader) Terminate() {
    method fetchHead (line 650) | func (d *Downloader) fetchHead(p *peerConnection) (head *types.Header,...
    method findAncestor (line 770) | func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *typ...
    method findAncestorSpanSearch (line 836) | func (d *Downloader) findAncestorSpanSearch(p *peerConnection, mode Sy...
    method findAncestorBinarySearch (line 920) | func (d *Downloader) findAncestorBinarySearch(p *peerConnection, mode ...
    method fetchHeaders (line 1011) | func (d *Downloader) fetchHeaders(p *peerConnection, from uint64) error {
    method fillHeaderSkeleton (line 1245) | func (d *Downloader) fillHeaderSkeleton(from uint64, skeleton []*types...
    method fetchBodies (line 1277) | func (d *Downloader) fetchBodies(from uint64) error {
    method fetchReceipts (line 1301) | func (d *Downloader) fetchReceipts(from uint64) error {
    method fetchParts (line 1349) | func (d *Downloader) fetchParts(deliveryCh chan dataPack, deliver func...
    method processHeaders (line 1524) | func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
    method processFullSyncContent (line 1699) | func (d *Downloader) processFullSyncContent() error {
    method importBlockResults (line 1714) | func (d *Downloader) importBlockResults(results []*fetchResult) error {
    method processFastSyncContent (line 1751) | func (d *Downloader) processFastSyncContent() error {
    method commitFastSyncData (line 1896) | func (d *Downloader) commitFastSyncData(results []*fetchResult, stateS...
    method commitPivotBlock (line 1929) | func (d *Downloader) commitPivotBlock(result *fetchResult) error {
    method DeliverHeaders (line 1955) | func (d *Downloader) DeliverHeaders(id string, headers []*types.Header...
    method DeliverBodies (line 1960) | func (d *Downloader) DeliverBodies(id string, transactions [][]*types....
    method DeliverReceipts (line 1965) | func (d *Downloader) DeliverReceipts(id string, receipts [][]*types.Re...
    method DeliverNodeData (line 1970) | func (d *Downloader) DeliverNodeData(id string, data [][]byte) error {
    method DeliverSnapPacket (line 1976) | func (d *Downloader) DeliverSnapPacket(peer *snap.Peer, packet snap.Pa...
    method deliver (line 2001) | func (d *Downloader) deliver(destCh chan dataPack, packet dataPack, in...
    method qosTuner (line 2026) | func (d *Downloader) qosTuner() {
    method qosReduceConfidence (line 2049) | func (d *Downloader) qosReduceConfidence() {
    method requestRTT (line 2081) | func (d *Downloader) requestRTT() time.Duration {
    method requestTTL (line 2087) | func (d *Downloader) requestTTL() time.Duration {
  type LightChain (line 169) | type LightChain interface
  type BlockChain (line 190) | type BlockChain interface
  function New (line 219) | func New(checkpoint uint64, stateDb ethdb.Database, stateBloom *trie.Syn...
  function calculateRequestSpan (line 721) | func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int,...
  function splitAroundPivot (line 1873) | func splitAroundPivot(pivot uint64, results []*fetchResult) (p *fetchRes...

FILE: eth/downloader/downloader_test.go
  function init (line 39) | func init() {
  type downloadTester (line 47) | type downloadTester struct
    method terminate (line 96) | func (dl *downloadTester) terminate() {
    method sync (line 101) | func (dl *downloadTester) sync(id string, td *big.Int, mode SyncMode) ...
    method HasHeader (line 123) | func (dl *downloadTester) HasHeader(hash common.Hash, number uint64) b...
    method HasBlock (line 128) | func (dl *downloadTester) HasBlock(hash common.Hash, number uint64) bo...
    method HasFastBlock (line 133) | func (dl *downloadTester) HasFastBlock(hash common.Hash, number uint64...
    method GetHeaderByHash (line 145) | func (dl *downloadTester) GetHeaderByHash(hash common.Hash) *types.Hea...
    method getHeaderByHash (line 153) | func (dl *downloadTester) getHeaderByHash(hash common.Hash) *types.Hea...
    method GetBlockByHash (line 162) | func (dl *downloadTester) GetBlockByHash(hash common.Hash) *types.Block {
    method CurrentHeader (line 174) | func (dl *downloadTester) CurrentHeader() *types.Header {
    method CurrentBlock (line 190) | func (dl *downloadTester) CurrentBlock() *types.Block {
    method CurrentFastBlock (line 211) | func (dl *downloadTester) CurrentFastBlock() *types.Block {
    method FastSyncCommitHead (line 227) | func (dl *downloadTester) FastSyncCommitHead(hash common.Hash) error {
    method GetTd (line 237) | func (dl *downloadTester) GetTd(hash common.Hash, number uint64) *big....
    method getTd (line 247) | func (dl *downloadTester) getTd(hash common.Hash) *big.Int {
    method InsertHeaderChain (line 255) | func (dl *downloadTester) InsertHeaderChain(headers []*types.Header, c...
    method InsertChain (line 291) | func (dl *downloadTester) InsertChain(blocks types.Blocks) (i int, err...
    method InsertReceiptChain (line 314) | func (dl *downloadTester) InsertReceiptChain(blocks types.Blocks, rece...
    method SetHead (line 345) | func (dl *downloadTester) SetHead(head uint64) error {
    method Rollback (line 389) | func (dl *downloadTester) Rollback(hashes []common.Hash) {
    method newPeer (line 393) | func (dl *downloadTester) newPeer(id string, version uint, chain *test...
    method dropPeer (line 403) | func (dl *downloadTester) dropPeer(id string) {
  function newTester (line 70) | func newTester() *downloadTester {
  type downloadTesterPeer (line 411) | type downloadTesterPeer struct
    method Head (line 420) | func (dlp *downloadTesterPeer) Head() (common.Hash, *big.Int) {
    method RequestHeadersByHash (line 428) | func (dlp *downloadTesterPeer) RequestHeadersByHash(origin common.Hash...
    method RequestHeadersByNumber (line 437) | func (dlp *downloadTesterPeer) RequestHeadersByNumber(origin uint64, a...
    method RequestBodies (line 446) | func (dlp *downloadTesterPeer) RequestBodies(hashes []common.Hash) err...
    method RequestReceipts (line 455) | func (dlp *downloadTesterPeer) RequestReceipts(hashes []common.Hash) e...
    method RequestNodeData (line 464) | func (dlp *downloadTesterPeer) RequestNodeData(hashes []common.Hash) e...
  function assertOwnChain (line 482) | func assertOwnChain(t *testing.T, tester *downloadTester, length int) {
  function assertOwnForkedChain (line 491) | func assertOwnForkedChain(t *testing.T, tester *downloadTester, common i...
  function TestCanonicalSynchronisation64Full (line 518) | func TestCanonicalSynchronisation64Full(t *testing.T) { testCanonSync(t,...
  function TestCanonicalSynchronisation64Fast (line 519) | func TestCanonicalSynchronisation64Fast(t *testing.T) { testCanonSync(t,...
  function TestCanonicalSynchronisation65Full (line 521) | func TestCanonicalSynchronisation65Full(t *testing.T)  { testCanonSync(t...
  function TestCanonicalSynchronisation65Fast (line 522) | func TestCanonicalSynchronisation65Fast(t *testing.T)  { testCanonSync(t...
  function TestCanonicalSynchronisation65Light (line 523) | func TestCanonicalSynchronisation65Light(t *testing.T) { testCanonSync(t...
  function TestCanonicalSynchronisation66Full (line 525) | func TestCanonicalSynchronisation66Full(t *testing.T)  { testCanonSync(t...
  function TestCanonicalSynchronisation66Fast (line 526) | func TestCanonicalSynchronisation66Fast(t *testing.T)  { testCanonSync(t...
  function TestCanonicalSynchronisation66Light (line 527) | func TestCanonicalSynchronisation66Light(t *testing.T) { testCanonSync(t...
  function testCanonSync (line 529) | func testCanonSync(t *testing.T, protocol uint, mode SyncMode) {
  function TestThrottling64Full (line 548) | func TestThrottling64Full(t *testing.T) { testThrottling(t, 64, FullSync) }
  function TestThrottling64Fast (line 549) | func TestThrottling64Fast(t *testing.T) { testThrottling(t, 64, FastSync) }
  function TestThrottling65Full (line 551) | func TestThrottling65Full(t *testing.T) { testThrottling(t, 65, FullSync) }
  function TestThrottling65Fast (line 552) | func TestThrottling65Fast(t *testing.T) { testThrottling(t, 65, FastSync) }
  function TestThrottling66Full (line 554) | func TestThrottling66Full(t *testing.T) { testThrottling(t, 66, FullSync) }
  function TestThrottling66Fast (line 555) | func TestThrottling66Fast(t *testing.T) { testThrottling(t, 66, FastSync) }
  function testThrottling (line 557) | func testThrottling(t *testing.T, protocol uint, mode SyncMode) {
  function TestForkedSync64Full (line 636) | func TestForkedSync64Full(t *testing.T) { testForkedSync(t, 64, FullSync) }
  function TestForkedSync64Fast (line 637) | func TestForkedSync64Fast(t *testing.T) { testForkedSync(t, 64, FastSync) }
  function TestForkedSync65Full (line 639) | func TestForkedSync65Full(t *testing.T)  { testForkedSync(t, 65, FullSyn...
  function TestForkedSync65Fast (line 640) | func TestForkedSync65Fast(t *testing.T)  { testForkedSync(t, 65, FastSyn...
  function TestForkedSync65Light (line 641) | func TestForkedSync65Light(t *testing.T) { testForkedSync(t, 65, LightSy...
  function TestForkedSync66Full (line 643) | func TestForkedSync66Full(t *testing.T)  { testForkedSync(t, 66, FullSyn...
  function TestForkedSync66Fast (line 644) | func TestForkedSync66Fast(t *testing.T)  { testForkedSync(t, 66, FastSyn...
  function TestForkedSync66Light (line 645) | func TestForkedSync66Light(t *testing.T) { testForkedSync(t, 66, LightSy...
  function testForkedSync (line 647) | func testForkedSync(t *testing.T, protocol uint, mode SyncMode) {
  function TestHeavyForkedSync64Full (line 672) | func TestHeavyForkedSync64Full(t *testing.T) { testHeavyForkedSync(t, 64...
  function TestHeavyForkedSync64Fast (line 673) | func TestHeavyForkedSync64Fast(t *testing.T) { testHeavyForkedSync(t, 64...
  function TestHeavyForkedSync65Full (line 675) | func TestHeavyForkedSync65Full(t *testing.T)  { testHeavyForkedSync(t, 6...
  function TestHeavyForkedSync65Fast (line 676) | func TestHeavyForkedSync65Fast(t *testing.T)  { testHeavyForkedSync(t, 6...
  function TestHeavyForkedSync65Light (line 677) | func TestHeavyForkedSync65Light(t *testing.T) { testHeavyForkedSync(t, 6...
  function TestHeavyForkedSync66Full (line 679) | func TestHeavyForkedSync66Full(t *testing.T)  { testHeavyForkedSync(t, 6...
  function TestHeavyForkedSync66Fast (line 680) | func TestHeavyForkedSync66Fast(t *testing.T)  { testHeavyForkedSync(t, 6...
  function TestHeavyForkedSync66Light (line 681) | func TestHeavyForkedSync66Light(t *testing.T) { testHeavyForkedSync(t, 6...
  function testHeavyForkedSync (line 683) | func testHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
  function TestBoundedForkedSync64Full (line 710) | func TestBoundedForkedSync64Full(t *testing.T) { testBoundedForkedSync(t...
  function TestBoundedForkedSync64Fast (line 711) | func TestBoundedForkedSync64Fast(t *testing.T) { testBoundedForkedSync(t...
  function TestBoundedForkedSync65Full (line 713) | func TestBoundedForkedSync65Full(t *testing.T)  { testBoundedForkedSync(...
  function TestBoundedForkedSync65Fast (line 714) | func TestBoundedForkedSync65Fast(t *testing.T)  { testBoundedForkedSync(...
  function TestBoundedForkedSync65Light (line 715) | func TestBoundedForkedSync65Light(t *testing.T) { testBoundedForkedSync(...
  function TestBoundedForkedSync66Full (line 717) | func TestBoundedForkedSync66Full(t *testing.T)  { testBoundedForkedSync(...
  function TestBoundedForkedSync66Fast (line 718) | func TestBoundedForkedSync66Fast(t *testing.T)  { testBoundedForkedSync(...
  function TestBoundedForkedSync66Light (line 719) | func TestBoundedForkedSync66Light(t *testing.T) { testBoundedForkedSync(...
  function testBoundedForkedSync (line 721) | func testBoundedForkedSync(t *testing.T, protocol uint, mode SyncMode) {
  function TestBoundedHeavyForkedSync64Full (line 747) | func TestBoundedHeavyForkedSync64Full(t *testing.T) { testBoundedHeavyFo...
  function TestBoundedHeavyForkedSync64Fast (line 748) | func TestBoundedHeavyForkedSync64Fast(t *testing.T) { testBoundedHeavyFo...
  function TestBoundedHeavyForkedSync65Full (line 750) | func TestBoundedHeavyForkedSync65Full(t *testing.T)  { testBoundedHeavyF...
  function TestBoundedHeavyForkedSync65Fast (line 751) | func TestBoundedHeavyForkedSync65Fast(t *testing.T)  { testBoundedHeavyF...
  function TestBoundedHeavyForkedSync65Light (line 752) | func TestBoundedHeavyForkedSync65Light(t *testing.T) { testBoundedHeavyF...
  function TestBoundedHeavyForkedSync66Full (line 754) | func TestBoundedHeavyForkedSync66Full(t *testing.T)  { testBoundedHeavyF...
  function TestBoundedHeavyForkedSync66Fast (line 755) | func TestBoundedHeavyForkedSync66Fast(t *testing.T)  { testBoundedHeavyF...
  function TestBoundedHeavyForkedSync66Light (line 756) | func TestBoundedHeavyForkedSync66Light(t *testing.T) { testBoundedHeavyF...
  function testBoundedHeavyForkedSync (line 758) | func testBoundedHeavyForkedSync(t *testing.T, protocol uint, mode SyncMo...
  function TestInactiveDownloader63 (line 783) | func TestInactiveDownloader63(t *testing.T) {
  function TestCancel64Full (line 802) | func TestCancel64Full(t *testing.T) { testCancel(t, 64, FullSync) }
  function TestCancel64Fast (line 803) | func TestCancel64Fast(t *testing.T) { testCancel(t, 64, FastSync) }
  function TestCancel65Full (line 805) | func TestCancel65Full(t *testing.T)  { testCancel(t, 65, FullSync) }
  function TestCancel65Fast (line 806) | func TestCancel65Fast(t *testing.T)  { testCancel(t, 65, FastSync) }
  function TestCancel65Light (line 807) | func TestCancel65Light(t *testing.T) { testCancel(t, 65, LightSync) }
  function TestCancel66Full (line 809) | func TestCancel66Full(t *testing.T)  { testCancel(t, 66, FullSync) }
  function TestCancel66Fast (line 810) | func TestCancel66Fast(t *testing.T)  { testCancel(t, 66, FastSync) }
  function TestCancel66Light (line 811) | func TestCancel66Light(t *testing.T) { testCancel(t, 66, LightSync) }
  function testCancel (line 813) | func testCancel(t *testing.T, protocol uint, mode SyncMode) {
  function TestMultiSynchronisation64Full (line 838) | func TestMultiSynchronisation64Full(t *testing.T) { testMultiSynchronisa...
  function TestMultiSynchronisation64Fast (line 839) | func TestMultiSynchronisation64Fast(t *testing.T) { testMultiSynchronisa...
  function TestMultiSynchronisation65Full (line 841) | func TestMultiSynchronisation65Full(t *testing.T)  { testMultiSynchronis...
  function TestMultiSynchronisation65Fast (line 842) | func TestMultiSynchronisation65Fast(t *testing.T)  { testMultiSynchronis...
  function TestMultiSynchronisation65Light (line 843) | func TestMultiSynchronisation65Light(t *testing.T) { testMultiSynchronis...
  function TestMultiSynchronisation66Full (line 845) | func TestMultiSynchronisation66Full(t *testing.T)  { testMultiSynchronis...
  function TestMultiSynchronisation66Fast (line 846) | func TestMultiSynchronisation66Fast(t *testing.T)  { testMultiSynchronis...
  function TestMultiSynchronisation66Light (line 847) | func TestMultiSynchronisation66Light(t *testing.T) { testMultiSynchronis...
  function testMultiSynchronisation (line 849) | func testMultiSynchronisation(t *testing.T, protocol uint, mode SyncMode) {
  function TestMultiProtoSynchronisation64Full (line 871) | func TestMultiProtoSynchronisation64Full(t *testing.T) { testMultiProtoS...
  function TestMultiProtoSynchronisation64Fast (line 872) | func TestMultiProtoSynchronisation64Fast(t *testing.T) { testMultiProtoS...
  function TestMultiProtoSynchronisation65Full (line 874) | func TestMultiProtoSynchronisation65Full(t *testing.T)  { testMultiProto...
  function TestMultiProtoSynchronisation65Fast (line 875) | func TestMultiProtoSynchronisation65Fast(t *testing.T)  { testMultiProto...
  function TestMultiProtoSynchronisation65Light (line 876) | func TestMultiProtoSynchronisation65Light(t *testing.T) { testMultiProto...
  function TestMultiProtoSynchronisation66Full (line 878) | func TestMultiProtoSynchronisation66Full(t *testing.T)  { testMultiProto...
  function TestMultiProtoSynchronisation66Fast (line 879) | func TestMultiProtoSynchronisation66Fast(t *testing.T)  { testMultiProto...
  function TestMultiProtoSynchronisation66Light (line 880) | func TestMultiProtoSynchronisation66Light(t *testing.T) { testMultiProto...
  function testMultiProtoSync (line 882) | func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
  function TestEmptyShortCircuit64Full (line 913) | func TestEmptyShortCircuit64Full(t *testing.T) { testEmptyShortCircuit(t...
  function TestEmptyShortCircuit64Fast (line 914) | func TestEmptyShortCircuit64Fast(t *testing.T) { testEmptyShortCircuit(t...
  function TestEmptyShortCircuit65Full (line 916) | func TestEmptyShortCircuit65Full(t *testing.T)  { testEmptyShortCircuit(...
  function TestEmptyShortCircuit65Fast (line 917) | func TestEmptyShortCircuit65Fast(t *testing.T)  { testEmptyShortCircuit(...
  function TestEmptyShortCircuit65Light (line 918) | func TestEmptyShortCircuit65Light(t *testing.T) { testEmptyShortCircuit(...
  function TestEmptyShortCircuit66Full (line 920) | func TestEmptyShortCircuit66Full(t *testing.T)  { testEmptyShortCircuit(...
  function TestEmptyShortCircuit66Fast (line 921) | func TestEmptyShortCircuit66Fast(t *testing.T)  { testEmptyShortCircuit(...
  function TestEmptyShortCircuit66Light (line 922) | func TestEmptyShortCircuit66Light(t *testing.T) { testEmptyShortCircuit(...
  function testEmptyShortCircuit (line 924) | func testEmptyShortCircuit(t *testing.T, protocol uint, mode SyncMode) {
  function TestMissingHeaderAttack64Full (line 970) | func TestMissingHeaderAttack64Full(t *testing.T) { testMissingHeaderAtta...
  function TestMissingHeaderAttack64Fast (line 971) | func TestMissingHeaderAttack64Fast(t *testing.T) { testMissingHeaderAtta...
  function TestMissingHeaderAttack65Full (line 973) | func TestMissingHeaderAttack65Full(t *testing.T)  { testMissingHeaderAtt...
  function TestMissingHeaderAttack65Fast (line 974) | func TestMissingHeaderAttack65Fast(t *testing.T)  { testMissingHeaderAtt...
  function TestMissingHeaderAttack65Light (line 975) | func TestMissingHeaderAttack65Light(t *testing.T) { testMissingHeaderAtt...
  function TestMissingHeaderAttack66Full (line 977) | func TestMissingHeaderAttack66Full(t *testing.T)  { testMissingHeaderAtt...
  function TestMissingHeaderAttack66Fast (line 978) | func TestMissingHeaderAttack66Fast(t *testing.T)  { testMissingHeaderAtt...
  function TestMissingHeaderAttack66Light (line 979) | func TestMissingHeaderAttack66Light(t *testing.T) { testMissingHeaderAtt...
  function testMissingHeaderAttack (line 981) | func testMissingHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
  function TestShiftedHeaderAttack64Full (line 1005) | func TestShiftedHeaderAttack64Full(t *testing.T) { testShiftedHeaderAtta...
  function TestShiftedHeaderAttack64Fast (line 1006) | func TestShiftedHeaderAttack64Fast(t *testing.T) { testShiftedHeaderAtta...
  function TestShiftedHeaderAttack65Full (line 1008) | func TestShiftedHeaderAttack65Full(t *testing.T)  { testShiftedHeaderAtt...
  function TestShiftedHeaderAttack65Fast (line 1009) | func TestShiftedHeaderAttack65Fast(t *testing.T)  { testShiftedHeaderAtt...
  function TestShiftedHeaderAttack65Light (line 1010) | func TestShiftedHeaderAttack65Light(t *testing.T) { testShiftedHeaderAtt...
  function TestShiftedHeaderAttack66Full (line 1012) | func TestShiftedHeaderAttack66Full(t *testing.T)  { testShiftedHeaderAtt...
  function TestShiftedHeaderAttack66Fast (line 1013) | func TestShiftedHeaderAttack66Fast(t *testing.T)  { testShiftedHeaderAtt...
  function TestShiftedHeaderAttack66Light (line 1014) | func TestShiftedHeaderAttack66Light(t *testing.T) { testShiftedHeaderAtt...
  function testShiftedHeaderAttack (line 1016) | func testShiftedHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
  function TestInvalidHeaderRollback64Fast (line 1045) | func TestInvalidHeaderRollback64Fast(t *testing.T) { testInvalidHeaderRo...
  function TestInvalidHeaderRollback65Fast (line 1046) | func TestInvalidHeaderRollback65Fast(t *testing.T) { testInvalidHeaderRo...
  function TestInvalidHeaderRollback66Fast (line 1047) | func TestInvalidHeaderRollback66Fast(t *testing.T) { testInvalidHeaderRo...
  function testInvalidHeaderRollback (line 1049) | func testInvalidHeaderRollback(t *testing.T, protocol uint, mode SyncMod...
  function TestHighTDStarvationAttack64Full (line 1137) | func TestHighTDStarvationAttack64Full(t *testing.T) { testHighTDStarvati...
  function TestHighTDStarvationAttack64Fast (line 1138) | func TestHighTDStarvationAttack64Fast(t *testing.T) { testHighTDStarvati...
  function TestHighTDStarvationAttack65Full (line 1140) | func TestHighTDStarvationAttack65Full(t *testing.T)  { testHighTDStarvat...
  function TestHighTDStarvationAttack65Fast (line 1141) | func TestHighTDStarvationAttack65Fast(t *testing.T)  { testHighTDStarvat...
  function TestHighTDStarvationAttack65Light (line 1142) | func TestHighTDStarvationAttack65Light(t *testing.T) { testHighTDStarvat...
  function TestHighTDStarvationAttack66Full (line 1144) | func TestHighTDStarvationAttack66Full(t *testing.T)  { testHighTDStarvat...
  function TestHighTDStarvationAttack66Fast (line 1145) | func TestHighTDStarvationAttack66Fast(t *testing.T)  { testHighTDStarvat...
  function TestHighTDStarvationAttack66Light (line 1146) | func TestHighTDStarvationAttack66Light(t *testing.T) { testHighTDStarvat...
  function testHighTDStarvationAttack (line 1148) | func testHighTDStarvationAttack(t *testing.T, protocol uint, mode SyncMo...
  function TestBlockHeaderAttackerDropping64 (line 1162) | func TestBlockHeaderAttackerDropping64(t *testing.T) { testBlockHeaderAt...
  function TestBlockHeaderAttackerDropping65 (line 1163) | func TestBlockHeaderAttackerDropping65(t *testing.T) { testBlockHeaderAt...
  function TestBlockHeaderAttackerDropping66 (line 1164) | func TestBlockHeaderAttackerDropping66(t *testing.T) { testBlockHeaderAt...
  function testBlockHeaderAttackerDropping (line 1166) | func testBlockHeaderAttackerDropping(t *testing.T, protocol uint) {
  function TestSyncProgress64Full (line 1216) | func TestSyncProgress64Full(t *testing.T) { testSyncProgress(t, 64, Full...
  function TestSyncProgress64Fast (line 1217) | func TestSyncProgress64Fast(t *testing.T) { testSyncProgress(t, 64, Fast...
  function TestSyncProgress65Full (line 1219) | func TestSyncProgress65Full(t *testing.T)  { testSyncProgress(t, 65, Ful...
  function TestSyncProgress65Fast (line 1220) | func TestSyncProgress65Fast(t *testing.T)  { testSyncProgress(t, 65, Fas...
  function TestSyncProgress65Light (line 1221) | func TestSyncProgress65Light(t *testing.T) { testSyncProgress(t, 65, Lig...
  function TestSyncProgress66Full (line 1223) | func TestSyncProgress66Full(t *testing.T)  { testSyncProgress(t, 66, Ful...
  function TestSyncProgress66Fast (line 1224) | func TestSyncProgress66Fast(t *testing.T)  { testSyncProgress(t, 66, Fas...
  function TestSyncProgress66Light (line 1225) | func TestSyncProgress66Light(t *testing.T) { testSyncProgress(t, 66, Lig...
  function testSyncProgress (line 1227) | func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
  function checkProgress (line 1288) | func checkProgress(t *testing.T, d *Downloader, stage string, want ether...
  function TestForkedSyncProgress64Full (line 1303) | func TestForkedSyncProgress64Full(t *testing.T) { testForkedSyncProgress...
  function TestForkedSyncProgress64Fast (line 1304) | func TestForkedSyncProgress64Fast(t *testing.T) { testForkedSyncProgress...
  function TestForkedSyncProgress65Full (line 1306) | func TestForkedSyncProgress65Full(t *testing.T)  { testForkedSyncProgres...
  function TestForkedSyncProgress65Fast (line 1307) | func TestForkedSyncProgress65Fast(t *testing.T)  { testForkedSyncProgres...
  function TestForkedSyncProgress65Light (line 1308) | func TestForkedSyncProgress65Light(t *testing.T) { testForkedSyncProgres...
  function TestForkedSyncProgress66Full (line 1310) | func TestForkedSyncProgress66Full(t *testing.T)  { testForkedSyncProgres...
  function TestForkedSyncProgress66Fast (line 1311) | func TestForkedSyncProgress66Fast(t *testing.T)  { testForkedSyncProgres...
  function TestForkedSyncProgress66Light (line 1312) | func TestForkedSyncProgress66Light(t *testing.T) { testForkedSyncProgres...
  function testForkedSyncProgress (line 1314) | func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
  function TestFailedSyncProgress64Full (line 1382) | func TestFailedSyncProgress64Full(t *testing.T) { testFailedSyncProgress...
  function TestFailedSyncProgress64Fast (line 1383) | func TestFailedSyncProgress64Fast(t *testing.T) { testFailedSyncProgress...
  function TestFailedSyncProgress65Full (line 1385) | func TestFailedSyncProgress65Full(t *testing.T)  { testFailedSyncProgres...
  function TestFailedSyncProgress65Fast (line 1386) | func TestFailedSyncProgress65Fast(t *testing.T)  { testFailedSyncProgres...
  function TestFailedSyncProgress65Light (line 1387) | func TestFailedSyncProgress65Light(t *testing.T) { testFailedSyncProgres...
  function TestFailedSyncProgress66Full (line 1389) | func TestFailedSyncProgress66Full(t *testing.T)  { testFailedSyncProgres...
  function TestFailedSyncProgress66Fast (line 1390) | func TestFailedSyncProgress66Fast(t *testing.T)  { testFailedSyncProgres...
  function TestFailedSyncProgress66Light (line 1391) | func TestFailedSyncProgress66Light(t *testing.T) { testFailedSyncProgres...
  function testFailedSyncProgress (line 1393) | func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
  function TestFakedSyncProgress64Full (line 1458) | func TestFakedSyncProgress64Full(t *testing.T) { testFakedSyncProgress(t...
  function TestFakedSyncProgress64Fast (line 1459) | func TestFakedSyncProgress64Fast(t *testing.T) { testFakedSyncProgress(t...
  function TestFakedSyncProgress65Full (line 1461) | func TestFakedSyncProgress65Full(t *testing.T)  { testFakedSyncProgress(...
  function TestFakedSyncProgress65Fast (line 1462) | func TestFakedSyncProgress65Fast(t *testing.T)  { testFakedSyncProgress(...
  function TestFakedSyncProgress65Light (line 1463) | func TestFakedSyncProgress65Light(t *testing.T) { testFakedSyncProgress(...
  function TestFakedSyncProgress66Full (line 1465) | func TestFakedSyncProgress66Full(t *testing.T)  { testFakedSyncProgress(...
  function TestFakedSyncProgress66Fast (line 1466) | func TestFakedSyncProgress66Fast(t *testing.T)  { testFakedSyncProgress(...
  function TestFakedSyncProgress66Light (line 1467) | func TestFakedSyncProgress66Light(t *testing.T) { testFakedSyncProgress(...
  function testFakedSyncProgress (line 1469) | func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
  function TestDeliverHeadersHang64Full (line 1538) | func TestDeliverHeadersHang64Full(t *testing.T) { testDeliverHeadersHang...
  function TestDeliverHeadersHang64Fast (line 1539) | func TestDeliverHeadersHang64Fast(t *testing.T) { testDeliverHeadersHang...
  function TestDeliverHeadersHang65Full (line 1541) | func TestDeliverHeadersHang65Full(t *testing.T)  { testDeliverHeadersHan...
  function TestDeliverHeadersHang65Fast (line 1542) | func TestDeliverHeadersHang65Fast(t *testing.T)  { testDeliverHeadersHan...
  function TestDeliverHeadersHang65Light (line 1543) | func TestDeliverHeadersHang65Light(t *testing.T) { testDeliverHeadersHan...
  function TestDeliverHeadersHang66Full (line 1545) | func TestDeliverHeadersHang66Full(t *testing.T)  { testDeliverHeadersHan...
  function TestDeliverHeadersHang66Fast (line 1546) | func TestDeliverHeadersHang66Fast(t *testing.T)  { testDeliverHeadersHan...
  function TestDeliverHeadersHang66Light (line 1547) | func TestDeliverHeadersHang66Light(t *testing.T) { testDeliverHeadersHan...
  function testDeliverHeadersHang (line 1549) | func testDeliverHeadersHang(t *testing.T, protocol uint, mode SyncMode) {
  type floodingTestPeer (line 1574) | type floodingTestPeer struct
    method Head (line 1579) | func (ftp *floodingTestPeer) Head() (common.Hash, *big.Int) { return f...
    method RequestHeadersByHash (line 1580) | func (ftp *floodingTestPeer) RequestHeadersByHash(hash common.Hash, co...
    method RequestBodies (line 1583) | func (ftp *floodingTestPeer) RequestBodies(hashes []common.Hash) error {
    method RequestReceipts (line 1586) | func (ftp *floodingTestPeer) RequestReceipts(hashes []common.Hash) err...
    method RequestNodeData (line 1589) | func (ftp *floodingTestPeer) RequestNodeData(hashes []common.Hash) err...
    method RequestHeadersByNumber (line 1593) | func (ftp *floodingTestPeer) RequestHeadersByNumber(from uint64, count...
  function TestRemoteHeaderRequestSpan (line 1625) | func TestRemoteHeaderRequestSpan(t *testing.T) {
  function TestCheckpointEnforcement64Full (line 1702) | func TestCheckpointEnforcement64Full(t *testing.T) { testCheckpointEnfor...
  function TestCheckpointEnforcement64Fast (line 1703) | func TestCheckpointEnforcement64Fast(t *testing.T) { testCheckpointEnfor...
  function TestCheckpointEnforcement65Full (line 1705) | func TestCheckpointEnforcement65Full(t *testing.T)  { testCheckpointEnfo...
  function TestCheckpointEnforcement65Fast (line 1706) | func TestCheckpointEnforcement65Fast(t *testing.T)  { testCheckpointEnfo...
  function TestCheckpointEnforcement65Light (line 1707) | func TestCheckpointEnforcement65Light(t *testing.T) { testCheckpointEnfo...
  function TestCheckpointEnforcement66Full (line 1709) | func TestCheckpointEnforcement66Full(t *testing.T)  { testCheckpointEnfo...
  function TestCheckpointEnforcement66Fast (line 1710) | func TestCheckpointEnforcement66Fast(t *testing.T)  { testCheckpointEnfo...
  function TestCheckpointEnforcement66Light (line 1711) | func TestCheckpointEnforcement66Light(t *testing.T) { testCheckpointEnfo...
  function testCheckpointEnforcement (line 1713) | func testCheckpointEnforcement(t *testing.T, protocol uint, mode SyncMod...

FILE: eth/downloader/events.go
  type DoneEvent (line 21) | type DoneEvent struct
  type StartEvent (line 24) | type StartEvent struct
  type FailedEvent (line 25) | type FailedEvent struct

FILE: eth/downloader/modes.go
  type SyncMode (line 23) | type SyncMode
    method IsValid (line 32) | func (mode SyncMode) IsValid() bool {
    method String (line 37) | func (mode SyncMode) String() string {
    method MarshalText (line 52) | func (mode SyncMode) MarshalText() ([]byte, error) {
    method UnmarshalText (line 67) | func (mode *SyncMode) UnmarshalText(text []byte) error {
  constant FullSync (line 26) | FullSync  SyncMode = iota
  constant FastSync (line 27) | FastSync
  constant SnapSync (line 28) | SnapSync
  constant LightSync (line 29) | LightSync

FILE: eth/downloader/peer.go
  constant maxLackingHashes (line 38) | maxLackingHashes  = 4096
  constant measurementImpact (line 39) | measurementImpact = 0.1
  type peerConnection (line 49) | type peerConnection struct
    method Reset (line 127) | func (p *peerConnection) Reset() {
    method FetchHeaders (line 145) | func (p *peerConnection) FetchHeaders(from uint64, count int) error {
    method FetchBodies (line 159) | func (p *peerConnection) FetchBodies(request *fetchRequest) error {
    method FetchReceipts (line 179) | func (p *peerConnection) FetchReceipts(request *fetchRequest) error {
    method FetchNodeData (line 199) | func (p *peerConnection) FetchNodeData(hashes []common.Hash) error {
    method SetHeadersIdle (line 214) | func (p *peerConnection) SetHeadersIdle(delivered int, deliveryTime ti...
    method SetBodiesIdle (line 221) | func (p *peerConnection) SetBodiesIdle(delivered int, deliveryTime tim...
    method SetReceiptsIdle (line 228) | func (p *peerConnection) SetReceiptsIdle(delivered int, deliveryTime t...
    method SetNodeDataIdle (line 235) | func (p *peerConnection) SetNodeDataIdle(delivered int, deliveryTime t...
    method setIdle (line 241) | func (p *peerConnection) setIdle(elapsed time.Duration, delivered int,...
    method HeaderCapacity (line 270) | func (p *peerConnection) HeaderCapacity(targetRTT time.Duration) int {
    method BlockCapacity (line 279) | func (p *peerConnection) BlockCapacity(targetRTT time.Duration) int {
    method ReceiptCapacity (line 288) | func (p *peerConnection) ReceiptCapacity(targetRTT time.Duration) int {
    method NodeDataCapacity (line 297) | func (p *peerConnection) NodeDataCapacity(targetRTT time.Duration) int {
    method MarkLacking (line 307) | func (p *peerConnection) MarkLacking(hash common.Hash) {
    method Lacks (line 322) | func (p *peerConnection) Lacks(hash common.Hash) bool {
  type LightPeer (line 79) | type LightPeer interface
  type Peer (line 86) | type Peer interface
  type lightPeerWrapper (line 94) | type lightPeerWrapper struct
    method Head (line 98) | func (w *lightPeerWrapper) Head() (common.Hash, *big.Int) { return w.p...
    method RequestHeadersByHash (line 99) | func (w *lightPeerWrapper) RequestHeadersByHash(h common.Hash, amount ...
    method RequestHeadersByNumber (line 102) | func (w *lightPeerWrapper) RequestHeadersByNumber(i uint64, amount int...
    method RequestBodies (line 105) | func (w *lightPeerWrapper) RequestBodies([]common.Hash) error {
    method RequestReceipts (line 108) | func (w *lightPeerWrapper) RequestReceipts([]common.Hash) error {
    method RequestNodeData (line 111) | func (w *lightPeerWrapper) RequestNodeData([]common.Hash) error {
  function newPeerConnection (line 116) | func newPeerConnection(id string, version uint, peer Peer, logger log.Lo...
  type peerSet (line 332) | type peerSet struct
    method SubscribeNewPeers (line 347) | func (ps *peerSet) SubscribeNewPeers(ch chan<- *peerConnection) event....
    method SubscribePeerDrops (line 352) | func (ps *peerSet) SubscribePeerDrops(ch chan<- *peerConnection) event...
    method Reset (line 358) | func (ps *peerSet) Reset() {
    method Register (line 373) | func (ps *peerSet) Register(p *peerConnection) error {
    method Unregister (line 408) | func (ps *peerSet) Unregister(id string) error {
    method Peer (line 423) | func (ps *peerSet) Peer(id string) *peerConnection {
    method Len (line 431) | func (ps *peerSet) Len() int {
    method AllPeers (line 439) | func (ps *peerSet) AllPeers() []*peerConnection {
    method HeaderIdlePeers (line 452) | func (ps *peerSet) HeaderIdlePeers() ([]*peerConnection, int) {
    method BodyIdlePeers (line 466) | func (ps *peerSet) BodyIdlePeers() ([]*peerConnection, int) {
    method ReceiptIdlePeers (line 480) | func (ps *peerSet) ReceiptIdlePeers() ([]*peerConnection, int) {
    method NodeDataIdlePeers (line 494) | func (ps *peerSet) NodeDataIdlePeers() ([]*peerConnection, int) {
    method idlePeers (line 509) | func (ps *peerSet) idlePeers(minProtocol, maxProtocol uint, idleCheck ...
    method medianRTT (line 532) | func (ps *peerSet) medianRTT() time.Duration {
  function newPeerSet (line 340) | func newPeerSet() *peerSet {
  type peerThroughputSort (line 564) | type peerThroughputSort struct
    method Len (line 569) | func (ps *peerThroughputSort) Len() int {
    method Less (line 573) | func (ps *peerThroughputSort) Less(i, j int) bool {
    method Swap (line 577) | func (ps *peerThroughputSort) Swap(i, j int) {

FILE: eth/downloader/peer_test.go
  function TestPeerThroughputSorting (line 24) | func TestPeerThroughputSorting(t *testing.T) {

FILE: eth/downloader/queue.go
  constant bodyType (line 38) | bodyType    = uint(0)
  constant receiptType (line 39) | receiptType = uint(1)
  type fetchRequest (line 55) | type fetchRequest struct
  type fetchResult (line 64) | type fetchResult struct
    method SetBodyDone (line 87) | func (f *fetchResult) SetBodyDone() {
    method AllDone (line 94) | func (f *fetchResult) AllDone() bool {
    method SetReceiptsDone (line 99) | func (f *fetchResult) SetReceiptsDone() {
    method Done (line 106) | func (f *fetchResult) Done(kind uint) bool {
  function newFetchResult (line 73) | func newFetchResult(header *types.Header, fastSync bool) *fetchResult {
  type queue (line 112) | type queue struct
    method Reset (line 160) | func (q *queue) Reset(blockCacheLimit int, thresholdInitialSize int) {
    method Close (line 184) | func (q *queue) Close() {
    method PendingHeaders (line 192) | func (q *queue) PendingHeaders() int {
    method PendingBlocks (line 200) | func (q *queue) PendingBlocks() int {
    method PendingReceipts (line 208) | func (q *queue) PendingReceipts() int {
    method InFlightHeaders (line 217) | func (q *queue) InFlightHeaders() bool {
    method InFlightBlocks (line 226) | func (q *queue) InFlightBlocks() bool {
    method InFlightReceipts (line 235) | func (q *queue) InFlightReceipts() bool {
    method Idle (line 243) | func (q *queue) Idle() bool {
    method ScheduleSkeleton (line 255) | func (q *queue) ScheduleSkeleton(from uint64, skeleton []*types.Header) {
    method RetrieveHeaders (line 282) | func (q *queue) RetrieveHeaders() ([]*types.Header, int) {
    method Schedule (line 294) | func (q *queue) Schedule(headers []*types.Header, from uint64) []*type...
    method Results (line 340) | func (q *queue) Results(block bool) []*fetchResult {
    method Stats (line 396) | func (q *queue) Stats() []interface{} {
    method stats (line 403) | func (q *queue) stats() []interface{} {
    method ReserveHeaders (line 413) | func (q *queue) ReserveHeaders(p *peerConnection, count int) *fetchReq...
    method ReserveBodies (line 454) | func (q *queue) ReserveBodies(p *peerConnection, count int) (*fetchReq...
    method ReserveReceipts (line 464) | func (q *queue) ReserveReceipts(p *peerConnection, count int) (*fetchR...
    method reserveHeaders (line 483) | func (q *queue) reserveHeaders(p *peerConnection, count int, taskPool ...
    method CancelHeaders (line 570) | func (q *queue) CancelHeaders(request *fetchRequest) {
    method CancelBodies (line 578) | func (q *queue) CancelBodies(request *fetchRequest) {
    method CancelReceipts (line 586) | func (q *queue) CancelReceipts(request *fetchRequest) {
    method cancel (line 593) | func (q *queue) cancel(request *fetchRequest, taskQueue *prque.Prque, ...
    method Revoke (line 606) | func (q *queue) Revoke(peerID string) {
    method ExpireHeaders (line 626) | func (q *queue) ExpireHeaders(timeout time.Duration) map[string]int {
    method ExpireBodies (line 635) | func (q *queue) ExpireBodies(timeout time.Duration) map[string]int {
    method ExpireReceipts (line 644) | func (q *queue) ExpireReceipts(timeout time.Duration) map[string]int {
    method expire (line 657) | func (q *queue) expire(timeout time.Duration, pendPool map[string]*fet...
    method DeliverHeaders (line 689) | func (q *queue) DeliverHeaders(id string, headers []*types.Header, hea...
    method DeliverBodies (line 783) | func (q *queue) DeliverBodies(id string, txLists [][]*types.Transactio...
    method DeliverReceipts (line 808) | func (q *queue) DeliverReceipts(id string, receiptList [][]*types.Rece...
    method deliver (line 830) | func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Hea...
    method Prepare (line 904) | func (q *queue) Prepare(offset uint64, mode SyncMode) {
  function newQueue (line 146) | func newQueue(blockCacheLimit int, thresholdInitialSize int) *queue {

FILE: eth/downloader/queue_test.go
  function makeChain (line 45) | func makeChain(n int, seed byte, parent *types.Block, empty bool) ([]*ty...
  type chainData (line 61) | type chainData struct
    method headers (line 79) | func (chain *chainData) headers() []*types.Header {
    method Len (line 87) | func (chain *chainData) Len() int {
  function init (line 69) | func init() {
  function dummyPeer (line 91) | func dummyPeer(id string) *peerConnection {
  function TestBasics (line 99) | func TestBasics(t *testing.T) {
  function TestEmptyBlocks (line 195) | func TestEmptyBlocks(t *testing.T) {
  function XTestDelivery (line 262) | func XTestDelivery(t *testing.T) {
  function newNetwork (line 381) | func newNetwork() *network {
  type network (line 390) | type network struct
    method getTransactions (line 398) | func (n *network) getTransactions(blocknum uint64) types.Transactions {
    method getReceipts (line 402) | func (n *network) getReceipts(blocknum uint64) types.Receipts {
    method forget (line 411) | func (n *network) forget(blocknum uint64) {
    method progress (line 418) | func (n *network) progress(numBlocks int) {
    method headers (line 430) | func (n *network) headers(from int) []*types.Header {

FILE: eth/downloader/resultstore.go
  type resultStore (line 29) | type resultStore struct
    method SetThrottleThreshold (line 58) | func (r *resultStore) SetThrottleThreshold(threshold uint64) uint64 {
    method AddFetch (line 78) | func (r *resultStore) AddFetch(header *types.Header, fastSync bool) (s...
    method GetDeliverySlot (line 98) | func (r *resultStore) GetDeliverySlot(headerNumber uint64) (*fetchResu...
    method getFetchResult (line 108) | func (r *resultStore) getFetchResult(headerNumber uint64) (item *fetch...
    method HasCompletedItems (line 128) | func (r *resultStore) HasCompletedItems() bool {
    method countCompleted (line 145) | func (r *resultStore) countCompleted() int {
    method GetCompleted (line 163) | func (r *resultStore) GetCompleted(limit int) []*fetchResult {
    method Prepare (line 187) | func (r *resultStore) Prepare(offset uint64) {
  function newResultStore (line 48) | func newResultStore(size int) *resultStore {

FILE: eth/downloader/statesync.go
  type stateReq (line 36) | type stateReq struct
    method timedOut (line 49) | func (req *stateReq) timedOut() bool {
  type stateSyncStats (line 55) | type stateSyncStats struct
  method syncState (line 63) | func (d *Downloader) syncState(root common.Hash) *stateSync {
  method stateFetcher (line 81) | func (d *Downloader) stateFetcher() {
  method runStateSync (line 98) | func (d *Downloader) runStateSync(s *stateSync) *stateSync {
  method spindownStateSync (line 222) | func (d *Downloader) spindownStateSync(active map[string]*stateReq, fini...
  type stateSync (line 260) | type stateSync struct
    method run (line 315) | func (s *stateSync) run() {
    method Wait (line 326) | func (s *stateSync) Wait() error {
    method Cancel (line 332) | func (s *stateSync) Cancel() error {
    method loop (line 345) | func (s *stateSync) loop() (err error) {
    method commit (line 411) | func (s *stateSync) commit(force bool) error {
    method assignTasks (line 431) | func (s *stateSync) assignTasks() {
    method fillTasks (line 456) | func (s *stateSync) fillTasks(n int, req *stateReq) (nodes []common.Ha...
    method process (line 522) | func (s *stateSync) process(req *stateReq) (int, error) {
    method processNodeData (line 589) | func (s *stateSync) processNodeData(blob []byte) (common.Hash, error) {
    method updateStats (line 600) | func (s *stateSync) updateStats(written, duplicate, unexpected int, du...
  type trieTask (line 284) | type trieTask struct
  type codeTask (line 291) | type codeTask struct
  function newStateSync (line 297) | func newStateSync(d *Downloader, root common.Hash) *stateSync {

FILE: eth/downloader/testchain_test.go
  function init (line 47) | func init() {
  type testChain (line 57) | type testChain struct
    method makeFork (line 79) | func (tc *testChain) makeFork(length int, heavy bool, seed byte) *test...
    method shorten (line 87) | func (tc *testChain) shorten(length int) *testChain {
    method copy (line 94) | func (tc *testChain) copy(newlen int) *testChain {
    method generate (line 117) | func (tc *testChain) generate(n int, seed byte, parent *types.Block, h...
    method len (line 159) | func (tc *testChain) len() int {
    method headBlock (line 164) | func (tc *testChain) headBlock() *types.Block {
    method td (line 169) | func (tc *testChain) td(hash common.Hash) *big.Int {
    method headersByHash (line 174) | func (tc *testChain) headersByHash(origin common.Hash, amount int, ski...
    method headersByNumber (line 180) | func (tc *testChain) headersByNumber(origin uint64, amount int, skip i...
    method receipts (line 200) | func (tc *testChain) receipts(hashes []common.Hash) [][]*types.Receipt {
    method bodies (line 211) | func (tc *testChain) bodies(hashes []common.Hash) ([][]*types.Transact...
    method hashToNumber (line 223) | func (tc *testChain) hashToNumber(target common.Hash) (uint64, bool) {
  function newTestChain (line 67) | func newTestChain(length int, genesis *types.Block) *testChain {

FILE: eth/downloader/types.go
  type peerDropFn (line 26) | type peerDropFn
  type dataPack (line 29) | type dataPack interface
  type headerPack (line 36) | type headerPack struct
    method PeerId (line 41) | func (p *headerPack) PeerId() string { return p.peerID }
    method Items (line 42) | func (p *headerPack) Items() int     { return len(p.headers) }
    method Stats (line 43) | func (p *headerPack) Stats() string  { return fmt.Sprintf("%d", len(p....
  type bodyPack (line 46) | type bodyPack struct
    method PeerId (line 52) | func (p *bodyPack) PeerId() string { return p.peerID }
    method Items (line 53) | func (p *bodyPack) Items() int {
    method Stats (line 59) | func (p *bodyPack) Stats() string { return fmt.Sprintf("%d:%d", len(p....
  type receiptPack (line 62) | type receiptPack struct
    method PeerId (line 67) | func (p *receiptPack) PeerId() string { return p.peerID }
    method Items (line 68) | func (p *receiptPack) Items() int     { return len(p.receipts) }
    method Stats (line 69) | func (p *receiptPack) Stats() string  { return fmt.Sprintf("%d", len(p...
  type statePack (line 72) | type statePack struct
    method PeerId (line 77) | func (p *statePack) PeerId() string { return p.peerID }
    method Items (line 78) | func (p *statePack) Items() int     { return len(p.states) }
    method Stats (line 79) | func (p *statePack) Stats() string  { return fmt.Sprintf("%d", len(p.s...

FILE: eth/ethconfig/config.go
  function init (line 91) | func init() {
  type Config (line 115) | type Config struct
  function CreateConsensusEngine (line 207) | func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainCo...

FILE: eth/ethconfig/gen_config.go
  method MarshalTOML (line 18) | func (c Config) MarshalTOML() (interface{}, error) {
  method UnmarshalTOML (line 110) | func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {

FILE: eth/fetcher/block_fetcher.go
  constant lightTimeout (line 35) | lightTimeout  = time.Millisecond
  constant arriveTimeout (line 36) | arriveTimeout = 500 * time.Millisecond
  constant gatherSlack (line 37) | gatherSlack   = 100 * time.Millisecond
  constant fetchTimeout (line 38) | fetchTimeout  = 5 * time.Second
  constant maxUncleDist (line 42) | maxUncleDist = 7
  constant maxQueueDist (line 43) | maxQueueDist = 32
  constant hashLimit (line 44) | hashLimit    = 256
  constant blockLimit (line 45) | blockLimit   = 64
  type HeaderRetrievalFn (line 71) | type HeaderRetrievalFn
  type blockRetrievalFn (line 74) | type blockRetrievalFn
  type headerRequesterFn (line 77) | type headerRequesterFn
  type bodyRequesterFn (line 80) | type bodyRequesterFn
  type headerVerifierFn (line 83) | type headerVerifierFn
  type blockBroadcasterFn (line 86) | type blockBroadcasterFn
  type chainHeightFn (line 89) | type chainHeightFn
  type headersInsertFn (line 92) | type headersInsertFn
  type chainInsertFn (line 95) | type chainInsertFn
  type peerDropFn (line 98) | type peerDropFn
  type blockAnnounce (line 102) | type blockAnnounce struct
  type headerFilterTask (line 115) | type headerFilterTask struct
  type bodyFilterTask (line 123) | type bodyFilterTask struct
  type blockOrHeaderInject (line 131) | type blockOrHeaderInject struct
    method number (line 139) | func (inject *blockOrHeaderInject) number() uint64 {
    method hash (line 147) | func (inject *blockOrHeaderInject) hash() common.Hash {
  type BlockFetcher (line 156) | type BlockFetcher struct
    method Start (line 230) | func (f *BlockFetcher) Start() {
    method Stop (line 236) | func (f *BlockFetcher) Stop() {
    method Notify (line 242) | func (f *BlockFetcher) Notify(peer string, hash common.Hash, number ui...
    method Enqueue (line 261) | func (f *BlockFetcher) Enqueue(peer string, block *types.Block) error {
    method FilterHeaders (line 276) | func (f *BlockFetcher) FilterHeaders(peer string, headers []*types.Hea...
    method FilterBodies (line 304) | func (f *BlockFetcher) FilterBodies(peer string, transactions [][]*typ...
    method loop (line 332) | func (f *BlockFetcher) loop() {
    method rescheduleFetch (line 664) | func (f *BlockFetcher) rescheduleFetch(fetch *time.Timer) {
    method rescheduleComplete (line 686) | func (f *BlockFetcher) rescheduleComplete(complete *time.Timer) {
    method enqueue (line 703) | func (f *BlockFetcher) enqueue(peer string, header *types.Header, bloc...
    method importHeaders (line 749) | func (f *BlockFetcher) importHeaders(peer string, header *types.Header) {
    method importBlocks (line 782) | func (f *BlockFetcher) importBlocks(peer string, block *types.Block) {
    method forgetHash (line 830) | func (f *BlockFetcher) forgetHash(hash common.Hash) {
    method forgetBlock (line 872) | func (f *BlockFetcher) forgetBlock(hash common.Hash) {
  function NewBlockFetcher (line 200) | func NewBlockFetcher(light bool, getHeader HeaderRetrievalFn, getBlock b...

FILE: eth/fetcher/block_fetcher_test.go
  function makeChain (line 49) | func makeChain(n int, seed byte, parent *types.Block) ([]common.Hash, ma...
  type fetcherTester (line 79) | type fetcherTester struct
    method getHeader (line 105) | func (f *fetcherTester) getHeader(hash common.Hash) *types.Header {
    method getBlock (line 113) | func (f *fetcherTester) getBlock(hash common.Hash) *types.Block {
    method verifyHeader (line 121) | func (f *fetcherTester) verifyHeader(header *types.Header) error {
    method broadcastBlock (line 126) | func (f *fetcherTester) broadcastBlock(block *types.Block, propagate b...
    method chainHeight (line 130) | func (f *fetcherTester) chainHeight() uint64 {
    method insertHeaders (line 141) | func (f *fetcherTester) insertHeaders(headers []*types.Header) (int, e...
    method insertChain (line 162) | func (f *fetcherTester) insertChain(blocks types.Blocks) (int, error) {
    method dropPeer (line 184) | func (f *fetcherTester) dropPeer(peer string) {
    method makeHeaderFetcher (line 192) | func (f *fetcherTester) makeHeaderFetcher(peer string, blocks map[comm...
    method makeBodyFetcher (line 212) | func (f *fetcherTester) makeBodyFetcher(peer string, blocks map[common...
  function newTester (line 91) | func newTester(light bool) *fetcherTester {
  function verifyFetchingEvent (line 237) | func verifyFetchingEvent(t *testing.T, fetching chan []common.Hash, arri...
  function verifyCompletingEvent (line 254) | func verifyCompletingEvent(t *testing.T, completing chan []common.Hash, ...
  function verifyImportEvent (line 271) | func verifyImportEvent(t *testing.T, imported chan interface{}, arrive b...
  function verifyImportCount (line 289) | func verifyImportCount(t *testing.T, imported chan interface{}, count in...
  function verifyImportDone (line 301) | func verifyImportDone(t *testing.T, imported chan interface{}) {
  function verifyChainHeight (line 310) | func verifyChainHeight(t *testing.T, fetcher *fetcherTester, height uint...
  function TestFullSequentialAnnouncements (line 318) | func TestFullSequentialAnnouncements(t *testing.T)  { testSequentialAnno...
  function TestLightSequentialAnnouncements (line 319) | func TestLightSequentialAnnouncements(t *testing.T) { testSequentialAnno...
  function testSequentialAnnouncements (line 321) | func testSequentialAnnouncements(t *testing.T, light bool) {
  function TestFullConcurrentAnnouncements (line 355) | func TestFullConcurrentAnnouncements(t *testing.T)  { testConcurrentAnno...
  function TestLightConcurrentAnnouncements (line 356) | func TestLightConcurrentAnnouncements(t *testing.T) { testConcurrentAnno...
  function testConcurrentAnnouncements (line 358) | func testConcurrentAnnouncements(t *testing.T, light bool) {
  function TestFullOverlappingAnnouncements (line 411) | func TestFullOverlappingAnnouncements(t *testing.T)  { testOverlappingAn...
  function TestLightOverlappingAnnouncements (line 412) | func TestLightOverlappingAnnouncements(t *testing.T) { testOverlappingAn...
  function testOverlappingAnnouncements (line 414) | func testOverlappingAnnouncements(t *testing.T, light bool) {
  function TestFullPendingDeduplication (line 457) | func TestFullPendingDeduplication(t *testing.T)  { testPendingDeduplicat...
  function TestLightPendingDeduplication (line 458) | func TestLightPendingDeduplication(t *testing.T) { testPendingDeduplicat...
  function testPendingDeduplication (line 460) | func testPendingDeduplication(t *testing.T, light bool) {
  function TestFullRandomArrivalImport (line 505) | func TestFullRandomArrivalImport(t *testing.T)  { testRandomArrivalImpor...
  function TestLightRandomArrivalImport (line 506) | func TestLightRandomArrivalImport(t *testing.T) { testRandomArrivalImpor...
  function testRandomArrivalImport (line 508) | func testRandomArrivalImport(t *testing.T, light bool) {
  function TestQueueGapFill (line 547) | func TestQueueGapFill(t *testing.T) {
  function TestImportDeduplication (line 575) | func TestImportDeduplication(t *testing.T) {
  function TestDistantPropagationDiscarding (line 614) | func TestDistantPropagationDiscarding(t *testing.T) {
  function TestFullDistantAnnouncementDiscarding (line 646) | func TestFullDistantAnnouncementDiscarding(t *testing.T)  { testDistantA...
  function TestLightDistantAnnouncementDiscarding (line 647) | func TestLightDistantAnnouncementDiscarding(t *testing.T) { testDistantA...
  function testDistantAnnouncementDiscarding (line 649) | func testDistantAnnouncementDiscarding(t *testing.T, light bool) {
  function TestFullInvalidNumberAnnouncement (line 689) | func TestFullInvalidNumberAnnouncement(t *testing.T)  { testInvalidNumbe...
  function TestLightInvalidNumberAnnouncement (line 690) | func TestLightInvalidNumberAnnouncement(t *testing.T) { testInvalidNumbe...
  function testInvalidNumberAnnouncement (line 692) | func testInvalidNumberAnnouncement(t *testing.T, light bool) {
  function TestEmptyBlockShortCircuit (line 744) | func TestEmptyBlockShortCircuit(t *testing.T) {
  function TestHashMemoryExhaustionAttack (line 785) | func TestHashMemoryExhaustionAttack(t *testing.T) {
  function TestBlockMemoryExhaustionAttack (line 832) | func TestBlockMemoryExhaustionAttack(t *testing.T) {

FILE: eth/fetcher/tx_fetcher.go
  constant maxTxAnnounces (line 38) | maxTxAnnounces = 4096
  constant maxTxRetrievals (line 48) | maxTxRetrievals = 256
  constant maxTxUnderpricedSetSize (line 53) | maxTxUnderpricedSetSize = 32768
  constant txArriveTimeout (line 57) | txArriveTimeout = 500 * time.Millisecond
  constant txGatherSlack (line 61) | txGatherSlack = 100 * time.Millisecond
  type txAnnounce (line 101) | type txAnnounce struct
  type txRequest (line 108) | type txRequest struct
  type txDelivery (line 116) | type txDelivery struct
  type txDrop (line 123) | type txDrop struct
  type TxFetcher (line 144) | type TxFetcher struct
    method Notify (line 215) | func (f *TxFetcher) Notify(peer string, hashes []common.Hash) error {
    method Enqueue (line 263) | func (f *TxFetcher) Enqueue(peer string, txs []*types.Transaction, dir...
    method Drop (line 325) | func (f *TxFetcher) Drop(peer string) error {
    method Start (line 336) | func (f *TxFetcher) Start() {
    method Stop (line 342) | func (f *TxFetcher) Stop() {
    method loop (line 346) | func (f *TxFetcher) loop() {
    method rescheduleWait (line 692) | func (f *TxFetcher) rescheduleWait(timer *mclock.Timer, trigger chan s...
    method rescheduleTimeout (line 726) | func (f *TxFetcher) rescheduleTimeout(timer *mclock.Timer, trigger cha...
    method scheduleFetches (line 751) | func (f *TxFetcher) scheduleFetches(timer *mclock.Timer, timeout chan ...
    method forEachPeer (line 816) | func (f *TxFetcher) forEachPeer(peers map[string]struct{}, do func(pee...
    method forEachHash (line 838) | func (f *TxFetcher) forEachHash(hashes map[common.Hash]struct{}, do fu...
  function NewTxFetcher (line 182) | func NewTxFetcher(hasTx func(common.Hash) bool, addTxs func([]*types.Tra...
  function NewTxFetcherForTests (line 188) | func NewTxFetcherForTests(
  function rotateStrings (line 864) | func rotateStrings(slice []string, n int) {
  function sortHashes (line 875) | func sortHashes(slice []common.Hash) {
  function rotateHashes (line 887) | func rotateHashes(slice []common.Hash, n int) {

FILE: eth/fetcher/tx_fetcher_test.go
  type doTxNotify (line 44) | type doTxNotify struct
  type doTxEnqueue (line 48) | type doTxEnqueue struct
  type doWait (line 53) | type doWait struct
  type doDrop (line 57) | type doDrop
  type doFunc (line 58) | type doFunc
  type isWaiting (line 60) | type isWaiting
  type isScheduled (line 61) | type isScheduled struct
  type isUnderpriced (line 66) | type isUnderpriced
  type txFetcherTest (line 70) | type txFetcherTest struct
  function TestTransactionFetcherWaiting (line 77) | func TestTransactionFetcherWaiting(t *testing.T) {
  function TestTransactionFetcherSkipWaiting (line 167) | func TestTransactionFetcherSkipWaiting(t *testing.T) {
  function TestTransactionFetcherSingletonRequesting (line 230) | func TestTransactionFetcherSingletonRequesting(t *testing.T) {
  function TestTransactionFetcherFailedRescheduling (line 304) | func TestTransactionFetcherFailedRescheduling(t *testing.T) {
  function TestTransactionFetcherCleanup (line 377) | func TestTransactionFetcherCleanup(t *testing.T) {
  function TestTransactionFetcherCleanupEmpty (line 416) | func TestTransactionFetcherCleanupEmpty(t *testing.T) {
  function TestTransactionFetcherMissingRescheduling (line 454) | func TestTransactionFetcherMissingRescheduling(t *testing.T) {
  function TestTransactionFetcherMissingCleanup (line 500) | func TestTransactionFetcherMissingCleanup(t *testing.T) {
  function TestTransactionFetcherBroadcasts (line 538) | func TestTransactionFetcherBroadcasts(t *testing.T) {
  function TestTransactionFetcherWaitTimerResets (line 588) | func TestTransactionFetcherWaitTimerResets(t *testing.T) {
  function TestTransactionFetcherTimeoutRescheduling (line 643) | func TestTransactionFetcherTimeoutRescheduling(t *testing.T) {
  function TestTransactionFetcherTimeoutTimerResets (line 710) | func TestTransactionFetcherTimeoutTimerResets(t *testing.T) {
  function TestTransactionFetcherRateLimiting (line 763) | func TestTransactionFetcherRateLimiting(t *testing.T) {
  function TestTransactionFetcherDoSProtection (line 798) | func TestTransactionFetcherDoSProtection(t *testing.T) {
  function TestTransactionFetcherUnderpricedDedup (line 864) | func TestTransactionFetcherUnderpricedDedup(t *testing.T) {
  function TestTransactionFetcherUnderpricedDoSProtection (line 903) | func TestTransactionFetcherUnderpricedDoSProtection(t *testing.T) {
  function TestTransactionFetcherOutOfBoundDeliveries (line 963) | func TestTransactionFetcherOutOfBoundDeliveries(t *testing.T) {
  function TestTransactionFetcherDrop (line 1016) | func TestTransactionFetcherDrop(t *testing.T) {
  function TestTransactionFetcherDropRescheduling (line 1082) | func TestTransactionFetcherDropRescheduling(t *testing.T) {
  function TestTransactionFetcherFuzzCrash01 (line 1127) | func TestTransactionFetcherFuzzCrash01(t *testing.T) {
  function TestTransactionFetcherFuzzCrash02 (line 1154) | func TestTransactionFetcherFuzzCrash02(t *testing.T) {
  function TestTransactionFetcherFuzzCrash03 (line 1183) | func TestTransactionFetcherFuzzCrash03(t *testing.T) {
  function TestTransactionFetcherFuzzCrash04 (line 1213) | func TestTransactionFetcherFuzzCrash04(t *testing.T) {
  function testTransactionFetcherParallel (line 1248) | func testTransactionFetcherParallel(t *testing.T, tt txFetcherTest) {
  function testTransactionFetcher (line 1253) | func testTransactionFetcher(t *testing.T, tt txFetcherTest) {
  function containsHash (line 1521) | func containsHash(slice []common.Hash, hash common.Hash) bool {

FILE: eth/filters/api.go
  type filter (line 39) | type filter struct
  type PublicFilterAPI (line 50) | type PublicFilterAPI struct
    method timeoutLoop (line 77) | func (api *PublicFilterAPI) timeoutLoop(timeout time.Duration) {
    method NewPendingTransactionFilter (line 112) | func (api *PublicFilterAPI) NewPendingTransactionFilter() rpc.ID {
    method NewPendingTransactions (line 145) | func (api *PublicFilterAPI) NewPendingTransactions(ctx context.Context...
    method NewBlockFilter (line 182) | func (api *PublicFilterAPI) NewBlockFilter() rpc.ID {
    method NewHeads (line 214) | func (api *PublicFilterAPI) NewHeads(ctx context.Context) (*rpc.Subscr...
    method Logs (line 244) | func (api *PublicFilterAPI) Logs(ctx context.Context, crit FilterCrite...
    method NewFilter (line 298) | func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, er...
    method GetLogs (line 333) | func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit FilterCr...
    method UninstallFilter (line 362) | func (api *PublicFilterAPI) UninstallFilter(id rpc.ID) bool {
    method GetFilterLogs (line 380) | func (api *PublicFilterAPI) GetFilterLogs(ctx context.Context, id rpc....
    method GetFilterChanges (line 421) | func (api *PublicFilterAPI) GetFilterChanges(id rpc.ID) (interface{}, ...
  function NewPublicFilterAPI (line 62) | func NewPublicFilterAPI(backend Backend, lightMode bool, timeout time.Du...
  type FilterCriteria (line 283) | type FilterCriteria
    method UnmarshalJSON (line 467) | func (args *FilterCriteria) UnmarshalJSON(data []byte) error {
  function returnHashes (line 450) | func returnHashes(hashes []common.Hash) []common.Hash {
  function returnLogs (line 459) | func returnLogs(logs []*types.Log) []*types.Log {
  function decodeAddress (line 569) | func decodeAddress(s string) (common.Address, error) {
  function decodeTopic (line 577) | func decodeTopic(s string) (common.Hash, error) {

FILE: eth/filters/api_test.go
  function TestUnmarshalJSONNewFilterArgs (line 28) | func TestUnmarshalJSONNewFilterArgs(t *testing.T) {

FILE: eth/filters/bench_test.go
  function BenchmarkBloomBits512 (line 34) | func BenchmarkBloomBits512(b *testing.B) {
  function BenchmarkBloomBits1k (line 38) | func BenchmarkBloomBits1k(b *testing.B) {
  function BenchmarkBloomBits2k (line 42) | func BenchmarkBloomBits2k(b *testing.B) {
  function BenchmarkBloomBits4k (line 46) | func BenchmarkBloomBits4k(b *testing.B) {
  function BenchmarkBloomBits8k (line 50) | func BenchmarkBloomBits8k(b *testing.B) {
  function BenchmarkBloomBits16k (line 54) | func BenchmarkBloomBits16k(b *testing.B) {
  function BenchmarkBloomBits32k (line 58) | func BenchmarkBloomBits32k(b *testing.B) {
  constant benchFilterCnt (line 62) | benchFilterCnt = 2000
  function benchmarkBloomBits (line 64) | func benchmarkBloomBits(b *testing.B, sectionSize uint64) {
  function clearBloomBits (line 148) | func clearBloomBits(db ethdb.Database) {
  function BenchmarkNoBloomBits (line 157) | func BenchmarkNoBloomBits(b *testing.B) {

FILE: eth/filters/filter.go
  type Backend (line 33) | type Backend interface
  type Filter (line 51) | type Filter struct
    method Logs (line 119) | func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) {
    method indexedLogs (line 168) | func (f *Filter) indexedLogs(ctx context.Context, end uint64) ([]*type...
    method unindexedLogs (line 215) | func (f *Filter) unindexedLogs(ctx context.Context, end uint64) ([]*ty...
    method blockLogs (line 233) | func (f *Filter) blockLogs(ctx context.Context, header *types.Header) ...
    method checkMatches (line 246) | func (f *Filter) checkMatches(ctx context.Context, header *types.Heade...
  function NewRangeFilter (line 66) | func NewRangeFilter(backend Backend, begin, end int64, addresses []commo...
  function NewBlockFilter (line 99) | func NewBlockFilter(backend Backend, block common.Hash, addresses []comm...
  function newFilter (line 108) | func newFilter(backend Backend, addresses []common.Address, topics [][]c...
  function includes (line 275) | func includes(addresses []common.Address, a common.Address) bool {
  function filterLogs (line 286) | func filterLogs(logs []*types.Log, fromBlock, toBlock *big.Int, addresse...
  function bloomFilter (line 321) | func bloomFilter(bloom types.Bloom, addresses []common.Address, topics [...

FILE: eth/filters/filter_system.go
  type Type (line 39) | type Type
  constant UnknownSubscription (line 43) | UnknownSubscription Type = iota
  constant LogsSubscription (line 45) | LogsSubscription
  constant PendingLogsSubscription (line 47) | PendingLogsSubscription
  constant MinedAndPendingLogsSubscription (line 49) | MinedAndPendingLogsSubscription
  constant PendingTransactionsSubscription (line 52) | PendingTransactionsSubscription
  constant BlocksSubscription (line 54) | BlocksSubscription
  constant LastIndexSubscription (line 56) | LastIndexSubscription
  constant txChanSize (line 62) | txChanSize = 4096
  constant rmLogsChanSize (line 64) | rmLogsChanSize = 10
  constant logsChanSize (line 66) | logsChanSize = 10
  constant chainEvChanSize (line 68) | chainEvChanSize = 10
  type subscription (line 71) | type subscription struct
  type EventSystem (line 85) | type EventSystem struct
    method subscribe (line 181) | func (es *EventSystem) subscribe(sub *subscription) *Subscription {
    method SubscribeLogs (line 190) | func (es *EventSystem) SubscribeLogs(crit ethereum.FilterQuery, logs c...
    method subscribeMinedPendingLogs (line 228) | func (es *EventSystem) subscribeMinedPendingLogs(crit ethereum.FilterQ...
    method subscribeLogs (line 245) | func (es *EventSystem) subscribeLogs(crit ethereum.FilterQuery, logs c...
    method subscribePendingLogs (line 262) | func (es *EventSystem) subscribePendingLogs(crit ethereum.FilterQuery,...
    method SubscribeNewHeads (line 279) | func (es *EventSystem) SubscribeNewHeads(headers chan *types.Header) *...
    method SubscribePendingTxs (line 295) | func (es *EventSystem) SubscribePendingTxs(hashes chan []common.Hash) ...
    method handleLogs (line 311) | func (es *EventSystem) handleLogs(filters filterIndex, ev []*types.Log) {
    method handlePendingLogs (line 323) | func (es *EventSystem) handlePendingLogs(filters filterIndex, ev []*ty...
    method handleRemovedLogs (line 335) | func (es *EventSystem) handleRemovedLogs(filters filterIndex, ev core....
    method handleTxsEvent (line 344) | func (es *EventSystem) handleTxsEvent(filters filterIndex, ev core.New...
    method handleChainEvent (line 354) | func (es *EventSystem) handleChainEvent(filters filterIndex, ev core.C...
    method lightFilterNewHead (line 369) | func (es *EventSystem) lightFilterNewHead(newHeader *types.Header, cal...
    method lightFilterLogs (line 403) | func (es *EventSystem) lightFilterLogs(header *types.Header, addresses...
    method eventLoop (line 443) | func (es *EventSystem) eventLoop() {
  function NewEventSystem (line 113) | func NewEventSystem(backend Backend, lightMode bool) *EventSystem {
  type Subscription (line 143) | type Subscription struct
    method Err (line 151) | func (sub *Subscription) Err() <-chan error {
    method Unsubscribe (line 156) | func (sub *Subscription) Unsubscribe() {
  type filterIndex (line 309) | type filterIndex

FILE: eth/filters/filter_system_test.go
  type testBackend (line 46) | type testBackend struct
    method ChainDb (line 57) | func (b *testBackend) ChainDb() ethdb.Database {
    method HeaderByNumber (line 61) | func (b *testBackend) HeaderByNumber(ctx context.Context, blockNr rpc....
    method HeaderByHash (line 80) | func (b *testBackend) HeaderByHash(ctx context.Context, hash common.Ha...
    method GetReceipts (line 88) | func (b *testBackend) GetReceipts(ctx context.Context, hash common.Has...
    method GetLogs (line 95) | func (b *testBackend) GetLogs(ctx context.Context, hash common.Hash) (...
    method SubscribeNewTxsEvent (line 109) | func (b *testBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent)...
    method SubscribeRemovedLogsEvent (line 113) | func (b *testBackend) SubscribeRemovedLogsEvent(ch chan<- core.Removed...
    method SubscribeLogsEvent (line 117) | func (b *testBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event...
    method SubscribePendingLogsEvent (line 121) | func (b *testBackend) SubscribePendingLogsEvent(ch chan<- []*types.Log...
    method SubscribeChainEvent (line 125) | func (b *testBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) e...
    method BloomStatus (line 129) | func (b *testBackend) BloomStatus() (uint64, uint64) {
    method ServiceFilter (line 133) | func (b *testBackend) ServiceFilter(ctx context.Context, session *bloo...
  function TestBlockSubscription (line 165) | func TestBlockSubscription(t *testing.T) {
  function TestPendingTxFilter (line 217) | func TestPendingTxFilter(t *testing.T) {
  function TestLogFilterCreation (line 274) | func TestLogFilterCreation(t *testing.T) {
  function TestInvalidLogFilterCreation (line 316) | func TestInvalidLogFilterCreation(t *testing.T) {
  function TestInvalidGetLogsRequest (line 340) | func TestInvalidGetLogsRequest(t *testing.T) {
  function TestLogFilter (line 363) | func TestLogFilter(t *testing.T) {
  function TestPendingLogsSubscription (line 477) | func TestPendingLogsSubscription(t *testing.T) {
  function TestPendingTxFilterDeadlock (line 612) | func TestPendingTxFilterDeadlock(t *testing.T) {
  function flattenLogs (line 676) | func flattenLogs(pl [][]*types.Log) []*types.Log {

FILE: eth/filters/filter_test.go
  function makeReceipt (line 35) | func makeReceipt(addr common.Address) *types.Receipt {
  function BenchmarkFilters (line 44) | func BenchmarkFilters(b *testing.B) {
  function TestFilters (line 98) | func TestFilters(t *testing.T) {

FILE: eth/gasprice/gasprice.go
  constant sampleNumber (line 32) | sampleNumber = 3
  type Config (line 36) | type Config struct
  type OracleBackend (line 44) | type OracleBackend interface
  type Oracle (line 52) | type Oracle struct
    method SuggestPrice (line 97) | func (gpo *Oracle) SuggestPrice(ctx context.Context) (*big.Int, error) {
    method getBlockPrices (line 186) | func (gpo *Oracle) getBlockPrices(ctx context.Context, signer types.Si...
  function NewOracle (line 66) | func NewOracle(backend OracleBackend, params Config) *Oracle {
  type getBlockPricesResult (line 171) | type getBlockPricesResult struct
  type transactionsByGasPrice (line 176) | type transactionsByGasPrice
    method Len (line 178) | func (t transactionsByGasPrice) Len() int           { return len(t) }
    method Swap (line 179) | func (t transactionsByGasPrice) Swap(i, j int)      { t[i], t[j] = t[j...
    method Less (line 180) | func (t transactionsByGasPrice) Less(i, j int) bool { return t[i].GasP...
  type bigIntArray (line 216) | type bigIntArray
    method Len (line 218) | func (s bigIntArray) Len() int           { return len(s) }
    method Less (line 219) | func (s bigIntArray) Less(i, j int) bool { return s[i].Cmp(s[j]) < 0 }
    method Swap (line 220) | func (s bigIntArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }

FILE: eth/gasprice/gasprice_test.go
  type testBackend (line 36) | type testBackend struct
    method HeaderByNumber (line 40) | func (b *testBackend) HeaderByNumber(ctx context.Context, number rpc.B...
    method BlockByNumber (line 47) | func (b *testBackend) BlockByNumber(ctx context.Context, number rpc.Bl...
    method ChainConfig (line 54) | func (b *testBackend) ChainConfig() *params.ChainConfig {
    method CurrentHeader (line 92) | func (b *testBackend) CurrentHeader() *types.Header {
    method GetBlockByNumber (line 96) | func (b *testBackend) GetBlockByNumber(number uint64) *types.Block {
  function newTestBackend (line 58) | func newTestBackend(t *testing.T) *testBackend {
  function TestSuggestPrice (line 100) | func TestSuggestPrice(t *testing.T) {

FILE: eth/handler.go
  constant txChanSize (line 46) | txChanSize = 4096
  type txPool (line 55) | type txPool interface
  type handlerConfig (line 78) | type handlerConfig struct
  type handler (line 90) | type handler struct
    method runEthPeer (line 238) | func (h *handler) runEthPeer(peer *eth.Peer, handler eth.Handler) error {
    method runSnapExtension (line 346) | func (h *handler) runSnapExtension(peer *snap.Peer, handler snap.Handl...
    method removePeer (line 359) | func (h *handler) removePeer(id string) {
    method Start (line 391) | func (h *handler) Start(maxPeers int) {
    method Stop (line 411) | func (h *handler) Stop() {
    method BroadcastBlock (line 432) | func (h *handler) BroadcastBlock(block *types.Block, propagate bool) {
    method BroadcastTransactions (line 467) | func (h *handler) BroadcastTransactions(txs types.Transactions) {
    method minedBroadcastLoop (line 511) | func (h *handler) minedBroadcastLoop() {
    method txBroadcastLoop (line 523) | func (h *handler) txBroadcastLoop() {
  function newHandler (line 129) | func newHandler(config *handlerConfig) (*handler, error) {

FILE: eth/handler_eth.go
  type ethHandler (line 37) | type ethHandler
    method Chain (line 39) | func (h *ethHandler) Chain() *core.BlockChain     { return h.chain }
    method StateBloom (line 40) | func (h *ethHandler) StateBloom() *trie.SyncBloom { return h.stateBloom }
    method TxPool (line 41) | func (h *ethHandler) TxPool() eth.TxPool          { return h.txpool }
    method RunPeer (line 44) | func (h *ethHandler) RunPeer(peer *eth.Peer, hand eth.Handler) error {
    method PeerInfo (line 49) | func (h *ethHandler) PeerInfo(id enode.ID) interface{} {
    method AcceptTxs (line 58) | func (h *ethHandler) AcceptTxs() bool {
    method Handle (line 64) | func (h *ethHandler) Handle(peer *eth.Peer, packet eth.Packet) error {
    method handleHeaders (line 109) | func (h *ethHandler) handleHeaders(peer *eth.Peer, headers []*types.He...
    method handleBodies (line 165) | func (h *ethHandler) handleBodies(peer *eth.Peer, txs [][]*types.Trans...
    method handleBlockAnnounces (line 182) | func (h *ethHandler) handleBlockAnnounces(peer *eth.Peer, hashes []com...
    method handleBlockBroadcast (line 202) | func (h *ethHandler) handleBlockBroadcast(peer *eth.Peer, block *types...

FILE: eth/handler_eth_test.go
  type testEthHandler (line 45) | type testEthHandler struct
    method Chain (line 51) | func (h *testEthHandler) Chain() *core.BlockChain              { panic...
    method StateBloom (line 52) | func (h *testEthHandler) StateBloom() *trie.SyncBloom          { panic...
    method TxPool (line 53) | func (h *testEthHandler) TxPool() eth.TxPool                   { panic...
    method AcceptTxs (line 54) | func (h *testEthHandler) AcceptTxs() bool                      { retur...
    method RunPeer (line 55) | func (h *testEthHandler) RunPeer(*eth.Peer, eth.Handler) error { panic...
    method PeerInfo (line 56) | func (h *testEthHandler) PeerInfo(enode.ID) interface{}        { panic...
    method Handle (line 58) | func (h *testEthHandler) Handle(peer *eth.Peer, packet eth.Packet) err...
  function TestForkIDSplit64 (line 83) | func TestForkIDSplit64(t *testing.T) { testForkIDSplit(t, 64) }
  function TestForkIDSplit65 (line 84) | func TestForkIDSplit65(t *testing.T) { testForkIDSplit(t, 65) }
  function testForkIDSplit (line 86) | func testForkIDSplit(t *testing.T, protocol uint) {
  function TestRecvTransactions64 (line 239) | func TestRecvTransactions64(t *testing.T) { testRecvTransactions(t, 64) }
  function TestRecvTransactions65 (line 240) | func TestRecvTransactions65(t *testing.T) { testRecvTransactions(t, 65) }
  function testRecvTransactions (line 242) | func testRecvTransactions(t *testing.T, protocol uint) {
  function TestSendTransactions64 (line 297) | func TestSendTransactions64(t *testing.T) { testSendTransactions(t, 64) }
  function TestSendTransactions65 (line 298) | func TestSendTransactions65(t *testing.T) { testSendTransactions(t, 65) }
  function testSendTransactions (line 300) | func testSendTransactions(t *testing.T, protocol uint) {
  function TestTransactionPropagation64 (line 395) | func TestTransactionPropagation64(t *testing.T) { testTransactionPropaga...
  function TestTransactionPropagation65 (line 396) | func TestTransactionPropagation65(t *testing.T) { testTransactionPropaga...
  function testTransactionPropagation (line 398) | func testTransactionPropagation(t *testing.T, protocol uint) {
  function TestCheckpointChallenge (line 468) | func TestCheckpointChallenge(t *testing.T) {
  function testCheckpointChallenge (line 504) | func testCheckpointChallenge(t *testing.T, syncmode downloader.SyncMode,...
  function TestBroadcastBlock1Peer (line 588) | func TestBroadcastBlock1Peer(t *testing.T)    { testBroadcastBlock(t, 1,...
  function TestBroadcastBlock2Peers (line 589) | func TestBroadcastBlock2Peers(t *testing.T)   { testBroadcastBlock(t, 2,...
  function TestBroadcastBlock3Peers (line 590) | func TestBroadcastBlock3Peers(t *testing.T)   { testBroadcastBlock(t, 3,...
  function TestBroadcastBlock4Peers (line 591) | func TestBroadcastBlock4Peers(t *testing.T)   { testBroadcastBlock(t, 4,...
  function TestBroadcastBlock5Peers (line 592) | func TestBroadcastBlock5Peers(t *testing.T)   { testBroadcastBlock(t, 5,...
  function TestBroadcastBlock8Peers (line 593) | func TestBroadcastBlock8Peers(t *testing.T)   { testBroadcastBlock(t, 9,...
  function TestBroadcastBlock12Peers (line 594) | func TestBroadcastBlock12Peers(t *testing.T)  { testBroadcastBlock(t, 12...
  function TestBroadcastBlock16Peers (line 595) | func TestBroadcastBlock16Peers(t *testing.T)  { testBroadcastBlock(t, 16...
  function TestBroadcastBloc26Peers (line 596) | func TestBroadcastBloc26Peers(t *testing.T)   { testBroadcastBlock(t, 26...
  function TestBroadcastBlock100Peers (line 597) | func TestBroadcastBlock100Peers(t *testing.T) { testBroadcastBlock(t, 10...
  function testBroadcastBlock (line 599) | func testBroadcastBlock(t *testing.T, peers, bcasts int) {
  function TestBroadcastMalformedBlock64 (line 675) | func TestBroadcastMalformedBlock64(t *testing.T) { testBroadcastMalforme...
  function TestBroadcastMalformedBlock65 (line 676) | func TestBroadcastMalformedBlock65(t *testing.T) { testBroadcastMalforme...
  function testBroadcastMalformedBlock (line 678) | func testBroadcastMalformedBlock(t *testing.T, protocol uint) {

FILE: eth/handler_snap.go
  type snapHandler (line 27) | type snapHandler
    method Chain (line 29) | func (h *snapHandler) Chain() *core.BlockChain { return h.chain }
    method RunPeer (line 32) | func (h *snapHandler) RunPeer(peer *snap.Peer, hand snap.Handler) error {
    method PeerInfo (line 37) | func (h *snapHandler) PeerInfo(id enode.ID) interface{} {
    method Handle (line 48) | func (h *snapHandler) Handle(peer *snap.Peer, packet snap.Packet) error {

FILE: eth/handler_test.go
  type testTxPool (line 48) | type testTxPool struct
    method Has (line 64) | func (p *testTxPool) Has(hash common.Hash) bool {
    method Get (line 73) | func (p *testTxPool) Get(hash common.Hash) *types.Transaction {
    method AddRemotes (line 82) | func (p *testTxPool) AddRemotes(txs []*types.Transaction) []error {
    method Pending (line 94) | func (p *testTxPool) Pending() (map[common.Address]types.Transactions,...
    method SubscribeNewTxsEvent (line 111) | func (p *testTxPool) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) ...
  function newTestTxPool (line 56) | func newTestTxPool() *testTxPool {
  type testHandler (line 118) | type testHandler struct
    method close (line 167) | func (b *testHandler) close() {
  function newTestHandler (line 126) | func newTestHandler() *testHandler {
  function newTestHandlerWithBlocks (line 132) | func newTestHandlerWithBlocks(blocks int) *testHandler {

FILE: eth/peer.go
  type ethPeerInfo (line 30) | type ethPeerInfo struct
  type ethPeer (line 37) | type ethPeer struct
    method info (line 47) | func (p *ethPeer) info() *ethPeerInfo {
  type snapPeerInfo (line 59) | type snapPeerInfo struct
  type snapPeer (line 64) | type snapPeer struct
    method info (line 69) | func (p *snapPeer) info() *snapPeerInfo {

FILE: eth/peerset.go
  type peerSet (line 50) | type peerSet struct
    method registerSnapExtension (line 73) | func (ps *peerSet) registerSnapExtension(peer *snap.Peer) error {
    method waitSnapExtension (line 102) | func (ps *peerSet) waitSnapExtension(peer *eth.Peer) (*snap.Peer, erro...
    method registerPeer (line 136) | func (ps *peerSet) registerPeer(peer *eth.Peer, ext *snap.Peer) error {
    method unregisterPeer (line 161) | func (ps *peerSet) unregisterPeer(id string) error {
    method peer (line 177) | func (ps *peerSet) peer(id string) *ethPeer {
    method peersWithoutBlock (line 186) | func (ps *peerSet) peersWithoutBlock(hash common.Hash) []*ethPeer {
    method peersWithoutTransaction (line 201) | func (ps *peerSet) peersWithoutTransaction(hash common.Hash) []*ethPeer {
    method len (line 217) | func (ps *peerSet) len() int {
    method snapLen (line 225) | func (ps *peerSet) snapLen() int {
    method peerWithHighestTD (line 234) | func (ps *peerSet) peerWithHighestTD() *eth.Peer {
    method close (line 251) | func (ps *peerSet) close() {
  function newPeerSet (line 62) | func newPeerSet() *peerSet {

FILE: eth/protocols/eth/broadcast.go
  constant maxTxPacketSize (line 29) | maxTxPacketSize = 100 * 1024
  type blockPropagation (line 34) | type blockPropagation struct
  method broadcastBlocks (line 42) | func (p *Peer) broadcastBlocks() {
  method broadcastTransactions (line 66) | func (p *Peer) broadcastTransactions() {
  method announceTransactions (line 133) | func (p *Peer) announceTransactions() {

FILE: eth/protocols/eth/discovery.go
  type enrEntry (line 27) | type enrEntry struct
    method ENRKey (line 35) | func (e enrEntry) ENRKey() string {
  function StartENRUpdater (line 41) | func StartENRUpdater(chain *core.BlockChain, ln *enode.LocalNode) {
  function currentENREntry (line 61) | func currentENREntry(chain *core.BlockChain) *enrEntry {

FILE: eth/protocols/eth/handler.go
  constant softResponseLimit (line 37) | softResponseLimit = 2 * 1024 * 1024
  constant estHeaderSize (line 40) | estHeaderSize = 500
  constant maxHeadersServe (line 44) | maxHeadersServe = 1024
  constant maxBodiesServe (line 49) | maxBodiesServe = 1024
  constant maxNodeDataServe (line 53) | maxNodeDataServe = 1024
  constant maxReceiptsServe (line 59) | maxReceiptsServe = 1024
  type Handler (line 64) | type Handler
  type Backend (line 68) | type Backend interface
  type TxPool (line 98) | type TxPool interface
  function MakeProtocols (line 104) | func MakeProtocols(backend Backend, network uint64, dnsdisc enode.Iterat...
  type NodeInfo (line 136) | type NodeInfo struct
  function nodeInfo (line 145) | func nodeInfo(chain *core.BlockChain, network uint64) *NodeInfo {
  function Handle (line 159) | func Handle(backend Backend, peer *Peer) error {
  type msgHandler (line 168) | type msgHandler
  type Decoder (line 169) | type Decoder interface
  function handleMessage (line 228) | func handleMessage(backend Backend, peer *Peer) error {

FILE: eth/protocols/eth/handler_test.go
  type testBackend (line 51) | type testBackend struct
    method close (line 89) | func (b *testBackend) close() {
    method Chain (line 94) | func (b *testBackend) Chain() *core.BlockChain     { return b.chain }
    method StateBloom (line 95) | func (b *testBackend) StateBloom() *trie.SyncBloom { return nil }
    method TxPool (line 96) | func (b *testBackend) TxPool() TxPool              { return b.txpool }
    method RunPeer (line 98) | func (b *testBackend) RunPeer(peer *Peer, handler Handler) error {
    method PeerInfo (line 103) | func (b *testBackend) PeerInfo(enode.ID) interface{} { panic("not impl...
    method AcceptTxs (line 105) | func (b *testBackend) AcceptTxs() bool {
    method Handle (line 108) | func (b *testBackend) Handle(*Peer, Packet) error {
  function newTestBackend (line 58) | func newTestBackend(blocks int) *testBackend {
  function newTestBackendWithGenerator (line 64) | func newTestBackendWithGenerator(blocks int, generator func(int, *core.B...
  function TestGetBlockHeaders64 (line 113) | func TestGetBlockHeaders64(t *testing.T) { testGetBlockHeaders(t, 64) }
  function TestGetBlockHeaders65 (line 114) | func TestGetBlockHeaders65(t *testing.T) { testGetBlockHeaders(t, 65) }
  function testGetBlockHeaders (line 116) | func testGetBlockHeaders(t *testing.T, protocol uint) {
  function TestGetBlockBodies64 (line 276) | func TestGetBlockBodies64(t *testing.T) { testGetBlockBodies(t, 64) }
  function TestGetBlockBodies65 (line 277) | func TestGetBlockBodies65(t *testing.T) { testGetBlockBodies(t, 65) }
  function testGetBlockBodies (line 279) | func testGetBlockBodies(t *testing.T, protocol uint) {
  function TestGetNodeData64 (line 354) | func TestGetNodeData64(t *testing.T) { testGetNodeData(t, 64) }
  function TestGetNodeData65 (line 355) | func TestGetNodeData65(t *testing.T) { testGetNodeData(t, 65) }
  function testGetNodeData (line 357) | func testGetNodeData(t *testing.T, protocol uint) {
  function TestGetBlockReceipts64 (line 455) | func TestGetBlockReceipts64(t *testing.T) { testGetBlockReceipts(t, 64) }
  function TestGetBlockReceipts65 (line 456) | func TestGetBlockReceipts65(t *testing.T) { testGetBlockReceipts(t, 65) }
  function testGetBlockReceipts (line 458) | func testGetBlockReceipts(t *testing.T, protocol uint) {

FILE: eth/protocols/eth/handlers.go
  function handleGetBlockHeaders (line 31) | func handleGetBlockHeaders(backend Backend, msg Decoder, peer *Peer) err...
  function handleGetBlockHeaders66 (line 42) | func handleGetBlockHeaders66(backend Backend, msg Decoder, peer *Peer) e...
  function answerGetBlockHeadersQuery (line 52) | func answerGetBlockHeadersQuery(backend Backend, query *GetBlockHeadersP...
  function handleGetBlockBodies (line 138) | func handleGetBlockBodies(backend Backend, msg Decoder, peer *Peer) error {
  function handleGetBlockBodies66 (line 148) | func handleGetBlockBodies66(backend Backend, msg Decoder, peer *Peer) er...
  function answerGetBlockBodiesQuery (line 158) | func answerGetBlockBodiesQuery(backend Backend, query GetBlockBodiesPack...
  function handleGetNodeData (line 177) | func handleGetNodeData(backend Backend, msg Decoder, peer *Peer) error {
  function handleGetNodeData66 (line 187) | func handleGetNodeData66(backend Backend, msg Decoder, peer *Peer) error {
  function answerGetNodeDataQuery (line 197) | func answerGetNodeDataQuery(backend Backend, query GetNodeDataPacket, pe...
  function handleGetReceipts (line 226) | func handleGetReceipts(backend Backend, msg Decoder, peer *Peer) error {
  function handleGetReceipts66 (line 236) | func handleGetReceipts66(backend Backend, msg Decoder, peer *Peer) error {
  function answerGetReceiptsQuery (line 246) | func answerGetReceiptsQuery(backend Backend, query GetReceiptsPacket, pe...
  function handleNewBlockhashes (line 275) | func handleNewBlockhashes(backend Backend, msg Decoder, peer *Peer) error {
  function handleNewBlock (line 289) | func handleNewBlock(backend Backend, msg Decoder, peer *Peer) error {
  function handleBlockHeaders (line 315) | func handleBlockHeaders(backend Backend, msg Decoder, peer *Peer) error {
  function handleBlockHeaders66 (line 324) | func handleBlockHeaders66(backend Backend, msg Decoder, peer *Peer) error {
  function handleBlockBodies (line 333) | func handleBlockBodies(backend Backend, msg Decoder, peer *Peer) error {
  function handleBlockBodies66 (line 342) | func handleBlockBodies66(backend Backend, msg Decoder, peer *Peer) error {
  function handleNodeData (line 351) | func handleNodeData(backend Backend, msg Decoder, peer *Peer) error {
  function handleNodeData66 (line 360) | func handleNodeData66(backend Backend, msg Decoder, peer *Peer) error {
  function handleReceipts (line 369) | func handleReceipts(backend Backend, msg Decoder, peer *Peer) error {
  function handleReceipts66 (line 378) | func handleReceipts66(backend Backend, msg Decoder, peer *Peer) error {
  function handleNewPooledTransactionHashes (line 387) | func handleNewPooledTransactionHashes(backend Backend, msg Decoder, peer...
  function handleGetPooledTransactions (line 404) | func handleGetPooledTransactions(backend Backend, msg Decoder, peer *Pee...
  function handleGetPooledTransactions66 (line 414) | func handleGetPooledTransactions66(backend Backend, msg Decoder, peer *P...
  function answerGetPooledTransactions (line 424) | func answerGetPooledTransactions(backend Backend, query GetPooledTransac...
  function handleTransactions (line 452) | func handleTransactions(backend Backend, msg Decoder, peer *Peer) error {
  function handlePooledTransactions (line 472) | func handlePooledTransactions(backend Backend, msg Decoder, peer *Peer) ...
  function handlePooledTransactions66 (line 492) | func handlePooledTransactions66(backend Backend, msg Decoder, peer *Peer...

FILE: eth/protocols/eth/handshake.go
  constant handshakeTimeout (line 32) | handshakeTimeout = 5 * time.Second
  method Handshake (line 37) | func (p *Peer) Handshake(network uint64, td *big.Int, head common.Hash, ...
  method readStatus (line 79) | func (p *Peer) readStatus(network uint64, status *StatusPacket, genesis ...

FILE: eth/protocols/eth/handshake_test.go
  function TestHandshake64 (line 30) | func TestHandshake64(t *testing.T) { testHandshake(t, 64) }
  function TestHandshake65 (line 31) | func TestHandshake65(t *testing.T) { testHandshake(t, 65) }
  function testHandshake (line 33) | func testHandshake(t *testing.T, protocol uint) {

FILE: eth/protocols/eth/peer.go
  constant maxKnownTxs (line 34) | maxKnownTxs = 32768
  constant maxKnownBlocks (line 38) | maxKnownBlocks = 1024
  constant maxQueuedTxs (line 42) | maxQueuedTxs = 4096
  constant maxQueuedTxAnns (line 46) | maxQueuedTxAnns = 4096
  constant maxQueuedBlocks (line 51) | maxQueuedBlocks = 4
  constant maxQueuedBlockAnns (line 56) | maxQueuedBlockAnns = 4
  function max (line 60) | func max(a, b int) int {
  type Peer (line 68) | type Peer struct
    method Close (line 120) | func (p *Peer) Close() {
    method ID (line 125) | func (p *Peer) ID() string {
    method Version (line 130) | func (p *Peer) Version() uint {
    method Head (line 135) | func (p *Peer) Head() (hash common.Hash, td *big.Int) {
    method SetHead (line 144) | func (p *Peer) SetHead(hash common.Hash, td *big.Int) {
    method KnownBlock (line 153) | func (p *Peer) KnownBlock(hash common.Hash) bool {
    method KnownTransaction (line 158) | func (p *Peer) KnownTransaction(hash common.Hash) bool {
    method markBlock (line 164) | func (p *Peer) markBlock(hash common.Hash) {
    method markTransaction (line 174) | func (p *Peer) markTransaction(hash common.Hash) {
    method SendTransactions (line 191) | func (p *Peer) SendTransactions(txs types.Transactions) error {
    method AsyncSendTransactions (line 205) | func (p *Peer) AsyncSendTransactions(hashes []common.Hash) {
    method sendPooledTransactionHashes (line 226) | func (p *Peer) sendPooledTransactionHashes(hashes []common.Hash) error {
    method AsyncSendPooledTransactionHashes (line 240) | func (p *Peer) AsyncSendPooledTransactionHashes(hashes []common.Hash) {
    method SendPooledTransactionsRLP (line 260) | func (p *Peer) SendPooledTransactionsRLP(hashes []common.Hash, txs []r...
    method ReplyPooledTransactionsRLP (line 272) | func (p *Peer) ReplyPooledTransactionsRLP(id uint64, hashes []common.H...
    method SendNewBlockHashes (line 289) | func (p *Peer) SendNewBlockHashes(hashes []common.Hash, numbers []uint...
    method AsyncSendNewBlockHash (line 308) | func (p *Peer) AsyncSendNewBlockHash(block *types.Block) {
    method SendNewBlock (line 322) | func (p *Peer) SendNewBlock(block *types.Block, td *big.Int) error {
    method AsyncSendNewBlock (line 336) | func (p *Peer) AsyncSendNewBlock(block *types.Block, td *big.Int) {
    method SendBlockHeaders (line 350) | func (p *Peer) SendBlockHeaders(headers []*types.Header) error {
    method ReplyBlockHeaders (line 355) | func (p *Peer) ReplyBlockHeaders(id uint64, headers []*types.Header) e...
    method SendBlockBodiesRLP (line 364) | func (p *Peer) SendBlockBodiesRLP(bodies []rlp.RawValue) error {
    method ReplyBlockBodiesRLP (line 369) | func (p *Peer) ReplyBlockBodiesRLP(id uint64, bodies []rlp.RawValue) e...
    method SendNodeData (line 379) | func (p *Peer) SendNodeData(data [][]byte) error {
    method ReplyNodeData (line 384) | func (p *Peer) ReplyNodeData(id uint64, data [][]byte) error {
    method SendReceiptsRLP (line 393) | func (p *Peer) SendReceiptsRLP(receipts []rlp.RawValue) error {
    method ReplyReceiptsRLP (line 398) | func (p *Peer) ReplyReceiptsRLP(id uint64, receipts []rlp.RawValue) er...
    method RequestOneHeader (line 407) | func (p *Peer) RequestOneHeader(hash common.Hash) error {
    method RequestHeadersByHash (line 426) | func (p *Peer) RequestHeadersByHash(origin common.Hash, amount int, sk...
    method RequestHeadersByNumber (line 445) | func (p *Peer) RequestHeadersByNumber(origin uint64, amount int, skip ...
    method ExpectRequestHeadersByNumber (line 464) | func (p *Peer) ExpectRequestHeadersByNumber(origin uint64, amount int,...
    method RequestBodies (line 476) | func (p *Peer) RequestBodies(hashes []common.Hash) error {
    method RequestNodeData (line 489) | func (p *Peer) RequestNodeData(hashes []common.Hash) error {
    method RequestReceipts (line 501) | func (p *Peer) RequestReceipts(hashes []common.Hash) error {
    method RequestTxs (line 513) | func (p *Peer) RequestTxs(hashes []common.Hash) error {
  function NewPeer (line 93) | func NewPeer(version uint, p *p2p.Peer, rw p2p.MsgReadWriter, txpool TxP...

FILE: eth/protocols/eth/peer_test.go
  type testPeer (line 30) | type testPeer struct
    method close (line 58) | func (p *testPeer) close() {
  function newTestPeer (line 38) | func newTestPeer(name string, version uint, backend Backend) (*testPeer,...

FILE: eth/protocols/eth/protocol.go
  constant ETH64 (line 33) | ETH64 = 64
  constant ETH65 (line 34) | ETH65 = 65
  constant ETH66 (line 35) | ETH66 = 66
  constant ProtocolName (line 40) | ProtocolName = "eth"
  constant maxMessageSize (line 51) | maxMessageSize = 10 * 1024 * 1024
  constant StatusMsg (line 55) | StatusMsg          = 0x00
  constant NewBlockHashesMsg (line 56) | NewBlockHashesMsg  = 0x01
  constant TransactionsMsg (line 57) | TransactionsMsg    = 0x02
  constant GetBlockHeadersMsg (line 58) | GetBlockHeadersMsg = 0x03
  constant BlockHeadersMsg (line 59) | BlockHeadersMsg    = 0x04
  constant GetBlockBodiesMsg (line 60) | GetBlockBodiesMsg  = 0x05
  constant BlockBodiesMsg (line 61) | BlockBodiesMsg     = 0x06
  constant NewBlockMsg (line 62) | NewBlockMsg        = 0x07
  constant GetNodeDataMsg (line 63) | GetNodeDataMsg     = 0x0d
  constant NodeDataMsg (line 64) | NodeDataMsg        = 0x0e
  constant GetReceiptsMsg (line 65) | GetReceiptsMsg     = 0x0f
  constant ReceiptsMsg (line 66) | ReceiptsMsg        = 0x10
  constant NewPooledTransactionHashesMsg (line 69) | NewPooledTransactionHashesMsg = 0x08
  constant GetPooledTransactionsMsg (line 70) | GetPooledTransactionsMsg      = 0x09
  constant PooledTransactionsMsg (line 71) | PooledTransactionsMsg         = 0x0a
  type Packet (line 86) | type Packet interface
  type StatusPacket (line 92) | type StatusPacket struct
    method Name (line 325) | func (*StatusPacket) Name() string { return "Status" }
    method Kind (line 326) | func (*StatusPacket) Kind() byte   { return StatusMsg }
  type NewBlockHashesPacket (line 102) | type NewBlockHashesPacket
    method Unpack (line 110) | func (p *NewBlockHashesPacket) Unpack() ([]common.Hash, []uint64) {
    method Name (line 328) | func (*NewBlockHashesPacket) Name() string { return "NewBlockHashes" }
    method Kind (line 329) | func (*NewBlockHashesPacket) Kind() byte   { return NewBlockHashesMsg }
  type TransactionsPacket (line 122) | type TransactionsPacket
    method Name (line 331) | func (*TransactionsPacket) Name() string { return "Transactions" }
    method Kind (line 332) | func (*TransactionsPacket) Kind() byte   { return TransactionsMsg }
  type GetBlockHeadersPacket (line 125) | type GetBlockHeadersPacket struct
    method Name (line 334) | func (*GetBlockHeadersPacket) Name() string { return "GetBlockHeaders" }
    method Kind (line 335) | func (*GetBlockHeadersPacket) Kind() byte   { return GetBlockHeadersMsg }
  type GetBlockHeadersPacket66 (line 133) | type GetBlockHeadersPacket66 struct
  type HashOrNumber (line 139) | type HashOrNumber struct
    method EncodeRLP (line 146) | func (hn *HashOrNumber) EncodeRLP(w io.Writer) error {
    method DecodeRLP (line 158) | func (hn *HashOrNumber) DecodeRLP(s *rlp.Stream) error {
  type BlockHeadersPacket (line 175) | type BlockHeadersPacket
    method Name (line 337) | func (*BlockHeadersPacket) Name() string { return "BlockHeaders" }
    method Kind (line 338) | func (*BlockHeadersPacket) Kind() byte   { return BlockHeadersMsg }
  type BlockHeadersPacket66 (line 178) | type BlockHeadersPacket66 struct
  type NewBlockPacket (line 184) | type NewBlockPacket struct
    method sanityCheck (line 190) | func (request *NewBlockPacket) sanityCheck() error {
    method Name (line 346) | func (*NewBlockPacket) Name() string { return "NewBlock" }
    method Kind (line 347) | func (*NewBlockPacket) Kind() byte   { return NewBlockMsg }
  type GetBlockBodiesPacket (line 203) | type GetBlockBodiesPacket
    method Name (line 340) | func (*GetBlockBodiesPacket) Name() string { return "GetBlockBodies" }
    method Kind (line 341) | func (*GetBlockBodiesPacket) Kind() byte   { return GetBlockBodiesMsg }
  type GetBlockBodiesPacket66 (line 206) | type GetBlockBodiesPacket66 struct
  type BlockBodiesPacket (line 212) | type BlockBodiesPacket
    method Unpack (line 239) | func (p *BlockBodiesPacket) Unpack() ([][]*types.Transaction, [][]*typ...
    method Name (line 343) | func (*BlockBodiesPacket) Name() string { return "BlockBodies" }
    method Kind (line 344) | func (*BlockBodiesPacket) Kind() byte   { return BlockBodiesMsg }
  type BlockBodiesPacket66 (line 215) | type BlockBodiesPacket66 struct
  type BlockBodiesRLPPacket (line 223) | type BlockBodiesRLPPacket
  type BlockBodiesRLPPacket66 (line 226) | type BlockBodiesRLPPacket66 struct
  type BlockBody (line 232) | type BlockBody struct
  type GetNodeDataPacket (line 251) | type GetNodeDataPacket
    method Name (line 349) | func (*GetNodeDataPacket) Name() string { return "GetNodeData" }
    method Kind (line 350) | func (*GetNodeDataPacket) Kind() byte   { return GetNodeDataMsg }
  type GetNodeDataPacket66 (line 254) | type GetNodeDataPacket66 struct
  type NodeDataPacket (line 260) | type NodeDataPacket
    method Name (line 352) | func (*NodeDataPacket) Name() string { return "NodeData" }
    method Kind (line 353) | func (*NodeDataPacket) Kind() byte   { return NodeDataMsg }
  type NodeDataPacket66 (line 263) | type NodeDataPacket66 struct
  type GetReceiptsPacket (line 269) | type GetReceiptsPacket
    method Name (line 355) | func (*GetReceiptsPacket) Name() string { return "GetReceipts" }
    method Kind (line 356) | func (*GetReceiptsPacket) Kind() byte   { return GetReceiptsMsg }
  type GetReceiptsPacket66 (line 272) | type GetReceiptsPacket66 struct
  type ReceiptsPacket (line 278) | type ReceiptsPacket
    method Name (line 358) | func (*ReceiptsPacket) Name() string { return "Receipts" }
    method Kind (line 359) | func (*ReceiptsPacket) Kind() byte   { return ReceiptsMsg }
  type ReceiptsPacket66 (line 281) | type ReceiptsPacket66 struct
  type ReceiptsRLPPacket (line 287) | type ReceiptsRLPPacket
  type ReceiptsRLPPacket66 (line 290) | type ReceiptsRLPPacket66 struct
  type NewPooledTransactionHashesPacket (line 296) | type NewPooledTransactionHashesPacket
    method Name (line 361) | func (*NewPooledTransactionHashesPacket) Name() string { return "NewPo...
    method Kind (line 362) | func (*NewPooledTransactionHashesPacket) Kind() byte   { return NewPoo...
  type GetPooledTransactionsPacket (line 299) | type GetPooledTransactionsPacket
    method Name (line 364) | func (*GetPooledTransactionsPacket) Name() string { return "GetPooledT...
    method Kind (line 365) | func (*GetPooledTransactionsPacket) Kind() byte   { return GetPooledTr...
  type GetPooledTransactionsPacket66 (line 301) | type GetPooledTransactionsPacket66 struct
  type PooledTransactionsPacket (line 307) | type PooledTransactionsPacket
    method Name (line 367) | func (*PooledTransactionsPacket) Name() string { return "PooledTransac...
    method Kind (line 368) | func (*PooledTransactionsPacket) Kind() byte   { return PooledTransact...
  type PooledTransactionsPacket66 (line 310) | type PooledTransactionsPacket66 struct
  type PooledTransactionsRLPPacket (line 317) | type PooledTransactionsRLPPacket
  type PooledTransactionsRLPPacket66 (line 320) | type PooledTransactionsRLPPacket66 struct

FILE: eth/protocols/eth/protocol_test.go
  function TestGetBlockHeadersDataEncodeDecode (line 30) | func TestGetBlockHeadersDataEncodeDecode(t *testing.T) {
  function TestEth66EmptyMessages (line 74) | func TestEth66EmptyMessages(t *testing.T) {
  function TestEth66Messages (line 122) | func TestEth66Messages(t *testing.T) {

FILE: eth/protocols/snap/discovery.go
  type enrEntry (line 24) | type enrEntry struct
    method ENRKey (line 30) | func (e enrEntry) ENRKey() string {

FILE: eth/protocols/snap/handler.go
  constant softResponseLimit (line 39) | softResponseLimit = 2 * 1024 * 1024
  constant maxCodeLookups (line 43) | maxCodeLookups = 1024
  constant stateLookupSlack (line 48) | stateLookupSlack = 0.1
  constant maxTrieNodeLookups (line 52) | maxTrieNodeLookups = 1024
  constant maxTrieNodeTimeSpent (line 57) | maxTrieNodeTimeSpent = 5 * time.Second
  type Handler (line 62) | type Handler
  type Backend (line 66) | type Backend interface
  function MakeProtocols (line 86) | func MakeProtocols(backend Backend, dnsdisc enode.Iterator) []p2p.Protoc...
  function handle (line 115) | func handle(backend Backend, peer *Peer) error {
  function handleMessage (line 127) | func handleMessage(backend Backend, peer *Peer) error {
  type NodeInfo (line 509) | type NodeInfo struct
  function nodeInfo (line 512) | func nodeInfo(chain *core.BlockChain) *NodeInfo {

FILE: eth/protocols/snap/peer.go
  type Peer (line 26) | type Peer struct
    method ID (line 50) | func (p *Peer) ID() string {
    method Version (line 55) | func (p *Peer) Version() uint {
    method Log (line 60) | func (p *Peer) Log() log.Logger {
    method RequestAccountRange (line 66) | func (p *Peer) RequestAccountRange(id uint64, root common.Hash, origin...
    method RequestStorageRanges (line 80) | func (p *Peer) RequestStorageRanges(id uint64, root common.Hash, accou...
    method RequestByteCodes (line 97) | func (p *Peer) RequestByteCodes(id uint64, hashes []common.Hash, bytes...
    method RequestTrieNodes (line 108) | func (p *Peer) RequestTrieNodes(id uint64, root common.Hash, paths []T...
  function newPeer (line 38) | func newPeer(version uint, p *p2p.Peer, rw p2p.MsgReadWriter) *Peer {

FILE: eth/protocols/snap/protocol.go
  constant snap1 (line 30) | snap1 = 1
  constant ProtocolName (line 35) | ProtocolName = "snap"
  constant maxMessageSize (line 46) | maxMessageSize = 10 * 1024 * 1024
  constant GetAccountRangeMsg (line 49) | GetAccountRangeMsg  = 0x00
  constant AccountRangeMsg (line 50) | AccountRangeMsg     = 0x01
  constant GetStorageRangesMsg (line 51) | GetStorageRangesMsg = 0x02
  constant StorageRangesMsg (line 52) | StorageRangesMsg    = 0x03
  constant GetByteCodesMsg (line 53) | GetByteCodesMsg     = 0x04
  constant ByteCodesMsg (line 54) | ByteCodesMsg        = 0x05
  constant GetTrieNodesMsg (line 55) | GetTrieNodesMsg     = 0x06
  constant TrieNodesMsg (line 56) | TrieNodesMsg        = 0x07
  type Packet (line 67) | type Packet interface
  type GetAccountRangePacket (line 73) | type GetAccountRangePacket struct
    method Name (line 196) | func (*GetAccountRangePacket) Name() string { return "GetAccountRange" }
    method Kind (line 197) | func (*GetAccountRangePacket) Kind() byte   { return GetAccountRangeMsg }
  type AccountRangePacket (line 82) | type AccountRangePacket struct
    method Unpack (line 101) | func (p *AccountRangePacket) Unpack() ([]common.Hash, [][]byte, error) {
    method Name (line 199) | func (*AccountRangePacket) Name() string { return "AccountRange" }
    method Kind (line 200) | func (*AccountRangePacket) Kind() byte   { return AccountRangeMsg }
  type AccountData (line 89) | type AccountData struct
  type GetStorageRangesPacket (line 117) | type GetStorageRangesPacket struct
    method Name (line 202) | func (*GetStorageRangesPacket) Name() string { return "GetStorageRange...
    method Kind (line 203) | func (*GetStorageRangesPacket) Kind() byte   { return GetStorageRanges...
  type StorageRangesPacket (line 127) | type StorageRangesPacket struct
    method Unpack (line 141) | func (p *StorageRangesPacket) Unpack() ([][]common.Hash, [][][]byte) {
    method Name (line 205) | func (*StorageRangesPacket) Name() string { return "StorageRanges" }
    method Kind (line 206) | func (*StorageRangesPacket) Kind() byte   { return StorageRangesMsg }
  type StorageData (line 134) | type StorageData struct
  type GetByteCodesPacket (line 158) | type GetByteCodesPacket struct
    method Name (line 208) | func (*GetByteCodesPacket) Name() string { return "GetByteCodes" }
    method Kind (line 209) | func (*GetByteCodesPacket) Kind() byte   { return GetByteCodesMsg }
  type ByteCodesPacket (line 165) | type ByteCodesPacket struct
    method Name (line 211) | func (*ByteCodesPacket) Name() string { return "ByteCodes" }
    method Kind (line 212) | func (*ByteCodesPacket) Kind() byte   { return ByteCodesMsg }
  type GetTrieNodesPacket (line 171) | type GetTrieNodesPacket struct
    method Name (line 214) | func (*GetTrieNodesPacket) Name() string { return "GetTrieNodes" }
    method Kind (line 215) | func (*GetTrieNodesPacket) Kind() byte   { return GetTrieNodesMsg }
  type TrieNodePathSet (line 188) | type TrieNodePathSet
  type TrieNodesPacket (line 191) | type TrieNodesPacket struct
    method Name (line 217) | func (*TrieNodesPacket) Name() string { return "TrieNodes" }
    method Kind (line 218) | func (*TrieNodesPacket) Kind() byte   { return TrieNodesMsg }

FILE: eth/protocols/snap/sync.go
  constant maxRequestSize (line 52) | maxRequestSize = 512 * 1024
  constant maxStorageSetRequestCount (line 58) | maxStorageSetRequestCount = maxRequestSize / 1024
  constant maxCodeRequestCount (line 68) | maxCodeRequestCount = maxRequestSize / (24 * 1024) * 4
  constant maxTrieRequestCount (line 74) | maxTrieRequestCount = 512
  constant accountConcurrency (line 78) | accountConcurrency = 16
  constant storageConcurrency (line 82) | storageConcurrency = 16
  type accountRequest (line 104) | type accountRequest struct
  type accountResponse (line 121) | type accountResponse struct
  type bytecodeRequest (line 145) | type bytecodeRequest struct
  type bytecodeResponse (line 158) | type bytecodeResponse struct
  type storageRequest (line 174) | type storageRequest struct
  type storageResponse (line 195) | type storageResponse struct
  type trienodeHealRequest (line 222) | type trienodeHealRequest struct
  type trienodeHealResponse (line 237) | type trienodeHealResponse struct
  type bytecodeHealRequest (line 254) | type bytecodeHealRequest struct
  type bytecodeHealResponse (line 267) | type bytecodeHealResponse struct
  type accountTask (line 275) | type accountTask struct
  type storageTask (line 297) | type storageTask struct
  type healTask (line 308) | type healTask struct
  type syncProgress (line 318) | type syncProgress struct
  type SyncPeer (line 343) | type SyncPeer interface
  type Syncer (line 378) | type Syncer struct
    method Register (line 484) | func (s *Syncer) Register(peer SyncPeer) error {
    method Unregister (line 511) | func (s *Syncer) Unregister(id string) error {
    method Sync (line 541) | func (s *Syncer) Sync(root common.Hash, cancel chan struct{}) error {
    method loadSyncStatus (line 651) | func (s *Syncer) loadSyncStatus() {
    method saveSyncStatus (line 712) | func (s *Syncer) saveSyncStatus() {
    method cleanAccountTasks (line 735) | func (s *Syncer) cleanAccountTasks() {
    method cleanStorageTasks (line 751) | func (s *Syncer) cleanStorageTasks() {
    method assignAccountTasks (line 784) | func (s *Syncer) assignAccountTasks(cancel chan struct{}) {
    method assignBytecodeTasks (line 862) | func (s *Syncer) assignBytecodeTasks(cancel chan struct{}) {
    method assignStorageTasks (line 949) | func (s *Syncer) assignStorageTasks(cancel chan struct{}) {
    method assignTrienodeHealTasks (line 1084) | func (s *Syncer) assignTrienodeHealTasks(cancel chan struct{}) {
    method assignBytecodeHealTasks (line 1192) | func (s *Syncer) assignBytecodeHealTasks(cancel chan struct{}) {
    method revertRequests (line 1292) | func (s *Syncer) revertRequests(peer string) {
    method scheduleRevertAccountRequest (line 1347) | func (s *Syncer) scheduleRevertAccountRequest(req *accountRequest) {
    method revertAccountRequest (line 1363) | func (s *Syncer) revertAccountRequest(req *accountRequest) {
    method scheduleRevertBytecodeRequest (line 1388) | func (s *Syncer) scheduleRevertBytecodeRequest(req *bytecodeRequest) {
    method revertBytecodeRequest (line 1404) | func (s *Syncer) revertBytecodeRequest(req *bytecodeRequest) {
    method scheduleRevertStorageRequest (line 1429) | func (s *Syncer) scheduleRevertStorageRequest(req *storageRequest) {
    method revertStorageRequest (line 1445) | func (s *Syncer) revertStorageRequest(req *storageRequest) {
    method scheduleRevertTrienodeHealRequest (line 1474) | func (s *Syncer) scheduleRevertTrienodeHealRequest(req *trienodeHealRe...
    method revertTrienodeHealRequest (line 1490) | func (s *Syncer) revertTrienodeHealRequest(req *trienodeHealRequest) {
    method scheduleRevertBytecodeHealRequest (line 1515) | func (s *Syncer) scheduleRevertBytecodeHealRequest(req *bytecodeHealRe...
    method revertBytecodeHealRequest (line 1531) | func (s *Syncer) revertBytecodeHealRequest(req *bytecodeHealRequest) {
    method processAccountResponse (line 1556) | func (s *Syncer) processAccountResponse(res *accountResponse) {
    method processBytecodeResponse (line 1648) | func (s *Syncer) processBytecodeResponse(res *bytecodeResponse) {
    method processStorageResponse (line 1696) | func (s *Syncer) processStorageResponse(res *storageResponse) {
    method processTrienodeHealResponse (line 1850) | func (s *Syncer) processTrienodeHealResponse(res *trienodeHealResponse) {
    method processBytecodeHealResponse (line 1886) | func (s *Syncer) processBytecodeHealResponse(res *bytecodeHealResponse) {
    method forwardAccountTask (line 1923) | func (s *Syncer) forwardAccountTask(task *accountTask) {
    method OnAccounts (line 2008) | func (s *Syncer) OnAccounts(peer SyncPeer, id uint64, hashes []common....
    method OnByteCodes (line 2123) | func (s *Syncer) OnByteCodes(peer SyncPeer, id uint64, bytecodes [][]b...
    method onByteCodes (line 2136) | func (s *Syncer) onByteCodes(peer SyncPeer, id uint64, bytecodes [][]b...
    method OnStorage (line 2229) | func (s *Syncer) OnStorage(peer SyncPeer, id uint64, hashes [][]common...
    method OnTrieNodes (line 2387) | func (s *Syncer) OnTrieNodes(peer SyncPeer, id uint64, trienodes [][]b...
    method onHealByteCodes (line 2481) | func (s *Syncer) onHealByteCodes(peer SyncPeer, id uint64, bytecodes [...
    method report (line 2576) | func (s *Syncer) report(force bool) {
    method reportSyncProgress (line 2585) | func (s *Syncer) reportSyncProgress(force bool) {
    method reportHealProgress (line 2624) | func (s *Syncer) reportHealProgress(force bool) {
  function NewSyncer (line 448) | func NewSyncer(db ethdb.KeyValueStore) *Syncer {

FILE: eth/protocols/snap/sync_test.go
  function TestHashing (line 42) | func TestHashing(t *testing.T) {
  function BenchmarkHashing (line 78) | func BenchmarkHashing(b *testing.B) {
  type accountHandlerFunc (line 117) | type accountHandlerFunc
  type storageHandlerFunc (line 118) | type storageHandlerFunc
  type trieHandlerFunc (line 119) | type trieHandlerFunc
  type codeHandlerFunc (line 120) | type codeHandlerFunc
  type testPeer (line 123) | type testPeer struct
    method ID (line 156) | func (t *testPeer) ID() string      { return t.id }
    method Log (line 157) | func (t *testPeer) Log() log.Logger { return t.logger }
    method RequestAccountRange (line 159) | func (t *testPeer) RequestAccountRange(id uint64, root, origin, limit ...
    method RequestTrieNodes (line 165) | func (t *testPeer) RequestTrieNodes(id uint64, root common.Hash, paths...
    method RequestStorageRanges (line 171) | func (t *testPeer) RequestStorageRanges(id uint64, root common.Hash, a...
    method RequestByteCodes (line 181) | func (t *testPeer) RequestByteCodes(id uint64, hashes []common.Hash, b...
  function newTestPeer (line 140) | func newTestPeer(id string, t *testing.T, term func()) *testPeer {
  function defaultTrieRequestHandler (line 188) | func defaultTrieRequestHandler(t *testPeer, requestId uint64, root commo...
  function defaultAccountRequestHandler (line 217) | func defaultAccountRequestHandler(t *testPeer, id uint64, root common.Ha...
  function createAccountRequestResponse (line 227) | func createAccountRequestResponse(t *testPeer, root common.Hash, origin ...
  function defaultStorageRequestHandler (line 266) | func defaultStorageRequestHandler(t *testPeer, requestId uint64, root co...
  function defaultCodeRequestHandler (line 275) | func defaultCodeRequestHandler(t *testPeer, id uint64, hashes []common.H...
  function createStorageRequestResponse (line 287) | func createStorageRequestResponse(t *testPeer, root common.Hash, account...
  function createStorageRequestResponseAlwaysProve (line 354) | func createStorageRequestResponseAlwaysProve(t *testPeer, root common.Ha...
  function emptyRequestAccountRangeFn (line 412) | func emptyRequestAccountRangeFn(t *testPeer, requestId uint64, root comm...
  function nonResponsiveRequestAccountRangeFn (line 417) | func nonResponsiveRequestAccountRangeFn(t *testPeer, requestId uint64, r...
  function emptyTrieRequestHandler (line 421) | func emptyTrieRequestHandler(t *testPeer, requestId uint64, root common....
  function nonResponsiveTrieRequestHandler (line 426) | func nonResponsiveTrieRequestHandler(t *testPeer, requestId uint64, root...
  function emptyStorageRequestHandler (line 430) | func emptyStorageRequestHandler(t *testPeer, requestId uint64, root comm...
  function nonResponsiveStorageRequestHandler (line 435) | func nonResponsiveStorageRequestHandler(t *testPeer, requestId uint64, r...
  function proofHappyStorageRequestHandler (line 439) | func proofHappyStorageRequestHandler(t *testPeer, requestId uint64, root...
  function corruptCodeRequestHandler (line 454) | func corruptCodeRequestHandler(t *testPeer, id uint64, hashes []common.H...
  function cappedCodeRequestHandler (line 468) | func cappedCodeRequestHandler(t *testPeer, id uint64, hashes []common.Ha...
  function starvingStorageRequestHandler (line 482) | func starvingStorageRequestHandler(t *testPeer, requestId uint64, root c...
  function starvingAccountRequestHandler (line 486) | func starvingAccountRequestHandler(t *testPeer, requestId uint64, root c...
  function corruptAccountRequestHandler (line 494) | func corruptAccountRequestHandler(t *testPeer, requestId uint64, root co...
  function corruptStorageRequestHandler (line 508) | func corruptStorageRequestHandler(t *testPeer, requestId uint64, root co...
  function noProofStorageRequestHandler (line 521) | func noProofStorageRequestHandler(t *testPeer, requestId uint64, root co...
  function TestSyncBloatedProof (line 534) | func TestSyncBloatedProof(t *testing.T) {
  function setupSyncer (line 600) | func setupSyncer(peers ...*testPeer) *Syncer {
  function TestSync (line 611) | func TestSync(t *testing.T) {
  function TestSyncTinyTriePanic (line 640) | func TestSyncTinyTriePanic(t *testing.T) {
  function TestMultiSync (line 670) | func TestMultiSync(t *testing.T) {
  function TestSyncWithStorage (line 700) | func TestSyncWithStorage(t *testing.T) {
  function TestMultiSyncManyUseless (line 732) | func TestMultiSyncManyUseless(t *testing.T) {
  function TestMultiSyncManyUselessWithLowTimeout (line 780) | func TestMultiSyncManyUselessWithLowTimeout(t *testing.T) {
  function TestMultiSyncManyUnresponsive (line 832) | func TestMultiSyncManyUnresponsive(t *testing.T) {
  function checkStall (line 881) | func checkStall(t *testing.T, term func()) chan struct{} {
  function TestSyncBoundaryAccountTrie (line 897) | func TestSyncBoundaryAccountTrie(t *testing.T) {
  function TestSyncNoStorageAndOneCappedPeer (line 931) | func TestSyncNoStorageAndOneCappedPeer(t *testing.T) {
  function TestSyncNoStorageAndOneCodeCorruptPeer (line 972) | func TestSyncNoStorageAndOneCodeCorruptPeer(t *testing.T) {
  function TestSyncNoStorageAndOneAccountCorruptPeer (line 1009) | func TestSyncNoStorageAndOneAccountCorruptPeer(t *testing.T) {
  function TestSyncNoStorageAndOneCodeCappedPeer (line 1048) | func TestSyncNoStorageAndOneCodeCappedPeer(t *testing.T) {
  function TestSyncBoundaryStorageTrie (line 1096) | func TestSyncBoundaryStorageTrie(t *testing.T) {
  function TestSyncWithStorageAndOneCappedPeer (line 1132) | func TestSyncWithStorageAndOneCappedPeer(t *testing.T) {
  function TestSyncWithStorageAndCorruptPeer (line 1173) | func TestSyncWithStorageAndCorruptPeer(t *testing.T) {
  function TestSyncWithStorageAndNonProvingPeer (line 1211) | func TestSyncWithStorageAndNonProvingPeer(t *testing.T) {
  function TestSyncWithStorageMisbehavingProve (line 1252) | func TestSyncWithStorageMisbehavingProve(t *testing.T) {
  type kv (line 1281) | type kv struct
  type entrySlice (line 1286) | type entrySlice
    method Len (line 1288) | func (p entrySlice) Len() int           { return len(p) }
    method Less (line 1289) | func (p entrySlice) Less(i, j int) bool { return bytes.Compare(p[i].k,...
    method Swap (line 1290) | func (p entrySlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
  function key32 (line 1292) | func key32(i uint64) []byte {
  function getCodeHash (line 1312) | func getCodeHash(i uint64) []byte {
  function getCodeByHash (line 1318) | func getCodeByHash(hash common.Hash) []byte {
  function makeAccountTrieNoStorage (line 1331) | func makeAccountTrieNoStorage(n int) (*trie.Trie, entrySlice) {
  function makeBoundaryAccountTrie (line 1355) | func makeBoundaryAccountTrie(n int) (*trie.Trie, entrySlice) {
  function makeAccountTrieWithStorageWithUniqueStorage (line 1410) | func makeAccountTrieWithStorageWithUniqueStorage(accounts, slots int, co...
  function makeAccountTrieWithStorage (line 1449) | func makeAccountTrieWithStorage(accounts, slots int, code, boundary bool...
  function makeStorageTrieWithSeed (line 1498) | func makeStorageTrieWithSeed(n, seed uint64, db *trie.Database) (*trie.T...
  function makeBoundaryStorageTrie (line 1521) | func makeBoundaryStorageTrie(n int, db *trie.Database) (*trie.Trie, entr...
  function verifyTrie (line 1569) | func verifyTrie(db ethdb.KeyValueStore, root common.Hash, t *testing.T) {

FILE: eth/state_accessor.go
  method stateAtBlock (line 36) | func (eth *Ethereum) stateAtBlock(block *types.Block, reexec uint64) (st...
  method statesInRange (line 117) | func (eth *Ethereum) statesInRange(fromBlock, toBlock *types.Block, reex...
  method stateAtTransaction (line 191) | func (eth *Ethereum) stateAtTransaction(block *types.Block, txIndex int,...

FILE: eth/sync.go
  constant forceSyncCycle (line 35) | forceSyncCycle      = 10 * time.Second
  constant defaultMinSyncPeers (line 36) | defaultMinSyncPeers = 5
  constant txsyncPackSize (line 40) | txsyncPackSize = 100 * 1024
  type txsync (line 43) | type txsync struct
  method syncTransactions (line 49) | func (h *handler) syncTransactions(p *eth.Peer) {
  method txsyncLoop64 (line 86) | func (h *handler) txsyncLoop64() {
  type chainSyncer (line 158) | type chainSyncer struct
    method handlePeerEvent (line 185) | func (cs *chainSyncer) handlePeerEvent(peer *eth.Peer) bool {
    method loop (line 195) | func (cs *chainSyncer) loop() {
    method nextSyncOp (line 238) | func (cs *chainSyncer) nextSyncOp() *chainSyncOp {
    method modeAndLocalHead (line 275) | func (cs *chainSyncer) modeAndLocalHead() (downloader.SyncMode, *big.I...
    method startSync (line 298) | func (cs *chainSyncer) startSync(op *chainSyncOp) {
  type chainSyncOp (line 167) | type chainSyncOp struct
  function newChainSyncer (line 175) | func newChainSyncer(handler *handler) *chainSyncer {
  function peerToSyncOp (line 270) | func peerToSyncOp(mode downloader.SyncMode, p *eth.Peer) *chainSyncOp {
  method doSync (line 304) | func (h *handler) doSync(op *chainSyncOp) error {

FILE: eth/sync_test.go
  function TestFastSyncDisabling64 (line 31) | func TestFastSyncDisabling64(t *testing.T) { testFastSyncDisabling(t, 64) }
  function TestFastSyncDisabling65 (line 32) | func TestFastSyncDisabling65(t *testing.T) { testFastSyncDisabling(t, 65) }
  function testFastSyncDisabling (line 36) | func testFastSyncDisabling(t *testing.T, protocol uint) {

FILE: eth/tracers/api.go
  constant defaultTraceTimeout (line 50) | defaultTraceTimeout = 5 * time.Second
  constant defaultTraceReexec (line 55) | defaultTraceReexec = uint64(128)
  type Backend (line 60) | type Backend interface
  type API (line 76) | type API struct
    method chainContext (line 111) | func (api *API) chainContext(ctx context.Context) core.ChainContext {
    method blockByNumber (line 117) | func (api *API) blockByNumber(ctx context.Context, number rpc.BlockNum...
    method blockByHash (line 130) | func (api *API) blockByHash(ctx context.Context, hash common.Hash) (*t...
    method blockByNumberAndHash (line 146) | func (api *API) blockByNumberAndHash(ctx context.Context, number rpc.B...
    method TraceChain (line 210) | func (api *API) TraceChain(ctx context.Context, start, end rpc.BlockNu...
    method traceChain (line 228) | func (api *API) traceChain(ctx context.Context, start, end *types.Bloc...
    method TraceBlockByNumber (line 385) | func (api *API) TraceBlockByNumber(ctx context.Context, number rpc.Blo...
    method TraceBlockByHash (line 395) | func (api *API) TraceBlockByHash(ctx context.Context, hash common.Hash...
    method TraceBlock (line 405) | func (api *API) TraceBlock(ctx context.Context, blob []byte, config *T...
    method TraceBlockFromFile (line 415) | func (api *API) TraceBlockFromFile(ctx context.Context, file string, c...
    method TraceBadBlock (line 426) | func (api *API) TraceBadBlock(ctx context.Context, hash common.Hash, c...
    method StandardTraceBlockToFile (line 438) | func (api *API) StandardTraceBlockToFile(ctx context.Context, hash com...
    method StandardTraceBadBlockToFile (line 449) | func (api *API) StandardTraceBadBlockToFile(ctx context.Context, hash ...
    method traceBlock (line 461) | func (api *API) traceBlock(ctx context.Context, block *types.Block, co...
    method standardTraceBlockToFile (line 546) | func (api *API) standardTraceBlockToFile(ctx context.Context, block *t...
    method TraceTransaction (line 676) | func (api *API) TraceTransaction(ctx context.Context, hash common.Hash...
    method TraceCall (line 711) | func (api *API) TraceCall(ctx context.Context, args ethapi.CallArgs, b...
    method traceTx (line 746) | func (api *API) traceTx(ctx context.Context, message core.Message, txc...
  function NewAPI (line 81) | func NewAPI(backend Backend) *API {
  type chainContext (line 85) | type chainContext struct
    method Engine (line 90) | func (context *chainContext) Engine() consensus.Engine {
    method GetHeader (line 94) | func (context *chainContext) GetHeader(hash common.Hash, number uint64...
  type TraceConfig (line 158) | type TraceConfig struct
  type StdTraceConfig (line 166) | type StdTraceConfig struct
  type txTraceContext (line 173) | type txTraceContext struct
  type txTraceResult (line 180) | type txTraceResult struct
  type blockTraceTask (line 187) | type blockTraceTask struct
  type blockTraceResult (line 195) | type blockTraceResult struct
  type txTraceTask (line 203) | type txTraceTask struct
  function containsTx (line 665) | func containsTx(block *types.Block, hash common.Hash) bool {
  function APIs (line 815) | func APIs(backend Backend) []rpc.API {

FILE: eth/tracers/api_test.go
  type testBackend (line 53) | type testBackend struct
    method HeaderByHash (line 94) | func (b *testBackend) HeaderByHash(ctx context.Context, hash common.Ha...
    method HeaderByNumber (line 98) | func (b *testBackend) HeaderByNumber(ctx context.Context, number rpc.B...
    method BlockByHash (line 105) | func (b *testBackend) BlockByHash(ctx context.Context, hash common.Has...
    method BlockByNumber (line 109) | func (b *testBackend) BlockByNumber(ctx context.Context, number rpc.Bl...
    method GetTransaction (line 116) | func (b *testBackend) GetTransaction(ctx context.Context, txHash commo...
    method RPCGasCap (line 124) | func (b *testBackend) RPCGasCap() uint64 {
    method ChainConfig (line 128) | func (b *testBackend) ChainConfig() *params.ChainConfig {
    method Engine (line 132) | func (b *testBackend) Engine() consensus.Engine {
    method ChainDb (line 136) | func (b *testBackend) ChainDb() ethdb.Database {
    method StateAtBlock (line 140) | func (b *testBackend) StateAtBlock(ctx context.Context, block *types.B...
    method StateAtTransaction (line 148) | func (b *testBackend) StateAtTransaction(ctx context.Context, block *t...
    method StatesInRange (line 178) | func (b *testBackend) StatesInRange(ctx context.Context, fromBlock *ty...
  function newTestBackend (line 60) | func newTestBackend(t *testing.T, n int, gspec *core.Genesis, generator ...
  function TestTraceCall (line 194) | func TestTraceCall(t *testing.T) {
  function TestTraceTransaction (line 324) | func TestTraceTransaction(t *testing.T) {
  function TestTraceBlock (line 357) | func TestTraceBlock(t *testing.T) {
  type Account (line 468) | type Account struct
  type Accounts (line 473) | type Accounts
    method Len (line 475) | func (a Accounts) Len() int           { return len(a) }
    method Swap (line 476) | func (a Accounts) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
    method Less (line 477) | func (a Accounts) Less(i, j int) bool { return bytes.Compare(a[i].addr...
  function newAccounts (line 479) | func newAccounts(n int) (accounts Accounts) {

FILE: eth/tracers/internal/tracers/assets.go
  function bindataRead (line 28) | func bindataRead(data []byte, name string) ([]byte, error) {
  type asset (line 48) | type asset struct
  type bindataFileInfo (line 54) | type bindataFileInfo struct
    method Name (line 61) | func (fi bindataFileInfo) Name() string {
    method Size (line 64) | func (fi bindataFileInfo) Size() int64 {
    method Mode (line 67) | func (fi bindataFileInfo) Mode() os.FileMode {
    method ModTime (line 70) | func (fi bindataFileInfo) ModTime() time.Time {
    method IsDir (line 73) | func (fi bindataFileInfo) IsDir() bool {
    method Sys (line 76) | func (fi bindataFileInfo) Sys() interface{} {
  function _4byte_tracerJsBytes (line 82) | func _4byte_tracerJsBytes() ([]byte, error) {
  function _4byte_tracerJs (line 89) | func _4byte_tracerJs() (*asset, error) {
  function bigram_tracerJsBytes (line 102) | func bigram_tracerJsBytes() ([]byte, error) {
  function bigram_tracerJs (line 109) | func bigram_tracerJs() (*asset, error) {
  function call_tracerJsBytes (line 122) | func call_tracerJsBytes() ([]byte, error) {
  function call_tracerJs (line 129) | func call_tracerJs() (*asset, error) {
  function evmdis_tracerJsBytes (line 142) | func evmdis_tracerJsBytes() ([]byte, error) {
  function evmdis_tracerJs (line 149) | func evmdis_tracerJs() (*asset, error) {
  function noop_tracerJsBytes (line 162) | func noop_tracerJsBytes() ([]byte, error) {
  function noop_tracerJs (line 169) | func noop_tracerJs() (*asset, error) {
  function opcount_tracerJsBytes (line 182) | func opcount_tracerJsBytes() ([]byte, error) {
  function opcount_tracerJs (line 189) | func opcount_tracerJs() (*asset, error) {
  function prestate_tracerJsBytes (line 202) | func prestate_tracerJsBytes() ([]byte, error) {
  function prestate_tracerJs (line 209) | func prestate_tracerJs() (*asset, error) {
  function trigram_tracerJsBytes (line 222) | func trigram_tracerJsBytes() ([]byte, error) {
  function trigram_tracerJs (line 229) | func trigram_tracerJs() (*asset, error) {
  function unigram_tracerJsBytes (line 242) | func unigram_tracerJsBytes() ([]byte, error) {
  function unigram_tracerJs (line 249) | func unigram_tracerJs() (*asset, error) {
  function Asset (line 263) | func Asset(name string) ([]byte, error) {
  function AssetString (line 276) | func AssetString(name string) (string, error) {
  function MustAsset (line 283) | func MustAsset(name string) []byte {
  function MustAssetString (line 294) | func MustAssetString(name string) string {
  function AssetInfo (line 301) | func AssetInfo(name string) (os.FileInfo, error) {
  function AssetDigest (line 315) | func AssetDigest(name string) ([sha256.Size]byte, error) {
  function Digests (line 328) | func Digests() (map[string][sha256.Size]byte, error) {
  function AssetNames (line 341) | func AssetNames() []string {
  constant AssetDebug (line 363) | AssetDebug = false
  function AssetDir (line 378) | func AssetDir(name string) ([]string, error) {
  type bintree (line 400) | type bintree struct
  function RestoreAsset (line 418) | func RestoreAsset(dir, name string) error {
  function RestoreAssets (line 439) | func RestoreAssets(dir, name string) error {
  function _filePath (line 455) | func _filePath(dir, name string) string {

FILE: eth/tracers/tracer.go
  constant bigIntegerJS (line 38) | bigIntegerJS = `var bigInt=function(undefined){"use strict";var BASE=1e7...
  function makeSlice (line 46) | func makeSlice(ptr unsafe.Pointer, size uint) []byte {
  function popSlice (line 57) | func popSlice(ctx *duktape.Context) []byte {
  function pushBigInt (line 64) | func pushBigInt(n *big.Int, ctx *duktape.Context) {
  type opWrapper (line 71) | type opWrapper struct
    method pushObject (line 77) | func (ow *opWrapper) pushObject(vm *duktape.Context) {
  type memoryWrapper (line 91) | type memoryWrapper struct
    method slice (line 96) | func (mw *memoryWrapper) slice(begin, end int64) []byte {
    method getUint (line 116) | func (mw *memoryWrapper) getUint(addr int64) *big.Int {
    method pushObject (line 128) | func (mw *memoryWrapper) pushObject(vm *duktape.Context) {
  type stackWrapper (line 154) | type stackWrapper struct
    method peek (line 159) | func (sw *stackWrapper) peek(idx int) *big.Int {
    method pushObject (line 171) | func (sw *stackWrapper) pushObject(vm *duktape.Context) {
  type dbWrapper (line 189) | type dbWrapper struct
    method pushObject (line 195) | func (dw *dbWrapper) pushObject(vm *duktape.Context) {
  type contractWrapper (line 244) | type contractWrapper struct
    method pushObject (line 250) | func (cw *contractWrapper) pushObject(vm *duktape.Context) {
  type Tracer (line 289) | type Tracer struct
    method Stop (line 501) | func (jst *Tracer) Stop(err error) {
    method call (line 508) | func (jst *Tracer) call(method string, args ...string) (json.RawMessag...
    method CaptureStart (line 530) | func (jst *Tracer) CaptureStart(env *vm.EVM, from common.Address, to c...
    method CaptureState (line 555) | func (jst *Tracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, ...
    method CaptureFault (line 587) | func (jst *Tracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, ...
    method CaptureEnd (line 601) | func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Du...
    method GetResult (line 612) | func (jst *Tracer) GetResult() (json.RawMessage, error) {
  function New (line 318) | func New(code string, txCtx vm.TxContext) (*Tracer, error) {
  function wrapError (line 525) | func wrapError(context string, err error) error {

FILE: eth/tracers/tracer_test.go
  type account (line 32) | type account struct
    method SubBalance (line 34) | func (account) SubBalance(amount *big.Int)                          {}
    method AddBalance (line 35) | func (account) AddBalance(amount *big.Int)                          {}
    method SetAddress (line 36) | func (account) SetAddress(common.Address)                           {}
    method Value (line 37) | func (account) Value() *big.Int                                     { ...
    method SetBalance (line 38) | func (account) SetBalance(*big.Int)                                 {}
    method SetNonce (line 39) | func (account) SetNonce(uint64)                                     {}
    method Balance (line 40) | func (account) Balance() *big.Int                                   { ...
    method Address (line 41) | func (account) Address() common.Address                             { ...
    method ReturnGas (line 42) | func (account) ReturnGas(*big.Int)                                  {}
    method SetCode (line 43) | func (account) SetCode(common.Hash, []byte)                         {}
    method ForEachStorage (line 44) | func (account) ForEachStorage(cb func(key, value common.Hash) bool) {}
  type dummyStatedb (line 46) | type dummyStatedb struct
    method GetRefund (line 50) | func (*dummyStatedb) GetRefund() uint64                       { return...
    method GetBalance (line 51) | func (*dummyStatedb) GetBalance(addr common.Address) *big.Int { return...
  type vmContext (line 53) | type vmContext struct
  function testCtx (line 58) | func testCtx() *vmContext {
  function runTrace (line 62) | func runTrace(tracer *Tracer, vmctx *vmContext) (json.RawMessage, error) {
  function TestTracer (line 80) | func TestTracer(t *testing.T) {
  function TestHalt (line 127) | func TestHalt(t *testing.T) {
  function TestHaltBetweenSteps (line 147) | func TestHaltBetweenSteps(t *testing.T) {
  function TestNoStepExec (line 170) | func TestNoStepExec(t *testing.T) {

FILE: eth/tracers/tracers.go
  function camel (line 31) | func camel(str string) string {
  function init (line 40) | func init() {
  function tracer (line 48) | func tracer(name string) (string, bool) {

FILE: eth/tracers/tracers_test.go
  type callTrace (line 94) | type callTrace struct
  type callContext (line 107) | type callContext struct
  type callTracerTest (line 116) | type callTracerTest struct
  function TestPrestateTracerCreate2 (line 123) | func TestPrestateTracerCreate2(t *testing.T) {
  function TestCallTracer (line 206) | func TestCallTracer(t *testing.T) {
  function jsonEqual (line 288) | func jsonEqual(x, y interface{}) bool {

FILE: ethclient/ethclient.go
  type Client (line 35) | type Client struct
    method Close (line 57) | func (ec *Client) Close() {
    method ChainID (line 64) | func (ec *Client) ChainID(ctx context.Context) (*big.Int, error) {
    method BlockByHash (line 77) | func (ec *Client) BlockByHash(ctx context.Context, hash common.Hash) (...
    method BlockByNumber (line 86) | func (ec *Client) BlockByNumber(ctx context.Context, number *big.Int) ...
    method BlockNumber (line 91) | func (ec *Client) BlockNumber(ctx context.Context) (uint64, error) {
    method getBlock (line 103) | func (ec *Client) getBlock(ctx context.Context, method string, args .....
    method HeaderByHash (line 169) | func (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) ...
    method HeaderByNumber (line 180) | func (ec *Client) HeaderByNumber(ctx context.Context, number *big.Int)...
    method TransactionByHash (line 208) | func (ec *Client) TransactionByHash(ctx context.Context, hash common.H...
    method TransactionSender (line 230) | func (ec *Client) TransactionSender(ctx context.Context, tx *types.Tra...
    method TransactionCount (line 250) | func (ec *Client) TransactionCount(ctx context.Context, blockHash comm...
    method TransactionInBlock (line 257) | func (ec *Client) TransactionInBlock(ctx context.Context, blockHash co...
    method TransactionReceipt (line 276) | func (ec *Client) TransactionReceipt(ctx context.Context, txHash commo...
    method SyncProgress (line 308) | func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncPro...
    method SubscribeNewHead (line 333) | func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *typ...
    method NetworkID (line 340) | func (ec *Client) NetworkID(ctx context.Context) (*big.Int, error) {
    method BalanceAt (line 354) | func (ec *Client) BalanceAt(ctx context.Context, account common.Addres...
    method StorageAt (line 362) | func (ec *Client) StorageAt(ctx context.Context, account common.Addres...
    method CodeAt (line 370) | func (ec *Client) CodeAt(ctx context.Context, account common.Address, ...
    method NonceAt (line 378) | func (ec *Client) NonceAt(ctx context.Context, account common.Address,...
    method FilterLogs (line 387) | func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQue...
    method SubscribeFilterLogs (line 398) | func (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum....
    method PendingBalanceAt (line 430) | func (ec *Client) PendingBalanceAt(ctx context.Context, account common...
    method PendingStorageAt (line 437) | func (ec *Client) PendingStorageAt(ctx context.Context, account common...
    method PendingCodeAt (line 444) | func (ec *Client) PendingCodeAt(ctx context.Context, account common.Ad...
    method PendingNonceAt (line 452) | func (ec *Client) PendingNonceAt(ctx context.Context, account common.A...
    method PendingTransactionCount (line 459) | func (ec *Client) PendingTransactionCount(ctx context.Context) (uint, ...
    method CallContract (line 475) | func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallM...
    method PendingCallContract (line 486) | func (ec *Client) PendingCallContract(ctx context.Context, msg ethereu...
    method SuggestGasPrice (line 497) | func (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, erro...
    method EstimateGas (line 509) | func (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMs...
    method SendTransaction (line 522) | func (ec *Client) SendTransaction(ctx context.Context, tx *types.Trans...
  function Dial (line 40) | func Dial(rawurl string) (*Client, error) {
  function DialContext (line 44) | func DialContext(ctx context.Context, rawurl string) (*Client, error) {
  function NewClient (line 53) | func NewClient(c *rpc.Client) *Client {
  type rpcBlock (line 97) | type rpcBlock struct
  type rpcTransaction (line 189) | type rpcTransaction struct
    method UnmarshalJSON (line 200) | func (tx *rpcTransaction) UnmarshalJSON(msg []byte) error {
  type txExtraInfo (line 194) | type txExtraInfo struct
  function toBlockNumArg (line 287) | func toBlockNumArg(number *big.Int) string {
  type rpcProgress (line 298) | type rpcProgress struct
  function toFilterArg (line 406) | func toFilterArg(q ethereum.FilterQuery) (interface{}, error) {
  function toCallArg (line 530) | func toCallArg(msg ethereum.CallMsg) interface{} {

FILE: ethclient/ethclient_test.go
  function TestToFilterArg (line 58) | func TestToFilterArg(t *testing.T) {
  function newTestBackend (line 190) | func newTestBackend(t *testing.T) (*node.Node, []*types.Block) {
  function generateTestChain (line 215) | func generateTestChain() (*core.Genesis, []*types.Block) {
  function TestEthClient (line 235) | func TestEthClient(t *testing.T) {
  function testHeader (line 276) | func testHeader(t *testing.T, chain []*types.Block, client *rpc.Client) {
  function testBalanceAt (line 316) | func testBalanceAt(t *testing.T, client *rpc.Client) {
  function testTransactionInBlockInterrupted (line 357) | func testTransactionInBlockInterrupted(t *testing.T, client *rpc.Client) {
  function testChainID (line 381) | func testChainID(t *testing.T, client *rpc.Client) {
  function testGetBlock (line 392) | func testGetBlock(t *testing.T, client *rpc.Client) {
  function testStatusFunctions (line 436) | func testStatusFunctions(t *testing.T, client *rpc.Client) {
  function testCallContract (line 465) | func testCallContract(t *testing.T, client *rpc.Client) {
  function testAtFunctions (line 493) | func testAtFunctions(t *testing.T, client *rpc.Client) {
  function sendTransaction (line 556) | func sendTransaction(ec *Client) error {

FILE: ethclient/signer.go
  type senderFromServer (line 30) | type senderFromServer struct
    method Equal (line 42) | func (s *senderFromServer) Equal(other types.Signer) bool {
    method Sender (line 47) | func (s *senderFromServer) Sender(tx *types.Transaction) (common.Addre...
    method ChainID (line 54) | func (s *senderFromServer) ChainID() *big.Int {
    method Hash (line 57) | func (s *senderFromServer) Hash(tx *types.Transaction) common.Hash {
    method SignatureValues (line 60) | func (s *senderFromServer) SignatureValues(tx *types.Transaction, sig ...
  function setSenderFromServer (line 37) | func setSenderFromServer(tx *types.Transaction, addr common.Address, blo...

FILE: ethstats/ethstats.go
  constant historyUpdateRange (line 54) | historyUpdateRange = 50
  constant txChanSize (line 58) | txChanSize = 4096
  constant chainHeadChanSize (line 60) | chainHeadChanSize = 10
  type backend (line 64) | type backend interface
  type fullNodeBackend (line 76) | type fullNodeBackend interface
  type Service (line 86) | type Service struct
    method Start (line 171) | func (s *Service) Start() error {
    method Stop (line 184) | func (s *Service) Stop() error {
    method loop (line 193) | func (s *Service) loop(chainHeadCh chan core.ChainHeadEvent, txEventCh...
    method readLoop (line 334) | func (s *Service) readLoop(conn *connWrapper) {
    method login (line 443) | func (s *Service) login(conn *connWrapper) error {
    method report (line 490) | func (s *Service) report(conn *connWrapper) error {
    method reportLatency (line 508) | func (s *Service) reportLatency(conn *connWrapper) error {
    method reportBlock (line 577) | func (s *Service) reportBlock(conn *connWrapper, block *types.Block) e...
    method assembleBlockStats (line 596) | func (s *Service) assembleBlockStats(block *types.Block) *blockStats {
    method reportHistory (line 652) | func (s *Service) reportHistory(conn *connWrapper, list []uint64) error {
    method reportPending (line 714) | func (s *Service) reportPending(conn *connWrapper) error {
    method reportStats (line 745) | func (s *Service) reportStats(conn *connWrapper) error {
  type connWrapper (line 113) | type connWrapper struct
    method WriteJSON (line 125) | func (w *connWrapper) WriteJSON(v interface{}) error {
    method ReadJSON (line 133) | func (w *connWrapper) ReadJSON(v interface{}) error {
    method Close (line 141) | func (w *connWrapper) Close() error {
  function newConnectionWrapper (line 120) | func newConnectionWrapper(conn *websocket.Conn) *connWrapper {
  function New (line 148) | func New(node *node.Node, backend backend, engine consensus.Engine, url ...
  type nodeInfo (line 422) | type nodeInfo struct
  type authMsg (line 436) | type authMsg struct
  type blockStats (line 544) | type blockStats struct
  type txStats (line 561) | type txStats struct
  type uncleStats (line 567) | type uncleStats
    method MarshalJSON (line 569) | func (s uncleStats) MarshalJSON() ([]byte, error) {
  type pendStats (line 708) | type pendStats struct
  type nodeStats (line 733) | type nodeStats struct

FILE: ffi-toolkit/src/lib.rs
  function rust_str_to_c_str (line 8) | pub fn rust_str_to_c_str<T: Into<String>>(s: T) -> *mut libc::c_char {
  function free_c_str (line 13) | pub unsafe fn free_c_str(ptr: *mut libc::c_char) {
  function raw_ptr (line 20) | pub fn raw_ptr<T>(thing: T) -> *mut T {
  function c_str_to_rust_str (line 25) | pub unsafe fn c_str_to_rust_str<'a>(x: *const libc::c_char) -> Cow<'a, s...
  function cast_const (line 35) | pub unsafe fn cast_const<'a, T>(x: *mut T) -> &'a T {
  function c_str_to_pbuf (line 41) | pub unsafe fn c_str_to_pbuf(x: *const libc::c_char) -> PathBuf {

FILE: fil-proofs-param/src/bin/fakeipfsadd.rs
  type Cli (line 15) | enum Cli {
    method file_path (line 25) | fn file_path(&self) -> &str {
  function main (line 32) | pub fn main() {

FILE: fil-proofs-param/src/bin/paramcache.rs
  function cache_porep_params (line 27) | fn cache_porep_params<Tree: 'static + MerkleTreeTrait>(porep_config: PoR...
  function cache_winning_post_params (line 64) | fn cache_winning_post_params<Tree: 'static + MerkleTreeTrait>(post_confi...
  function cache_window_post_params (line 90) | fn cache_window_post_params<Tree: 'static + MerkleTreeTrait>(post_config...
  type Opt (line 124) | struct Opt {
  function generate_params_post (line 143) | fn generate_params_post(sector_size: u64, api_version: ApiVersion) {
  function generate_params_porep (line 175) | fn generate_params_porep(sector_size: u64, api_version: ApiVersion) {
  function main (line 194) | pub fn main() {

FILE: fil-proofs-param/src/bin/paramfetch.rs
  constant DEFAULT_JSON (line 34) | const DEFAULT_JSON: &str = include_str!("../../parameters.json");
  constant DEFAULT_IPGET_VERSION (line 35) | const DEFAULT_IPGET_VERSION: &str = "v0.6.0";
  function ipget_dir (line 38) | fn ipget_dir(version: &str) -> String {
  function ipget_path (line 43) | fn ipget_path(version: &str) -> String {
  type FetchProgress (line 48) | struct FetchProgress<R> {
  method read (line 54) | fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
  function new (line 63) | fn new(reader: R, size: u64) -> Self {
  function download_ipget (line 74) | fn download_ipget(version: &str, verbose: bool) -> Result<()> {
  function get_filenames_requiring_download (line 149) | fn get_filenames_requiring_download(
  function download_file_with_ipget (line 186) | fn download_file_with_ipget(
  type Cli (line 220) | struct Cli {
  function main (line 276) | pub fn main() {

FILE: fil-proofs-param/src/bin/parampublish.rs
  constant DEFAULT_SECTOR_SIZES (line 37) | const DEFAULT_SECTOR_SIZES: [u64; 5] = [
  type FileInfo (line 46) | struct FileInfo {
  function human_size (line 55) | fn human_size(sector_size: u64) -> String {
  function is_well_formed_filename (line 60) | fn is_well_formed_filename(filename: &str) -> bool {
  function get_filenames_in_cache_dir (line 81) | fn get_filenames_in_cache_dir() -> Vec<String> {
  function publish_file (line 102) | fn publish_file(ipfs_bin: &str, filename: &str) -> Result<String> {
  function write_param_map_to_disk (line 121) | fn write_param_map_to_disk(param_map: &ParameterMap, json_path: &str) ->...
  type Cli (line 129) | struct Cli {
  function main (line 155) | pub fn main() {

FILE: fil-proofs-param/tests/paramfetch/mod.rs
  function rand_bytes_with_blake2b (line 20) | fn rand_bytes_with_blake2b() -> Result<(Vec<u8>, String), FailureError> {
  function nothing_to_fetch_if_cache_fully_hydrated (line 36) | fn nothing_to_fetch_if_cache_fully_hydrated() -> Result<(), FailureError> {
  function prompts_to_download_if_file_in_manifest_is_missing (line 67) | fn prompts_to_download_if_file_in_manifest_is_missing() -> Result<(), Fa...
  function prompts_to_download_if_file_checksum_does_not_match_manifest (line 94) | fn prompts_to_download_if_file_checksum_does_not_match_manifest() -> Res...
  function fetches_vk_even_if_sector_size_does_not_match (line 126) | fn fetches_vk_even_if_sector_size_does_not_match() -> Result<(), Failure...
  function invalid_json_path_produces_error (line 163) | fn invalid_json_path_produces_error() -> Result<(), FailureError> {
  function invalid_json_produces_error (line 175) | fn invalid_json_produces_error() -> Result<(), FailureError> {
  function no_json_path_uses_default_manifest (line 191) | fn no_json_path_uses_default_manifest() -> Result<(), FailureError> {

FILE: fil-proofs-param/tests/paramfetch/session.rs
  type ParamFetchSessionBuilder (line 12) | pub struct ParamFetchSessionBuilder {
    method new (line 21) | pub fn new(manifest: Option<PathBuf>) -> ParamFetchSessionBuilder {
    method with_session_timeout_ms (line 34) | pub fn with_session_timeout_ms(mut self, timeout_ms: u64) -> ParamFetc...
    method whitelisted_sector_sizes (line 40) | pub fn whitelisted_sector_sizes(
    method with_file_and_bytes (line 49) | pub fn with_file_and_bytes<P: AsRef<Path>, R: Read>(
    method build (line 65) | pub fn build(self) -> ParamFetchSession {
  type ParamFetchSession (line 108) | pub struct ParamFetchSession {
    method exp_string (line 116) | pub fn exp_string(

FILE: fil-proofs-param/tests/parampublish/prompts_to_publish.rs
  function ignores_files_unrecognized_extensions (line 7) | fn ignores_files_unrecognized_extensions() -> Result<(), FailureError> {
  function displays_sector_size_in_prompt (line 29) | fn displays_sector_size_in_prompt() -> Result<(), FailureError> {
  function no_assets_no_prompt (line 54) | fn no_assets_no_prompt() -> Result<(), FailureError> {

FILE: fil-proofs-param/tests/parampublish/read_metadata_files.rs
  function fails_if_missing_metadata_file (line 6) | fn fails_if_missing_metadata_file() -> Result<(), FailureError> {
  function fails_if_malformed_metadata_file (line 22) | fn fails_if_malformed_metadata_file() -> Result<(), FailureError> {

FILE: fil-proofs-param/tests/parampublish/support/session.rs
  type ParamPublishSessionBuilder (line 14) | pub struct ParamPublishSessionBuilder {
    method new (line 24) | pub fn new() -> ParamPublishSessionBuilder {
    method with_ipfs_bin (line 43) | pub fn with_ipfs_bin(mut self, ipfs_bin: &FakeIpfsBin) -> ParamPublish...
    method with_files (line 50) | pub fn with_files<P: AsRef<Path>>(self, filenames: &[P]) -> ParamPubli...
    method with_file (line 56) | pub fn with_file<P: AsRef<Path>>(mut self, filename: P) -> ParamPublis...
    method with_file_and_bytes (line 71) | pub fn with_file_and_bytes<P: AsRef<Path>, R: Read>(
    method with_metadata (line 88) | pub fn with_metadata<P: AsRef<Path>>(
    method with_session_timeout_ms (line 100) | pub fn with_session_timeout_ms(mut self, timeout_ms: u64) -> ParamPubl...
    method list_all_files (line 106) | pub fn list_all_files(mut self) -> ParamPublishSessionBuilder {
    method write_manifest_to (line 112) | pub fn write_manifest_to(mut self, manifest_dest: PathBuf) -> ParamPub...
    method build (line 118) | pub fn build(self) -> (ParamPublishSession, Vec<PathBuf>) {
  type ParamPublishSession (line 156) | pub struct ParamPublishSession {
    method send_line (line 163) | pub fn send_line(&mut self, line: &str) -> Result<usize, SyncFailure<r...
    method exp_string (line 169) | pub fn exp_string(

FILE: fil-proofs-param/tests/parampublish/write_json_manifest.rs
  function writes_json_manifest (line 13) | fn writes_json_manifest() -> Result<(), failure::Error> {
  function filename_to_checksum (line 70) | fn filename_to_checksum<P: AsRef<Path>>(

FILE: fil-proofs-param/tests/support/mod.rs
  type FakeIpfsBin (line 14) | pub struct FakeIpfsBin {
    method new (line 19) | pub fn new() -> FakeIpfsBin {
    method compute_checksum (line 25) | pub fn compute_checksum<P: AsRef<Path>>(&self, path: P) -> Result<Stri...
    method bin_path (line 42) | pub fn bin_path(&self) -> &Path {
  function target_dir (line 48) | pub fn target_dir() -> PathBuf {
  function cargo_bin (line 62) | pub fn cargo_bin<S: AsRef<str>>(name: S) -> PathBuf {
  function spawn_bash_with_retries (line 67) | pub fn spawn_bash_with_retries(
  function tmp_manifest (line 87) | pub fn tmp_manifest(

FILE: fil-proofs-tooling/src/bin/benchy/hash_fns.rs
  function blake2s_count (line 10) | fn blake2s_count(bytes: usize) -> anyhow::Result<Report> {
  function sha256_count (line 46) | fn sha256_count(bytes: usize) -> anyhow::Result<Report> {
  type Report (line 75) | struct Report {
  function run (line 81) | pub fn run() -> anyhow::Result<()> {

FILE: fil-proofs-tooling/src/bin/benchy/main.rs
  function main (line 21) | fn main() -> Result<()> {

FILE: fil-proofs-tooling/src/bin/benchy/merkleproofs.rs
  function generate_proofs (line 15) | fn generate_proofs<R: Rng, Tree: MerkleTreeTrait>(
  function run_merkleproofs_bench (line 67) | pub fn run_merkleproofs_bench<Tree: 'static + MerkleTreeTrait>(
  function run (line 104) | pub fn run(size: usize, proofs_count: usize, validate: bool) -> Result<(...

FILE: fil-proofs-tooling/src/bin/benchy/prodbench.rs
  constant SEED (line 29) | const SEED: [u8; 16] = [
  type ProdbenchTree (line 33) | type ProdbenchTree = DefaultOctTree;
  type ProdbenchReport (line 36) | pub struct ProdbenchReport {
  type ProdbenchInputs (line 42) | pub struct ProdbenchInputs {
    method sector_size_bytes (line 56) | pub fn sector_size_bytes(&self) -> u64 {
    method api_version (line 59) | pub fn api_version(&self) -> ApiVersion {
  type ProdbenchOutputs (line 65) | pub struct ProdbenchOutputs {
  function augment_with_op_measurements (line 101) | fn augment_with_op_measurements(mut _output: &mut ProdbenchOutputs) {}
  function augment_with_op_measurements (line 104) | fn augment_with_op_measurements(mut output: &mut ProdbenchOutputs) {
  function configure_global_config (line 160) | fn configure_global_config(inputs: &ProdbenchInputs) {
  function run (line 175) | pub fn run(
  type CircuitOutputs (line 260) | struct CircuitOutputs {
  function run_measure_circuits (line 264) | fn run_measure_circuits(i: &ProdbenchInputs) -> CircuitOutputs {
  function measure_porep_circuit (line 270) | fn measure_porep_circuit(i: &ProdbenchInputs) -> usize {
  function generate_params (line 300) | fn generate_params(i: &ProdbenchInputs) {
  function cache_porep_params (line 323) | fn cache_porep_params(porep_config: PoRepConfig) {

FILE: fil-proofs-tooling/src/bin/benchy/stacked.rs
  function dump_proof_bytes (line 32) | fn dump_proof_bytes<Tree: MerkleTreeTrait>(
  type Params (line 47) | struct Params {
  function generate_report (line 75) | fn generate_report<H: 'static>(params: Params, cache_dir: &TempDir) -> a...
  type CircuitWorkMeasurement (line 310) | struct CircuitWorkMeasurement {
  function do_circuit_work (line 315) | fn do_circuit_work<Tree: 'static + MerkleTreeTrait>(
  type Inputs (line 426) | struct Inputs {
    method from (line 62) | fn from(p: Params) -> Self {
  type Outputs (line 438) | struct Outputs {
  type Report (line 463) | struct Report {
    method print (line 470) | pub fn print(&self) {
  type RunOpts (line 476) | pub struct RunOpts {
  function run (line 492) | pub fn run(opts: RunOpts) -> anyhow::Result<()> {

FILE: fil-proofs-tooling/src/bin/benchy/window_post.rs
  constant SECTOR_ID (line 26) | const SECTOR_ID: u64 = 0;
  type Inputs (line 30) | struct Inputs {
  type Outputs (line 36) | struct Outputs {
  type Report (line 57) | struct Report {
    method print (line 64) | pub fn print(&self) {
  function run_window_post_bench (line 70) | pub fn run_window_post_bench<Tree: 'static + MerkleTreeTrait>(
  function run (line 281) | pub fn run(sector_size: usize) -> anyhow::Result<()> {

FILE: fil-proofs-tooling/src/bin/benchy/winning_post.rs
  type Inputs (line 19) | struct Inputs {
  type Outputs (line 25) | struct Outputs {
  type Report (line 36) | struct Report {
    method print (line 43) | pub fn print(&self) {
  function run_fallback_post_bench (line 49) | pub fn run_fallback_post_bench<Tree: 'static + MerkleTreeTrait>(
  function run (line 129) | pub fn run(sector_size: usize, api_version: ApiVersion) -> anyhow::Resul...

FILE: fil-proofs-tooling/src/bin/check_parameters/main.rs
  function run_map (line 10) | fn run_map(parameter_file: &PathBuf) -> Result<MappedParameters<Bls12>> {
  function main (line 14) | fn main() -> Result<()> {

FILE: fil-proofs-tooling/src/bin/circuitinfo/main.rs
  type CircuitInfo (line 21) | struct CircuitInfo {
  function circuit_info (line 26) | fn circuit_info<C: Circuit<Bls12>>(circuit: C) -> CircuitInfo {
  function get_porep_info (line 38) | fn get_porep_info<Tree: 'static + MerkleTreeTrait>(porep_config: PoRepCo...
  function get_winning_post_info (line 57) | fn get_winning_post_info<Tree: 'static + MerkleTreeTrait>(post_config: &...
  function get_window_post_info (line 71) | fn get_window_post_info<Tree: 'static + MerkleTreeTrait>(post_config: &P...
  type Opt (line 87) | struct Opt {
  function winning_post_info (line 100) | fn winning_post_info(sector_size: u64, api_version: ApiVersion) -> Circu...
  function window_post_info (line 115) | fn window_post_info(sector_size: u64, api_version: ApiVersion) -> Circui...
  function porep_info (line 134) | fn porep_info(sector_size: u64, api_version: ApiVersion) -> (CircuitInfo...
  function main (line 156) | pub fn main() {

FILE: fil-proofs-tooling/src/bin/fdlimit/main.rs
  function main (line 3) | fn main() -> Result<()> {

FILE: fil-proofs-tooling/src/bin/gen_graph_cache/main.rs
  constant PARENT_CACHE_JSON_OUTPUT (line 17) | const PARENT_CACHE_JSON_OUTPUT: &str = "./parent_cache.json";
  type ParentCacheSummaryMap (line 19) | pub type ParentCacheSummaryMap = BTreeMap<String, ParentCacheSummary>;
  type ParentCacheSummary (line 22) | pub struct ParentCacheSummary {
  function gen_graph_cache (line 27) | fn gen_graph_cache<Tree: 'static + MerkleTreeTrait>(
  function main (line 71) | fn main() -> Result<()> {

FILE: fil-proofs-tooling/src/bin/gpu-cpu-test/main.rs
  constant FIXED_API_VERSION (line 23) | const FIXED_API_VERSION: ApiVersion = ApiVersion::V1_0_0;
  type MerkleTree (line 25) | type MerkleTree = SectorShape8MiB;
  constant SECTOR_SIZE (line 26) | const SECTOR_SIZE: u64 = SECTOR_SIZE_8_MIB;
  constant TIMEOUT (line 27) | const TIMEOUT: u64 = 5 * 60;
  constant POST_CONFIG (line 28) | const POST_CONFIG: PoStConfig = PoStConfig {
  type RunInfo (line 46) | pub struct RunInfo {
  function colored_with_thread (line 51) | pub fn colored_with_thread(
  function generate_post (line 71) | fn generate_post(priv_replica_info: &[(SectorId, PrivateReplicaInfo<Merk...
  function generate_post_in_priority (line 76) | fn generate_post_in_priority(priv_replica_info: &[(SectorId, PrivateRepl...
  function thread_fun (line 83) | fn thread_fun(
  function spawn_thread (line 119) | fn spawn_thread(
  function threads_mode (line 134) | fn threads_mode(parallel: u8, gpu_stealing: bool) {
  function processes_mode (line 183) | fn processes_mode(parallel: u8, gpu_stealing: bool) {
  function spawn_process (line 210) | fn spawn_process(name: &str, gpu_stealing: bool) -> Child {
  function main (line 229) | fn main() {

FILE: fil-proofs-tooling/src/bin/micro.rs
  type Interval (line 11) | struct Interval {
  type Point (line 19) | struct Point {
  type CriterionResult (line 26) | struct CriterionResult {
  function make_detail_re (line 41) | fn make_detail_re(name: &str) -> Regex {
  function parse_criterion_out (line 46) | fn parse_criterion_out(s: impl AsRef<str>) -> Result<Vec<CriterionResult...
  function throughput_to_uom (line 225) | fn throughput_to_uom(s: &str) -> String {
  function throughput_val (line 233) | fn throughput_val(s: &str) -> f64 {
  function time_to_us (line 241) | fn time_to_us(s: &str) -> f64 {
  function run_benches (line 257) | fn run_benches(mut args: Vec<String>) -> Result<()> {
  function main (line 297) | fn main() {
  function test_time_to_us (line 314) | fn test_time_to_us() {
  function test_throughput_uom (line 320) | fn test_throughput_uom() {
  function test_parse_criterion_no_throughput (line 326) | fn test_parse_criterion_no_throughput() {
  function test_parse_criterion_with_throughput (line 393) | fn test_parse_criterion_with_throughput() {

FILE: fil-proofs-tooling/src/bin/settings/main.rs
  function main (line 5) | fn main() -> Result<()> {

FILE: fil-proofs-tooling/src/bin/update_tree_r_cache/main.rs
  function get_tree_r_info (line 29) | fn get_tree_r_info(
  function get_tree_r_last_root (line 62) | fn get_tree_r_last_root(
  function get_persistent_aux (line 108) | fn get_persistent_aux(cache: &PathBuf) -> Result<PersistentAux<DefaultTr...
  function build_tree_r_last (line 120) | fn build_tree_r_last<Tree: MerkleTreeTrait>(
  function run_rebuild (line 170) | fn run_rebuild(
  function run_inspect (line 184) | fn run_inspect(sector_size: usize, cache: PathBuf, replica_path: PathBuf...
  function run_verify (line 210) | fn run_verify(sector_size: usize, cache: PathBuf, replica_path: PathBuf)...
  function main (line 313) | fn main() -> Result<()> {

FILE: fil-proofs-tooling/src/measure.rs
  type FuncMeasurement (line 6) | pub struct FuncMeasurement<T> {
  function measure (line 12) | pub fn measure<T, F>(f: F) -> Result<FuncMeasurement<T>>

FILE: fil-proofs-tooling/src/metadata.rs
  type Metadata (line 9) | pub struct Metadata<T> {
  function wrap (line 16) | pub fn wrap(benchmarks: T) -> Result<Self> {
  type GitMetadata (line 28) | pub struct GitMetadata {
    method new (line 34) | pub fn new() -> Result<Self> {
  type SystemMetadata (line 54) | pub struct SystemMetadata {
    method new (line 69) | pub fn new() -> Result<Self> {
  function test_metadata (line 134) | fn test_metadata() {

FILE: fil-proofs-tooling/src/shared.rs
  constant PROVER_ID (line 20) | pub const PROVER_ID: [u8; 32] = [9; 32];
  constant RANDOMNESS (line 21) | pub const RANDOMNESS: [u8; 32] = [44; 32];
  constant TICKET_BYTES (line 22) | pub const TICKET_BYTES: [u8; 32] = [1; 32];
  type PreCommitReplicaOutput (line 24) | pub struct PreCommitReplicaOutput<Tree: 'static + MerkleTreeTrait> {
  function create_piece (line 30) | pub fn create_piece(piece_bytes: UnpaddedBytesAmount) -> NamedTempFile {
  function create_replica (line 68) | pub fn create_replica<Tree: 'static + MerkleTreeTrait>(
  function create_replicas (line 84) | pub fn create_replicas<Tree: 'static + MerkleTreeTrait>(

FILE: filecoin-hashers/src/blake2s.rs
  type Blake2sHasher (line 25) | pub struct Blake2sHasher {}
  type Domain (line 28) | type Domain = Blake2sDomain;
  type Function (line 29) | type Function = Blake2sFunction;
  method name (line 31) | fn name() -> String {
  type Blake2sFunction (line 37) | pub struct Blake2sFunction(State);
    method hash (line 186) | fn hash(data: &[u8]) -> Blake2sDomain {
    method hash2 (line 195) | fn hash2(a: &Blake2sDomain, b: &Blake2sDomain) -> Blake2sDomain {
    method hash_multi_leaf_circuit (line 205) | fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
    method hash_leaf_bits_circuit (line 222) | fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_circuit (line 243) | fn hash_circuit<CS: ConstraintSystem<Bls12>>(
    method hash2_circuit (line 253) | fn hash2_circuit<CS>(
    method hash (line 283) | fn hash(&mut self) -> Blake2sDomain {
    method reset (line 288) | fn reset(&mut self) {
    method leaf (line 292) | fn leaf(&mut self, leaf: Blake2sDomain) -> Blake2sDomain {
    method node (line 296) | fn node(&mut self, left: Blake2sDomain, right: Blake2sDomain, _height:...
    method multi_node (line 302) | fn multi_node(&mut self, parts: &[Blake2sDomain], _height: usize) -> B...
  method default (line 40) | fn default() -> Self {
  method eq (line 46) | fn eq(&self, other: &Self) -> bool {
  method fmt (line 54) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
  method write (line 61) | fn write(&mut self, msg: &[u8]) {
  method finish (line 66) | fn finish(&self) -> u64 {
  type Blake2sDomain (line 74) | pub struct Blake2sDomain(pub [u8; 32]);
    method as_ref (line 77) | fn as_ref(&self) -> &Self {
    method trim_to_fr32 (line 83) | pub fn trim_to_fr32(&mut self) {
    method as_ref (line 90) | fn as_ref(&self) -> &[u8] {
    method hash (line 96) | fn hash(&self, state: &mut Blake2sFunction) {
    method from (line 102) | fn from(val: Fr) -> Self {
    method from (line 113) | fn from(val: FrRepr) -> Self {
    method from (line 312) | fn from(val: [u8; 32]) -> Self {
  method byte_len (line 122) | fn byte_len() -> usize {
  method from_slice (line 126) | fn from_slice(bytes: &[u8]) -> Self {
  method copy_to_slice (line 133) | fn copy_to_slice(&self, bytes: &mut [u8]) {
  method from (line 139) | fn from(val: Blake2sDomain) -> Self {
  method into_bytes (line 148) | fn into_bytes(&self) -> Vec<u8> {
  method try_from_bytes (line 152) | fn try_from_bytes(raw: &[u8]) -> anyhow::Result<Self> {
  method write_bytes (line 163) | fn write_bytes(&self, dest: &mut [u8]) -> anyhow::Result<()> {
  method random (line 169) | fn random<R: RngCore>(rng: &mut R) -> Self {
  method into (line 176) | fn into(self) -> Blake2sDomain {
  function from (line 319) | fn from(val: Blake2sDomain) -> Self {

FILE: filecoin-hashers/src/poseidon.rs
  type PoseidonHasher (line 29) | pub struct PoseidonHasher {}
  type Domain (line 32) | type Domain = PoseidonDomain;
  type Function (line 33) | type Function = PoseidonFunction;
  method name (line 35) | fn name() -> String {
  type PoseidonFunction (line 41) | pub struct PoseidonFunction(Fr);
    method hash (line 229) | fn hash(data: &[u8]) -> PoseidonDomain {
    method hash2 (line 233) | fn hash2(a: &PoseidonDomain, b: &PoseidonDomain) -> PoseidonDomain {
    method hash_md (line 240) | fn hash_md(input: &[PoseidonDomain]) -> PoseidonDomain {
    method hash_leaf_circuit (line 264) | fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_multi_leaf_circuit (line 275) | fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: Constra...
    method hash_md_circuit (line 284) | fn hash_md_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_circuit (line 315) | fn hash_circuit<CS: ConstraintSystem<Bls12>>(
    method hash2_circuit (line 322) | fn hash2_circuit<CS>(
    method hash (line 337) | fn hash(&mut self) -> PoseidonDomain {
    method reset (line 342) | fn reset(&mut self) {
    method leaf (line 346) | fn leaf(&mut self, leaf: PoseidonDomain) -> PoseidonDomain {
    method node (line 350) | fn node(
    method multi_node (line 363) | fn multi_node(&mut self, parts: &[PoseidonDomain], _height: usize) -> ...
  method default (line 44) | fn default() -> PoseidonFunction {
  method hash (line 50) | fn hash(&self, state: &mut PoseidonFunction) {
  type PoseidonDomain (line 70) | pub struct PoseidonDomain(pub FrRepr);
    method hash (line 60) | fn hash(&self, state: &mut PoseidonFunction) {
    method as_ref (line 73) | fn as_ref(&self) -> &PoseidonDomain {
    method as_ref (line 115) | fn as_ref(&self) -> &[u8] {
    method from (line 383) | fn from(val: Fr) -> Self {
    method from (line 390) | fn from(val: FrRepr) -> Self {
  method hash (line 79) | fn hash<H: StdHasher>(&self, state: &mut H) {
  method eq (line 86) | fn eq(&self, other: &Self) -> bool {
  method default (line 94) | fn default() -> PoseidonDomain {
  method cmp (line 101) | fn cmp(&self, other: &PoseidonDomain) -> Ordering {
  method partial_cmp (line 108) | fn partial_cmp(&self, other: &PoseidonDomain) -> Option<Ordering> {
  function as_ref (line 125) | fn as_ref<'a>(src: &'a [u64; 4]) -> &'a [u8] {
  method into_bytes (line 130) | fn into_bytes(&self) -> Vec<u8> {
  method try_from_bytes (line 137) | fn try_from_bytes(raw: &[u8]) -> anyhow::Result<Self> {
  method write_bytes (line 148) | fn write_bytes(&self, dest: &mut [u8]) -> anyhow::Result<()> {
  method random (line 153) | fn random<R: RngCore>(rng: &mut R) -> Self {
  method byte_len (line 160) | fn byte_len() -> usize {
  method from_slice (line 164) | fn from_slice(bytes: &[u8]) -> Self {
  method copy_to_slice (line 171) | fn copy_to_slice(&self, bytes: &mut [u8]) {
  method write (line 178) | fn write(&mut self, msg: &[u8]) {
  method finish (line 183) | fn finish(&self) -> u64 {
  function shared_hash (line 188) | fn shared_hash(data: &[u8]) -> PoseidonDomain {
  function shared_hash_frs (line 202) | fn shared_hash_frs(preimage: &[<Bls12 as ScalarEngine>::Fr]) -> <Bls12 a...
  method from (line 397) | fn from(val: PoseidonDomain) -> Self {
  function test_path (line 412) | fn test_path() {
  function test_poseidon_hasher (line 443) | fn test_poseidon_hasher() {
  function test_as_ref (line 499) | fn test_as_ref() {
  function test_serialize (line 531) | fn test_serialize() {
  function test_hash_md (line 544) | fn test_hash_md() {
  function test_hash_md_circuit (line 561) | fn test_hash_md_circuit() {

FILE: filecoin-hashers/src/poseidon_types.rs
  type PoseidonBinaryArity (line 8) | pub type PoseidonBinaryArity = U2;
  type PoseidonQuadArity (line 9) | pub type PoseidonQuadArity = U4;
  type PoseidonOctArity (line 10) | pub type PoseidonOctArity = U8;
  type PoseidonMDArity (line 13) | pub type PoseidonMDArity = U36;
  constant MERKLE_TREE_ARITY (line 17) | pub const MERKLE_TREE_ARITY: usize = 2;
  type PoseidonArity (line 35) | pub trait PoseidonArity: Arity<Fr> + Send + Sync + Clone + Debug {
    method PARAMETERS (line 37) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self>;
    method PARAMETERS (line 41) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 47) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 53) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 59) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 65) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 71) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 76) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {
    method PARAMETERS (line 81) | fn PARAMETERS() -> &'static PoseidonConstants<Bls12, Self> {

FILE: filecoin-hashers/src/sha256.rs
  type Sha256Hasher (line 23) | pub struct Sha256Hasher {}
  type Domain (line 26) | type Domain = Sha256Domain;
  type Function (line 27) | type Function = Sha256Function;
  method name (line 29) | fn name() -> String {
  type Sha256Function (line 35) | pub struct Sha256Function(Sha256);
    method hash (line 162) | fn hash(data: &[u8]) -> Sha256Domain {
    method hash2 (line 170) | fn hash2(a: &Sha256Domain, b: &Sha256Domain) -> Sha256Domain {
    method hash_multi_leaf_circuit (line 181) | fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
    method hash_leaf_bits_circuit (line 203) | fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_circuit (line 238) | fn hash_circuit<CS: ConstraintSystem<Bls12>>(
    method hash2_circuit (line 252) | fn hash2_circuit<CS>(
    method hash (line 296) | fn hash(&mut self) -> Sha256Domain {
    method reset (line 305) | fn reset(&mut self) {
    method leaf (line 309) | fn leaf(&mut self, leaf: Sha256Domain) -> Sha256Domain {
    method node (line 313) | fn node(&mut self, left: Sha256Domain, right: Sha256Domain, _height: u...
    method multi_node (line 319) | fn multi_node(&mut self, parts: &[Sha256Domain], _height: usize) -> Sh...
  method write (line 39) | fn write(&mut self, msg: &[u8]) {
  method finish (line 44) | fn finish(&self) -> u64 {
  type Sha256Domain (line 50) | pub struct Sha256Domain(pub [u8; 32]);
    method as_ref (line 59) | fn as_ref(&self) -> &Self {
    method trim_to_fr32 (line 65) | fn trim_to_fr32(&mut self) {
    method as_ref (line 72) | fn as_ref(&self) -> &[u8] {
    method hash (line 78) | fn hash(&self, state: &mut Sha256Function) {
    method from (line 84) | fn from(val: Fr) -> Self {
    method from (line 95) | fn from(val: FrRepr) -> Self {
    method from (line 329) | fn from(val: [u8; 32]) -> Self {
  method fmt (line 53) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
  method from (line 104) | fn from(val: Sha256Domain) -> Self {
  method into_bytes (line 113) | fn into_bytes(&self) -> Vec<u8> {
  method try_from_bytes (line 117) | fn try_from_bytes(raw: &[u8]) -> anyhow::Result<Self> {
  method write_bytes (line 128) | fn write_bytes(&self, dest: &mut [u8]) -> anyhow::Result<()> {
  method random (line 138) | fn random<R: RngCore>(rng: &mut R) -> Self {
  method byte_len (line 145) | fn byte_len() -> usize {
  method from_slice (line 149) | fn from_slice(bytes: &[u8]) -> Self {
  method copy_to_slice (line 156) | fn copy_to_slice(&self, bytes: &mut [u8]) {
  function from (line 336) | fn from(val: Sha256Domain) -> Self {

FILE: filecoin-hashers/src/types.rs
  type Domain (line 19) | pub trait Domain:
    method into_bytes (line 37) | fn into_bytes(&self) -> Vec<u8>;
    method try_from_bytes (line 38) | fn try_from_bytes(raw: &[u8]) -> anyhow::Result<Self>;
    method write_bytes (line 40) | fn write_bytes(&self, _: &mut [u8]) -> anyhow::Result<()>;
    method random (line 42) | fn random<R: RngCore>(rng: &mut R) -> Self;
  type HashFunction (line 45) | pub trait HashFunction<T: Domain>: Clone + Debug + Send + Sync + LightAl...
    method hash (line 46) | fn hash(data: &[u8]) -> T;
    method hash2 (line 47) | fn hash2(a: &T, b: &T) -> T;
    method hash_md (line 48) | fn hash_md(input: &[T]) -> T {
    method hash_leaf (line 57) | fn hash_leaf(data: &dyn LightHashable<Self>) -> T {
    method hash_single_node (line 64) | fn hash_single_node(data: &dyn LightHashable<Self>) -> T {
    method hash_leaf_circuit (line 70) | fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_multi_leaf_circuit (line 82) | fn hash_multi_leaf_circuit<Arity: 'static + PoseidonArity, CS: Constra...
    method hash_md_circuit (line 88) | fn hash_md_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_leaf_bits_circuit (line 95) | fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
    method hash_circuit (line 104) | fn hash_circuit<CS: ConstraintSystem<Bls12>>(
    method hash2_circuit (line 109) | fn hash2_circuit<CS>(
  type Hasher (line 118) | pub trait Hasher: Clone + Debug + Eq + Default + Send + Sync {
    method name (line 122) | fn name() -> String;

FILE: filecoin-proofs/benches/preprocessing.rs
  function start_profile (line 11) | fn start_profile(stage: &str) {
  function start_profile (line 21) | fn start_profile(_stage: &str) {}
  function stop_profile (line 25) | fn stop_profile() {
  function stop_profile (line 35) | fn stop_profile() {}
  function random_data (line 37) | fn random_data(size: usize) -> Vec<u8> {
  function preprocessing_benchmark (line 42) | fn preprocessing_benchmark(c: &mut Criterion) {
  function add_piece_benchmark (line 68) | fn add_piece_benchmark(c: &mut Criterion) {

FILE: filecoin-proofs/build.rs
  constant VERSION (line 10) | const VERSION: &'static str = env!("CARGO_PKG_VERSION");
  function main (line 12) | fn main() {

FILE: filecoin-proofs/examples/beacon-post.rs
  function start_profile (line 36) | fn start_profile(stage: &str) {
  function start_profile (line 46) | fn start_profile(_stage: &str) {}
  function stop_profile (line 50) | fn stop_profile() {
  function stop_profile (line 56) | fn stop_profile() {}
  function do_the_work (line 58) | fn do_the_work(
  function main (line 164) | fn main() {

FILE: filecoin-proofs/examples/drgporep-vanilla-disk.rs
  function file_backed_mmap_from_random_bytes (line 36) | fn file_backed_mmap_from_random_bytes(n: usize) -> MmapMut {
  function do_the_work (line 49) | fn do_the_work<H: Hasher>(data_size: usize, m: usize, sloth_iter: usize,...
  function main (line 139) | fn main() {

FILE: filecoin-proofs/examples/drgporep-vanilla.rs
  function start_profile (line 35) | fn start_profile(stage: &str) {
  function start_profile (line 45) | fn start_profile(_stage: &str) {}
  function stop_profile (line 49) | fn stop_profile() {
  function stop_profile (line 55) | fn stop_profile() {}
  function do_the_work (line 57) | fn do_the_work<H: Hasher>(data_size: usize, m: usize, sloth_iter: usize,...
  function main (line 156) | fn main() {

FILE: filecoin-proofs/examples/drgporep.rs
  type DrgPoRepExample (line 21) | struct DrgPoRepExample<'a, E: JubjubEngine> {
  function synthesize (line 37) | fn synthesize<CS: ConstraintSystem<Bls12>>(self, cs: &mut CS) -> Result<...
  type DrgPoRepApp (line 58) | struct DrgPoRepApp {}
    method name (line 63) | fn name() -> String {
    method generate_groth_params (line 67) | fn generate_groth_params<R: Rng>(
    method samples (line 96) | fn samples() -> usize {
    method create_circuit (line 100) | fn create_circuit<R: Rng>(
    method verify_proof (line 133) | fn verify_proof(
  constant SLOTH_ROUNDS (line 60) | const SLOTH_ROUNDS: usize = 1;
  function main (line 143) | fn main() {

FILE: filecoin-proofs/examples/encoding.rs
  function start_profile (line 42) | fn start_profile(stage: &str) {
  function start_profile (line 52) | fn start_profile(_stage: &str) {}
  function stop_profile (line 56) | fn stop_profile() {
  function stop_profile (line 62) | fn stop_profile() {}
  function file_backed_mmap_from_random_bytes (line 64) | fn file_backed_mmap_from_random_bytes(n: usize) -> MmapMut {
  function file_backed_mmap_from (line 77) | pub fn file_backed_mmap_from(data: &[u8]) -> MmapMut {
  function do_the_work (line 84) | fn do_the_work<H: 'static>(data_size: usize, m: usize, expansion_degree:...
  function main (line 145) | fn main() {

FILE: filecoin-proofs/examples/ffi/main.rs
  function make_piece (line 31) | fn make_piece(num_bytes_in_piece: usize) -> (String, Vec<u8>) {
  function create_and_add_piece (line 40) | unsafe fn create_and_add_piece(
  function create_sector_builder (line 61) | unsafe fn create_sector_builder(
  funct
Condensed preview — 728 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,920K chars).
[
  {
    "path": ".circleci/config.yml",
    "chars": 19360,
    "preview": "version: 2.1\n\nparameters:\n  nightly-toolchain:\n    type: string\n    default: \"nightly-2021-04-24\"\n\nexecutors:\n  default:"
  },
  {
    "path": ".clippy.toml",
    "chars": 31,
    "preview": "type-complexity-threshold = 400"
  },
  {
    "path": ".dockerignore",
    "chars": 15,
    "preview": ".git\n/target/*\n"
  },
  {
    "path": ".gitignore",
    "chars": 113,
    "preview": "/target\n**/*.rs.bk\nCargo.lock\n.criterion\n**/*.h\nheaptrack*\n.bencher\n*.profile\n*.heap\nrust-fil-proofs.config.toml\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 19489,
    "preview": "# Changelog\n\nAll notable changes to rust-fil-proofs will be documented in this file.\n\nThe format is based on [Keep a Cha"
  },
  {
    "path": "CODEOWNERS",
    "chars": 34,
    "preview": "# Global Owners\n* @dignifiedquire\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 7106,
    "preview": "# Contributing\n\nWelcome, it is great that you found your way here. In order to make the best of all our time, we have ga"
  },
  {
    "path": "COPYRIGHT",
    "chars": 62,
    "preview": "This library is dual-licensed under Apache 2.0 and MIT terms.\n"
  },
  {
    "path": "Cargo.toml",
    "chars": 215,
    "preview": "[workspace]\n\nmembers = [\n  \"filecoin-proofs\",\n  \"storage-proofs-core\",\n  \"storage-proofs-porep\",\n  \"storage-proofs-post\""
  },
  {
    "path": "Dockerfile-ci",
    "chars": 959,
    "preview": "# Dockerfile for CircleCI\n# build with\n# `docker build -t filecoin/rust:latest -f ./Dockerfile-ci .`\n# rebuild: `docker "
  },
  {
    "path": "Dockerfile-profile",
    "chars": 3606,
    "preview": "# How to build and run this Dockerfile:\n#\n# ```\n# RUST_FIL_PROOFS=`pwd` # path to `rust-fil-proofs`\n# docker --log-level"
  },
  {
    "path": "LICENSE-APACHE",
    "chars": 582,
    "preview": "                         Copyright (c) 2018 Filecoin Project\n\nLicensed under the Apache License, Version 2.0 (the \"Licen"
  },
  {
    "path": "LICENSE-MIT",
    "chars": 1022,
    "preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
  },
  {
    "path": "README.md",
    "chars": 34,
    "preview": "# worlddatabase Proving Subsystem\n"
  },
  {
    "path": "SECURITY.md",
    "chars": 355,
    "preview": "# Security Policy\n\n## Reporting a Vulnerability\n\nFor reporting *critical* and *security* bugs, please consult our [Secur"
  },
  {
    "path": "bench.config.toml",
    "chars": 682,
    "preview": "\n[merklepor]\nchallenges = [ 1 ] #, 10, 50, 100, 200 ]\nsize = [ \"1 KiB\" ] #, \"64 MiB\", \"128 MiB\", \"256 MiB\", \"512 MiB\", \""
  },
  {
    "path": "build.rs",
    "chars": 206,
    "preview": "fn is_compiled_for_64_bit_arch() -> bool {\n    cfg!(target_pointer_width = \"64\")\n}\n\nfn main() {\n    assert!(\n        is_"
  },
  {
    "path": "console/bridge.go",
    "chars": 15713,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "console/bridge_test.go",
    "chars": 1452,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "console/console.go",
    "chars": 16143,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "console/console_test.go",
    "chars": 10709,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "console/prompt/prompter.go",
    "chars": 6284,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "console/testdata/exec.js",
    "chars": 37,
    "preview": "var execed = \"some-executed-string\";\n"
  },
  {
    "path": "console/testdata/preload.js",
    "chars": 41,
    "preview": "var preloaded = \"some-preloaded-string\";\n"
  },
  {
    "path": "eth/api.go",
    "chars": 17988,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/api_backend.go",
    "chars": 11749,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/api_test.go",
    "chars": 7120,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/backend.go",
    "chars": 19296,
    "preview": "// Copyright 2014 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/bloombits.go",
    "chars": 2551,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/discovery.go",
    "chars": 2337,
    "preview": "// Copyright 2019 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/api.go",
    "chars": 5456,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/downloader.go",
    "chars": 79209,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/downloader_test.go",
    "chars": 68010,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/events.go",
    "chars": 976,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/metrics.go",
    "chars": 2188,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/modes.go",
    "chars": 2321,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/peer.go",
    "chars": 19535,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/peer_test.go",
    "chars": 1557,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of go-ethereum.\n//\n// go-ethereum is free software: you c"
  },
  {
    "path": "eth/downloader/queue.go",
    "chars": 31656,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/queue_test.go",
    "chars": 13119,
    "preview": "// Copyright 2019 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/resultstore.go",
    "chars": 6440,
    "preview": "// Copyright 2019 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/statesync.go",
    "chars": 21703,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/testchain_test.go",
    "chars": 7995,
    "preview": "// Copyright 2018 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/downloader/types.go",
    "chars": 2578,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/ethconfig/config.go",
    "chars": 8242,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/ethconfig/gen_config.go",
    "chars": 9703,
    "preview": "// Code generated by github.com/fjl/gencodec. DO NOT EDIT.\n\npackage ethconfig\n\nimport (\n\t\"time\"\n\n\t\"github.com/ethereum/g"
  },
  {
    "path": "eth/fetcher/block_fetcher.go",
    "chars": 32521,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/fetcher/block_fetcher_test.go",
    "chars": 32722,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/fetcher/tx_fetcher.go",
    "chars": 33043,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/fetcher/tx_fetcher_test.go",
    "chars": 48105,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/api.go",
    "chars": 17039,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/api_test.go",
    "chars": 6346,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/bench_test.go",
    "chars": 5706,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/filter.go",
    "chars": 10402,
    "preview": "// Copyright 2014 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/filter_system.go",
    "chars": 16752,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/filter_system_test.go",
    "chars": 23869,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/filters/filter_test.go",
    "chars": 7205,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/gasprice/gasprice.go",
    "chars": 7083,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/gasprice/gasprice_test.go",
    "chars": 3880,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/handler.go",
    "chars": 19625,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/handler_eth.go",
    "chars": 8136,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/handler_eth_test.go",
    "chars": 26592,
    "preview": "// Copyright 2014 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/handler_snap.go",
    "chars": 1892,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/handler_test.go",
    "chars": 5254,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/peer.go",
    "chars": 2469,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/peerset.go",
    "chars": 7697,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/broadcast.go",
    "chars": 6258,
    "preview": "// Copyright 2019 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/discovery.go",
    "chars": 2166,
    "preview": "// Copyright 2019 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/handler.go",
    "chars": 9646,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/handler_test.go",
    "chars": 20321,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/handlers.go",
    "chars": 17504,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/handshake.go",
    "chars": 3589,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/handshake_test.go",
    "chars": 3094,
    "preview": "// Copyright 2014 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/peer.go",
    "chars": 19080,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/peer_test.go",
    "chars": 2067,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/protocol.go",
    "chars": 12499,
    "preview": "// Copyright 2014 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/eth/protocol_test.go",
    "chars": 15797,
    "preview": "// Copyright 2014 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/snap/discovery.go",
    "chars": 1141,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/snap/handler.go",
    "chars": 18049,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/snap/peer.go",
    "chars": 4334,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/snap/protocol.go",
    "chars": 8550,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/snap/sync.go",
    "chars": 91082,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/protocols/snap/sync_test.go",
    "chars": 49328,
    "preview": "// Copyright 2020 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/state_accessor.go",
    "chars": 9073,
    "preview": "// Copyright 2021 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/sync.go",
    "chars": 11677,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/sync_test.go",
    "chars": 2938,
    "preview": "// Copyright 2015 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/api.go",
    "chars": 28545,
    "preview": "// Copyright 2021 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/api_test.go",
    "chars": 14943,
    "preview": "// Copyright 2021 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/4byte_tracer.js",
    "chars": 2933,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/assets.go",
    "chars": 58744,
    "preview": "// Code generated by go-bindata. DO NOT EDIT.\n// sources:\n// 4byte_tracer.js (2.933kB)\n// bigram_tracer.js (1.712kB)\n// "
  },
  {
    "path": "eth/tracers/internal/tracers/bigram_tracer.js",
    "chars": 1712,
    "preview": "// Copyright 2018 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/call_tracer.js",
    "chars": 8956,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/evmdis_tracer.js",
    "chars": 4195,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/noop_tracer.js",
    "chars": 1271,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/opcount_tracer.js",
    "chars": 1372,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/prestate_tracer.js",
    "chars": 4287,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/tracers.go",
    "chars": 1017,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/trigram_tracer.js",
    "chars": 1788,
    "preview": "// Copyright 2018 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/internal/tracers/unigram_tracer.js",
    "chars": 1469,
    "preview": "// Copyright 2018 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_create.json",
    "chars": 12897,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"3755480783\",\n    \"gasLimit\": \"5401723\",\n    \"miner\": \"0xd049bfd667cb46aa3ef5df0da3e5"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_deep_calls.json",
    "chars": 95978,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"117066904\",\n    \"gasLimit\": \"4712384\",\n    \"miner\": \"0x1977c248e1014cc103929dd7f1541"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_delegatecall.json",
    "chars": 15643,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"31927752\",\n    \"gasLimit\": \"4707788\",\n    \"miner\": \"0x5659922ce141eedbc2733678f9806c"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_inner_create_oog_outer_throw.json",
    "chars": 43370,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"3451177886\",\n    \"gasLimit\": \"4709286\",\n    \"miner\": \"0x1585936b53834b021f68cc13eeef"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_inner_instafail.json",
    "chars": 2772,
    "preview": "{\n  \"genesis\": {\n    \"difficulty\": \"117067574\",\n    \"extraData\": \"0xd783010502846765746887676f312e372e33856c696e7578\",\n "
  },
  {
    "path": "eth/tracers/testdata/call_tracer_inner_throw_outer_revert.json",
    "chars": 24868,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"3956606365\",\n    \"gasLimit\": \"5413248\",\n    \"miner\": \"0x00d8ae40d9a06d0e7a2877b62e32"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_oog.json",
    "chars": 9812,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"3699098917\",\n    \"gasLimit\": \"5258985\",\n    \"miner\": \"0xd049bfd667cb46aa3ef5df0da3e5"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_revert.json",
    "chars": 6298,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"3665057456\",\n    \"gasLimit\": \"5232723\",\n    \"miner\": \"0xf4d8e706cfb25c0decbbdd4d2e2c"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_revert_reason.json",
    "chars": 8809,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"2\",\n    \"gasLimit\": \"8000000\",\n    \"miner\": \"0x0000000000000000000000000000000000000"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_simple.json",
    "chars": 6523,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"3502894804\",\n    \"gasLimit\": \"4722976\",\n    \"miner\": \"0x1585936b53834b021f68cc13eeef"
  },
  {
    "path": "eth/tracers/testdata/call_tracer_throw.json",
    "chars": 12985,
    "preview": "{\n  \"context\": {\n    \"difficulty\": \"117009631\",\n    \"gasLimit\": \"4712388\",\n    \"miner\": \"0x294e5d6c39a36ce38af1dca70c106"
  },
  {
    "path": "eth/tracers/tracer.go",
    "chars": 47786,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/tracer_test.go",
    "chars": 8015,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/tracers.go",
    "chars": 1780,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "eth/tracers/tracers_test.go",
    "chars": 10586,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "ethclient/ethclient.go",
    "chars": 19559,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "ethclient/ethclient_test.go",
    "chars": 16219,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "ethclient/signer.go",
    "chars": 2190,
    "preview": "// Copyright 2017 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "ethstats/ethstats.go",
    "chars": 24088,
    "preview": "// Copyright 2016 The go-ethereum Authors\n// This file is part of the go-ethereum library.\n//\n// The go-ethereum library"
  },
  {
    "path": "ffi-toolkit/Cargo.toml",
    "chars": 158,
    "preview": "[package]\nname = \"ffi-toolkit\"\nversion = \"0.1.0\"\nauthors = [\"laser <l@s3r.com>\"]\nlicense = \"MIT OR Apache-2.0\"\n\nedition "
  },
  {
    "path": "ffi-toolkit/LICENSE-APACHE",
    "chars": 10846,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "ffi-toolkit/LICENSE-MIT",
    "chars": 1022,
    "preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
  },
  {
    "path": "ffi-toolkit/README.md",
    "chars": 110,
    "preview": "# FFI Toolkit\n\nA collection of functions useful for working with the Rust FFI.\n\n## License\n\nMIT or Apache 2.0\n"
  },
  {
    "path": "ffi-toolkit/src/lib.rs",
    "chars": 1164,
    "preview": "extern crate libc;\n\nuse std::borrow::Cow;\nuse std::ffi::{CStr, CString};\nuse std::path::PathBuf;\n\n// produce a C string "
  },
  {
    "path": "fil-proofs-param/Cargo.toml",
    "chars": 2468,
    "preview": "[package]\nname = \"fil-proofs-param\"\ndescription = \"Filecoin parameter cli tools.\"\nversion = \"2.0.1\"\nauthors = [\"dignifie"
  },
  {
    "path": "fil-proofs-param/LICENSE-APACHE",
    "chars": 10846,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "fil-proofs-param/LICENSE-MIT",
    "chars": 1022,
    "preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
  },
  {
    "path": "fil-proofs-param/README.md",
    "chars": 16,
    "preview": "# worlddatabase\n"
  },
  {
    "path": "fil-proofs-param/scripts/pin-params.sh",
    "chars": 2700,
    "preview": "#!/usr/bin/env bash\nset -Eeuo pipefail\n\n# pin-params.sh\n#\n# - Post the directory of params to cluster.ipfs.io\n# - Grab t"
  },
  {
    "path": "fil-proofs-param/scripts/verify-parameters-json.sh",
    "chars": 1829,
    "preview": "#!/bin/sh\n\n# This script verifies that a given `.params` file (and the corresponding\n# `.vk` file) is part of `parameter"
  },
  {
    "path": "fil-proofs-param/src/bin/fakeipfsadd.rs",
    "chars": 1247,
    "preview": "use std::fs::File;\nuse std::io;\n\nuse blake2b_simd::State as Blake2b;\nuse structopt::StructOpt;\n\n#[derive(Debug, StructOp"
  },
  {
    "path": "fil-proofs-param/src/bin/paramcache.rs",
    "chars": 8952,
    "preview": "use std::env;\nuse std::process::exit;\nuse std::str::FromStr;\n\nuse dialoguer::{theme::ColorfulTheme, MultiSelect};\nuse fi"
  },
  {
    "path": "fil-proofs-param/src/bin/paramfetch.rs",
    "chars": 14728,
    "preview": "use std::env;\nuse std::fs::{create_dir_all, rename, File};\nuse std::io::{self, copy, stderr, stdout, Read, Stdout, Write"
  },
  {
    "path": "fil-proofs-param/src/bin/parampublish.rs",
    "chars": 12699,
    "preview": "use std::collections::BTreeMap;\nuse std::env;\nuse std::fs::{read_dir, File};\nuse std::io::{stderr, Write};\nuse std::path"
  },
  {
    "path": "fil-proofs-param/src/lib.rs",
    "chars": 87,
    "preview": "#![deny(clippy::all, clippy::perf, clippy::correctness)]\n#![warn(clippy::unwrap_used)]\n"
  },
  {
    "path": "fil-proofs-param/tests/paramfetch/mod.rs",
    "chars": 6155,
    "preview": "use std::collections::BTreeMap;\nuse std::fs::File;\nuse std::io::{self, BufReader, Write};\nuse std::path::PathBuf;\n\nuse b"
  },
  {
    "path": "fil-proofs-param/tests/paramfetch/session.rs",
    "chars": 3774,
    "preview": "use std::fs::File;\nuse std::io::{self, Read};\nuse std::panic::panic_any;\nuse std::path::{Path, PathBuf};\n\nuse failure::S"
  },
  {
    "path": "fil-proofs-param/tests/paramfetch/support/mod.rs",
    "chars": 17,
    "preview": "pub mod session;\n"
  },
  {
    "path": "fil-proofs-param/tests/parampublish/mod.rs",
    "chars": 103,
    "preview": "pub mod prompts_to_publish;\npub mod read_metadata_files;\npub mod support;\npub mod write_json_manifest;\n"
  },
  {
    "path": "fil-proofs-param/tests/parampublish/prompts_to_publish.rs",
    "chars": 2214,
    "preview": "use failure::Error as FailureError;\nuse storage_proofs_core::parameter_cache::CacheEntryMetadata;\n\nuse crate::parampubli"
  },
  {
    "path": "fil-proofs-param/tests/parampublish/read_metadata_files.rs",
    "chars": 1175,
    "preview": "use failure::Error as FailureError;\n\nuse crate::parampublish::support::session::ParamPublishSessionBuilder;\n\n#[test]\nfn "
  },
  {
    "path": "fil-proofs-param/tests/parampublish/support/mod.rs",
    "chars": 17,
    "preview": "pub mod session;\n"
  },
  {
    "path": "fil-proofs-param/tests/parampublish/support/session.rs",
    "chars": 6020,
    "preview": "use std::fs::{read_dir, File};\nuse std::io::{self, Read, Write};\nuse std::panic::panic_any;\nuse std::path::{Path, PathBu"
  },
  {
    "path": "fil-proofs-param/tests/parampublish/write_json_manifest.rs",
    "chars": 2994,
    "preview": "use std::collections::BTreeMap;\nuse std::fs::File;\nuse std::path::Path;\n\nuse storage_proofs_core::parameter_cache::{Cach"
  },
  {
    "path": "fil-proofs-param/tests/suite.rs",
    "chars": 47,
    "preview": "mod paramfetch;\nmod parampublish;\nmod support;\n"
  },
  {
    "path": "fil-proofs-param/tests/support/mod.rs",
    "chars": 2790,
    "preview": "use std::collections::BTreeMap;\nuse std::env;\nuse std::fs::File;\nuse std::path::{Path, PathBuf};\nuse std::process::Comma"
  },
  {
    "path": "fil-proofs-tooling/.gitignore",
    "chars": 129,
    "preview": "/target\n**/*.rs.bk\nCargo.lock\n.criterion\n**/*.h\nheaptrack*\n.bencher\nlogging-toolkit\n*.profile\n*.heap\nrust-fil-proofs.con"
  },
  {
    "path": "fil-proofs-tooling/Cargo.toml",
    "chars": 2537,
    "preview": "[package]\nname = \"fil-proofs-tooling\"\ndescription = \"Tooling for rust-fil-proofs\"\nversion = \"6.0.1\"\nauthors = [\"dignifie"
  },
  {
    "path": "fil-proofs-tooling/LICENSE-APACHE",
    "chars": 582,
    "preview": "                         Copyright (c) 2018 Filecoin Project\n\nLicensed under the Apache License, Version 2.0 (the \"Licen"
  },
  {
    "path": "fil-proofs-tooling/LICENSE-MIT",
    "chars": 1022,
    "preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
  },
  {
    "path": "fil-proofs-tooling/README.md",
    "chars": 14,
    "preview": "worlddatabase\n"
  },
  {
    "path": "fil-proofs-tooling/release.toml",
    "chars": 84,
    "preview": "disable-push = true\ndisable-publish = true\ndisable-tag = true\nno-dev-version = true\n"
  },
  {
    "path": "fil-proofs-tooling/scripts/aggregate-benchmarks.sh",
    "chars": 648,
    "preview": "#!/usr/bin/env bash\n\nset -e\n\nstacked_path=$1\nmicro_path=$2\nhash_constraints_path=$3\nwindow_post_path=$4\n\njq --sort-keys "
  },
  {
    "path": "fil-proofs-tooling/scripts/benchy.sh",
    "chars": 1577,
    "preview": "#!/usr/bin/env bash\n\nwhich jq >/dev/null || { printf '%s\\n' \"error: jq\" >&2; exit 1; }\n\nBENCHY_STDOUT=$(mktemp)\nGTIME_ST"
  },
  {
    "path": "fil-proofs-tooling/scripts/micro.sh",
    "chars": 990,
    "preview": "#!/usr/bin/env bash\n\nMICRO_SDERR=$(mktemp)\nMICRO_SDOUT=$(mktemp)\nJQ_STDERR=$(mktemp)\n\nCMD=\"cargo run --bin micro --relea"
  },
  {
    "path": "fil-proofs-tooling/scripts/retry.sh",
    "chars": 1206,
    "preview": "#!/usr/bin/env bash\n\n# Inspired by https://gist.github.com/reacocard/28611bfaa2395072119464521d48729a\n\nset -o errexit\nse"
  },
  {
    "path": "fil-proofs-tooling/scripts/run-remote.sh",
    "chars": 958,
    "preview": "#!/usr/bin/env bash\n\nCMDS=$(cat <<EOF\n\nset -e\n\n# Creates a temporary directory in which we build rust-fil-proofs and cap"
  },
  {
    "path": "fil-proofs-tooling/scripts/with-dots.sh",
    "chars": 159,
    "preview": "#!/usr/bin/env bash\n\ntrap cleanup EXIT\n\ncleanup() {\n  kill $DOT_PID\n}\n\n(\n  sleep 1\n  while true; do\n    (printf \".\" >&2)"
  },
  {
    "path": "fil-proofs-tooling/scripts/with-lock.sh",
    "chars": 1067,
    "preview": "#!/usr/bin/env bash\n\n# Inspired by http://mywiki.wooledge.org/BashFAQ/045\n\nfailure_code=$1\nlockdir=$2\nshift 2\n\n# Check t"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/hash_fns.rs",
    "chars": 2839,
    "preview": "use bellperson::bls::Bls12;\nuse bellperson::gadgets::boolean::Boolean;\nuse bellperson::util_cs::test_cs::TestConstraintS"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/main.rs",
    "chars": 8499,
    "preview": "//requires nightly, or later stable version\n//#![warn(clippy::unwrap_used)]\n\nuse std::io::{stdin, stdout};\nuse std::str:"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/merkleproofs.rs",
    "chars": 3120,
    "preview": "use std::fs::{create_dir, remove_dir_all};\nuse std::time::{SystemTime, UNIX_EPOCH};\n\nuse anyhow::Result;\nuse filecoin_ha"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/prodbench.rs",
    "chars": 12459,
    "preview": "use std::fs::remove_file;\nuse std::str::FromStr;\n\nuse bellperson::{bls::Bls12, util_cs::bench_cs::BenchCS, Circuit};\nuse"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/stacked.rs",
    "chars": 18062,
    "preview": "use std::fs::OpenOptions;\nuse std::time::Duration;\nuse std::{io, u32};\n\nuse anyhow::bail;\nuse bellperson::Circuit;\nuse c"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/window_post.rs",
    "chars": 10433,
    "preview": "use std::collections::BTreeMap;\nuse std::io::{stdout, Seek, SeekFrom, Write};\n\nuse fil_proofs_tooling::{measure, Metadat"
  },
  {
    "path": "fil-proofs-tooling/src/bin/benchy/winning_post.rs",
    "chars": 4740,
    "preview": "use std::io::stdout;\n\nuse anyhow::anyhow;\nuse fil_proofs_tooling::shared::{create_replica, PROVER_ID, RANDOMNESS};\nuse f"
  },
  {
    "path": "fil-proofs-tooling/src/bin/check_parameters/main.rs",
    "chars": 1070,
    "preview": "use std::path::PathBuf;\n\nuse anyhow::Result;\nuse bellperson::bls::Bls12;\nuse bellperson::groth16::MappedParameters;\nuse "
  },
  {
    "path": "fil-proofs-tooling/src/bin/circuitinfo/main.rs",
    "chars": 8493,
    "preview": "use std::str::FromStr;\n\nuse bellperson::{bls::Bls12, util_cs::bench_cs::BenchCS, Circuit};\nuse dialoguer::{theme::Colorf"
  },
  {
    "path": "fil-proofs-tooling/src/bin/fdlimit/main.rs",
    "chars": 223,
    "preview": "use anyhow::Result;\n\nfn main() -> Result<()> {\n    fil_logger::init();\n\n    let res = fdlimit::raise_fd_limit().expect(\""
  },
  {
    "path": "fil-proofs-tooling/src/bin/gen_graph_cache/main.rs",
    "chars": 7420,
    "preview": "use std::collections::BTreeMap;\nuse std::fs::File;\nuse std::io::BufWriter;\nuse std::path::Path;\n\nuse anyhow::Result;\nuse"
  },
  {
    "path": "fil-proofs-tooling/src/bin/gpu-cpu-test/README.md",
    "chars": 1996,
    "preview": "GPU CPU Test\n============\n\nThis is a test utility to test whether it works to prioritize certain proofs. When a proof is"
  },
  {
    "path": "fil-proofs-tooling/src/bin/gpu-cpu-test/main.rs",
    "chars": 9503,
    "preview": "//requires nightly, or later stable version\n//#![warn(clippy::unwrap_used)]\n\nuse std::collections::HashMap;\nuse std::pro"
  },
  {
    "path": "fil-proofs-tooling/src/bin/micro.rs",
    "chars": 15294,
    "preview": "use std::io::{self, BufRead};\n\nuse anyhow::{anyhow, Context, Result};\nuse commandspec::command;\nuse fil_proofs_tooling::"
  },
  {
    "path": "fil-proofs-tooling/src/bin/settings/main.rs",
    "chars": 140,
    "preview": "use anyhow::Result;\n\nuse storage_proofs_core::settings::SETTINGS;\n\nfn main() -> Result<()> {\n    println!(\"{:#?}\", *SETT"
  },
  {
    "path": "fil-proofs-tooling/src/bin/update_tree_r_cache/main.rs",
    "chars": 13811,
    "preview": "use std::fs::{self, create_dir_all, remove_dir_all, OpenOptions};\nuse std::path::{Path, PathBuf};\n\nuse anyhow::{ensure, "
  },
  {
    "path": "fil-proofs-tooling/src/lib.rs",
    "chars": 316,
    "preview": "#![deny(clippy::all, clippy::perf, clippy::correctness, rust_2018_idioms)]\n#![warn(clippy::unwrap_used)]\n#![warn(clippy:"
  },
  {
    "path": "fil-proofs-tooling/src/measure.rs",
    "chars": 553,
    "preview": "use std::time::{Duration, Instant};\n\nuse anyhow::Result;\nuse cpu_time::ProcessTime;\n\npub struct FuncMeasurement<T> {\n   "
  },
  {
    "path": "fil-proofs-tooling/src/metadata.rs",
    "chars": 4461,
    "preview": "use anyhow::{anyhow, Result};\nuse chrono::{DateTime, TimeZone, Utc};\nuse git2::Repository;\nuse serde::Serialize;\n\n/// Ca"
  },
  {
    "path": "fil-proofs-tooling/src/shared.rs",
    "chars": 7988,
    "preview": "use std::cmp::min;\nuse std::io::{BufWriter, Seek, SeekFrom, Write};\n\nuse filecoin_proofs::{\n    add_piece, seal_pre_comm"
  },
  {
    "path": "filecoin-hashers/Cargo.toml",
    "chars": 1261,
    "preview": "[package]\nname = \"filecoin-hashers\"\ndescription = \"Hashers used in filecoin and their abstractions.\"\nversion = \"2.0.1\"\na"
  },
  {
    "path": "filecoin-hashers/LICENSE-APACHE",
    "chars": 10846,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "filecoin-hashers/LICENSE-MIT",
    "chars": 1022,
    "preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
  },
  {
    "path": "filecoin-hashers/README.md",
    "chars": 165,
    "preview": "# worlddatabase\n\n> Different hash functions and abstraction over them.\n\n\nAvailable hashers are\n\n- `blake2s`\n- `poseidon`"
  },
  {
    "path": "filecoin-hashers/src/blake2s.rs",
    "chars": 8169,
    "preview": "use std::fmt::{self, Debug, Formatter};\nuse std::hash::Hasher as StdHasher;\nuse std::panic::panic_any;\n\nuse anyhow::ensu"
  },
  {
    "path": "filecoin-hashers/src/lib.rs",
    "chars": 439,
    "preview": "#![deny(clippy::all, clippy::perf, clippy::correctness, rust_2018_idioms)]\n#![allow(clippy::upper_case_acronyms)]\n#![war"
  },
  {
    "path": "filecoin-hashers/src/poseidon.rs",
    "chars": 17626,
    "preview": "use std::cmp::Ordering;\nuse std::hash::{Hash as StdHash, Hasher as StdHasher};\nuse std::mem::size_of;\nuse std::panic::pa"
  },
  {
    "path": "filecoin-hashers/src/poseidon_types.rs",
    "chars": 2706,
    "preview": "use std::fmt::Debug;\n\nuse bellperson::bls::{Bls12, Fr};\nuse generic_array::typenum::{U0, U11, U16, U2, U24, U36, U4, U8}"
  },
  {
    "path": "filecoin-hashers/src/sha256.rs",
    "chars": 8854,
    "preview": "use std::fmt::{self, Debug, Formatter};\nuse std::hash::Hasher as StdHasher;\nuse std::panic::panic_any;\n\nuse anyhow::ensu"
  },
  {
    "path": "filecoin-hashers/src/types.rs",
    "chars": 3427,
    "preview": "use std::fmt::Debug;\nuse std::hash::Hash as StdHash;\n\n#[cfg(feature = \"poseidon\")]\npub use crate::poseidon_types::*;\n\nus"
  },
  {
    "path": "filecoin-proofs/.gitignore",
    "chars": 52,
    "preview": "/target\n**/*.rs.bk\nCargo.lock\n.criterion\nheaptrack*\n"
  },
  {
    "path": "filecoin-proofs/Cargo.toml",
    "chars": 2480,
    "preview": "[package]\nname = \"filecoin-proofs\"\ndescription = \"The Filecoin specific aspects of storage-proofs, including a C based F"
  },
  {
    "path": "filecoin-proofs/LICENSE-APACHE",
    "chars": 10846,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "filecoin-proofs/LICENSE-MIT",
    "chars": 1022,
    "preview": "Permission is hereby granted, free of charge, to any\nperson obtaining a copy of this software and associated\ndocumentati"
  },
  {
    "path": "filecoin-proofs/README.md",
    "chars": 162,
    "preview": "# worlddatabase\n\n> The worlddatabase specific aspects of `storage-proofs`, including a C based WD, to generate and verif"
  },
  {
    "path": "filecoin-proofs/benches/preprocessing.rs",
    "chars": 3151,
    "preview": "use std::io::{Cursor, Read};\nuse std::time::Duration;\n\nuse criterion::{criterion_group, criterion_main, Criterion, Param"
  },
  {
    "path": "filecoin-proofs/build.rs",
    "chars": 2708,
    "preview": "extern crate bindgen;\nextern crate cbindgen;\n\nuse std::env;\nuse std::fs::File;\nuse std::io::Write;\nuse std::path::PathBu"
  },
  {
    "path": "filecoin-proofs/cbindgen.toml",
    "chars": 296,
    "preview": "[export]\n# A list of symbols to not include in the generated bindings\nexclude = [\"MerkleTree\"]\n\n[parse]\n# Whether to par"
  },
  {
    "path": "filecoin-proofs/examples/beacon-post.rs",
    "chars": 7099,
    "preview": "extern crate bellman;\nextern crate pairing;\nextern crate rand;\nextern crate sapling_crypto;\n#[macro_use]\nextern crate cl"
  },
  {
    "path": "filecoin-proofs/examples/drgporep-vanilla-disk.rs",
    "chars": 6480,
    "preview": "extern crate bellman;\nextern crate pairing;\nextern crate rand;\nextern crate sapling_crypto;\n#[macro_use]\nextern crate cl"
  },
  {
    "path": "filecoin-proofs/examples/drgporep-vanilla.rs",
    "chars": 6760,
    "preview": "extern crate bellman;\nextern crate pairing;\nextern crate rand;\nextern crate sapling_crypto;\n#[macro_use]\nextern crate cl"
  },
  {
    "path": "filecoin-proofs/examples/drgporep.rs",
    "chars": 4427,
    "preview": "extern crate bellman;\nextern crate pairing;\nextern crate pbr;\nextern crate rand;\nextern crate sapling_crypto;\n\nextern cr"
  }
]

// ... and 528 more files (download for full content)

About this extraction

This page contains the full source code of the WorldDbs/rust-fil-proofs GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 728 files (5.3 MB), approximately 1.4M tokens, and a symbol index with 8088 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!