Repository: utnet-org/utility
Branch: main
Commit: cedcc29826cb
Files: 1727
Total size: 25.5 MB
Directory structure:
gitextract_ayheqwxv/
├── .cargo/
│ ├── audit.toml
│ └── config.toml
├── .config/
│ └── nextest.toml
├── .dockerignore
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── 01_BUG_REPORT.md
│ │ └── 02_FEATURE_REQUEST.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── RELEASE_TEMPLATE.md
│ └── workflows/
│ ├── calculate-alpha-release.bash
│ ├── crates_publish.yml
│ ├── default.yml
│ ├── gh_pages.yml
│ ├── issue_metrics.yml
│ ├── release_binaries.yml
│ └── release_docker.yml
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── .style.yapf
├── ATTRIBUTIONS.md
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.toml
├── Dockerfile
├── Justfile
├── LICENSE-GPL2
├── LICENSE-GPL2.1
├── Makefile
├── README.md
├── SECURITY.md
├── buf.yaml
├── chain/
│ ├── chain/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── block_processing_utils.rs
│ │ ├── blocks_delay_tracker.rs
│ │ ├── chain.rs
│ │ ├── chain_update.rs
│ │ ├── chunks_store.rs
│ │ ├── crypto_hash_timer.rs
│ │ ├── doomslug.rs
│ │ ├── flat_storage_creator.rs
│ │ ├── garbage_collection.rs
│ │ ├── lib.rs
│ │ ├── lightclient.rs
│ │ ├── metrics.rs
│ │ ├── migrations.rs
│ │ ├── missing_chunks.rs
│ │ ├── orphan.rs
│ │ ├── resharding.rs
│ │ ├── sharding.rs
│ │ ├── state_request_tracker.rs
│ │ ├── state_snapshot_actor.rs
│ │ ├── store.rs
│ │ ├── store_validator/
│ │ │ └── validate.rs
│ │ ├── store_validator.rs
│ │ ├── test_utils/
│ │ │ ├── kv_runtime.rs
│ │ │ └── validator_schedule.rs
│ │ ├── test_utils.rs
│ │ ├── tests/
│ │ │ ├── challenges.rs
│ │ │ ├── doomslug.rs
│ │ │ ├── garbage_collection.rs
│ │ │ ├── mod.rs
│ │ │ ├── simple_chain.rs
│ │ │ └── sync_chain.rs
│ │ ├── types.rs
│ │ ├── update_shard.rs
│ │ └── validate.rs
│ ├── chain-primitives/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── error.rs
│ │ └── lib.rs
│ ├── chunks/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── adapter.rs
│ │ ├── chunk_cache.rs
│ │ ├── client.rs
│ │ ├── lib.rs
│ │ ├── logic.rs
│ │ ├── metrics.rs
│ │ ├── shards_manager_actor.rs
│ │ ├── test/
│ │ │ ├── basic.rs
│ │ │ └── multi.rs
│ │ ├── test_loop.rs
│ │ └── test_utils.rs
│ ├── chunks-primitives/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── error.rs
│ │ └── lib.rs
│ ├── client/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── adapter.rs
│ │ ├── adversarial.rs
│ │ ├── chunk_validation.rs
│ │ ├── client.rs
│ │ ├── client_actor.rs
│ │ ├── config_updater.rs
│ │ ├── debug.rs
│ │ ├── info.rs
│ │ ├── lib.rs
│ │ ├── metrics.rs
│ │ ├── sync/
│ │ │ ├── adapter.rs
│ │ │ ├── block.rs
│ │ │ ├── epoch.rs
│ │ │ ├── external.rs
│ │ │ ├── header.rs
│ │ │ ├── mod.rs
│ │ │ ├── state.rs
│ │ │ └── sync_actor.rs
│ │ ├── sync_jobs_actor.rs
│ │ ├── test_utils/
│ │ │ ├── block_stats.rs
│ │ │ ├── client.rs
│ │ │ ├── mod.rs
│ │ │ ├── peer_manager_mock.rs
│ │ │ ├── setup.rs
│ │ │ ├── test_env.rs
│ │ │ └── test_env_builder.rs
│ │ ├── tests/
│ │ │ ├── bug_repros.rs
│ │ │ ├── catching_up.rs
│ │ │ ├── chunks_management.rs
│ │ │ ├── consensus.rs
│ │ │ ├── cross_shard_tx.rs
│ │ │ ├── doomslug.rs
│ │ │ ├── maintenance_windows.rs
│ │ │ ├── mod.rs
│ │ │ ├── process_blocks.rs
│ │ │ └── query_client.rs
│ │ └── view_client.rs
│ ├── client-primitives/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── debug.rs
│ │ ├── lib.rs
│ │ └── types.rs
│ ├── epoch-manager/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── adapter.rs
│ │ ├── lib.rs
│ │ ├── proposals.rs
│ │ ├── reward_calculator.rs
│ │ ├── shard_assignment.rs
│ │ ├── shard_tracker.rs
│ │ ├── test_utils.rs
│ │ ├── tests/
│ │ │ ├── mod.rs
│ │ │ └── random_epochs.rs
│ │ ├── types.rs
│ │ └── validator_selection.rs
│ ├── indexer/
│ │ ├── CHANGELOG.md
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── lib.rs
│ │ └── streamer/
│ │ ├── errors.rs
│ │ ├── fetchers.rs
│ │ ├── metrics.rs
│ │ ├── mod.rs
│ │ └── utils.rs
│ ├── indexer-primitives/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ └── lib.rs
│ ├── jsonrpc/
│ │ ├── CHANGELOG.md
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── client/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ ├── fuzz/
│ │ │ ├── .gitignore
│ │ │ ├── Cargo.toml
│ │ │ └── fuzz_targets_disabled/
│ │ │ └── fuzz_target_1.rs
│ │ ├── jsonrpc-tests/
│ │ │ ├── Cargo.toml
│ │ │ ├── res/
│ │ │ │ └── genesis_config.json
│ │ │ ├── src/
│ │ │ │ └── lib.rs
│ │ │ └── tests/
│ │ │ ├── http_query.rs
│ │ │ ├── rpc_query.rs
│ │ │ └── rpc_transactions.rs
│ │ ├── res/
│ │ │ ├── chain_n_chunk_info.css
│ │ │ ├── chain_n_chunk_info.html
│ │ │ ├── debug.html
│ │ │ ├── epoch_info.css
│ │ │ ├── epoch_info.html
│ │ │ ├── last_blocks.css
│ │ │ ├── last_blocks.html
│ │ │ ├── last_blocks.js
│ │ │ ├── network_info.css
│ │ │ ├── network_info.html
│ │ │ ├── network_info.js
│ │ │ ├── rpc_errors_schema.json
│ │ │ ├── split_store.html
│ │ │ ├── sync.css
│ │ │ ├── sync.html
│ │ │ ├── tier1_network_info.html
│ │ │ ├── validator.css
│ │ │ └── validator.html
│ │ └── src/
│ │ ├── api/
│ │ │ ├── all_miners.rs
│ │ │ ├── blocks.rs
│ │ │ ├── changes.rs
│ │ │ ├── chunks.rs
│ │ │ ├── client_config.rs
│ │ │ ├── config.rs
│ │ │ ├── gas_price.rs
│ │ │ ├── light_client.rs
│ │ │ ├── maintenance.rs
│ │ │ ├── mod.rs
│ │ │ ├── network_info.rs
│ │ │ ├── provider.rs
│ │ │ ├── query.rs
│ │ │ ├── receipts.rs
│ │ │ ├── sandbox.rs
│ │ │ ├── split_storage.rs
│ │ │ ├── status.rs
│ │ │ ├── transactions.rs
│ │ │ └── validator.rs
│ │ ├── lib.rs
│ │ └── metrics.rs
│ ├── jsonrpc-adversarial-primitives/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── jsonrpc-primitives/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── errors.rs
│ │ ├── lib.rs
│ │ ├── message.rs
│ │ └── types/
│ │ ├── all_miners.rs
│ │ ├── blocks.rs
│ │ ├── changes.rs
│ │ ├── chunks.rs
│ │ ├── client_config.rs
│ │ ├── config.rs
│ │ ├── entity_debug.rs
│ │ ├── gas_price.rs
│ │ ├── light_client.rs
│ │ ├── maintenance.rs
│ │ ├── mod.rs
│ │ ├── network_info.rs
│ │ ├── provider.rs
│ │ ├── query.rs
│ │ ├── receipts.rs
│ │ ├── sandbox.rs
│ │ ├── split_storage.rs
│ │ ├── status.rs
│ │ ├── transactions.rs
│ │ └── validator.rs
│ ├── network/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ └── src/
│ │ ├── accounts_data/
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── actix.rs
│ │ ├── announce_accounts/
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── blacklist.rs
│ │ ├── broadcast/
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── client.rs
│ │ ├── concurrency/
│ │ │ ├── arc_mutex.rs
│ │ │ ├── atomic_cell.rs
│ │ │ ├── ctx/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── tests.rs
│ │ │ │ └── time.rs
│ │ │ ├── demux.rs
│ │ │ ├── mod.rs
│ │ │ ├── rate.rs
│ │ │ ├── rayon.rs
│ │ │ ├── runtime.rs
│ │ │ ├── scope/
│ │ │ │ ├── mod.rs
│ │ │ │ └── tests.rs
│ │ │ ├── signal.rs
│ │ │ └── tests.rs
│ │ ├── config.rs
│ │ ├── config_json.rs
│ │ ├── debug.rs
│ │ ├── lib.rs
│ │ ├── network_protocol/
│ │ │ ├── borsh.rs
│ │ │ ├── borsh_conv.rs
│ │ │ ├── edge.rs
│ │ │ ├── mod.rs
│ │ │ ├── network.proto
│ │ │ ├── peer.rs
│ │ │ ├── proto_conv/
│ │ │ │ ├── account_key.rs
│ │ │ │ ├── crypto.rs
│ │ │ │ ├── handshake.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── net.rs
│ │ │ │ ├── peer_message.rs
│ │ │ │ ├── time.rs
│ │ │ │ ├── trace_context.rs
│ │ │ │ └── util.rs
│ │ │ ├── state_sync.rs
│ │ │ ├── testonly.rs
│ │ │ └── tests.rs
│ │ ├── peer/
│ │ │ ├── mod.rs
│ │ │ ├── peer_actor.rs
│ │ │ ├── stream.rs
│ │ │ ├── testonly.rs
│ │ │ ├── tests/
│ │ │ │ ├── communication.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── stream.rs
│ │ │ ├── tracker.rs
│ │ │ └── transfer_stats.rs
│ │ ├── peer_manager/
│ │ │ ├── connection/
│ │ │ │ ├── mod.rs
│ │ │ │ └── tests.rs
│ │ │ ├── connection_store/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── testonly.rs
│ │ │ │ └── tests.rs
│ │ │ ├── mod.rs
│ │ │ ├── network_state/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── routing.rs
│ │ │ │ └── tier1.rs
│ │ │ ├── peer_manager_actor.rs
│ │ │ ├── peer_store/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── testonly.rs
│ │ │ │ └── tests.rs
│ │ │ ├── testonly.rs
│ │ │ └── tests/
│ │ │ ├── accounts_data.rs
│ │ │ ├── connection_pool.rs
│ │ │ ├── mod.rs
│ │ │ ├── nonce.rs
│ │ │ ├── routing.rs
│ │ │ ├── snapshot_hosts.rs
│ │ │ ├── tier1.rs
│ │ │ └── tier2.rs
│ │ ├── private_actix.rs
│ │ ├── raw/
│ │ │ ├── connection.rs
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── routing/
│ │ │ ├── bfs.rs
│ │ │ ├── edge.rs
│ │ │ ├── edge_cache/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── testonly.rs
│ │ │ │ └── tests.rs
│ │ │ ├── graph/
│ │ │ │ ├── mod.rs
│ │ │ │ └── tests.rs
│ │ │ ├── graph_v2/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── testonly.rs
│ │ │ │ └── tests.rs
│ │ │ ├── mod.rs
│ │ │ ├── route_back_cache.rs
│ │ │ └── routing_table_view/
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── shards_manager.rs
│ │ ├── sink.rs
│ │ ├── snapshot_hosts/
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── state_sync.rs
│ │ ├── stats/
│ │ │ ├── metrics.rs
│ │ │ └── mod.rs
│ │ ├── store/
│ │ │ ├── mod.rs
│ │ │ ├── schema/
│ │ │ │ ├── mod.rs
│ │ │ │ ├── testonly.rs
│ │ │ │ └── tests.rs
│ │ │ └── testonly.rs
│ │ ├── stun/
│ │ │ ├── mod.rs
│ │ │ ├── testonly.rs
│ │ │ └── tests.rs
│ │ ├── tcp.rs
│ │ ├── test_loop.rs
│ │ ├── test_utils.rs
│ │ ├── testonly/
│ │ │ ├── fake_client.rs
│ │ │ ├── mod.rs
│ │ │ └── stream.rs
│ │ └── types.rs
│ ├── pool/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── metrics.rs
│ │ └── types.rs
│ └── telemetry/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── lib.rs
│ └── metrics.rs
├── cliff.toml
├── codecov.yml
├── core/
│ ├── async/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── actix.rs
│ │ ├── examples/
│ │ │ ├── async_component.rs
│ │ │ ├── async_component_test.rs
│ │ │ ├── mod.rs
│ │ │ ├── multi_instance_test.rs
│ │ │ ├── sum_numbers.rs
│ │ │ ├── sum_numbers_test.rs
│ │ │ ├── timed_component.rs
│ │ │ └── timed_component_test.rs
│ │ ├── futures.rs
│ │ ├── lib.rs
│ │ ├── messaging.rs
│ │ ├── test_loop/
│ │ │ ├── adhoc.rs
│ │ │ ├── delay_sender.rs
│ │ │ ├── event_handler.rs
│ │ │ ├── futures.rs
│ │ │ └── multi_instance.rs
│ │ ├── test_loop.rs
│ │ └── time.rs
│ ├── chain-configs/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── client_config.rs
│ │ ├── genesis_config.rs
│ │ ├── genesis_validate.rs
│ │ ├── lib.rs
│ │ ├── metrics.rs
│ │ └── updateable_config.rs
│ ├── crypto/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── errors.rs
│ │ ├── hash.rs
│ │ ├── key_conversion.rs
│ │ ├── key_file.rs
│ │ ├── lib.rs
│ │ ├── signature.rs
│ │ ├── signer.rs
│ │ ├── test_utils.rs
│ │ ├── traits.rs
│ │ ├── util.rs
│ │ └── vrf.rs
│ ├── dyn-configs/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── lib.rs
│ │ └── metrics.rs
│ ├── o11y/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── benches/
│ │ │ └── metrics.rs
│ │ └── src/
│ │ ├── context.rs
│ │ ├── delay_detector.rs
│ │ ├── env_filter.rs
│ │ ├── io_tracer.rs
│ │ ├── lib.rs
│ │ ├── log_config.rs
│ │ ├── log_counter.rs
│ │ ├── macros.rs
│ │ ├── metrics.rs
│ │ ├── opentelemetry.rs
│ │ ├── reload.rs
│ │ ├── span_duration_logger.rs
│ │ ├── subscriber.rs
│ │ ├── testonly/
│ │ │ └── tracing_capture.rs
│ │ └── testonly.rs
│ ├── parameters/
│ │ ├── Cargo.toml
│ │ ├── res/
│ │ │ ├── README.md
│ │ │ └── runtime_configs/
│ │ │ ├── 129.yaml
│ │ │ ├── 138.yaml
│ │ │ ├── 35.yaml
│ │ │ ├── 42.yaml
│ │ │ ├── 46.yaml
│ │ │ ├── 48.yaml
│ │ │ ├── 49.yaml
│ │ │ ├── 50.yaml
│ │ │ ├── 52.yaml
│ │ │ ├── 53.yaml
│ │ │ ├── 55.yaml
│ │ │ ├── 57.yaml
│ │ │ ├── 59.yaml
│ │ │ ├── 61.yaml
│ │ │ ├── 62.yaml
│ │ │ ├── 63.yaml
│ │ │ ├── 64.yaml
│ │ │ ├── parameters.snap
│ │ │ ├── parameters.yaml
│ │ │ └── parameters_testnet.yaml
│ │ └── src/
│ │ ├── config.rs
│ │ ├── config_store.rs
│ │ ├── cost.rs
│ │ ├── lib.rs
│ │ ├── parameter.rs
│ │ ├── parameter_table.rs
│ │ ├── snapshots/
│ │ │ ├── unc_parameters__config_store__tests__138.json.snap
│ │ │ ├── unc_parameters__config_store__tests__testnet_138.json.snap
│ │ │ └── unc_parameters__view__tests__runtime_config_view.snap
│ │ ├── view.rs
│ │ └── vm.rs
│ ├── primitives/
│ │ ├── Cargo.toml
│ │ ├── benches/
│ │ │ └── serialization.rs
│ │ └── src/
│ │ ├── action/
│ │ │ ├── delegate.rs
│ │ │ └── mod.rs
│ │ ├── block.rs
│ │ ├── block_header.rs
│ │ ├── challenge.rs
│ │ ├── chunk_validation.rs
│ │ ├── epoch_manager.rs
│ │ ├── epoch_sync.rs
│ │ ├── errors.rs
│ │ ├── lib.rs
│ │ ├── merkle.rs
│ │ ├── network.rs
│ │ ├── rand.rs
│ │ ├── receipt.rs
│ │ ├── runtime/
│ │ │ ├── apply_state.rs
│ │ │ ├── migration_data.rs
│ │ │ └── mod.rs
│ │ ├── sandbox.rs
│ │ ├── shard_layout.rs
│ │ ├── sharding/
│ │ │ └── shard_chunk_header_inner.rs
│ │ ├── sharding.rs
│ │ ├── signable_message.rs
│ │ ├── snapshots/
│ │ │ ├── unc_primitives__views__tests__exec_metadata_v1_view.snap
│ │ │ ├── unc_primitives__views__tests__exec_metadata_v2_view.snap
│ │ │ ├── unc_primitives__views__tests__exec_metadata_v3_view.snap
│ │ │ └── unc_primitives__views__tests__runtime_config_view.snap
│ │ ├── state.rs
│ │ ├── state_part.rs
│ │ ├── state_record.rs
│ │ ├── state_sync.rs
│ │ ├── static_clock.rs
│ │ ├── telemetry.rs
│ │ ├── test_utils.rs
│ │ ├── transaction.rs
│ │ ├── trie_key.rs
│ │ ├── types.rs
│ │ ├── upgrade_schedule.rs
│ │ ├── utils/
│ │ │ └── min_heap.rs
│ │ ├── utils.rs
│ │ ├── validator_mandates.rs
│ │ ├── validator_signer.rs
│ │ ├── version.rs
│ │ └── views.rs
│ ├── primitives-core/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── account.rs
│ │ ├── chains.rs
│ │ ├── config.rs
│ │ ├── hash.rs
│ │ ├── lib.rs
│ │ ├── serialize.rs
│ │ ├── types.rs
│ │ └── version.rs
│ └── store/
│ ├── Cargo.toml
│ ├── benches/
│ │ ├── finalize_bench.rs
│ │ ├── store_bench.rs
│ │ └── trie_bench.rs
│ └── src/
│ ├── cold_storage.rs
│ ├── columns.rs
│ ├── config.rs
│ ├── db/
│ │ ├── colddb.rs
│ │ ├── database_tests.rs
│ │ ├── refcount.rs
│ │ ├── rocksdb/
│ │ │ ├── instance_tracker.rs
│ │ │ └── snapshot.rs
│ │ ├── rocksdb.rs
│ │ ├── slice.rs
│ │ ├── splitdb.rs
│ │ └── testdb.rs
│ ├── db.rs
│ ├── flat/
│ │ ├── chunk_view.rs
│ │ ├── delta.rs
│ │ ├── inlining_migration.rs
│ │ ├── manager.rs
│ │ ├── metrics.rs
│ │ ├── mod.rs
│ │ ├── storage.rs
│ │ ├── store_helper.rs
│ │ ├── test_utils.rs
│ │ └── types.rs
│ ├── genesis/
│ │ ├── initialization.rs
│ │ ├── mod.rs
│ │ └── state_applier.rs
│ ├── lib.rs
│ ├── metadata.rs
│ ├── metrics.rs
│ ├── migrations.rs
│ ├── opener.rs
│ ├── rocksdb_metrics.rs
│ ├── sync_utils.rs
│ ├── test_utils.rs
│ └── trie/
│ ├── accounting_cache.rs
│ ├── config.rs
│ ├── from_flat.rs
│ ├── insert_delete.rs
│ ├── iterator.rs
│ ├── mem/
│ │ ├── arena/
│ │ │ ├── alloc.rs
│ │ │ ├── metrics.rs
│ │ │ └── mod.rs
│ │ ├── construction.rs
│ │ ├── flexible_data/
│ │ │ ├── children.rs
│ │ │ ├── encoding.rs
│ │ │ ├── extension.rs
│ │ │ ├── mod.rs
│ │ │ └── value.rs
│ │ ├── loading.rs
│ │ ├── lookup.rs
│ │ ├── metrics.rs
│ │ ├── mod.rs
│ │ ├── node/
│ │ │ ├── encoding.rs
│ │ │ ├── mod.rs
│ │ │ ├── mutation.rs
│ │ │ ├── tests.rs
│ │ │ └── view.rs
│ │ └── updating.rs
│ ├── mod.rs
│ ├── nibble_slice.rs
│ ├── prefetching_trie_storage.rs
│ ├── raw_node.rs
│ ├── resharding.rs
│ ├── shard_tries.rs
│ ├── state_parts.rs
│ ├── state_snapshot.rs
│ ├── trie_recording.rs
│ ├── trie_storage.rs
│ ├── trie_tests.rs
│ ├── update/
│ │ └── iterator.rs
│ └── update.rs
├── deny.toml
├── docs/
│ ├── README.md
│ ├── SUMMARY.md
│ ├── advanced_configuration/
│ │ └── networking.md
│ ├── architecture/
│ │ ├── README.md
│ │ ├── gas/
│ │ │ ├── README.md
│ │ │ ├── estimator.md
│ │ │ ├── gas_profile.md
│ │ │ └── parameter_definition.md
│ │ ├── how/
│ │ │ ├── README.md
│ │ │ ├── epoch.md
│ │ │ ├── gas.md
│ │ │ ├── gc.md
│ │ │ ├── meta-tx.md
│ │ │ ├── proofs.md
│ │ │ ├── serialization.md
│ │ │ ├── sync.md
│ │ │ ├── tx_receipts.md
│ │ │ └── tx_routing.md
│ │ ├── network.md
│ │ ├── next/
│ │ │ ├── README.md
│ │ │ ├── catchup_and_state_sync.md
│ │ │ └── malicious_chunk_producer_and_phase2.md
│ │ ├── storage/
│ │ │ ├── database.md
│ │ │ ├── flat_storage.md
│ │ │ ├── flow.md
│ │ │ └── trie.md
│ │ └── storage.md
│ ├── book.toml
│ ├── misc/
│ │ ├── README.md
│ │ ├── state_sync_dump.md
│ │ └── state_sync_from_external_storage.md
│ ├── practices/
│ │ ├── README.md
│ │ ├── docs.md
│ │ ├── engaging_and_effective_communication.md
│ │ ├── fast_builds.md
│ │ ├── protocol_upgrade.md
│ │ ├── rust.md
│ │ ├── security_vulnerabilities.md
│ │ ├── style.md
│ │ ├── testing/
│ │ │ ├── README.md
│ │ │ ├── python_tests.md
│ │ │ └── test_utils.md
│ │ ├── tracking_issues.md
│ │ ├── when_to_use_private_repository.md
│ │ └── workflows/
│ │ ├── README.md
│ │ ├── deploy_a_contract.md
│ │ ├── gas_estimations.md
│ │ ├── io_trace.md
│ │ ├── localnet_on_many_machines.md
│ │ └── run_a_node.md
│ └── test_networks/
│ └── mainnet_spoon.md
├── genesis-tools/
│ ├── README.md
│ ├── genesis-csv-to-json/
│ │ ├── Cargo.toml
│ │ ├── res/
│ │ │ └── test_accounts.csv
│ │ └── src/
│ │ ├── csv_parser.rs
│ │ ├── csv_to_json_configs.rs
│ │ ├── main.rs
│ │ └── serde_with.rs
│ ├── genesis-populate/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── main.rs
│ │ └── state_dump.rs
│ └── keypair-generator/
│ ├── Cargo.toml
│ └── src/
│ └── main.rs
├── infra/
│ ├── Cargo.toml
│ ├── benches/
│ │ └── store.rs
│ ├── res/
│ │ ├── example-config-gc.json
│ │ └── example-config-no-gc.json
│ ├── src/
│ │ ├── append_only_map.rs
│ │ ├── cold_storage.rs
│ │ ├── config.rs
│ │ ├── config_validate.rs
│ │ ├── download_file.rs
│ │ ├── dyn_config.rs
│ │ ├── entity_debug.rs
│ │ ├── entity_debug_serializer.rs
│ │ ├── lib.rs
│ │ ├── metrics.rs
│ │ ├── migrations.rs
│ │ ├── runtime/
│ │ │ ├── errors.rs
│ │ │ ├── mod.rs
│ │ │ └── tests.rs
│ │ ├── state_sync.rs
│ │ └── test_utils.rs
│ └── tests/
│ └── economics.rs
├── integration-tests/
│ ├── Cargo.toml
│ └── src/
│ ├── genesis_helpers.rs
│ ├── lib.rs
│ ├── node/
│ │ ├── mod.rs
│ │ ├── process_node.rs
│ │ ├── runtime_node.rs
│ │ └── thread_node.rs
│ ├── runtime_utils.rs
│ ├── test_helpers.rs
│ ├── tests/
│ │ ├── client/
│ │ │ ├── access_key_nonce_for_implicit_accounts.rs
│ │ │ ├── account_id_in_function_call_permission.rs
│ │ │ ├── adversarial_behaviors.rs
│ │ │ ├── benchmarks.rs
│ │ │ ├── block_corruption.rs
│ │ │ ├── cap_max_gas_price.rs
│ │ │ ├── challenges.rs
│ │ │ ├── chunk_nodes_cache.rs
│ │ │ ├── chunk_validation.rs
│ │ │ ├── chunks_management.rs
│ │ │ ├── cold_storage.rs
│ │ │ ├── epoch_sync.rs
│ │ │ ├── fix_contract_loading_cost.rs
│ │ │ ├── fix_storage_usage.rs
│ │ │ ├── flat_storage.rs
│ │ │ ├── in_memory_tries.rs
│ │ │ ├── increase_deployment_cost.rs
│ │ │ ├── increase_storage_compute_cost.rs
│ │ │ ├── limit_contract_functions_number.rs
│ │ │ ├── lower_storage_key_limit.rs
│ │ │ ├── mod.rs
│ │ │ ├── process_blocks.rs
│ │ │ ├── restore_receipts_after_fix_apply_chunks.rs
│ │ │ ├── runtimes.rs
│ │ │ ├── sandbox.rs
│ │ │ ├── state_dump.rs
│ │ │ ├── state_snapshot.rs
│ │ │ ├── sync_state_nodes.rs
│ │ │ ├── uncvm.rs
│ │ │ ├── undo_block.rs
│ │ │ ├── wallet_contract.rs
│ │ │ └── zero_balance_account.rs
│ │ ├── framework/
│ │ │ ├── mod.rs
│ │ │ ├── node_cluster.rs
│ │ │ ├── pledge_nodes.rs
│ │ │ ├── rpc_error_structs.rs
│ │ │ ├── rpc_nodes.rs
│ │ │ ├── run_nodes.rs
│ │ │ ├── sync_nodes.rs
│ │ │ └── track_shards.rs
│ │ ├── mod.rs
│ │ ├── network/
│ │ │ ├── churn_attack.rs
│ │ │ ├── full_network.rs
│ │ │ ├── mod.rs
│ │ │ ├── peer_handshake.rs
│ │ │ ├── runner.rs
│ │ │ └── stress_network.rs
│ │ ├── runtime/
│ │ │ ├── deployment.rs
│ │ │ ├── mod.rs
│ │ │ ├── sanity_checks.rs
│ │ │ ├── snapshots/
│ │ │ │ ├── integration_tests__tests__runtime__sanity_checks__receipts_gas_profile.snap
│ │ │ │ ├── integration_tests__tests__runtime__sanity_checks__receipts_gas_profile_nightly.snap
│ │ │ │ ├── integration_tests__tests__runtime__sanity_checks__receipts_gas_profile_nondeterministic.snap
│ │ │ │ ├── integration_tests__tests__runtime__sanity_checks__receipts_gas_profile_nondeterministic_nightly.snap
│ │ │ │ ├── integration_tests__tests__runtime__sanity_checks__receipts_status.snap
│ │ │ │ └── integration_tests__tests__runtime__sanity_checks__receipts_status_nondeterministic.snap
│ │ │ ├── state_viewer.rs
│ │ │ └── test_evil_contracts.rs
│ │ ├── standard_cases/
│ │ │ ├── mod.rs
│ │ │ ├── rpc.rs
│ │ │ └── runtime.rs
│ │ ├── test_catchup.rs
│ │ ├── test_errors.rs
│ │ ├── test_overflows.rs
│ │ ├── test_simple.rs
│ │ └── test_tps_regression.rs
│ ├── unc_utils.rs
│ └── user/
│ ├── mod.rs
│ ├── rpc_user.rs
│ └── runtime_user.rs
├── lychee.toml
├── node/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── res/
│ │ ├── invalid_proof.json
│ │ └── proof_example.json
│ └── src/
│ ├── cli.rs
│ └── main.rs
├── pytest/
│ ├── Pipfile
│ ├── README.md
│ ├── __init__.py
│ ├── debug_scripts/
│ │ ├── Pipfile
│ │ ├── READEME.md
│ │ ├── __init__.py
│ │ ├── request_chain_info.py
│ │ ├── send_validator_logs.py
│ │ └── tests/
│ │ ├── __init__.py
│ │ ├── data/
│ │ │ └── node0.logs
│ │ └── send_validator_logs_test.py
│ ├── endtoend/
│ │ ├── __init__.py
│ │ └── endtoend.py
│ ├── lib/
│ │ ├── __init__.py
│ │ ├── account.py
│ │ ├── branches.py
│ │ ├── cluster.py
│ │ ├── configured_logger.py
│ │ ├── data.py
│ │ ├── key.py
│ │ ├── lightclient.py
│ │ ├── messages/
│ │ │ ├── __init__.py
│ │ │ ├── block.py
│ │ │ ├── bridge.py
│ │ │ ├── crypto.py
│ │ │ ├── network.py
│ │ │ ├── shard.py
│ │ │ └── tx.py
│ │ ├── metrics.py
│ │ ├── mocknet.py
│ │ ├── mocknet_helpers.py
│ │ ├── network.py
│ │ ├── peer.py
│ │ ├── populate.py
│ │ ├── proxy.py
│ │ ├── proxy_instances.py
│ │ ├── resharding_lib.py
│ │ ├── serializer.py
│ │ ├── state_sync_lib.py
│ │ ├── transaction.py
│ │ └── utils.py
│ ├── remote.json
│ ├── requirements.txt
│ ├── tests/
│ │ ├── __init__.py
│ │ ├── delete_remote_nodes.py
│ │ └── loadtest/
│ │ ├── README.md
│ │ ├── contract/
│ │ │ ├── Cargo.toml
│ │ │ ├── build.sh
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ ├── loadtest.py
│ │ ├── loadtest2.py
│ │ ├── locust/
│ │ │ ├── README.md
│ │ │ ├── common/
│ │ │ │ ├── base.py
│ │ │ │ ├── congestion.py
│ │ │ │ ├── ft.py
│ │ │ │ └── social.py
│ │ │ ├── locustfiles/
│ │ │ │ ├── congestion.py
│ │ │ │ ├── ft.py
│ │ │ │ └── social.py
│ │ │ └── res/
│ │ │ └── social_db.wasm
│ │ └── setup.py
│ └── tools/
│ ├── mirror/
│ │ ├── contract/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ ├── mirror_utils.py
│ │ ├── offline_test.py
│ │ └── online_test.py
│ └── prober/
│ ├── prober.py
│ ├── prober_split.py
│ └── prober_util.py
├── runtime/
│ ├── runtime/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── actions.rs
│ │ │ ├── adapter.rs
│ │ │ ├── balance_checker.rs
│ │ │ ├── config.rs
│ │ │ ├── ext.rs
│ │ │ ├── lib.rs
│ │ │ ├── metrics.rs
│ │ │ ├── prefetch.rs
│ │ │ ├── receipt_manager.rs
│ │ │ ├── state_viewer/
│ │ │ │ ├── errors.rs
│ │ │ │ └── mod.rs
│ │ │ └── verifier.rs
│ │ └── tests/
│ │ ├── runtime_group_tools/
│ │ │ ├── mod.rs
│ │ │ └── random_config.rs
│ │ └── test_async_calls.rs
│ ├── runtime-params-estimator/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── compiler.sh
│ │ ├── costs.txt
│ │ ├── emu-cost/
│ │ │ ├── Dockerfile
│ │ │ ├── README.md
│ │ │ ├── build.sh
│ │ │ ├── counter_plugin/
│ │ │ │ ├── 0001-linux-user-fix-page-table-trashing-when-mmap-munmap-.patch
│ │ │ │ ├── 0002-linux-user-strace-better-format-mmap-logs-support-mr.patch
│ │ │ │ ├── 0003-plugins-avoid-failing-plugin-when-CPU-is-inited-seve.patch
│ │ │ │ ├── Makefile
│ │ │ │ ├── counter.c
│ │ │ │ ├── qemu-x86_64
│ │ │ │ └── test.c
│ │ │ ├── data_builder.py
│ │ │ ├── io_cost.sh
│ │ │ └── run.sh
│ │ ├── estimate.sh
│ │ ├── estimator-warehouse/
│ │ │ ├── .gitignore
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ ├── check.rs
│ │ │ ├── db.rs
│ │ │ ├── estimate.rs
│ │ │ ├── import.rs
│ │ │ ├── init.sql
│ │ │ ├── main.rs
│ │ │ ├── snapshots/
│ │ │ │ ├── estimator_warehouse__check__tests__check_command-2.snap
│ │ │ │ ├── estimator_warehouse__check__tests__check_command-3.snap
│ │ │ │ ├── estimator_warehouse__check__tests__check_command-4.snap
│ │ │ │ ├── estimator_warehouse__check__tests__check_command.snap
│ │ │ │ └── estimator_warehouse__tests__stats.snap
│ │ │ └── zulip.rs
│ │ ├── res/
│ │ │ ├── 75220100-75220101.s0.io_trace
│ │ │ ├── fungible_token.wasm
│ │ │ ├── lockup_contract.wasm
│ │ │ ├── mission_control.wasm
│ │ │ ├── staking_pool.wasm
│ │ │ ├── status_message.wasm
│ │ │ ├── voting_contract.wasm
│ │ │ └── whitelist.wasm
│ │ ├── setup.sh
│ │ └── src/
│ │ ├── action_costs.rs
│ │ ├── config.rs
│ │ ├── cost.rs
│ │ ├── cost_table.rs
│ │ ├── costs_to_runtime_config.rs
│ │ ├── estimator_context.rs
│ │ ├── estimator_params.rs
│ │ ├── function_call.rs
│ │ ├── gas_cost.rs
│ │ ├── gas_metering.rs
│ │ ├── least_squares.rs
│ │ ├── lib.rs
│ │ ├── main.rs
│ │ ├── qemu.rs
│ │ ├── replay/
│ │ │ ├── cache_stats.rs
│ │ │ ├── fold_db_ops.rs
│ │ │ └── gas_charges.rs
│ │ ├── replay.rs
│ │ ├── rocksdb.rs
│ │ ├── snapshots/
│ │ │ ├── runtime_params_estimator__replay__tests__CacheStats-75220100-75220101.s0.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__CacheStats-75220100-75220101.s1.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__CacheStats-75220100-75220101.s2.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__CacheStats-75220100-75220101.s3.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkCacheStats-75220100-75220101.s0.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkCacheStats-75220100-75220101.s1.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkCacheStats-75220100-75220101.s2.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkCacheStats-75220100-75220101.s3.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkDbStats-75220100-75220101.s0.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkDbStats-75220100-75220101.s1.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkDbStats-75220100-75220101.s2.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ChunkDbStats-75220100-75220101.s3.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__GasCharges-75220100-75220101.s0.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__GasCharges-75220100-75220101.s1.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__GasCharges-75220100-75220101.s2.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__GasCharges-75220100-75220101.s3.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptCacheStats-75220100-75220101.s0.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptCacheStats-75220100-75220101.s1.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptCacheStats-75220100-75220101.s2.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptCacheStats-75220100-75220101.s3.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptDbStats-75220100-75220101.s0.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptDbStats-75220100-75220101.s1.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptDbStats-75220100-75220101.s2.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__ReceiptDbStats-75220100-75220101.s3.io_trace.snap
│ │ │ ├── runtime_params_estimator__replay__tests__account_filter_CacheStats.snap
│ │ │ ├── runtime_params_estimator__replay__tests__account_filter_ReceiptCacheStats.snap
│ │ │ └── runtime_params_estimator__replay__tests__account_filter_ReceiptDbStats.snap
│ │ ├── transaction_builder.rs
│ │ ├── trie.rs
│ │ ├── utils.rs
│ │ └── vm_estimator.rs
│ ├── unc-test-contracts/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── build.rs
│ │ ├── contract-for-fuzzing-rs/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ ├── estimator-contract/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ ├── res/
│ │ │ ├── .gitignore
│ │ │ ├── test_contract_ts.wasm
│ │ │ └── unc_evm.wasm
│ │ ├── src/
│ │ │ └── lib.rs
│ │ └── test-contract-rs/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── unc-vm/
│ │ ├── .gitignore
│ │ ├── ATTRIBUTIONS.md
│ │ ├── README.md
│ │ ├── compiler/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ ├── address_map.rs
│ │ │ ├── compiler.rs
│ │ │ ├── error.rs
│ │ │ ├── function.rs
│ │ │ ├── jump_table.rs
│ │ │ ├── lib.rs
│ │ │ ├── module.rs
│ │ │ ├── relocation.rs
│ │ │ ├── section.rs
│ │ │ ├── sourceloc.rs
│ │ │ ├── target.rs
│ │ │ ├── translator/
│ │ │ │ ├── environ.rs
│ │ │ │ ├── error.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── module.rs
│ │ │ │ ├── sections.rs
│ │ │ │ └── state.rs
│ │ │ └── trap.rs
│ │ ├── compiler-singlepass/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ ├── address_map.rs
│ │ │ ├── codegen_x64.rs
│ │ │ ├── compiler.rs
│ │ │ ├── config.rs
│ │ │ ├── emitter_x64.rs
│ │ │ ├── lib.rs
│ │ │ ├── machine.rs
│ │ │ └── x64_decl.rs
│ │ ├── compiler-test-derive/
│ │ │ ├── Cargo.toml
│ │ │ ├── build.rs
│ │ │ └── src/
│ │ │ ├── ignores.rs
│ │ │ └── lib.rs
│ │ ├── engine/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── src/
│ │ │ ├── engine.rs
│ │ │ ├── error.rs
│ │ │ ├── export.rs
│ │ │ ├── lib.rs
│ │ │ ├── resolver.rs
│ │ │ ├── trap/
│ │ │ │ ├── error.rs
│ │ │ │ ├── frame_info.rs
│ │ │ │ └── mod.rs
│ │ │ └── universal/
│ │ │ ├── artifact.rs
│ │ │ ├── builder.rs
│ │ │ ├── code_memory.rs
│ │ │ ├── engine.rs
│ │ │ ├── executable.rs
│ │ │ ├── link.rs
│ │ │ └── mod.rs
│ │ ├── test-api/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ ├── build.rs
│ │ │ └── src/
│ │ │ ├── lib.rs
│ │ │ └── sys/
│ │ │ ├── env.rs
│ │ │ ├── exports.rs
│ │ │ ├── externals/
│ │ │ │ ├── function.rs
│ │ │ │ ├── global.rs
│ │ │ │ ├── memory.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── table.rs
│ │ │ ├── import_object.rs
│ │ │ ├── instance.rs
│ │ │ ├── mod.rs
│ │ │ ├── module.rs
│ │ │ ├── native.rs
│ │ │ ├── ptr.rs
│ │ │ ├── store.rs
│ │ │ ├── tunables.rs
│ │ │ └── types.rs
│ │ ├── test-generator/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ ├── lib.rs
│ │ │ └── processors.rs
│ │ ├── tests/
│ │ │ ├── compilers/
│ │ │ │ ├── compilation.rs
│ │ │ │ ├── config.rs
│ │ │ │ ├── deterministic.rs
│ │ │ │ ├── imports.rs
│ │ │ │ ├── issues.rs
│ │ │ │ ├── main.rs
│ │ │ │ ├── multi_value_imports.rs
│ │ │ │ ├── native_functions.rs
│ │ │ │ ├── serialize.rs
│ │ │ │ ├── stack_limiter.rs
│ │ │ │ ├── traps.rs
│ │ │ │ └── wast.rs
│ │ │ ├── deprecated/
│ │ │ │ └── README.md
│ │ │ ├── deprecated.rs
│ │ │ ├── examples/
│ │ │ │ ├── add.wat
│ │ │ │ ├── call_indirect.wat
│ │ │ │ ├── fac.wat
│ │ │ │ ├── fib.wat
│ │ │ │ ├── global.wat
│ │ │ │ ├── invalid.wat
│ │ │ │ ├── memory.wat
│ │ │ │ ├── no_start.wat
│ │ │ │ └── trap.wat
│ │ │ ├── ignores.txt
│ │ │ ├── lib/
│ │ │ │ └── compiler-test-derive/
│ │ │ │ └── src/
│ │ │ │ └── lib.rs.orig
│ │ │ └── wast/
│ │ │ ├── README.md
│ │ │ ├── spec/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── Contributing.md
│ │ │ │ ├── LICENSE
│ │ │ │ ├── README.md
│ │ │ │ ├── address.wast
│ │ │ │ ├── align.wast
│ │ │ │ ├── binary-leb128.wast
│ │ │ │ ├── binary.wast
│ │ │ │ ├── block.wast
│ │ │ │ ├── br.wast
│ │ │ │ ├── br_if.wast
│ │ │ │ ├── br_table.wast
│ │ │ │ ├── bulk.wast
│ │ │ │ ├── call.wast
│ │ │ │ ├── call_indirect.wast
│ │ │ │ ├── comments.wast
│ │ │ │ ├── const.wast
│ │ │ │ ├── conversions.wast
│ │ │ │ ├── custom.wast
│ │ │ │ ├── data.wast
│ │ │ │ ├── elem.wast
│ │ │ │ ├── endianness.wast
│ │ │ │ ├── exports.wast
│ │ │ │ ├── extract-parts.sh
│ │ │ │ ├── f32.wast
│ │ │ │ ├── f32_bitwise.wast
│ │ │ │ ├── f32_cmp.wast
│ │ │ │ ├── f64.wast
│ │ │ │ ├── f64_bitwise.wast
│ │ │ │ ├── f64_cmp.wast
│ │ │ │ ├── fac.wast
│ │ │ │ ├── float_exprs.wast
│ │ │ │ ├── float_literals.wast
│ │ │ │ ├── float_memory.wast
│ │ │ │ ├── float_misc.wast
│ │ │ │ ├── forward.wast
│ │ │ │ ├── func.wast
│ │ │ │ ├── func_ptrs.wast
│ │ │ │ ├── global.wast
│ │ │ │ ├── i32.wast
│ │ │ │ ├── i64.wast
│ │ │ │ ├── if.wast
│ │ │ │ ├── imports.wast
│ │ │ │ ├── inline-module.wast
│ │ │ │ ├── int_exprs.wast
│ │ │ │ ├── int_literals.wast
│ │ │ │ ├── labels.wast
│ │ │ │ ├── left-to-right.wast
│ │ │ │ ├── linking.wast
│ │ │ │ ├── load.wast
│ │ │ │ ├── local_get.wast
│ │ │ │ ├── local_set.wast
│ │ │ │ ├── local_tee.wast
│ │ │ │ ├── loop.wast
│ │ │ │ ├── memory.wast
│ │ │ │ ├── memory_copy.wast
│ │ │ │ ├── memory_fill.wast
│ │ │ │ ├── memory_grow.wast
│ │ │ │ ├── memory_init.wast
│ │ │ │ ├── memory_redundancy.wast
│ │ │ │ ├── memory_size.wast
│ │ │ │ ├── memory_trap.wast
│ │ │ │ ├── names.wast
│ │ │ │ ├── nop.wast
│ │ │ │ ├── proposals/
│ │ │ │ │ ├── annotations/
│ │ │ │ │ │ └── annotations.wast
│ │ │ │ │ ├── bulk-memory-operations/
│ │ │ │ │ │ ├── binary.wast
│ │ │ │ │ │ ├── bulk.wast
│ │ │ │ │ │ ├── custom.wast
│ │ │ │ │ │ ├── data.wast
│ │ │ │ │ │ ├── elem.wast
│ │ │ │ │ │ ├── imports.wast
│ │ │ │ │ │ ├── linking.wast
│ │ │ │ │ │ ├── memory_copy.wast
│ │ │ │ │ │ ├── memory_fill.wast
│ │ │ │ │ │ ├── memory_init.wast
│ │ │ │ │ │ ├── table_copy.wast
│ │ │ │ │ │ └── table_init.wast
│ │ │ │ │ ├── gc/
│ │ │ │ │ │ ├── array.wast
│ │ │ │ │ │ ├── binary.wast
│ │ │ │ │ │ ├── br_on.wast
│ │ │ │ │ │ ├── br_on_cast.wast
│ │ │ │ │ │ ├── br_on_null.wast
│ │ │ │ │ │ ├── br_table.wast
│ │ │ │ │ │ ├── call_ref.wast
│ │ │ │ │ │ ├── func.wast
│ │ │ │ │ │ ├── func_bind.wast
│ │ │ │ │ │ ├── i31.wast
│ │ │ │ │ │ ├── if.wast
│ │ │ │ │ │ ├── let.wast
│ │ │ │ │ │ ├── linking.wast
│ │ │ │ │ │ ├── ref.wast
│ │ │ │ │ │ ├── ref_as.wast
│ │ │ │ │ │ ├── ref_as_non_null.wast
│ │ │ │ │ │ ├── ref_cast.wast
│ │ │ │ │ │ ├── ref_eq.wast
│ │ │ │ │ │ ├── ref_is.wast
│ │ │ │ │ │ ├── ref_is_null.wast
│ │ │ │ │ │ ├── ref_null.wast
│ │ │ │ │ │ ├── ref_test.wast
│ │ │ │ │ │ ├── return_call_ref.wast
│ │ │ │ │ │ ├── select.wast
│ │ │ │ │ │ ├── struct.wast
│ │ │ │ │ │ ├── table-sub.wast
│ │ │ │ │ │ ├── table.wast
│ │ │ │ │ │ ├── type-equivalence.wast
│ │ │ │ │ │ └── unreached-invalid.wast
│ │ │ │ │ ├── multi-value/
│ │ │ │ │ │ ├── binary.wast
│ │ │ │ │ │ ├── block.wast
│ │ │ │ │ │ ├── br.wast
│ │ │ │ │ │ ├── call.wast
│ │ │ │ │ │ ├── call_indirect.wast
│ │ │ │ │ │ ├── fac.wast
│ │ │ │ │ │ ├── func.wast
│ │ │ │ │ │ ├── if.wast
│ │ │ │ │ │ ├── loop.wast
│ │ │ │ │ │ └── type.wast
│ │ │ │ │ ├── mutable-global/
│ │ │ │ │ │ ├── globals.wast
│ │ │ │ │ │ └── linking.wast
│ │ │ │ │ ├── nontrapping-float-to-int-conversions/
│ │ │ │ │ │ └── conversions.wast
│ │ │ │ │ ├── reference-types/
│ │ │ │ │ │ ├── binary.wast
│ │ │ │ │ │ ├── br_table.wast
│ │ │ │ │ │ ├── bulk.wast
│ │ │ │ │ │ ├── custom.wast
│ │ │ │ │ │ ├── data.wast
│ │ │ │ │ │ ├── elem.wast
│ │ │ │ │ │ ├── exports.wast
│ │ │ │ │ │ ├── globals.wast
│ │ │ │ │ │ ├── imports.wast
│ │ │ │ │ │ ├── linking.wast
│ │ │ │ │ │ ├── memory_copy.wast
│ │ │ │ │ │ ├── memory_fill.wast
│ │ │ │ │ │ ├── memory_grow.wast
│ │ │ │ │ │ ├── memory_init.wast
│ │ │ │ │ │ ├── ref_func.wast
│ │ │ │ │ │ ├── ref_is_null.wast
│ │ │ │ │ │ ├── ref_null.wast
│ │ │ │ │ │ ├── select.wast
│ │ │ │ │ │ ├── table-sub.wast
│ │ │ │ │ │ ├── table_copy.wast
│ │ │ │ │ │ ├── table_fill.wast
│ │ │ │ │ │ ├── table_get.wast
│ │ │ │ │ │ ├── table_grow.wast
│ │ │ │ │ │ ├── table_init.wast
│ │ │ │ │ │ ├── table_set.wast
│ │ │ │ │ │ ├── table_size.wast
│ │ │ │ │ │ └── unreached-invalid.wast
│ │ │ │ │ ├── sign-extension-ops/
│ │ │ │ │ │ ├── i32.wast
│ │ │ │ │ │ └── i64.wast
│ │ │ │ │ ├── simd/
│ │ │ │ │ │ ├── simd_address.wast
│ │ │ │ │ │ ├── simd_align.wast
│ │ │ │ │ │ ├── simd_bit_shift.wast
│ │ │ │ │ │ ├── simd_bitwise.wast
│ │ │ │ │ │ ├── simd_boolean.wast
│ │ │ │ │ │ ├── simd_const.wast
│ │ │ │ │ │ ├── simd_conversions.wast
│ │ │ │ │ │ ├── simd_f32x4.wast
│ │ │ │ │ │ ├── simd_f32x4_arith.wast
│ │ │ │ │ │ ├── simd_f32x4_cmp.wast
│ │ │ │ │ │ ├── simd_f32x4_pmin_pmax.wast
│ │ │ │ │ │ ├── simd_f32x4_rounding.wast
│ │ │ │ │ │ ├── simd_f64x2.wast
│ │ │ │ │ │ ├── simd_f64x2_arith.wast
│ │ │ │ │ │ ├── simd_f64x2_cmp.wast
│ │ │ │ │ │ ├── simd_f64x2_pmin_pmax.wast
│ │ │ │ │ │ ├── simd_f64x2_rounding.wast
│ │ │ │ │ │ ├── simd_i16x8_arith.wast
│ │ │ │ │ │ ├── simd_i16x8_arith2.wast
│ │ │ │ │ │ ├── simd_i16x8_cmp.wast
│ │ │ │ │ │ ├── simd_i16x8_extadd_pairwise_i8x16.wast
│ │ │ │ │ │ ├── simd_i16x8_extmul_i8x16.wast
│ │ │ │ │ │ ├── simd_i16x8_q15mulr_sat_s.wast
│ │ │ │ │ │ ├── simd_i16x8_sat_arith.wast
│ │ │ │ │ │ ├── simd_i32x4_arith.wast
│ │ │ │ │ │ ├── simd_i32x4_arith2.wast
│ │ │ │ │ │ ├── simd_i32x4_cmp.wast
│ │ │ │ │ │ ├── simd_i32x4_dot_i16x8.wast
│ │ │ │ │ │ ├── simd_i32x4_extadd_pairwise_i16x8.wast
│ │ │ │ │ │ ├── simd_i32x4_extmul_i16x8.wast
│ │ │ │ │ │ ├── simd_i32x4_trunc_sat_f32x4.wast
│ │ │ │ │ │ ├── simd_i32x4_trunc_sat_f64x2.wast
│ │ │ │ │ │ ├── simd_i64x2_arith.wast
│ │ │ │ │ │ ├── simd_i64x2_arith2.wast
│ │ │ │ │ │ ├── simd_i64x2_cmp.wast
│ │ │ │ │ │ ├── simd_i64x2_extmul_i32x4.wast
│ │ │ │ │ │ ├── simd_i8x16_arith.wast
│ │ │ │ │ │ ├── simd_i8x16_arith2.wast
│ │ │ │ │ │ ├── simd_i8x16_cmp.wast
│ │ │ │ │ │ ├── simd_i8x16_sat_arith.wast
│ │ │ │ │ │ ├── simd_int_to_int_extend.wast
│ │ │ │ │ │ ├── simd_lane.wast
│ │ │ │ │ │ ├── simd_load.wast
│ │ │ │ │ │ ├── simd_load16_lane.wast
│ │ │ │ │ │ ├── simd_load32_lane.wast
│ │ │ │ │ │ ├── simd_load64_lane.wast
│ │ │ │ │ │ ├── simd_load8_lane.wast
│ │ │ │ │ │ ├── simd_load_extend.wast
│ │ │ │ │ │ ├── simd_load_splat.wast
│ │ │ │ │ │ ├── simd_load_zero.wast
│ │ │ │ │ │ ├── simd_splat.wast
│ │ │ │ │ │ ├── simd_store.wast
│ │ │ │ │ │ ├── simd_store16_lane.wast
│ │ │ │ │ │ ├── simd_store32_lane.wast
│ │ │ │ │ │ ├── simd_store64_lane.wast
│ │ │ │ │ │ └── simd_store8_lane.wast
│ │ │ │ │ ├── tail-call/
│ │ │ │ │ │ ├── return_call.wast
│ │ │ │ │ │ └── return_call_indirect.wast
│ │ │ │ │ └── threads/
│ │ │ │ │ ├── atomic.wast
│ │ │ │ │ ├── exports.wast
│ │ │ │ │ ├── imports.wast
│ │ │ │ │ └── memory.wast
│ │ │ │ ├── ref_func.wast
│ │ │ │ ├── ref_is_null.wast
│ │ │ │ ├── ref_null.wast
│ │ │ │ ├── return.wast
│ │ │ │ ├── select.wast
│ │ │ │ ├── skip-stack-guard-page.wast
│ │ │ │ ├── stack.wast
│ │ │ │ ├── start.wast
│ │ │ │ ├── store.wast
│ │ │ │ ├── switch.wast
│ │ │ │ ├── table-sub.wast
│ │ │ │ ├── table.wast
│ │ │ │ ├── table_copy.wast
│ │ │ │ ├── table_fill.wast
│ │ │ │ ├── table_get.wast
│ │ │ │ ├── table_grow.wast
│ │ │ │ ├── table_init.wast
│ │ │ │ ├── table_set.wast
│ │ │ │ ├── table_size.wast
│ │ │ │ ├── token.wast
│ │ │ │ ├── traps.wast
│ │ │ │ ├── type.wast
│ │ │ │ ├── unreachable.wast
│ │ │ │ ├── unreached-invalid.wast
│ │ │ │ ├── unwind.wast
│ │ │ │ ├── update-testsuite.sh
│ │ │ │ ├── utf8-custom-section-id.wast
│ │ │ │ ├── utf8-import-field.wast
│ │ │ │ ├── utf8-import-module.wast
│ │ │ │ └── utf8-invalid-encoding.wast
│ │ │ └── wasmer/
│ │ │ ├── README.md
│ │ │ ├── call-indirect-spilled-stack.wast
│ │ │ ├── fac.wast
│ │ │ ├── int-extend-garbage.wast
│ │ │ ├── max_locals.wast
│ │ │ ├── max_size_of_memory.wast
│ │ │ ├── multiple-traps.wast
│ │ │ ├── nan-canonicalization-issue-2159.wast
│ │ │ ├── nan-canonicalization-issue-2347.wast
│ │ │ ├── nan-canonicalization.wast
│ │ │ ├── rotate-shift-overflow.wast
│ │ │ ├── stack-overflow-sret.wast
│ │ │ └── stack-overflow.wast
│ │ ├── types/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ ├── src/
│ │ │ │ ├── archives.rs
│ │ │ │ ├── entity/
│ │ │ │ │ ├── boxed_slice.rs
│ │ │ │ │ ├── iter.rs
│ │ │ │ │ ├── keys.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ ├── packed_option.rs
│ │ │ │ │ ├── primary_map.rs
│ │ │ │ │ └── secondary_map.rs
│ │ │ │ ├── extern_ref.rs
│ │ │ │ ├── features.rs
│ │ │ │ ├── indexes.rs
│ │ │ │ ├── initializers.rs
│ │ │ │ ├── lib.rs
│ │ │ │ ├── memory_view.rs
│ │ │ │ ├── module.rs
│ │ │ │ ├── native.rs
│ │ │ │ ├── partial_sum_map.rs
│ │ │ │ ├── types.rs
│ │ │ │ ├── units.rs
│ │ │ │ └── values.rs
│ │ │ └── tests/
│ │ │ └── partial-sum-map/
│ │ │ ├── corpus/
│ │ │ │ └── .gitkeep
│ │ │ ├── crashes/
│ │ │ │ └── .gitkeep
│ │ │ └── main.rs
│ │ ├── vm/
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ ├── build.rs
│ │ │ └── src/
│ │ │ ├── artifact.rs
│ │ │ ├── export.rs
│ │ │ ├── func_data_registry.rs
│ │ │ ├── global.rs
│ │ │ ├── imports.rs
│ │ │ ├── instance/
│ │ │ │ ├── allocator.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── ref.rs
│ │ │ ├── lib.rs
│ │ │ ├── libcalls.rs
│ │ │ ├── memory.rs
│ │ │ ├── mmap.rs
│ │ │ ├── probestack.rs
│ │ │ ├── resolver.rs
│ │ │ ├── sig_registry.rs
│ │ │ ├── table.rs
│ │ │ ├── trap/
│ │ │ │ ├── handlers.c
│ │ │ │ ├── mod.rs
│ │ │ │ ├── trapcode.rs
│ │ │ │ └── traphandlers.rs
│ │ │ ├── tunables.rs
│ │ │ ├── vmcontext.rs
│ │ │ └── vmoffsets.rs
│ │ └── wast/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── error.rs
│ │ ├── lib.rs
│ │ ├── spectest.rs
│ │ └── wast.rs
│ ├── unc-vm-runner/
│ │ ├── Cargo.toml
│ │ ├── FAQ.md
│ │ ├── README.md
│ │ ├── RUNTIMES.md
│ │ ├── fuzz/
│ │ │ ├── .gitignore
│ │ │ ├── Cargo.toml
│ │ │ ├── fuzz_targets/
│ │ │ │ ├── diffrunner.rs
│ │ │ │ └── runner.rs
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ └── src/
│ │ ├── cache.rs
│ │ ├── code.rs
│ │ ├── errors.rs
│ │ ├── features.rs
│ │ ├── imports.rs
│ │ ├── instrument/
│ │ │ ├── gas/
│ │ │ │ ├── mod.rs
│ │ │ │ └── validation.rs
│ │ │ ├── rules.rs
│ │ │ └── stack_height/
│ │ │ ├── max_height.rs
│ │ │ ├── mod.rs
│ │ │ └── thunk.rs
│ │ ├── instrument.rs
│ │ ├── lib.rs
│ │ ├── logic/
│ │ │ ├── alt_bn128.rs
│ │ │ ├── context.rs
│ │ │ ├── dependencies.rs
│ │ │ ├── errors.rs
│ │ │ ├── gas_counter.rs
│ │ │ ├── logic.rs
│ │ │ ├── mocks/
│ │ │ │ ├── mock_external.rs
│ │ │ │ ├── mock_memory.rs
│ │ │ │ └── mod.rs
│ │ │ ├── mod.rs
│ │ │ ├── test_utils.rs
│ │ │ ├── tests/
│ │ │ │ ├── alt_bn128.rs
│ │ │ │ ├── context.rs
│ │ │ │ ├── ecrecover-tests.json
│ │ │ │ ├── ed25519_verify.rs
│ │ │ │ ├── gas_counter.rs
│ │ │ │ ├── helpers.rs
│ │ │ │ ├── iterators.rs
│ │ │ │ ├── logs.rs
│ │ │ │ ├── miscs.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── promises.rs
│ │ │ │ ├── registers.rs
│ │ │ │ ├── storage_read_write.rs
│ │ │ │ ├── storage_usage.rs
│ │ │ │ ├── view_method.rs
│ │ │ │ └── vm_logic_builder.rs
│ │ │ ├── types.rs
│ │ │ ├── utils.rs
│ │ │ └── vmstate.rs
│ │ ├── memory.rs
│ │ ├── prepare/
│ │ │ ├── prepare_v0.rs
│ │ │ ├── prepare_v1.rs
│ │ │ └── prepare_v2.rs
│ │ ├── prepare.rs
│ │ ├── profile/
│ │ │ └── profile_v2.rs
│ │ ├── profile.rs
│ │ ├── runner.rs
│ │ ├── tests/
│ │ │ ├── cache.rs
│ │ │ ├── compile_errors.rs
│ │ │ ├── fuzzers.rs
│ │ │ ├── regression_tests.rs
│ │ │ ├── rs_contract.rs
│ │ │ ├── runtime_errors.rs
│ │ │ ├── test_builder.rs
│ │ │ ├── ts_contract.rs
│ │ │ └── wasm_validation.rs
│ │ ├── tests.rs
│ │ ├── unc_vm_runner.rs
│ │ ├── utils.rs
│ │ ├── wasmer2_runner.rs
│ │ ├── wasmer_runner.rs
│ │ └── wasmtime_runner.rs
│ └── unc-wallet-contract/
│ ├── Cargo.toml
│ ├── README.md
│ ├── build.rs
│ ├── res/
│ │ └── .gitignore
│ ├── src/
│ │ └── lib.rs
│ └── wallet-contract/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
├── rust-toolchain.toml
├── rustfmt.toml
├── scripts/
│ ├── __init__.py
│ ├── binaries/
│ │ ├── build.sh
│ │ ├── build_all.sh
│ │ └── x86_64/
│ │ ├── arch.Dockerfile
│ │ ├── debian-11.Dockerfile
│ │ ├── debian-12.Dockerfile
│ │ ├── shared.dockerignore
│ │ ├── ubuntu-2004.Dockerfile
│ │ ├── ubuntu-2204.Dockerfile
│ │ └── ubuntu-2404.Dockerfile
│ ├── check_nightly.py
│ ├── check_pytests.py
│ ├── coverage-wrapper-rustc
│ ├── fix_nightly_feature_flags.py
│ ├── flaky_test_check.py
│ ├── formatting
│ ├── install_precommit.sh
│ ├── parallel_coverage.py
│ ├── requirements_check.sh
│ ├── run_docker.sh
│ ├── setup_hooks.sh
│ ├── split_storage_migration.sh
│ ├── state/
│ │ ├── mega-migrate.py
│ │ ├── split-genesis.py
│ │ └── update_res.py
│ └── testlib.py
├── test-utils/
│ ├── actix-test-utils/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── logger/
│ │ └── Cargo.toml
│ ├── runtime-tester/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── fuzz/
│ │ │ ├── .gitignore
│ │ │ ├── Cargo.toml
│ │ │ ├── README.md
│ │ │ └── fuzz_targets_disabled/
│ │ │ └── runtime_fuzzer.rs
│ │ └── src/
│ │ ├── fuzzing.rs
│ │ ├── lib.rs
│ │ ├── run_test.rs
│ │ └── scenario_builder.rs
│ ├── store-validator/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── main.rs
│ └── testlib/
│ ├── Cargo.toml
│ └── src/
│ ├── fees_utils.rs
│ ├── lib.rs
│ ├── process_blocks.rs
│ └── runtime_utils.rs
├── tools/
│ ├── amend-genesis/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cli.rs
│ │ └── lib.rs
│ ├── chainsync-loadtest/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── concurrency/
│ │ │ ├── mod.rs
│ │ │ ├── once.rs
│ │ │ ├── rate_limiter.rs
│ │ │ └── weak_map.rs
│ │ ├── fetch_chain.rs
│ │ ├── main.rs
│ │ └── network.rs
│ ├── cold-store/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── cli.rs
│ │ └── lib.rs
│ ├── crates-publish-checker/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ ├── rules.rs
│ │ ├── style.rs
│ │ ├── types.rs
│ │ └── utils.rs
│ ├── database/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── adjust_database.rs
│ │ ├── analyse_data_size_distribution.rs
│ │ ├── analyse_gas_usage.rs
│ │ ├── block_iterators/
│ │ │ ├── height_range.rs
│ │ │ ├── last_blocks.rs
│ │ │ └── mod.rs
│ │ ├── commands.rs
│ │ ├── compact.rs
│ │ ├── corrupt.rs
│ │ ├── lib.rs
│ │ ├── make_snapshot.rs
│ │ ├── memtrie.rs
│ │ ├── run_migrations.rs
│ │ ├── state_perf.rs
│ │ └── utils.rs
│ ├── debug-ui/
│ │ ├── .dockerignore
│ │ ├── .eslintrc.yml
│ │ ├── .gitignore
│ │ ├── .prettierrc.json
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── nginx.conf
│ │ ├── package.json
│ │ ├── public/
│ │ │ └── index.html
│ │ ├── src/
│ │ │ ├── App.scss
│ │ │ ├── App.tsx
│ │ │ ├── BlocksView.scss
│ │ │ ├── BlocksView.tsx
│ │ │ ├── ChainAndChunkInfoView.scss
│ │ │ ├── ChainAndChunkInfoView.tsx
│ │ │ ├── ChainInfoSummaryView.scss
│ │ │ ├── ChainInfoSummaryView.tsx
│ │ │ ├── ClusterNodeView.scss
│ │ │ ├── ClusterNodeView.tsx
│ │ │ ├── ClusterView.scss
│ │ │ ├── ClusterView.tsx
│ │ │ ├── ConnectionStorageView.scss
│ │ │ ├── ConnectionStorageView.tsx
│ │ │ ├── CurrentPeersView.scss
│ │ │ ├── CurrentPeersView.tsx
│ │ │ ├── EpochInfoView.scss
│ │ │ ├── EpochInfoView.tsx
│ │ │ ├── EpochShardsView.scss
│ │ │ ├── EpochShardsView.tsx
│ │ │ ├── EpochValidatorsView.scss
│ │ │ ├── EpochValidatorsView.tsx
│ │ │ ├── FloatingChunksView.scss
│ │ │ ├── FloatingChunksView.tsx
│ │ │ ├── HeaderBar.scss
│ │ │ ├── HeaderBar.tsx
│ │ │ ├── LandingPage.scss
│ │ │ ├── LandingPage.tsx
│ │ │ ├── LatestBlocksView.scss
│ │ │ ├── LatestBlocksView.tsx
│ │ │ ├── LogFileDrop.tsx
│ │ │ ├── NetworkInfoView.scss
│ │ │ ├── NetworkInfoView.tsx
│ │ │ ├── PeerStorageView.scss
│ │ │ ├── PeerStorageView.tsx
│ │ │ ├── RecentEpochsView.scss
│ │ │ ├── RecentEpochsView.tsx
│ │ │ ├── RoutingTableView.scss
│ │ │ ├── RoutingTableView.tsx
│ │ │ ├── SnapshotHostsView.scss
│ │ │ ├── SnapshotHostsView.tsx
│ │ │ ├── Tier1View.scss
│ │ │ ├── Tier1View.tsx
│ │ │ ├── api.tsx
│ │ │ ├── entity_debug/
│ │ │ │ ├── AllQueriesDisplay.scss
│ │ │ │ ├── AllQueriesDisplay.tsx
│ │ │ │ ├── EntityDataRootView.scss
│ │ │ │ ├── EntityDataRootView.tsx
│ │ │ │ ├── EntityDataValueView.scss
│ │ │ │ ├── EntityDataValueView.tsx
│ │ │ │ ├── EntityDebugView.scss
│ │ │ │ ├── EntityDebugView.tsx
│ │ │ │ ├── EntityQueryComposer.scss
│ │ │ │ ├── EntityQueryComposer.tsx
│ │ │ │ ├── KeyInput.scss
│ │ │ │ ├── KeyInput.tsx
│ │ │ │ ├── PinnedKeysView.scss
│ │ │ │ ├── PinnedKeysView.tsx
│ │ │ │ ├── all_queries.tsx
│ │ │ │ ├── composing_query.tsx
│ │ │ │ ├── fetcher.tsx
│ │ │ │ ├── fields.tsx
│ │ │ │ ├── keys.tsx
│ │ │ │ ├── pinned_keys.tsx
│ │ │ │ └── types.tsx
│ │ │ ├── index.css
│ │ │ ├── index.tsx
│ │ │ ├── log_visualizer/
│ │ │ │ ├── LogVisualizer.scss
│ │ │ │ ├── LogVisualizer.tsx
│ │ │ │ ├── arrows.ts
│ │ │ │ ├── events.ts
│ │ │ │ ├── interval.ts
│ │ │ │ └── layout.ts
│ │ │ ├── pretty-print.ts
│ │ │ ├── react-app-env.d.ts
│ │ │ └── utils.tsx
│ │ └── tsconfig.json
│ ├── epoch-sync/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cli.rs
│ │ └── lib.rs
│ ├── flat-storage/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── commands.rs
│ │ └── lib.rs
│ ├── fork-network/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cli.rs
│ │ ├── lib.rs
│ │ ├── single_shard_storage_mutator.rs
│ │ └── storage_mutator.rs
│ ├── indexer/
│ │ └── example/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── configs.rs
│ │ └── main.rs
│ ├── mirror/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── chain_tracker.rs
│ │ ├── cli.rs
│ │ ├── genesis.rs
│ │ ├── key_mapping.rs
│ │ ├── lib.rs
│ │ ├── metrics.rs
│ │ ├── offline.rs
│ │ ├── online.rs
│ │ └── secret.rs
│ ├── mock-node/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── lib.rs
│ │ ├── main.rs
│ │ └── setup.rs
│ ├── ping/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cli.rs
│ │ ├── csv.rs
│ │ ├── lib.rs
│ │ └── metrics.rs
│ ├── re-pledged/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── main.rs
│ ├── rpctypegen/
│ │ ├── core/
│ │ │ ├── Cargo.toml
│ │ │ └── src/
│ │ │ └── lib.rs
│ │ └── macro/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── speedy_sync/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ └── main.rs
│ ├── state-parts/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cli.rs
│ │ └── lib.rs
│ ├── state-parts-dump-check/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── cli.rs
│ │ ├── lib.rs
│ │ └── metrics.rs
│ ├── state-viewer/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ ├── apply_chain_range.rs
│ │ ├── apply_chunk.rs
│ │ ├── cli.rs
│ │ ├── commands.rs
│ │ ├── contract_accounts.rs
│ │ ├── epoch_info.rs
│ │ ├── lib.rs
│ │ ├── rocksdb_stats.rs
│ │ ├── scan_db.rs
│ │ ├── state_changes.rs
│ │ ├── state_dump.rs
│ │ ├── state_parts.rs
│ │ ├── trie_iteration_benchmark.rs
│ │ └── tx_dump.rs
│ ├── storage-usage-delta-calculator/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ └── src/
│ │ └── main.rs
│ └── undo-block/
│ ├── Cargo.toml
│ └── src/
│ ├── cli.rs
│ └── lib.rs
└── utils/
├── config/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
├── fmt/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ └── lib.rs
├── mainnet-res/
│ ├── Cargo.toml
│ ├── README.md
│ ├── res/
│ │ ├── mainnet_genesis.json
│ │ ├── mainnet_restored_receipts.json
│ │ └── storage_usage_delta.json
│ ├── src/
│ │ └── lib.rs
│ └── tests/
│ └── load_genesis.rs
├── stdx/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
├── unc-cache/
│ ├── Cargo.toml
│ ├── README.md
│ ├── benches/
│ │ └── cache.rs
│ └── src/
│ ├── cell.rs
│ ├── lib.rs
│ └── sync.rs
├── unc-performance-metrics/
│ ├── Cargo.toml
│ └── src/
│ ├── actix_disabled.rs
│ ├── actix_enabled.rs
│ ├── lib.rs
│ ├── process.rs
│ ├── stats_disabled.rs
│ └── stats_enabled.rs
├── unc-performance-metrics-macros/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
└── unc-stable-hasher/
├── Cargo.toml
├── README.md
└── src/
└── lib.rs
================================================
FILE CONTENTS
================================================
================================================
FILE: .cargo/audit.toml
================================================
[advisories]
ignore = [
# DO NOT ADD ANYTHING TO THIS LIST WITHOUT CAREFUL CONSIDERATION!
# dotenv being unmaintained is ignored because it is an indirect dependency of cloud-storage, which would be hard to replace.
# In addition, it is most likely not ever going to be on a security-critical path, considering it only parses trusted .env files.
# However, we should probably replace cloud-storage with tame-gcs as soon as possible to remove this ignore.
"RUSTSEC-2021-0141",
# mach is unmaintained, but seems to be required by wasmtime at its latest version, which we currently cannot do without.
# We should replace it with mach2 in our personal code, but will need to keep it there until wasmtime switches to it.
# Anyway, it cannot be a security liability in production, considering it is bindings to the OS X kernel.
"RUSTSEC-2020-0168",
# memmap is unmaintained, but is used by wasmer0, which we need to keep alive for replayability reasons.
# We should remove wasmer0 and this ignore as soon as we get limited replayability.
"RUSTSEC-2020-0077",
# parity-wasm is deprecated, but is used by our runtimes before unc-vm, which we need to keep alive for replayability reasons.
# We should remove them all, as well as this ignore, as soon as we get limited replayability.
"RUSTSEC-2022-0061",
# borsh is vulnerable, but is used by wasmer0, which we need to keep alive for replayability reasons.
# We should remove it, as well as this ignore, as soon as we get limited replayability.
"RUSTSEC-2023-0033",
# older versions of parking-lot are vulnerable, but used by wasmer0, which we need to keep alive for replayability reasons.
# We should remove it, as well as this ignore, as soon as we get limited replayability.
"RUSTSEC-2020-0070",
]
================================================
FILE: .cargo/config.toml
================================================
[build]
# We compile with `panic=abort`, so we need `-Cforce-unwind-tables=y`
# to get a useful backtrace on panic.
rustflags = ["-Cforce-unwind-tables=y"]
[target.'cfg(target_arch = "x86_64")']
rustflags = ["-Ctarget-feature=+sse4.1,+sse4.2", "-Cforce-unwind-tables=y"]
================================================
FILE: .config/nextest.toml
================================================
[profile.default]
slow-timeout = { period = "60s", terminate-after = 2, grace-period = "0s" }
[[profile.default.overrides]]
filter = 'test(test_full_estimator)'
slow-timeout = { period = "10m", terminate-after = 3 }
retries = 0
threads-required = 2
# Unfortunately no support for inheriting profiles yet:
# https://github.com/nextest-rs/nextest/issues/387
[profile.ci]
slow-timeout = { period = "120s", terminate-after = 5 }
# Try a few times before failing the whole test suite on a potentially spurious tests.
# The hope is that people will fix the spurious tests as they encounter them locally...
retries = { backoff = "fixed", count = 3, delay = "30s" }
failure-output = "final"
fail-fast = false
[[profile.ci.overrides]]
filter = 'test(test_full_estimator)'
slow-timeout = { period = "10m", terminate-after = 3 }
retries = 0
threads-required = 2
================================================
FILE: .dockerignore
================================================
.idea/
.vscode/
docker/
!docker/scripts/
ops/
!ops/run.sh
!ops/tendermint-config.toml
**/target
storage/
keystore/
tmp/
sandbox/
# Ignore Vim swapfiles
*.swp
# Docker files shouldn't invalidate the cache because Docker itself will use these appropriately
.dockerignore
Dockerfile
Dockerfile.nightly
================================================
FILE: .gitattributes
================================================
**/package-lock.json linguist-generated=true -diff
# Disable linguist for WebAssembly files.
# Those are used to test the runtime and should not be indexed.
*.wasm linguist-detectable=false
*.wast linguist-detectable=false
*.wat linguist-detectable=false
================================================
FILE: .github/ISSUE_TEMPLATE/01_BUG_REPORT.md
================================================
---
name: Bug Report
about: In case you have found a bug in our product.
title: "bug: "
labels: "bug"
assignees: ""
---
# Bug Report
Check the [contributing guide](https://github.com/utnet-org/utility/blob/main/CONTRIBUTING.md)
## Description
## Steps to Reproduce
1.
2.
3.
## Expected Behavior
## Actual Behavior
## Additional Information
================================================
FILE: .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md
================================================
---
name: Feature Request
about: If you have any idea to contribute to the Utility project.
title: "feat: "
labels: "enhancement"
assignees: ""
---
# Feature Request
Check the [contributing guide](https://github.com/utnet-org/utility/blob/main/CONTRIBUTING.md)
## Summary
## Detailed Description
## Use Cases
## Alternative Solutions
## Additional Context
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
# Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
- [ ] Feature
- [ ] Bugfix
- [ ] Refactor
- [ ] Format
- [ ] Documentation
- [ ] Testing
- [ ] Other:
## Description
## Related Issues
## Testing Performed
## Checklist
- [ ] I have performed a self-review of my own code.
- [ ] The tests pass successfully with `cargo test`.
- [ ] The code was formatted with `cargo fmt`.
- [ ] The code compiles with no new warnings with `cargo build --release` and `cargo build --release --features nightly`.
- [ ] The code has no new warnings when using `cargo clippy`.
- [ ] If this change affects documented features or needs new documentation, I have created a PR with a [documentation update](https://github.com/utnet-org/utility.github.io).
================================================
FILE: .github/RELEASE_TEMPLATE.md
================================================
# unc-node vx.x.x
# Versions
Node Version: x.x.x
# Breaking changes
# Added
- Scope - Description
# Changed
- Scope - Description
# Fixed
- Scope - Description
# New Runtime
================================================
FILE: .github/workflows/calculate-alpha-release.bash
================================================
#!/bin/bash
# Exit on error. Append "|| true" if you expect an error.
set -o errexit
# Exit on error inside any functions or subshells.
set -o errtrace
# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR
set -o nounset
# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip`
set -o pipefail
# Turn on traces, useful while debugging but commented out by default
# set -o xtrace
last_release="$(git tag --sort=committerdate | grep -P "v0+\.\d+\.\d+$" | tail -1)"
echo "🐭 Last release: ${last_release}"
# detect breaking changes
if [ -n "$(git log --oneline ${last_release}..HEAD | grep '!:')" ]; then
echo "🐭 Breaking changes detected since ${last_release}"
git log --oneline ${last_release}..HEAD | grep '!:'
# increment the minor version
minor="${last_release##v0.}"
minor="${minor%.*}"
next_minor="$((minor + 1))"
next_release="v0.${next_minor}.0"
else
# increment the patch version
patch="${last_release##*.}"
next_patch="$((patch + 1))"
next_release="${last_release/%${patch}/${next_patch}}"
fi
echo "🐭 Next release: ${next_release}"
suffix="alpha"
last_tag="$(git tag --sort=committerdate | tail -1)"
if [[ "${last_tag}" = "${next_release}-${suffix}"* ]]; then
echo "🐭 Last alpha release: ${last_tag}"
# increment the alpha version
# e.g. v0.22.1-alpha.12 -> v0.22.1-alpha.13
alpha="${last_tag##*-${suffix}.}"
next_alpha="$((alpha + 1))"
next_tag="${last_tag/%${alpha}/${next_alpha}}"
else
# increment the patch and start the alpha version from 0
# e.g. v0.22.0 -> v0.22.1-alpha.0
next_tag="${next_release}-${suffix}.0"
fi
# update the crate version
msg="# crate version"
#sed -E -i "s/^version = .* ${msg}$/version = \"${next_tag#v}\" ${msg}/" Cargo.toml
echo "NEXT_TAG=${next_tag}" >> $GITHUB_ENV
echo "🐭 Next alpha release: ${next_tag}"
================================================
FILE: .github/workflows/crates_publish.yml
================================================
name: Crates Publish
on:
workflow_dispatch:
inputs:
branch:
type: string
required: true
description: Branch name or tag to publish crates from
jobs:
publish-cargo-crates:
name: "Publish utility-workspaces on crates.io https://crates.io/crates/utility-workspaces"
runs-on: "ubuntu-latest"
environment: deploy
permissions:
contents: write # required for crates push
timeout-minutes: 30
steps:
- name: Checkout utnet-org/utility's ${{ github.event.inputs.branch }} branch
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Set up git user
uses: fregante/setup-git-user@v2
- name: Publish unc-workspaces on crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
set -x
cargo install --git https://github.com/miraclx/cargo-workspaces --tag v0.3.0 cargo-workspaces
cargo ws publish --yes --allow-dirty --force '*' \
--no-git-commit --no-git-push --no-individual-tags --tag-prefix 'crates-' \
--tag-msg $$'crates.io snapshot\n---%{\n- %n - https://crates.io/crates/%n/%v}'
- name: Create tag on https://github.com/utnet-org/utility
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --no-follow-tags https://github.com/utnet-org/utility.git tag 'crates-*'
================================================
FILE: .github/workflows/default.yml
================================================
name: Lint Check && nextest && build
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch:
env:
CARGO_SCCACHE_COMMIT: bed5571c
jobs:
# cargo_nextest:
# name: "Cargo Nextest (${{matrix.name}})"
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Linux
# id: linux
# os: ubuntu-latest
# type: stable
# runs_integ_tests: true
# upload_profraws: true
# - name: Linux Nightly
# id: linux-nightly
# os: ubuntu-latest
# type: nightly
# runs_integ_tests: true
# upload_profraws: true
# timeout-minutes: 90
# steps:
# - uses: actions/checkout@v4
# # Install all the required tools
# - uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
# with:
# tool: just,cargo-nextest,cargo-llvm-cov
# # Run the tests:
# - run: mkdir -p coverage/profraw/{unit,integration,binaries}
# # - Run the unit tests, retrieving the coverage information
# - run: just codecov-ci "nextest-unit ${{ matrix.type }}"
# - run: mv coverage/codecov/{new,unit-${{matrix.id}}}.json
# - run: mv coverage/profraw/{new,unit/${{matrix.id}}}.tar.zst
# # - Run the integration tests, retrieving the coverage information
# - run: just codecov-ci "nextest-integration ${{ matrix.type }}"
# if: matrix.runs_integ_tests
# - run: mv coverage/codecov/{new,integration-${{matrix.id}}}.json
# if: matrix.runs_integ_tests
# - run: mv coverage/profraw/{new,integration/${{matrix.id}}}.tar.zst
# if: matrix.runs_integ_tests
# # Cleanup the target directory, leaving only stuff interesting to llvm-cov, and tarball it
# - run: just tar-bins-for-coverage-ci
# - run: mv coverage/profraw/binaries/{new,${{matrix.id}}}.tar.zst
# # Upload the coverage
# - uses: actions/upload-artifact@v3
# if: matrix.upload_profraws
# with:
# name: coverage-profraw
# path: coverage/profraw
# retention-days: 2
# - uses: actions/upload-artifact@v3
# with:
# name: coverage-codecov
# path: coverage/codecov
rpc_error_schema:
name: "RPC Schema"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
with:
tool: just
- run: just check-rpc-errors-schema
# lychee_checks:
# name: "Lychee Lints"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: lycheeverse/lychee-action@2ac9f030ccdea0033e2510a23a67da2a2da98492
# with:
# fail: true
check_fmt:
name: "Cargo Fmt"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
with:
tool: just
- run: just check-cargo-fmt
# check_clippy:
# name: "Cargo Clippy"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
# with:
# tool: just
# - run: just check-cargo-clippy
doctests:
name: "Rust Doctests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
with:
tool: just
- run: just doctests
# check_cargo_deny:
# name: "Cargo Deny"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
# with:
# tool: just,cargo-deny
# - run: just check-cargo-deny
check-crates-publish-checker:
name: "Crates Publish Checker"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
with:
tool: just
- run: just check-crates-publish-checker
check_non_default:
name: "Non-default Configuration Builds"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
with:
tool: just
- run: just check-non-default
# check_udeps:
# name: "Unused Dependencies"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
# with:
# tool: just,cargo-udeps
# - run: just check-cargo-udeps
# cargo_audit:
# name: "Cargo Audit"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: taiki-e/install-action@9b5b983efc779f85e5e5d11539f005e85ccb27ff
# with:
# tool: cargo-audit
# - run: cargo audit -D warnings
build:
runs-on: ubuntu-latest
needs: [rpc_error_schema, check_fmt, doctests, check_non_default]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
path: |
~/.cache/
~/.cargo/bin/sccache*
key: ${{ runner.OS }}-sccache-bin-${{ env.CARGO_SCCACHE_COMMIT }}-v1
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-dev valgrind git clang curl libssl-dev protobuf-compiler unzip python3-pip
- name: Setup Rust toolchain
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup show
- name: Set PATH for cargo
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "SCCACHE_DIR=${HOME}/.cache/sccache" >> $GITHUB_ENV
- name: SCCache
run: |
# We altered the path to avoid old actions to overwrite it
if [ ! -f ~/.cargo/bin/sccache ]; then
cargo install sccache \
--git https://github.com/purestake/sccache.git \
--rev $CARGO_SCCACHE_COMMIT \
--force --no-default-features --features=dist-client
fi
if [[ -z `pgrep sccache` ]]; then
chmod +x ~/.cargo/bin/sccache
sccache --start-server
fi
sccache -s
echo "RUSTC_WRAPPER=${HOME}/.cargo/bin/sccache" >> $GITHUB_ENV
- name: Build node
run: cargo build --release -p unc-node
- name: Upload unc-node binary
uses: actions/upload-artifact@v2
with:
name: unc-node
path: target/release/unc-node
- name: Display SCCache Stats
run: sccache --show-stats
================================================
FILE: .github/workflows/gh_pages.yml
================================================
name: Book Pages
on:
push:
branches:
- main
pull_request:
paths:
- 'docs/**'
- '.github/workflows/book.yml'
jobs:
book:
name: Book
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: '0.4.21'
steps:
- uses: actions/checkout@v2
- name: Install mdbook
run: |
curl -L https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.cargo/bin
- name: Build
run: mdbook build
working-directory: docs
- uses: actions/upload-artifact@v2
with:
name: book
path: target/book
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: write
needs: book
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v2
with:
name: book
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
force_orphan: true
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
cname: docs.xyz666.org
user_name: zwong91
user_email: yzbingchuan@gmail.com
================================================
FILE: .github/workflows/issue_metrics.yml
================================================
name: Monthly issue metrics
on:
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'
permissions:
issues: write
pull-requests: read
jobs:
monthly-issue-metrics:
name: past month issue metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
id: last-month
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "$first_day..$last_day"
echo "LAST_MONTH=$first_day..$last_day" >> $GITHUB_OUTPUT
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:utnet-org/utility is:issue created:${{ steps.last-month.outputs.LAST_MONTH }}'
- name: Create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
================================================
FILE: .github/workflows/release_binaries.yml
================================================
name: Release Binaries
on:
push:
branches-ignore:
- '**'
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Calculate the next release
run: .github/workflows/calculate-alpha-release.bash
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: ./cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}
build_binaries:
runs-on: ubuntu-latest
needs: changelog
strategy:
matrix:
include:
- command: ENGINE=podman DISTRO=ubuntu-2004 ZIP=1 ./scripts/binaries/build.sh
output_file: output/zips/x86_64-ubuntu-2004-unc-node.tar.gz
- command: ENGINE=podman DISTRO=ubuntu-2204 ZIP=1 ./scripts/binaries/build.sh
output_file: output/zips/x86_64-ubuntu-2204-unc-node.tar.gz
- command: ENGINE=podman DISTRO=ubuntu-2404 ZIP=1 ./scripts/binaries/build.sh
output_file: output/zips/x86_64-ubuntu-2404-unc-node.tar.gz
- command: ENGINE=podman DISTRO=debian-11 ZIP=1 ./scripts/binaries/build.sh
output_file: output/zips/x86_64-debian-11-unc-node.tar.gz
- command: ENGINE=podman DISTRO=debian-12 ZIP=1 ./scripts/binaries/build.sh
output_file: output/zips/x86_64-debian-12-unc-node.tar.gz
- command: ENGINE=podman DISTRO=arch ZIP=1 ./scripts/binaries/build.sh
output_file: output/zips/x86_64-arch-unc-node.tar.gz
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
- name: install podman
run: sudo apt-get update && sudo apt install podman -y
- uses: nick-fields/retry@v3
with:
timeout_minutes: 60
max_attempts: 3
command: ${{ matrix.command }}
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
- name: publish binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.output_file }}
release_name: ${{ steps.prepare.outputs.tag_name }}
tag: ${{ steps.prepare.outputs.tag_name }}
body: ${{ needs.changelog.outputs.release_body }}
overwrite: true
================================================
FILE: .github/workflows/release_docker.yml
================================================
name: Release Docker
# Trigger on all push events, new semantic version tags, and all PRs
on:
push:
branches-ignore:
- '**'
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
pull_request:
workflow_dispatch:
env:
GITHUB_REG: ghcr.io
MAINTAINER: ${{ github.repository_owner }}
DESCRIPTION: "${{ github.repository_owner }} repository ${{ github.repository }}"
jobs:
prepare-env:
runs-on: "ubuntu-latest"
outputs:
repo_owner: ${{ steps.setting_env.outputs.repo_owner }}
output_short_sha: ${{ steps.setting_env.outputs.short_sha }}
output_image_name: ${{ steps.setting_env.outputs.image_name }}
build_for_pr: ${{ steps.setting_logic.outputs.build_for_pr }}
build_for_merge: ${{ steps.setting_logic.outputs.build_for_merge }}
not_a_fork: ${{ steps.setting_logic.outputs.not_a_fork }}
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Add vars to ENV
id: setting_env
run: |
# Extract both the repository owner and repository name
# According to docs, github.repository is in the format of owner/repo, not just repo
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
REPO_OWNER=$(echo "${{ github.repository }}" | awk -F'/' '{print $1}' | tr '[:upper:]' '[:lower:]')
REPO_NAME=$(echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]')
# Check repo name for .github use to test this workflow
if [[ $REPO_NAME == ".github" ]]; then
# Remove the leading . to avoid failing the character check
REPO_NAME="github"
fi
# Log variables for debugging
echo "Repository Owner: $REPO_OWNER"
echo "Repository Name: $REPO_NAME"
echo "INPUT PACKAGE NAME: ${{ inputs.packageName }}"
# Set environment variables and outputs
echo "REPO_OWNER=$REPO_OWNER" >> $GITHUB_ENV
echo "repo_owner=$REPO_OWNER" >> "$GITHUB_OUTPUT"
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
echo "short_sha=`echo ${GITHUB_SHA} | cut -c1-8`" >> "$GITHUB_OUTPUT"
if [[ "${{ inputs.packageName }}" == "${{ github.repository }}" ]]; then
# If a user submitted package name that has the naming containing
# both the repository owner and repository name, we fail
# e.g: inputs.packageName = "utnet-org/unc-node" is not allowed
echo "------------------------------------------------------------"
echo "ERROR: Package name not valid! => [ ${{ inputs.packageName }} ]"
echo "Don't use the repository owner and repository name in the package name."
echo "------------------------------------------------------------"
exit 1
fi
# Set the default package name to the repository name
PACKAGE_NAME=$REPO_NAME
# If there is a user submitted package name, use it
if [[ -n "${{ inputs.packageName }}" ]]; then
PACKAGE_NAME=$(echo "${{ inputs.packageName }}" | tr '[:upper:]' '[:lower:]')
fi
# validate the package name characters
if [[ ! $PACKAGE_NAME =~ ^[A-Za-z0-9\-]+$ ]]; then
echo "------------------------------------------------------------"
echo "ERROR: Package name not valid! => [ $PACKAGE_NAME ]"
echo "ONLY can use: A-Za-z0-9\-"
echo "------------------------------------------------------------"
exit 1
fi
# Log the package name for debugging
echo "PACKAGE_NAME: $PACKAGE_NAME"
# Set environment variables and outputs
echo "IMAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "image_name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
# The key logic that we want to determine is whether or not we are working
# on a fork and if this is a pull request or merge to main.
#
# We care about forks because of github's security policies that prevent
# forks from pushing images. So we only want to build images on forks
#
# The distinction between pull requests and merges to main is that on pull
# requests we want a single image available quickly for testing. On merges
# to main we want all the images built and are ok waiting longer to ensure
# there are not bugs.
- name: Add logic to ENV
id: setting_logic
run: |
# yamllint disable
echo "build_for_pr=${{ github.event_name == 'pull_request' }}" >> "$GITHUB_OUTPUT"
echo "build_for_merge=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}" >> "$GITHUB_OUTPUT"
echo "not_a_fork=${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}" >> "$GITHUB_OUTPUT"
# yamllint enable
# Log the key inputs to the logic as well a the outputs. We check that
# build_for_pr and build_for_merge are never equal when they are true as that
# would indicate a bug. If they are both false, this is ok, as this is the
# case on pushing commits to a PR.
logic-check:
needs: prepare-env
runs-on: "ubuntu-latest"
steps:
- name: Log logic
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref: ${{ github.ref }}"
echo "head repo: ${{ github.event.pull_request.head.repo.full_name }}"
echo "base repo: ${{ github.event.pull_request.base.repo.full_name }}"
echo "build_for_pr: ${{ needs.prepare-env.outputs.build_for_pr }}"
echo "build_for_merge: ${{ needs.prepare-env.outputs.build_for_merge }}"
echo "not_a_fork: ${{ needs.prepare-env.outputs.not_a_fork }}"
- name: Check logic
if: |
(needs.prepare-env.outputs.build_for_pr == needs.prepare-env.outputs.build_for_merge)
&& needs.prepare-env.outputs.build_for_pr != 'false'
run: |
echo "Failing step due to build_for_pr == build_for_merge"
exit 1
docker-security:
needs: ["prepare-env", "logic-check"]
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Build
uses: docker/build-push-action@v5
env:
OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }}
OUTPUT_IMAGE_NAME: ${{ needs.prepare-env.outputs.output_image_name }}
with:
context: .
push: false
platforms: linux/amd64
# we're building the container before the scan, use the short sha tag
# for referring to it later
tags: ${{ env.OUTPUT_IMAGE_NAME }}:${{ env.OUTPUT_SHORT_SHA }}
file: ./Dockerfile
- name: Run Trivy vulnerability scanner
# source: https://github.com/aquasecurity/trivy-action
# https://github.com/marketplace/actions/aqua-security-trivy
uses: aquasecurity/trivy-action@master
env:
OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }}
OUTPUT_IMAGE_NAME: ${{ needs.prepare-env.outputs.output_image_name }}
with:
# here we use the local tag that we've built before
image-ref: "${{ env.OUTPUT_IMAGE_NAME }}:${{ env.OUTPUT_SHORT_SHA }}"
format: "table"
#exit-code: '1' # uncomment to stop the CI if the scanner fails
ignore-unfixed: true
vuln-type: "os,library"
severity: "CRITICAL,HIGH"
docker-build:
name: docker-build (${{ matrix.registry.name }}; ${{ matrix.registry.registry-url }}/${{ matrix.registry.registry-owner }}/${{ needs.prepare-env.outputs.output_image_name }})
runs-on: "ubuntu-latest"
# wait until the jobs are finished.
needs: ["prepare-env", "logic-check", "docker-security"]
# We only want to run this step if one of the build flags is true. We don't
# run if both logic flags are false. This is the case for push events on PR
# commits. The logic-check job protects us from the case of both build flags
# being equal to true.
if: |
needs.prepare-env.outputs.build_for_pr == 'true'
|| needs.prepare-env.outputs.build_for_merge == 'true'
permissions:
contents: write
packages: write
strategy:
matrix:
# run-on-pr is used to skip running registries that are expected to fail
# due to github permission issues with org wide secrets.
registry:
# - name: DockerHub
# user-secret: DOCKERHUB_USERNAME
# token-secret: DOCKER_PAT_TOKEN
# registry-url: docker.io
# registry-owner: utnet-org
# run-on-pr: "false"
- name: GHCR
user-secret: ${{ github.repository_owner }}
token-secret: GITHUB_TOKEN
registry-url: ghcr.io
registry-owner: ${{ needs.prepare-env.outputs.repo_owner }}
run-on-pr: "true"
fail-fast: false
steps:
- name: Check run conditions
id: run_check
# We only want to run when the registry is able to run on PR or if it is a merge event
run: echo "run=${{ matrix.registry.run-on-pr == needs.prepare-env.outputs.build_for_pr || needs.prepare-env.outputs.build_for_merge == 'true'}}" >> "$GITHUB_OUTPUT"
- name: Checkout
if: ${{ steps.run_check.outputs.run == 'true'}}
uses: "actions/checkout@v4"
- name: Login to ${{ matrix.registry.name }}
if: ${{ steps.run_check.outputs.run == 'true'}}
uses: docker/login-action@v3
with:
registry: ${{ matrix.registry.registry-url }}
username: ${{ matrix.registry.registry-url == env.GITHUB_REG && matrix.registry.user-secret || secrets[matrix.registry.user-secret] }}
password: ${{ secrets[matrix.registry.token-secret] }}
- name: Extract Docker Metadata
if: ${{ steps.run_check.outputs.run == 'true'}}
id: meta
uses: docker/metadata-action@v5
env:
OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }}
OUTPUT_IMAGE_NAME: ${{ needs.prepare-env.outputs.output_image_name }}
with:
images: ${{ matrix.registry.registry-url }}/${{ matrix.registry.registry-owner }}/${{ env.OUTPUT_IMAGE_NAME }}
# yamllint disable
labels: |
maintainer=${{ env.MAINTAINER }}
commitUrl=https://github.com/${{ github.repository }}/commit/${{ github.sha }}
dockerPull=docker pull ${{ matrix.registry.registry-url }}/${{ matrix.registry.registry-owner }}/${{ env.OUTPUT_IMAGE_NAME }}:${{ env.OUTPUT_SHORT_SHA }}
org.opencontainers.image.description=${{ env.DESCRIPTION }}
tags: |
# output minimal (short sha)
type=raw,value={{sha}}
# output v0.2.1/v*-* (or sha of no tag)
type=semver,pattern={{raw}}
# pull request event
type=ref,enable=true,prefix=pr-,suffix=,event=pr
# yamllint enable
- name: Set up QEMU
if: ${{ steps.run_check.outputs.run == 'true'}}
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: ${{ steps.run_check.outputs.run == 'true'}}
uses: docker/setup-buildx-action@v3
# Build and Publish images on main, master, and versioned branches.
#
# The reason we split out these steps into 2 is for better handling of
# forks when building amd64 images and to enable faster availability of
# the amd64 image since building the arm64 image takes significantly
# longer.
- name: "Merge on Main Trigger: Build and Push All Docker Images"
if: ${{ needs.prepare-env.outputs.build_for_merge == 'true' && steps.run_check.outputs.run == 'true'}}
uses: docker/build-push-action@v5
env:
OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }}
OUTPUT_IMAGE_NAME: ${{ needs.prepare-env.outputs.output_image_name }}
with:
context: .
platforms: linux/arm64,linux/amd64
provenance: false
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile
# Build amd64 images always, and publish when it is not a fork. The Github
# security model prevents forks from pushing to the registry so we can
# only push if the branch/PR is not generated from a fork. Even though
# forks can't push, we still want to try and build the image to catch
# bugs. For testing purposes we only need an amd64 image.
- name: "Pull Request Trigger: Build and Push amd64 Docker Image"
if: ${{ needs.prepare-env.outputs.build_for_pr == 'true' && steps.run_check.outputs.run == 'true'}}
uses: docker/build-push-action@v5
env:
OUTPUT_SHORT_SHA: ${{ needs.prepare-env.outputs.output_short_sha }}
OUTPUT_IMAGE_NAME: ${{ needs.prepare-env.outputs.output_image_name }}
with:
context: .
platforms: linux/amd64
provenance: false
# Only push if the head and base repos match, meaning it is not a fork
push: ${{ needs.prepare-env.outputs.not_a_fork == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile
================================================
FILE: .gitignore
================================================
# Generated by Cargo
# will have compiled files and executables
target
/target_expensive/
/sandbox
docker-build
/grafana-dashboard-testnet.json
/storage/
/test-utils/node/storage
/test-utils/ganache/storage
/node/service/storage
/keystore/
/chain/client/tmp_bench
testdir/
old_my_script.sh
# These are backup files generated by rustfmt
**/*.rs.bk
**/.ipynb_checkpoints/*
# Editor config files
.vscode
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea
# Python env
.env
*.pyc
venv
# Node
**/node_modules/
# Integration tests
create-unc-app/
test-keys/
tmp/
# OS X
.DS_Store
# Logs
*.log
# Vim tmp files
*.swp
rusty-tags.vi
# logs from mocknet nodes
/pytest/logs/
# Estimator generated files
costs-*.txt
names-to-stats.txt
data_dump_*.bin!
*_key.json
/ops
pytest/myenv/
================================================
FILE: .gitmodules
================================================
[submodule "ops"]
path = ops
url = https://github.com/utnet-org/ops.git
================================================
FILE: .pre-commit-config.yaml
================================================
- repo: https://github.com/doublify/pre-commit-rust
rev: master
hooks:
- id: fmt
================================================
FILE: .style.yapf
================================================
[style]
based_on_style = google
indent_width = 4
column_limit = 80
================================================
FILE: ATTRIBUTIONS.md
================================================
# Utility Client Attributions
We have taken inspiration and few pieces of code from:
* [OpenEthereum](https://github.com/openethereum/openethereum)
* [Parity Substrate](https://github.com/paritytech/substrate)
* [Parity Trie](https://github.com/paritytech/trie)
* [Grin](https://github.com/mimblewimble/grin/)
* [Near](https://github.com/near/nearcore)
## Licenses
### OpenEthereum, Parity Substrate
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and`show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
### Parity Trie
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
### Grin
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
### Near
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: CODEOWNERS
================================================
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
* @utnet-org/utility-codeowners
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
================================================
FILE: CONTRIBUTING.md
================================================
Thank you for your interest in contributing to the Utility reference client! We
welcome contributions from everyone. Below are various bits of information to
help you get started. If you require additional help, please reach out to us on
our [zulip channel](https://unc.zulipchat.com/).
## Quick Start
utility is a fairly standard Rust project, so building is as easy as
```console
cargo build
```
Building utility requires a fairly recent Rust compiler (get it
[here](https://rustup.rs)), as well as `clang` and `cmake` to build RocksDB
(`sudo apt install cmake clang`).
Sadly at the moment utility is only compatible with Linux and MacOS, Windows is
not supported yet.
To run a local UNC network with one node, use
```console
cargo run -p unc-node -- init # generates various configs in ~/.unc
cargo run -p unc-node -- run
```
You can now use your own node's HTTP RPC API (e.g.
[httpie](https://httpie.io/docs/cli/installation))
```console
$ http get http://localhost:3030/status
$ http post http://localhost:3030/ method=query jsonrpc=2.0 id=1 \
params:='{"request_type": "view_account", "finality": "final", "account_id": "test.unc"}'
```
The RPC is documented [here](https://docs.unc.org/api/rpc/introduction), and
can be conveniently accessed from the command line [UNC
CLI](https://docs.unc.org/tools/unc-cli) utility.
## Next Steps
To learn more about how utility works, skim through our guide to utility
development:
If you are looking for relatively simple tasks to familiarise yourself with
`utility`, please check out issues labeled with the `C-good-first-issue` label
[here](https://github.com/utnet-org/utility/labels/C-good-first-issue). If you see
one that looks interesting and is unassigned or has not been actively worked on
in some time, please ask to have the issue assigned to you and someone from
the team should help you get started. We do not always keep the issue tracker
up-to-date, so if you do not find an interesting task to work on, please ask for
help on our zulip channel.
## Pull Requests
All the contributions to `utility` happen via Pull Requests. Please follow the
following steps when creating a PR:
1. Fork the `utility` repository and create a new branch there to do your work.
2. The branch can contain any number of commits. When merged, all commits will
be squashed into a single commit.
3. The changes should be thoroughly tested. Please refer to [this
document](https://github.com/utnet-org/utility/blob/master/docs/practices/testing/README.md)
for our testing guidelines and an overview of the testing unc-infra.tructure.
4. When ready, send a pull request against the `master` branch of the `utility`
repository.
5. Feel free to submit draft PRs to get early feedback and to make sure you are
on the right track.
6. The PR name should follow the template: `: `. Where `type` is:
- `fix` for bug fixes;
- `feat` for new features;
- `refactor` for changes that reorganize code without adding new content;
- `doc` for changes that change documentation or comments;
- `test` for changes that introduce new tests;
- `chore` for grunt tasks like updating dependencies.
7. The PR should also contain a description when appropriate to provide
additional information to help the reviewer inspect the proposed change.
8. If your PR introduces a user-observable change (e.g. a new protocol feature,
new configuration option, new Prometheus metric etc.) please document it in
[CHANGELOG.md](CHANGELOG.md) in the `[unreleased]` section.
9. It is important to select the `Allow edits and access to secrets by
maintainers` checkbox on the PR. Without this option, the merge bot will not
have sufficient rights to be able to merge the PR when it is approved. It
also allows the maintainers to make trivial changes to the PR as necessary.
Please see
[these](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
[links](https://stackoverflow.com/questions/63341296/github-pull-request-allow-edits-by-maintainers)
for the implications of selecting the checkbox.
## After the PR is submitted
1. We have a CI process configured to run various tests on each PR. All tests
need to pass before a PR can be merged.
2. When all the comments from the reviewer(s) have been addressed, they should
approve the PR allowing a PR to be merged.
3. Before merging a PR, the code should be reviewed properly. In particular, the
person who clicks "Merge when ready" has specific duties, exposed in the last
paragraph of the "Code review process" section below.
4. An approved PR can be merged by clicking the "Merge when ready" button. The
button can be clicked by the author if they have the appropriate access, or by a
reviewer otherwise. PR authors can also click the button immediately after filing
a PR; removing an additional round-trip after the PR gets approved. The PR author
will be notified by email by github if the PR fails to land, once it has entered
the merge queue (ie. after it has passed PR CI and gotten an approving review).
## Code review process
We have two groups of code reviewers: Super owners and normal owners. When a
PR is created:
- a super owner will be automatically assigned to review.
- they may choose to review the PR themselves or they may delegate to someone else
who belongs either to the super owners or the normal owners group.
- the delegate will perform the review and as needed engage other reviewers as
well. They will review your tests, and make sure that they can convince
themselves the test coverage is adequate before they even look into the
change, so make sure you tested all the corner cases.
- it is normal to sometimes require multiple rounds of reviews to get a PR
merged. If your PR received some feedback from a reviewer, use the [github
UI](https://stackoverflow.com/questions/40893008/how-to-resume-review-process-after-updating-pull-request-at-github)
to re-request a review.
The author is also free to directly request reviews from specific persons
[through the github
ui](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review).
In this case, the automatically selected super owner will ensure that the
selected reviewer is sufficient or additional reviewers are needed.
The process for becoming a code reviewer is relatively straightforward.
The candidate should have a good understanding of the codebase and then
the existing super owners will discuss and approve the addition. These
discussions take place on zulip so if you are interested in becoming a
code reviewer, please reach out to us there.
The person who clicks the "Merge when ready" button is the one who
guarantees that no unreviewed code was added between the approving review
and the commit that is being landed. They must be especially careful of
commits that might have happened before the review, but not have been
reviewed (eg. because the review was already in progress), as they will
show above the review line on the GitHub UI. In addition, not refreshing
the page might lead to these commits just not displaying, so the reviewer
should refresh the page both before and after clicking "Merge when ready,"
and confirm that the commits are as expected.
## Release Schedule
Once your change ends up in master, it will be released with the rest of the
changes by other contributors on the regular release schedules.
On [betanet](https://docs.unc.org/docs/concepts/networks#testnet) we run
nightly build from master with all the nightly protocol features enabled. Every
five weeks, we stabilize some protocol features and make a release candidate for
testnet. The process for feature stabilization can be found in [this
document](docs/practices/protocol_upgrade.md). After the release candidate has been
running on testnet for four weeks and no issues are observed, we stabilize and
publish the release for mainnet.
================================================
FILE: Cargo.toml
================================================
[workspace.package]
version = "0.0.0" # managed by cargo-workspaces, see below
authors = ["Hello Inc "]
edition = "2021"
rust-version = "1.78.0"
repository = "https://github.com/utnet-org/utility"
license = "GPL-2.0-or-later"
[workspace.metadata.workspaces]
# Shared version of all public crates in the workspace.
# This is only used for crates that are not stable.
# Most crates are not stable on purpose, as maintaining API compatibility is a
# significant developer time expense. Please think thoroughly before adding
# anything to the list of stable crates.
version = "0.12.2"
exclude = ["node"]
[workspace]
resolver = "2"
members = [
"chain/chain",
"chain/chunks",
"chain/client",
"chain/client-primitives",
"chain/epoch-manager",
"chain/indexer",
"chain/indexer-primitives",
"chain/jsonrpc",
"chain/jsonrpc-adversarial-primitives",
"chain/jsonrpc-primitives",
"chain/jsonrpc/client",
"chain/jsonrpc/fuzz",
"chain/jsonrpc/jsonrpc-tests",
"chain/network",
"chain/pool",
"chain/telemetry",
"core/async",
"core/chain-configs",
"core/crypto",
"core/dyn-configs",
"core/o11y",
"core/parameters",
"core/primitives",
"core/primitives-core",
"core/store",
"genesis-tools/genesis-csv-to-json",
"genesis-tools/genesis-populate",
"genesis-tools/keypair-generator",
"infra",
"integration-tests",
"runtime/unc-vm/test-api",
"runtime/unc-vm/compiler",
"runtime/unc-vm/compiler-singlepass",
"runtime/unc-vm/engine",
"runtime/unc-vm/vm",
"runtime/unc-vm/types",
"runtime/unc-vm/wast",
"runtime/unc-vm/compiler-test-derive",
"runtime/unc-vm-runner",
"runtime/unc-vm-runner/fuzz",
"runtime/unc-wallet-contract",
"runtime/runtime",
"runtime/runtime-params-estimator",
"runtime/runtime-params-estimator/estimator-warehouse",
"test-utils/actix-test-utils",
"test-utils/runtime-tester",
"test-utils/runtime-tester/fuzz",
"test-utils/store-validator",
"test-utils/testlib",
"tools/database",
"tools/chainsync-loadtest",
"tools/fork-network",
"tools/indexer/example",
"tools/mirror",
"tools/mock-node",
"tools/ping",
"tools/re-pledged",
"tools/rpctypegen/core",
"tools/rpctypegen/macro",
"tools/speedy_sync",
"tools/state-parts",
"tools/state-parts-dump-check",
"tools/state-viewer",
"tools/storage-usage-delta-calculator",
"tools/crates-publish-checker",
"tools/undo-block",
"utils/config",
"utils/fmt",
"utils/mainnet-res",
"utils/unc-cache",
"utils/stdx",
"node",
]
[workspace.lints.rust]
warnings = "deny"
[workspace.lints.clippy]
all = { level = "allow", priority = -100 }
correctness = { level = "deny", priority = -50 }
suspicious = { level = "deny", priority = -50 }
perf = { level = "deny", priority = -50 }
# overrides clippy::perf = "deny": https://github.com/rust-lang/rust-clippy/issues/8111
single_char_pattern = "allow"
clone_on_copy = "deny"
derivable_impls = "deny"
redundant_clone = "deny"
len_zero = "deny"
[workspace.dependencies]
actix = "0.13.0"
actix-cors = "0.6.1"
actix-http = "3.3"
actix-rt = "2"
actix-web = "4.1"
anyhow = "1.0.62"
arbitrary = { version = "1.2.3", features = ["derive"] }
arc-swap = "1.5"
assert_matches = "1.5.0"
async-recursion = "1.0.4"
async-trait = "0.1.58"
awc = { version = "3", features = ["openssl"] }
backtrace = "0.3"
base64 = "0.21"
bencher = "0.1.5"
bitflags = "1.2"
blake2 = "0.9.1"
bn = { package = "zeropool-bn", version = "0.5.11", default-features = false }
bolero = { version = "0.10.1", features = ["arbitrary"] }
borsh = { version = "1.0.0", features = ["derive", "rc"] }
bs58 = "0.4"
bytes = "1"
bytesize = { version = "1.1", features = ["serde"] }
c2-chacha = "0.3"
cargo_metadata = "0.18.1"
cc = "1.0"
cfg-if = "1.0"
chrono = { version = "0.4.37", features = ["serde"] }
clap = { version = "4.2.0", features = ["derive", "env", "string"] }
cloud-storage = "0.11.1"
conqueue = "0.4.0"
cpu-time = "1.0"
criterion = { version = "0.5.1", default_features = false, features = ["html_reports", "cargo_bench_support"] }
crossbeam = "0.8"
crossbeam-channel = "0.5.8"
crossbeam-queue = "0.3.8"
csv = "1.2.1"
curve25519-dalek = { version = "4.1.1", default-features = false, features = ["alloc", "precomputed-tables", "rand_core"] }
derive-enum-from-into = "0.1.1"
derive_more = "0.99.9"
dirs = "4"
dynasm = "2.0"
dynasmrt = "2.0"
easy-ext = "0.2"
ed25519-dalek = { version = "2.1.0", default-features = false, features = ["hazmat", "rand_core"] }
elastic-array = "0.11"
enum-map = "2.1.0"
enumset = "1.0"
expect-test = "1.3.0"
finite-wasm = "0.5.0"
flate2 = "1.0.22"
fs2 = "0.4"
futures = "0.3.5"
futures-util = "0.3"
genesis-populate = { path = "genesis-tools/genesis-populate" }
hashbrown = "0.14.2"
hex = { version = "0.4.2", features = ["serde"] }
hex-literal = "0.2"
hkdf = "0.12.3"
hyper = { version = "0.14", features = ["full"] }
hyper-tls = "0.5.0"
im = "15"
indexmap = "1.6"
indicatif = { version = "0.15.0", features = ["with_rayon"] }
insta = { version = "1.34.0", features = ["json", "yaml", "redactions"] }
integration-tests = { path = "integration-tests" }
itertools = "0.12.1"
itoa = "1.0"
json_comments = "0.2.1"
lazy_static = "1.4"
leb128 = "0.2"
libc = "0.2.81"
libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] }
log = "0.4"
loupe = "0.1"
lru = "0.7.2"
memmap2 = "0.5"
memoffset = "0.8"
more-asserts = "0.2"
unc-account-id = { version = "0.7.2", features = ["internal_unstable", "serde", "borsh"] }
unc-actix-test-utils = { path = "test-utils/actix-test-utils" }
unc-amend-genesis = { path = "tools/amend-genesis" }
unc-database-tool= { path = "tools/database" }
unc-async = { path = "core/async" }
unc-cache = { path = "utils/unc-cache" }
unc-chain = { path = "chain/chain" }
unc-chain-configs = { path = "core/chain-configs" }
unc-chain-primitives = { path = "chain/chain-primitives" }
unc-chunks = { path = "chain/chunks" }
unc-chunks-primitives = { path = "chain/chunks-primitives" }
unc-client = { path = "chain/client" }
unc-client-primitives = { path = "chain/client-primitives" }
unc-cold-store-tool = { path = "tools/cold-store", package = "cold-store-tool" }
unc-config-utils = { path = "utils/config" }
unc-infra = { path = "infra" }
unc-crypto = { path = "core/crypto" }
unc-dyn-configs = { path = "core/dyn-configs" }
unc-epoch-manager = { path = "chain/epoch-manager" }
unc-epoch-sync-tool = { path = "tools/epoch-sync"}
unc-flat-storage = { path = "tools/flat-storage" }
unc-fork-network = { path = "tools/fork-network" }
unc-fmt = { path = "utils/fmt" }
unc-indexer = { path = "chain/indexer" }
unc-indexer-primitives = { path = "chain/indexer-primitives" }
unc-jsonrpc = { path = "chain/jsonrpc" }
unc-jsonrpc-adversarial-primitives = { path = "chain/jsonrpc-adversarial-primitives" }
unc-jsonrpc-client = { path = "chain/jsonrpc/client" }
unc-jsonrpc-primitives = { path = "chain/jsonrpc-primitives", features = ["full"] }
unc-jsonrpc-tests = { path = "chain/jsonrpc/jsonrpc-tests" }
unc-mainnet-res = { path = "utils/mainnet-res" }
unc-mirror = { path = "tools/mirror" }
unc-network = { path = "chain/network" }
unc-o11y = { path = "core/o11y" }
unc-parameters = { path = "core/parameters" }
unc-performance-metrics = { path = "utils/unc-performance-metrics" }
unc-performance-metrics-macros = { path = "utils/unc-performance-metrics-macros" }
unc-ping = { path = "tools/ping" }
unc-pool = { path = "chain/pool" }
unc-primitives = { path = "core/primitives" }
unc-primitives-core = { path = "core/primitives-core" }
unc-rpc-error-core = { path = "tools/rpctypegen/core" }
unc-rpc-error-macro = { path = "tools/rpctypegen/macro" }
unc-stable-hasher = { path = "utils/unc-stable-hasher" }
unc-state-parts = { path = "tools/state-parts" }
unc-state-parts-dump-check = { path = "tools/state-parts-dump-check" }
unc-state-viewer = { path = "tools/state-viewer", package = "state-viewer" }
unc-store = { path = "core/store" }
unc-telemetry = { path = "chain/telemetry" }
unc-test-contracts = { path = "runtime/unc-test-contracts" }
unc-undo-block = { path = "tools/undo-block" }
unc-vm-test-api = { path = "runtime/unc-vm/test-api" }
unc-vm-compiler = { path = "runtime/unc-vm/compiler" }
unc-vm-compiler-singlepass = { path = "runtime/unc-vm/compiler-singlepass" }
unc-vm-compiler-test-derive = { path = "runtime/unc-vm/compiler-test-derive" }
unc-vm-engine = { path = "runtime/unc-vm/engine" }
unc-vm-engine-universal = { path = "runtime/unc-vm/engine-universal" }
unc-vm-runner = { path = "runtime/unc-vm-runner" }
unc-vm-test-generator = { path = "runtime/unc-vm/test-generator" }
unc-vm-types = { path = "runtime/unc-vm/types" }
unc-vm-vm = { path = "runtime/unc-vm/vm" }
unc-vm-wast = { path = "runtime/unc-vm/wast" }
unc-wallet-contract = { path = "runtime/unc-wallet-contract" }
nix = "0.24"
node-runtime = { path = "runtime/runtime" }
num-bigint = "0.3"
num_cpus = "1.11"
num-rational = { version = "0.3.1", features = ["serde"] }
num-traits = "0.2.15"
once_cell = "1.13.1"
openssl = { version = "0.10.60", features = ["vendored"] }
openssl-probe = "0.1.4"
opentelemetry = { version = "0.17.0", features = ["rt-tokio", "trace"] }
opentelemetry-otlp = "0.10.0"
opentelemetry-semantic-conventions = "0.9.0"
paperclip = { version = "0.8.0", features = ["actix4"] }
parity-wasm = { version = "0.42", default-features = false }
parity-wasm_41 = { package = "parity-wasm", version = "0.41" }
parking_lot = "0.12.1"
percent-encoding = "2.2.0"
pin-project = "1.0"
prefix-sum-vec = "0.1.2"
pretty_assertions = "1.2"
primitive-types = { version = "0.10", default-features = false }
proc-macro2 = "1.0.64"
prometheus = "0.13.1"
protobuf = "3.0.1"
protobuf-codegen = "3.0.1"
pwasm-utils_12 = { package = "pwasm-utils", version = "0.12" }
quote = "1.0"
rand = "0.8.5"
rand_chacha = "0.3.1"
rand_core = "0.5"
rand_hc = "0.3.1"
rand_xorshift = "0.3"
rayon = "1.5"
redis = "0.23.0"
reed-solomon-erasure = "4"
regex = "1.7.1"
region = "3.0"
reqwest = { version = "0.12.2", features = ["blocking"] }
ripemd = "0.1.1"
rkyv = "0.7.31"
rlimit = "0.7"
rlp = "0.5.2"
rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "jemalloc"] }
runtime-tester = { path = "test-utils/runtime-tester" }
rusqlite = { version = "0.31.0", features = ["bundled", "chrono", "functions"] }
rustc-demangle = "0.1"
rust-s3 = { version = "0.33.0", features = ["blocking"] }
rustix = "0.37"
rsa = { version = "0.9.6", features = ["sha2", "getrandom"] }
secp256k1 = { version = "0.27.0", features = ["recovery", "rand-std"] }
semver = "1.0.4"
serde = { version = "1.0.136", features = ["alloc", "derive", "rc"] }
serde_ignored = "0.1"
serde_json = "1.0.68"
serde_repr = "0.1.8"
serde_with = { version = "3.0", features = ["base64"] }
serde_yaml = "0.9"
serial_test = "0.5"
sha2 = "0.10"
sha3 = "0.10"
shell-escape = "0.1.5"
smallvec = "1.6"
smart-default = "0.6"
smartstring = "1.0.1"
strum = { version = "0.24", features = ["derive"] }
stun = "0.4"
subtle = "2.2"
syn = { version = "2.0.4", features = ["extra-traits", "full"] }
sysinfo = "0.24.5"
tar = "0.4.38"
target-lexicon = { version = "0.12.2", default-features = false }
tempfile = "3.3"
testlib = { path = "test-utils/testlib" }
test-log = { version = "0.2", default-features = false, features = ["trace"] }
thiserror = "1.0.30"
tikv-jemallocator = "0.5.0"
time = { version = "0.3.9", features = ["parsing", "serde"] }
tokio = { version = "1.28", features = [
"fs",
"macros",
"net",
"rt-multi-thread",
"sync",
"time",
] }
tokio-stream = { version = "0.1.2", features = ["net"] }
tokio-util = { version = "0.7.1", features = ["codec", "io"] }
toml = "0.8.12"
tqdm = "0.4.4"
tracing = { version = "0.1.36", features = ["std"] }
tracing-appender = "0.2.2"
tracing-opentelemetry = "0.17.0"
tracing-span-tree = "0.1"
tracing-subscriber = { version = "0.3.15", features = ["env-filter", "fmt", "registry", "std"] }
trybuild = "1.0.11"
turn = "0.6"
validator = "0.12"
wasm-encoder = "0.27.0"
wasmer-compiler = { package = "wasmer-compiler-x", version = "=2.4.1" }
wasmer-compiler-singlepass = { package = "wasmer-compiler-singlepass-x", version = "=2.4.1" }
wasmer-engine = { package = "wasmer-engine-x", version = "=2.4.1" }
wasmer-engine-universal = { package = "wasmer-engine-universal-x", version = "=2.4.1", features = ["compiler"] }
wasmer-runtime = { version = "0.18.0", package = "wasmer-runtime-x", features = ["default-backend-singlepass"], default-features = false }
wasmer-runtime-core = { version = "0.18.3", package = "wasmer-runtime-core-x" }
wasmer-types = { package = "wasmer-types-x", version = "=2.4.1" }
wasmer-vm = { package = "wasmer-vm-x", version = "=2.4.1" }
wasmparser = "0.99"
wasmprinter = "0.2"
wasm-smith = "0.10"
wasmtime = { version = "14.0.4", default-features = false, features = ["cranelift"] }
wast = "40.0"
wat = "1.0.40"
webrtc-util = "0.7"
winapi = { version = "0.3", features = ["winbase", "memoryapi", "errhandlingapi", "winnt", "impl-default"] }
xshell = "0.2.1"
xz2 = "0.1.6"
yansi = "0.5.1"
stdx = { package = "unc-stdx", path = "utils/stdx" }
[patch.crates-io]
# Note that "bench" profile inherits from "release" profile and
# "test" profile inherits from "dev" profile.
# https://doc.rust-lang.org/cargo/reference/profiles.html#test
[profile.dev]
panic = 'abort'
[profile.release]
overflow-checks = true
panic = 'abort'
lto = "fat"
codegen-units = 1
# A much faster to compile version of `release`, for development use.
[profile.dev-release]
inherits = "release"
lto = false
codegen-units = 16
debug-assertions = true
# Used for fuzzing, LTO is ill-supported as of 2023-09 and so should not be enabled.
[profile.fuzz]
inherits = "dev"
opt-level = 3
incremental = false
codegen-units = 1
# Compile some dependencies with optimizations to speed up tests.
[profile.dev.package.hex]
opt-level = 3
[profile.dev.package.rand]
opt-level = 3
[profile.dev.package.bs58]
opt-level = 3
[profile.dev.package.sha2]
opt-level = 3
[profile.dev.package.curve25519-dalek]
opt-level = 3
[profile.dev.package.unsafe-libyaml]
opt-level = 3
[profile.dev.package.hashbrown]
opt-level = 3
[profile.dev.package.dynasmrt]
opt-level = 3
[profile.dev.package."*"]
opt-level = 1
================================================
FILE: Dockerfile
================================================
# syntax=docker/dockerfile-upstream:experimental
FROM ubuntu:22.04 as build
RUN apt-get update -qq && apt-get install -y \
git \
cmake \
g++ \
pkg-config \
libssl-dev \
curl \
llvm \
clang \
&& rm -rf /var/lib/apt/lists/*
COPY ./rust-toolchain.toml /tmp/rust-toolchain.toml
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN curl https://sh.rustup.rs -sSf | \
sh -s -- -y --no-modify-path --default-toolchain none
VOLUME [ /workdir ]
WORKDIR /workdir
COPY . .
ENV PORTABLE=ON
ARG make_target=unc-node-release
RUN make CARGO_TARGET_DIR=/tmp/target \
"${make_target:?make_target not set}"
# Docker image
FROM ubuntu:22.04
EXPOSE 3030 12345
RUN apt-get update -qq && apt-get install -y \
libssl-dev ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/run_docker.sh /usr/local/bin/run.sh
COPY --from=build /tmp/target/release/unc-node /usr/local/bin/unc-node
RUN chmod +x /usr/local/bin/unc-node
# Opencontainers annotations
LABEL org.opencontainers.image.authors="The Utility Project Team" \
org.opencontainers.image.url="https://www.utnet.org/" \
org.opencontainers.image.source="https://github.com/utnet-org/utility" \
org.opencontainers.image.version="0.10.0" \
org.opencontainers.image.revision="1" \
org.opencontainers.image.vendor="The Utility Project" \
org.opencontainers.image.licenses="GPL-2.0-or-later" \
org.opencontainers.image.title="Utility Node" \
org.opencontainers.image.description="Utility Chain Docker Node"
CMD ["/usr/local/bin/run.sh"]
================================================
FILE: Justfile
================================================
# FIXME: some of these tests don't work very well on MacOS at the moment. Should fix
# them at earliest convenience :)
# Also in addition to this, the `nextest-integration` test is currently disabled on macos
with_macos_excludes := if os() == "macos" {
"--exclude node-runtime --exclude runtime-params-estimator --exclude unc-network --exclude estimator-warehouse"
} else {
""
}
nightly_flags := "--features nightly,test_features"
export RUST_BACKTRACE := env("RUST_BACKTRACE", "short")
ci_hack_nextest_profile := if env("CI_HACKS", "0") == "1" { "--profile ci" } else { "" }
# all the tests, as close to CI as possible
test *FLAGS: (test-ci FLAGS) test-extra
# only the tests that are exactly the same as the ones in CI
test-ci *FLAGS: check-cargo-fmt \
python-style-checks \
check-cargo-deny \
check-crates-publish-checker \
check-cargo-clippy \
check-non-default \
check-cargo-udeps \
(nextest "stable" FLAGS) \
(nextest "nightly" FLAGS) \
doctests
# tests that are as close to CI as possible, but not exactly the same code
test-extra: check-lychee
# all cargo tests, TYPE is "stable" or "nightly"
nextest TYPE *FLAGS: (nextest-unit TYPE FLAGS) (nextest-integration TYPE FLAGS)
# cargo unit tests, TYPE is "stable" or "nightly"
nextest-unit TYPE *FLAGS:
RUSTFLAGS="-D warnings" \
cargo nextest run \
--locked \
--workspace \
--exclude integration-tests \
--cargo-profile dev-release \
{{ ci_hack_nextest_profile }} \
{{ with_macos_excludes }} \
{{ if TYPE == "nightly" { nightly_flags } \
else if TYPE == "stable" { "" } \
else { error("TYPE is neighter 'nightly' nor 'stable'") } }} \
{{ FLAGS }}
# cargo integration tests, TYPE is "stable" or "nightly"
[linux]
nextest-integration TYPE *FLAGS:
RUSTFLAGS="-D warnings" \
cargo nextest run \
--locked \
--package integration-tests \
--cargo-profile dev-release \
{{ ci_hack_nextest_profile }} \
{{ if TYPE == "nightly" { nightly_flags } \
else if TYPE == "stable" { "" } \
else { error("TYPE is neither 'nightly' nor 'stable'") } }} \
{{ FLAGS }}
# Note: when re-enabling this on macos, ci.yml will need to be adjusted to report code coverage again
[macos]
nextest-integration TYPE *FLAGS:
@echo "Nextest integration tests are currently disabled on macos!"
doctests:
cargo test --doc
# check various build configurations compile as anticipated
check-non-default:
# Ensure that unc-vm-runner always builds without default features enabled
RUSTFLAGS="-D warnings" \
cargo check -p unc-vm-runner --no-default-features
# check rust formatting
check-cargo-fmt:
cargo fmt -- --check
# check clippy lints
check-cargo-clippy:
CARGO_TARGET_DIR="target/clippy" \
RUSTFLAGS="-D warnings" \
cargo clippy --all-features --all-targets --locked
# check cargo deny lints
check-cargo-deny:
cargo deny --all-features --locked check bans
# crates-publish-checker-based checks
check-crates-publish-checker:
env CARGO_TARGET_DIR="target/crates-publish-checker" cargo run --locked -p crates-publish-checker
# generate a codecov report for RULE
codecov RULE:
#!/usr/bin/env bash
set -euxo pipefail
# Note: macos seems to not support `source <()` as a way to set environment variables, but
# this variant seems to work on both linux and macos.
# TODO: remove the RUSTFLAGS hack, see also https://github.com/rust-lang/cargo/issues/13040
cargo llvm-cov show-env --export-prefix | grep -v RUSTFLAGS= > env
source ./env
export RUSTC_WORKSPACE_WRAPPER="{{ absolute_path("scripts/coverage-wrapper-rustc") }}"
{{ just_executable() }} {{ RULE }}
mkdir -p coverage/codecov
cargo llvm-cov report --profile dev-release --codecov --output-path coverage/codecov/new.json
# generate a codecov report for RULE, CI version
codecov-ci RULE:
#!/usr/bin/env bash
set -euxo pipefail
{{ just_executable() }} codecov "{{ RULE }}"
pushd target
tar -c --zstd -f ../coverage/profraw/new.tar.zst *.profraw
popd
rm -rf target/*.profraw
# generate a tarball with all the binaries for coverage CI
tar-bins-for-coverage-ci:
#!/usr/bin/env bash
find target/dev-release/ \( -name incremental -or -name .fingerprint -or -name out \) -exec rm -rf '{}' \; || true
find target/dev-release/ -not -executable -delete || true
find target/dev-release/ -name 'build*script*build*' -delete || true
tar -c --zstd -f coverage/profraw/binaries/new.tar.zst target/dev-release/
# style checks from python scripts
python-style-checks:
python3 scripts/check_nightly.py
python3 scripts/check_pytests.py
python3 scripts/fix_nightly_feature_flags.py
./scripts/formatting --check
# verify there is no unused dependency specified in a Cargo.toml
check-cargo-udeps:
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
env CARGO_TARGET_DIR={{justfile_directory()}}/target/udeps RUSTFLAGS='--cfg=udeps --cap-lints=allow' cargo +nightly udeps
# lychee-based url validity checks
check-lychee:
# This is not actually run in CI. GITHUB_TOKEN can still be set locally by people who want
# to reproduce CI behavior in a better way.
git ls-files | grep 'md$\|mkd$\|html\?$' | xargs lychee {{ if env("GITHUB_TOKEN", "") != "" { "" } else { "-a 429" } }}
@echo {{ if env("GITHUB_TOKEN", "") != "" { "" } \
else { "Note: 'Too Many Requests' errors are allowed here but not in CI, set GITHUB_TOKEN to check them" } }}
# build target/rpc_errors_schema.json
build-rpc-errors-schema:
rm -f target/rpc_errors_schema.json
cargo check -p unc-jsonrpc --features dump_errors_schema
# update chain/jsonrpc/res/rpc_errors_schema.json
update-rpc-errors-schema: build-rpc-errors-schema
cp target/rpc_errors_schema.json chain/jsonrpc/res/rpc_errors_schema.json
# check chain/jsonrpc/res/rpc_errors_schema.json
check-rpc-errors-schema: build-rpc-errors-schema
diff target/rpc_errors_schema.json chain/jsonrpc/res/rpc_errors_schema.json
================================================
FILE: LICENSE-GPL2
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and`show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and`show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: LICENSE-GPL2.1
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C)
This 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 2.1 of the License, or (at your option) any later version.
This 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 this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
================================================
FILE: Makefile
================================================
export DOCKER_BUILDKIT = 1
export CARGO_BUILD_RUSTFLAGS = -D warnings
export UNC_RELEASE_BUILD = no
export CARGO_TARGET_DIR = target
# By default, build a regular release
all: release
docker-utility: DOCKER_TAG ?= utility
docker-utility:
docker build -t $(DOCKER_TAG) -f Dockerfile --build-arg=make_target=unc-node-release --progress=plain .
docker-utility-sandbox: DOCKER_TAG ?= utility-sandbox
docker-utility-sandbox:
docker build -t $(DOCKER_TAG) -f Dockerfile --build-arg=make_target=unc-node-sandbox-release --progress=plain .
docker-utility-nightly: DOCKER_TAG ?= utility-nightly
docker-utility-nightly:
docker build -t $(DOCKER_TAG) -f Dockerfile --build-arg=make_target=unc-node-nightly-release --progress=plain .
release: unc-node-release
cargo build -p store-validator --release
cargo build -p genesis-populate --release
$(MAKE) sandbox-release
unc-node: unc-node-release
@echo 'unc-node binary ready in ./target/release/unc-node'
unc-node-release: UNC_RELEASE_BUILD=release
unc-node-release:
cargo build -p unc-node --release
unc-node-debug:
cargo build -p unc-node
debug: unc-node-debug
cargo build -p store-validator
cargo build -p genesis-populate
$(MAKE) sandbox
perf-release: UNC_RELEASE_BUILD=release
perf-release:
CARGO_PROFILE_RELEASE_DEBUG=true cargo build -p unc-node --release --features performance_stats
cargo build -p store-validator --release --features unc-infra.performance_stats
perf-debug:
cargo build -p unc-node --features performance_stats
cargo build -p store-validator --features unc-infra.performance_stats
nightly-release: unc-node-nightly-release
cargo build -p store-validator --release --features unc-infra/nightly,unc-infra.performance_stats
cargo build -p genesis-populate --release --features unc-infra/nightly,unc-infra.performance_stats
unc-node-nightly-release:
cargo build -p unc-node --release --features nightly,performance_stats
nightly-debug:
cargo build -p unc-node --features nightly,performance_stats
cargo build -p store-validator --features unc-infra/nightly,unc-infra.performance_stats
cargo build -p genesis-populate --features unc-infra/nightly,unc-infra.performance_stats
assertions-release: UNC_RELEASE_BUILD=release
assertions-release:
CARGO_PROFILE_RELEASE_DEBUG=true CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=true cargo build -p unc-node --release --features performance_stats
sandbox: CARGO_TARGET_DIR=sandbox
sandbox: unc-node-sandbox
mkdir -p target/debug
ln -f sandbox/debug/unc-node target/debug/unc-node-sandbox
@ln -f sandbox/debug/unc-node target/debug/unc-sandbox
unc-node-sandbox:
cargo build -p unc-node --features sandbox
sandbox-release: CARGO_TARGET_DIR=sandbox
sandbox-release: unc-node-sandbox-release
mkdir -p target/release
ln -f sandbox/release/unc-node target/release/unc-node-sandbox
@ln -f sandbox/release/unc-node target/release/unc-sandbox
unc-node-sandbox-release:
cargo build -p unc-node --features sandbox --release
.PHONY: docker-utility docker-utility-nightly release unc-node debug
.PHONY: perf-release perf-debug nightly-release nightly-debug assertions-release sandbox
.PHONY: sandbox-release
================================================
FILE: README.md
================================================

![Stable Status][stable-release]
![Prerelease Status][prerelease]
[![codecov][codecov-badge]][codecov-url]
[![Discord chat][discord-badge]][discord-url]
[![Telegram Group][telegram-badge]][telegram-url]
[stable-release]: https://img.shields.io/github/v/release/utnet-org/utility?label=stable
[prerelease]: https://img.shields.io/github/v/release/utnet-org/utility?include_prereleases&label=prerelease
[codecov-badge]: https://codecov.io/gh/utnet-org/utility/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/utnet-org/utility
[discord-badge]: https://img.shields.io/discord/490367152054992913.svg
[discord-url]: https://unc.chat
[telegram-badge]: https://cdn.jsdelivr.net/gh/Patrolavia/telegram-badge@8fe3382b3fd3a1c533ba270e608035a27e430c2e/chat.svg
[telegram-url]: https://t.me/cryptounc
## Table of Contents
- [About Utility](#about-utility)
- [Installation](#installation)
- [Directory Structure](#directory-structure)
- [Contributing](#contributing)
- [Security](#security)
## About Utility
Utility's mission is to stimulate community-led innovation for the benefit of people worldwide.
To realize this mission, *Utility* provides a platform where developers and entrepreneurs can build applications that put users back in control of their data and assets. This is a core tenet of the ["Open Web" movement][open-web-url].
A key component of *utnet* is utility, a blockchain-powered unc-infra.tructure for serverless applications and smart contracts. Utility aims to offer the ease-of-use and scalability of modern PaaS like Firebase, but at a fraction of the cost of blockchains like Ethereum.
## Installation
The easiest way to join the network, is by using the `make release` command or download release binaries, which you can install as follows:
```sh
# testnet node init directly use binaries
unc-node --home ~/.unc init --chain-id testnet --download-genesis --download-config
# download snapshot data (optional)
## install rclone 1.66.0 or beyond
```sh
# Mac
$ brew install rclone
# Linux
$ sudo apt install rclone
$ mkdir -p ~/.config/rclone
$ touch ~/.config/rclone/rclone.conf
## rclone config
[unc_cf]
type = s3
provider = Cloudflare
endpoint= https://ec9b597fa02615ca6a0e62b7ff35d0cc.r2.cloudflarestorage.com
access_key_id = 2ff213c3730df215a7cc56e28914092e
secret_access_key = b28609e3869b43339c1267b59cf25aa5deff4097737d3848e1491e0729c3ff6c
acl = public-read
## download data
$ rclone copy --no-check-certificate unc_cf:unc/latest ./
$ latest=$(cat latest)
$ rclone copy --no-check-certificate --progress --transfers=6 unc_cf:unc/${latest:?}.tar.gz /tmp
## un archive snapshot
tar -zxvf /tmp/${latest:?}.tar.gz -C /tmp && mv /tmp/${latest:?}/data ~/.unc
## on ~/.unc dir touch file `validator_key.json` (optional)
{
"account_id": "miner-addr"
"public_key":"ed25519:2yMvZrTtjgFMtcpE12G3tdt7KsYKdKE6jufRnz4Yyxw3",
"private_key":"ed25519:3NVx4sHxBJciEH2wZoMig8YiMx1Q84Ur2RWTd2GQ7JNfWdyDxwwYrUR6XtJR3YcYeWh9NzVEmsnYe2keB97mVExZ"
}
# node run
$ unc-node --home ~/.unc run
```
To learn how to become validator, checkout [documentation](https://docs.xyz666.org).
## Directory Structure
├── chain: Consensus chain interaction utilities.
│ ├── bindings: block chain validate and rocksdb column.
│ ├── src: peer node bootstrap.
│ └── network: libp2p network discover.
├── docs: Documentation resources, including images and diagrams.
├── core: Components for utility primitives.
│ ├── crypto: Crypto libs rsa2048, secp256k1.
│ ├── primitives: Chain relatives base data structure.
│ └── store: rocksdb store data structure.
├── infra: The Utility instance, including application logic and attestation mechanisms.
│ ├── infra: Node initialize for Utility.
│ └── test: Command-line tools and utilities.
├── runtime: Core libraries for various protocol functionalities.
│ ├── runtime: Chain state apply, contracts executor.
│ └── runner: Rust bindings for smart contracts.
├── node: Node service for chain messages and transactions.
│ └── node: Application logic for the node service.
├── scripts: Utility scripts for development and operational tasks.
└── test: Testing suite for end-to-end, smoke, and utility testing.
## Contributing
For detailed instructions on how to contribute, including our coding standards, testing practices, and how to submit pull requests, please see [the contribution guidelines](CONTRIBUTING.md)
## Security
Please refer to [SECURITY.md](./SECURITY.md).
================================================
FILE: SECURITY.md
================================================
# Security Policy
Reference client for UNC is held to the highest security standard.
This document defines the policy on how to report vulnerabilities and receive updates when security patches are released.
If you have any suggestions or comments about the security policy, please email the [UNC Security Team](mailto:security@unc.org) at security@unc.org
## Reporting a vulnerability
All security issues should be submitted on [hackenproof](https://hackenproof.com/unc). The team will review the submissions and decide whether they are eligible for bounty payouts. For more details, please check out the program description on the hackenproof website.
## Handling & disclosure process
1. Security report is received and assigned to an owner. This person will coordinate the process of evaluating, fixing, releasing and disclosing the issue.
2. After initial report is received, the evaluation process is performed. It's identified if the issue exists, its severity and which version / components of the code is affected. Additional review to identify similar issues also happens.
3. Fixes are implemented for all supported releases. These fixes are not publicly communicated but held in a private repo of the Security Team or locally.
4. A suggested announcement date for this vulnerability is chosen. The notification is drafted and includes patches to all supported versions and affected components.
5. On the announcement date, the [UNC Security Update newsletter](https://groups.google.com/a/unc.org/g/security-updates) is sent an announcement. The changes are fast tracked and merged into the public repository. At least 6 hours after the mailing list is notified, a copy of the advisory will be published across social channels.
This process may take time, especially when coordinating with network participants and maintainers of other components in the ecosystem.
The goal will be to address issues in as short of a period as possible, but it's important that the process described above to ensure that disclosures are handled in a consistent manner.
*Note:* If the Security Team identifies that an issue is mission-critical and requires a subset of network participants to update prior to newsletter announcement - this will be done in a manual way by communicating via direct channels.
## Reward
The discovery of the security vulnerabilities that include but are not limited to the following categories will be rewarded proportionally to their severity:
* Algorithmic, implementation, and economic issues that violate safety of the blockchain;
* Algorithmic, implementation, and economic issues that stall the blockchain or significantly throttle liveness;
* Algorithmic, implementation, and economic issues in the standard contracts developed by UNC;
* Issues that expose the private data of the users, the developers, or the validators;
The following are the necessary conditions for the reward:
* The vulnerability is disclosed to UNC before it is disclosed publicly and UNC is given sufficient time to fix it;
* The vulnerability is not disclosed to anyone else except the finder and UNC before it is fixed;
* The vulnerability is not exploited until it is fixed.
### Rewards platform
We are using https://gitcoin.co/ to reward tokens. Meaning that every security vulnerability that you submit to us will be processed like a general work-item by an external contributor. To receive the reward, you would need to register on https://gitcoin.co/ and be able to receive the reward through it. Example of a reward for a security vulnerability finding: https://gitcoin.co/issue/utility/community/5/4359
## Receive Security Updates
If you want to be informed about security vulnerabilities, please subscribe to the [UNC Security Update newsletter](https://groups.google.com/a/unc.org/g/security-updates).
The newsletter is very low traffic and only sent out where public disclosure of a vulnerability happens.
================================================
FILE: buf.yaml
================================================
version: v1
breaking:
use:
- WIRE
================================================
FILE: chain/chain/Cargo.toml
================================================
[package]
name = "unc-chain"
version.workspace = true
authors.workspace = true
edition.workspace = true
publish = false
[lints]
workspace = true
[dependencies]
actix.workspace = true
assert_matches.workspace = true
borsh.workspace = true
bytesize.workspace = true
chrono.workspace = true
crossbeam-channel.workspace = true
enum-map.workspace = true
itertools.workspace = true
itoa.workspace = true
lru.workspace = true
num-rational.workspace = true
once_cell.workspace = true
rand.workspace = true
rand_chacha.workspace = true
rayon.workspace = true
strum.workspace = true
thiserror.workspace = true
tracing.workspace = true
yansi.workspace = true
unc-async.workspace = true
unc-cache.workspace = true
unc-chain-configs.workspace = true
unc-chain-primitives.workspace = true
unc-client-primitives.workspace = true
unc-crypto.workspace = true
unc-epoch-manager.workspace = true
unc-network.workspace = true
unc-o11y.workspace = true
unc-performance-metrics.workspace = true
unc-performance-metrics-macros.workspace = true
unc-pool.workspace = true
unc-primitives.workspace = true
unc-store.workspace = true
[dev-dependencies]
insta.workspace = true
assert_matches.workspace = true
[features]
# if enabled, we assert in most situations that are impossible unless some byzantine behavior is observed.
byzantine_asserts = []
expensive_tests = []
test_features = []
no_cache = ["unc-store/no_cache"]
new_epoch_sync = ["unc-store/new_epoch_sync", "unc-primitives/new_epoch_sync", "unc-epoch-manager/new_epoch_sync", "unc-chain-primitives/new_epoch_sync"]
protocol_feature_reject_blocks_with_outdated_protocol_version = [
"unc-primitives/protocol_feature_reject_blocks_with_outdated_protocol_version",
]
nightly = [
"nightly_protocol",
"protocol_feature_reject_blocks_with_outdated_protocol_version",
"unc-async/nightly",
"unc-chain-configs/nightly",
"unc-client-primitives/nightly",
"unc-epoch-manager/nightly",
"unc-network/nightly",
"unc-o11y/nightly",
"unc-pool/nightly",
"unc-primitives/nightly",
"unc-store/nightly",
]
nightly_protocol = [
"unc-async/nightly_protocol",
"unc-chain-configs/nightly_protocol",
"unc-client-primitives/nightly_protocol",
"unc-epoch-manager/nightly_protocol",
"unc-network/nightly_protocol",
"unc-o11y/nightly_protocol",
"unc-pool/nightly_protocol",
"unc-primitives/nightly_protocol",
"unc-store/nightly_protocol",
]
sandbox = ["unc-primitives/sandbox"]
================================================
FILE: chain/chain/src/block_processing_utils.rs
================================================
use crate::chain::BlockMissingChunks;
use crate::orphan::OrphanMissingChunks;
use crate::unc_chain_primitives::error::BlockKnownError::KnownInProcessing;
use crate::Provenance;
use once_cell::sync::OnceCell;
use std::collections::HashMap;
use std::sync::Arc;
use std::time::Instant;
use unc_primitives::block::Block;
use unc_primitives::challenge::{ChallengeBody, ChallengesResult};
use unc_primitives::hash::CryptoHash;
use unc_primitives::sharding::{ReceiptProof, ShardChunkHeader, StateSyncInfo};
use unc_primitives::types::ShardId;
/// Max number of blocks that can be in the pool at once.
/// This number will likely never be hit unless there are many forks in the chain.
pub(crate) const MAX_PROCESSING_BLOCKS: usize = 5;
/// Contains information from preprocessing a block
pub(crate) struct BlockPreprocessInfo {
pub(crate) is_caught_up: bool,
pub(crate) state_sync_info: Option,
pub(crate) incoming_receipts: HashMap>,
pub(crate) challenges_result: ChallengesResult,
pub(crate) challenged_blocks: Vec,
pub(crate) provenance: Provenance,
/// This field will be set when the apply_chunks has finished.
/// This is used to provide a way for caller to wait for the finishing of applying chunks of
/// a block
pub(crate) apply_chunks_done: Arc>,
/// This is used to calculate block processing time metric
pub(crate) block_start_processing_time: Instant,
}
/// Blocks which finished pre-processing and are now being applied asynchronously
pub(crate) struct BlocksInProcessing {
// A map that stores all blocks in processing
preprocessed_blocks: HashMap,
}
#[derive(Debug)]
pub(crate) enum AddError {
ExceedingPoolSize,
BlockAlreadyInPool,
}
impl From for unc_chain_primitives::Error {
fn from(err: AddError) -> Self {
match err {
AddError::ExceedingPoolSize => unc_chain_primitives::Error::TooManyProcessingBlocks,
AddError::BlockAlreadyInPool => {
unc_chain_primitives::Error::BlockKnown(KnownInProcessing)
}
}
}
}
/// Results from processing a block that are useful for client and client actor to use
/// for steps after a block is processed that can't be finished inside Chain after a block is processed
/// (for example, sending requests for missing chunks or challenges).
/// This struct is passed to Chain::process_block as an argument instead of returned as Result,
/// because the information stored here need to returned whether process_block succeeds or returns an error.
#[derive(Default)]
pub struct BlockProcessingArtifact {
pub orphans_missing_chunks: Vec,
pub blocks_missing_chunks: Vec,
pub challenges: Vec,
pub invalid_chunks: Vec,
}
/// This struct defines the callback function that will be called after apply chunks are finished
/// for each block. Multiple functions that might trigger the start processing of new blocks has
/// this as an argument. Caller of these functions must note that this callback can be called multiple
/// times, for different blocks, because these functions may trigger the processing of more than
/// one block.
pub type DoneApplyChunkCallback = Arc () + Send + Sync + 'static>;
#[derive(Debug)]
pub struct BlockNotInPoolError;
impl BlocksInProcessing {
pub(crate) fn new() -> Self {
BlocksInProcessing { preprocessed_blocks: HashMap::new() }
}
pub(crate) fn len(&self) -> usize {
self.preprocessed_blocks.len()
}
/// Add a preprocessed block to the pool. Return Error::ExceedingPoolSize if the pool already
/// reaches its max size.
pub(crate) fn add(
&mut self,
block: Block,
preprocess_info: BlockPreprocessInfo,
) -> Result<(), AddError> {
self.add_dry_run(block.hash())?;
self.preprocessed_blocks.insert(*block.hash(), (block, preprocess_info));
Ok(())
}
pub(crate) fn contains(&self, block_hash: &CryptoHash) -> bool {
self.preprocessed_blocks.contains_key(block_hash)
}
pub(crate) fn remove(
&mut self,
block_hash: &CryptoHash,
) -> Option<(Block, BlockPreprocessInfo)> {
self.preprocessed_blocks.remove(block_hash)
}
/// This function does NOT add the block, it simply checks if the block can be added
pub(crate) fn add_dry_run(&self, block_hash: &CryptoHash) -> Result<(), AddError> {
// We set a limit to the max number of blocks that we will be processing at the same time.
// Since processing a block requires that the its previous block is processed, this limit
// is likely never hit, unless there are many forks in the chain.
// In this case, we will simply drop the block.
if self.preprocessed_blocks.len() >= MAX_PROCESSING_BLOCKS {
Err(AddError::ExceedingPoolSize)
} else if self.preprocessed_blocks.contains_key(block_hash) {
Err(AddError::BlockAlreadyInPool)
} else {
Ok(())
}
}
pub(crate) fn has_blocks_to_catch_up(&self, prev_hash: &CryptoHash) -> bool {
self.preprocessed_blocks
.iter()
.any(|(_, (block, _))| block.header().prev_hash() == prev_hash)
}
/// This function waits until apply_chunks_done is marked as true for all blocks in the pool
/// Returns true if new blocks are done applying chunks
pub(crate) fn wait_for_all_blocks(&self) -> bool {
for (_, (_, block_preprocess_info)) in self.preprocessed_blocks.iter() {
let _ = block_preprocess_info.apply_chunks_done.wait();
}
!self.preprocessed_blocks.is_empty()
}
/// This function waits until apply_chunks_done is marked as true for block `block_hash`
pub(crate) fn wait_for_block(
&self,
block_hash: &CryptoHash,
) -> Result<(), BlockNotInPoolError> {
let _ = self
.preprocessed_blocks
.get(block_hash)
.ok_or(BlockNotInPoolError)?
.1
.apply_chunks_done
.wait();
Ok(())
}
}
================================================
FILE: chain/chain/src/blocks_delay_tracker.rs
================================================
use chrono::DateTime;
use std::collections::{hash_map::Entry, BTreeMap, HashMap};
use std::mem;
use std::time::Instant;
use tracing::error;
use unc_epoch_manager::EpochManagerAdapter;
use unc_primitives::block::{Block, Tip};
use unc_primitives::hash::CryptoHash;
use unc_primitives::sharding::{ChunkHash, ShardChunkHeader};
use unc_primitives::static_clock::StaticClock;
use unc_primitives::types::{BlockHeight, ShardId};
use unc_primitives::views::{
BlockProcessingInfo, BlockProcessingStatus, ChainProcessingInfo, ChunkProcessingInfo,
ChunkProcessingStatus, DroppedReason,
};
use crate::{metrics, Chain, ChainStoreAccess};
const BLOCK_DELAY_TRACKING_COUNT: u64 = 50;
/// A centralized place that records monitoring information about the important timestamps throughout
/// the lifetime of blocks and chunks. It keeps information of recent blocks and chunks
/// (blocks with height > head height - BLOCK_DELAY_TRACKING_HORIZON).
/// A block is added the first time when chain tries to process the block. Note that this means
/// the block already passes a few checks in ClientActor and in Client before it enters the chain
/// code. For example, client actor checks that the block must be within head_height + BLOCK_HORIZON (500),
/// that's why we know tracker at most tracks 550 blocks.
#[derive(Debug, Default)]
pub struct BlocksDelayTracker {
// A block is added at the first time it was received, and
// removed if it is too far from the chain head.
blocks: HashMap,
// Maps block height to block hash. Used for gc.
// Theoretically, each block height should only have one block, if our block processing code
// works correctly. We are storing a vector here just in case.
blocks_height_map: BTreeMap>,
// Chunks that belong to the blocks in the tracker
chunks: HashMap,
// Chunks that we don't know which block it belongs to yet
floating_chunks: HashMap,
head_height: BlockHeight,
}
#[derive(Debug, Clone)]
pub struct BlockTrackingStats {
/// Timestamp when block was received.
pub received_timestamp: Instant,
pub received_utc_timestamp: DateTime,
/// Timestamp when block was put to the orphan pool, if it ever was
pub orphaned_timestamp: Option,
/// Timestamp when block was put to the missing chunks pool
pub missing_chunks_timestamp: Option,
/// Timestamp when block was moved out of the orphan pool
pub removed_from_orphan_timestamp: Option,
/// Timestamp when block was moved out of the missing chunks pool
pub removed_from_missing_chunks_timestamp: Option,
/// Timestamp when block was done processing
pub processed_timestamp: Option,
/// Whether the block is not processed because of different reasons
pub dropped: Option,
/// Stores the error message encountered during the processing of this block
pub error: Option,
/// Only contains new chunks that belong to this block, if the block doesn't produce a new chunk
/// for a shard, the corresponding item will be None.
pub chunks: Vec