├── .cargo └── config.toml ├── .dockerignore ├── .github ├── CODEOWNERS ├── actions-rs │ └── grcov.yml └── workflows │ ├── build.yml │ ├── code_checks.yml │ ├── coverage.yml.disabled │ ├── loom.yml │ ├── release.yml │ ├── release_docker.yml │ ├── release_linux.yml │ ├── release_macos.yml │ ├── release_windows.yml │ └── wasm.yml ├── .gitignore ├── .gitlab-ci.yml ├── .gitlab └── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── SECURITY.md ├── accounting ├── Cargo.toml └── src │ ├── block_undo.rs │ ├── delta │ ├── combine.rs │ ├── delta_amount_collection.rs │ ├── delta_data_collection │ │ ├── mod.rs │ │ ├── tests │ │ │ ├── delta_delta_delta_tests.rs │ │ │ ├── delta_delta_undo_tests.rs │ │ │ ├── delta_delta_undo_undo_tests.rs │ │ │ └── mod.rs │ │ └── undo.rs │ ├── mod.rs │ └── tests.rs │ ├── error.rs │ └── lib.rs ├── api-server ├── README.md ├── api-server-common │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── storage │ │ ├── impls │ │ ├── in_memory │ │ │ ├── mod.rs │ │ │ └── transactional │ │ │ │ ├── mod.rs │ │ │ │ ├── read.rs │ │ │ │ └── write.rs │ │ ├── mod.rs │ │ └── postgres │ │ │ ├── mod.rs │ │ │ ├── queries.rs │ │ │ └── transactional │ │ │ ├── mod.rs │ │ │ ├── read.rs │ │ │ └── write.rs │ │ ├── mod.rs │ │ └── storage_api │ │ ├── block_aux_data.rs │ │ └── mod.rs ├── scanner-daemon │ ├── Cargo.toml │ └── src │ │ ├── config.rs │ │ └── main.rs ├── scanner-lib │ ├── Cargo.toml │ └── src │ │ ├── blockchain_state │ │ ├── mod.rs │ │ └── pos_adapter.rs │ │ ├── lib.rs │ │ └── sync │ │ ├── local_state.rs │ │ ├── mod.rs │ │ ├── remote_node.rs │ │ └── tests │ │ ├── mod.rs │ │ └── simulation.rs ├── stack-test-suite │ ├── Cargo.toml │ └── tests │ │ ├── in_memory.rs │ │ └── v2 │ │ ├── address.rs │ │ ├── address_all_utxos.rs │ │ ├── address_delegations.rs │ │ ├── address_spendable_utxos.rs │ │ ├── address_token_authority.rs │ │ ├── block.rs │ │ ├── block_header.rs │ │ ├── block_reward.rs │ │ ├── block_transaction_ids.rs │ │ ├── chain_at_height.rs │ │ ├── chain_tip.rs │ │ ├── feerate.rs │ │ ├── helpers.rs │ │ ├── htlc.rs │ │ ├── mod.rs │ │ ├── nft.rs │ │ ├── orders.rs │ │ ├── pool.rs │ │ ├── pool_block_stats.rs │ │ ├── pools.rs │ │ ├── statistics.rs │ │ ├── token.rs │ │ ├── token_ids.rs │ │ ├── token_ticker.rs │ │ ├── transaction.rs │ │ ├── transaction_merkle_path.rs │ │ ├── transaction_submit.rs │ │ └── transactions.rs ├── storage-test-suite │ ├── Cargo.toml │ ├── src │ │ ├── basic.rs │ │ ├── helpers.rs │ │ ├── lib.rs │ │ └── podman.rs │ └── tests │ │ ├── containers │ │ ├── mod.rs │ │ └── with_container.rs │ │ ├── in_memory.rs │ │ └── postgres.rs └── web-server │ ├── Cargo.toml │ └── src │ ├── api │ ├── json_helpers.rs │ ├── mod.rs │ └── v2.rs │ ├── config.rs │ ├── error.rs │ ├── lib.rs │ └── main.rs ├── blockprod ├── Cargo.toml └── src │ ├── config.rs │ ├── detail │ ├── job_manager │ │ ├── jobs_container.rs │ │ └── mod.rs │ ├── mod.rs │ ├── tests.rs │ ├── timestamp_searcher │ │ ├── mod.rs │ │ └── tests.rs │ └── utils.rs │ ├── interface │ ├── blockprod_interface.rs │ ├── blockprod_interface_impl.rs │ └── mod.rs │ ├── lib.rs │ └── rpc.rs ├── build-tools ├── assets │ ├── logo.icns │ ├── logo.ico │ └── node-gui-icon_512.png ├── code-docs │ ├── build-rpc-docs.sh │ └── build-wasm-docs.sh ├── codecheck │ ├── codecheck.py │ └── requirements.txt ├── coverage │ ├── README.md │ └── grcov.yml ├── docker │ ├── BUILD.md │ ├── Dockerfile.api-blockchain-scanner-daemon │ ├── Dockerfile.api-web-server │ ├── Dockerfile.builder │ ├── Dockerfile.dns-server │ ├── Dockerfile.node-daemon │ ├── Dockerfile.runner-base │ ├── Dockerfile.wallet-cli │ ├── Dockerfile.wallet-rpc-daemon │ ├── README.md │ ├── build.py │ ├── entrypoint.sh │ ├── example-mainnet-dns-server │ │ ├── .env │ │ ├── README.md │ │ └── docker-compose.yml │ └── example-mainnet │ │ ├── .env │ │ ├── README.md │ │ └── docker-compose.yml ├── linux-systemd-service │ ├── README.md │ ├── logrotate.d │ │ ├── README.md │ │ └── mintlayer │ ├── mintlayer-node-testnet.service │ └── mintlayer-wallet-rpc-testnet.service ├── osx │ ├── DeveloperIDG2CA.cer │ ├── Info.plist.template │ ├── entitlements.plist │ └── sign_and_notarize.sh ├── p2p-test │ ├── .env │ ├── Dockerfile │ ├── Dockerfile.dockerignore │ ├── README.md │ ├── docker-compose-base.yml │ ├── docker-compose.yml │ ├── print_connected_peers.sh │ ├── print_ip_addresses.sh │ ├── prune_node.sh │ └── run_wallet_cmd.sh ├── rust-version-extractor │ └── rust-version-extractor.py ├── staking-test │ ├── .env │ ├── Dockerfile │ ├── Dockerfile.dockerignore │ ├── README.md │ ├── common.py │ ├── docker-compose.yml │ ├── init_and_start_staking.py │ ├── list_pools.py │ └── node_runner.sh ├── win │ ├── create-license.ps1 │ └── create-nsis-script.ps1 └── workspace-partition.py ├── chainstate ├── Cargo.toml ├── constraints-value-accumulator │ ├── Cargo.toml │ └── src │ │ ├── accumulated_fee.rs │ │ ├── constraints_accumulator.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ └── tests │ │ ├── constraints_tests.rs │ │ ├── homomorphism.rs │ │ ├── mod.rs │ │ └── orders_constraints.rs ├── launcher │ ├── Cargo.toml │ └── src │ │ ├── config.rs │ │ ├── lib.rs │ │ └── storage_compatibility.rs ├── src │ ├── config.rs │ ├── detail │ │ ├── ban_score.rs │ │ ├── block_checking.rs │ │ ├── block_invalidation │ │ │ ├── best_chain_candidates.rs │ │ │ ├── best_chain_candidates_tests.rs │ │ │ └── mod.rs │ │ ├── bootstrap.rs │ │ ├── chainstateref │ │ │ ├── block_info.rs │ │ │ ├── consistency_checker.rs │ │ │ ├── epoch_seal.rs │ │ │ ├── in_memory_reorg.rs │ │ │ ├── mod.rs │ │ │ └── tx_verifier_storage.rs │ │ ├── error.rs │ │ ├── error_classification.rs │ │ ├── info.rs │ │ ├── median_time.rs │ │ ├── mod.rs │ │ ├── orphan_blocks │ │ │ ├── mod.rs │ │ │ ├── orphans_proxy.rs │ │ │ ├── orphans_proxy_impl.rs │ │ │ ├── orphans_refs.rs │ │ │ ├── pool.rs │ │ │ └── pool_impl.rs │ │ ├── query.rs │ │ ├── test.rs │ │ └── tx_verification_strategy │ │ │ ├── default_strategy.rs │ │ │ └── mod.rs │ ├── interface │ │ ├── chainstate_interface.rs │ │ ├── chainstate_interface_impl.rs │ │ ├── chainstate_interface_impl_delegation.rs │ │ └── mod.rs │ ├── lib.rs │ └── rpc │ │ ├── mod.rs │ │ └── types │ │ ├── account.rs │ │ ├── block.rs │ │ ├── block_reward.rs │ │ ├── consensus_data.rs │ │ ├── event.rs │ │ ├── input.rs │ │ ├── mod.rs │ │ ├── output.rs │ │ ├── signed_transaction.rs │ │ └── token.rs ├── storage │ ├── Cargo.toml │ └── src │ │ ├── internal │ │ ├── expensive.rs │ │ ├── mod.rs │ │ ├── store_tx │ │ │ ├── mod.rs │ │ │ ├── read_impls.rs │ │ │ └── write_impls.rs │ │ ├── test.rs │ │ └── version.rs │ │ ├── is_transaction_seal.rs │ │ ├── lib.rs │ │ ├── mock │ │ ├── mock_impl.rs │ │ ├── mock_impl_accounting.rs │ │ ├── mod.rs │ │ └── tests.rs │ │ └── schema.rs ├── test-framework │ ├── Cargo.toml │ └── src │ │ ├── block_builder.rs │ │ ├── framework.rs │ │ ├── framework_builder.rs │ │ ├── key_manager.rs │ │ ├── lib.rs │ │ ├── pos_block_builder.rs │ │ ├── random_tx_maker.rs │ │ ├── signature_destination_getter.rs │ │ ├── staking_pools.rs │ │ ├── storage.rs │ │ ├── transaction_builder.rs │ │ ├── tx_verification_strategy │ │ ├── disposable_strategy.rs │ │ ├── mod.rs │ │ └── randomized_strategy.rs │ │ ├── utils.rs │ │ └── utxo_for_spending.rs ├── test-suite │ ├── Cargo.toml │ ├── benches │ │ └── benches.rs │ └── src │ │ ├── lib.rs │ │ └── tests │ │ ├── basic_tests.rs │ │ ├── block_invalidation.rs │ │ ├── block_status.rs │ │ ├── bootstrap.rs │ │ ├── chainstate_accounting_storage_tests.rs │ │ ├── chainstate_storage_tests.rs │ │ ├── data_deposit.rs │ │ ├── delegation_tests.rs │ │ ├── double_spend_tests.rs │ │ ├── events_tests.rs │ │ ├── framework_tests.rs │ │ ├── fungible_tokens.rs │ │ ├── fungible_tokens_v1.rs │ │ ├── get_stake_pool_balances_at_heights.rs │ │ ├── helpers │ │ ├── block_creation_helpers.rs │ │ ├── block_index_handle_impl.rs │ │ ├── block_status_helpers.rs │ │ ├── in_memory_storage_wrapper.rs │ │ ├── mod.rs │ │ └── pos.rs │ │ ├── history_iteration.rs │ │ ├── homomorphism.rs │ │ ├── htlc.rs │ │ ├── initialization.rs │ │ ├── mempool_output_timelock.rs │ │ ├── mod.rs │ │ ├── nft_burn.rs │ │ ├── nft_issuance.rs │ │ ├── nft_reorgs.rs │ │ ├── nft_transfer.rs │ │ ├── orders_tests.rs │ │ ├── output_timelock.rs │ │ ├── pos_accounting_reorg.rs │ │ ├── pos_maturity_settings.rs │ │ ├── pos_processing_tests.rs │ │ ├── pos_retargeting_tests.rs │ │ ├── processing_tests.rs │ │ ├── reorgs_tests.rs │ │ ├── signature_tests.rs │ │ ├── stake_pool_tests.rs │ │ ├── syncing_tests.rs │ │ ├── tx_fee.rs │ │ ├── tx_verification_simulation.rs │ │ ├── tx_verifier_among_threads.rs │ │ └── tx_verifier_disconnect.rs ├── tx-verifier │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── transaction_verifier │ │ ├── accounting_undo_cache │ │ ├── cached_block_undo.rs │ │ ├── mod.rs │ │ └── tests.rs │ │ ├── cached_operation.rs │ │ ├── check_transaction.rs │ │ ├── error.rs │ │ ├── flush.rs │ │ ├── hierarchy.rs │ │ ├── input_check │ │ ├── mod.rs │ │ └── signature_only_check.rs │ │ ├── input_output_policy │ │ ├── mod.rs │ │ ├── purposes_check.rs │ │ └── tests │ │ │ ├── constraints_tests.rs │ │ │ ├── mod.rs │ │ │ ├── outputs_utils.rs │ │ │ ├── purpose_tests.rs │ │ │ └── reward_tests.rs │ │ ├── mod.rs │ │ ├── pos_accounting_delta_adapter.rs │ │ ├── reward_distribution.rs │ │ ├── storage.rs │ │ ├── tests │ │ ├── hierarchy_read.rs │ │ ├── hierarchy_write.rs │ │ ├── mock.rs │ │ └── mod.rs │ │ ├── timelock_check.rs │ │ ├── token_issuance_cache.rs │ │ ├── tokens_check │ │ ├── check_utils.rs │ │ └── mod.rs │ │ ├── tx_source.rs │ │ └── utxos_undo_cache │ │ ├── cached_utxo_block_undo.rs │ │ ├── mod.rs │ │ └── tests.rs └── types │ ├── Cargo.toml │ └── src │ ├── ancestor.rs │ ├── block_index.rs │ ├── block_index_handle.rs │ ├── block_index_history_iter.rs │ ├── block_status.rs │ ├── epoch_data.rs │ ├── epoch_data_cache.rs │ ├── error.rs │ ├── gen_block_index.rs │ ├── height_skip.rs │ ├── lib.rs │ ├── locator.rs │ ├── pos_randomness.rs │ ├── storage_result.rs │ └── vrf_tools.rs ├── clippy.toml ├── common ├── Cargo.toml ├── src │ ├── address │ │ ├── dehexify.rs │ │ ├── hexified.rs │ │ ├── mod.rs │ │ ├── pubkeyhash.rs │ │ ├── rpc.rs │ │ └── traits.rs │ ├── chain │ │ ├── block │ │ │ ├── block_body │ │ │ │ ├── block_merkle.rs │ │ │ │ ├── merkle_proxy.rs │ │ │ │ ├── merkle_tools.rs │ │ │ │ └── mod.rs │ │ │ ├── block_header.rs │ │ │ ├── block_reward.rs │ │ │ ├── block_size.rs │ │ │ ├── block_v1.rs │ │ │ ├── consensus_data.rs │ │ │ ├── mod.rs │ │ │ ├── signed_block_header.rs │ │ │ └── timestamp.rs │ │ ├── chaintrust │ │ │ ├── asymptote.rs │ │ │ └── mod.rs │ │ ├── coin_unit.rs │ │ ├── config │ │ │ ├── builder.rs │ │ │ ├── checkpoints.rs │ │ │ ├── checkpoints_data │ │ │ │ ├── mainnet.rs │ │ │ │ ├── mod.rs │ │ │ │ └── testnet.rs │ │ │ ├── emission_schedule.rs │ │ │ ├── mod.rs │ │ │ ├── regtest.rs │ │ │ └── regtest_options.rs │ │ ├── gen_block.rs │ │ ├── genesis.rs │ │ ├── make_id.rs │ │ ├── mod.rs │ │ ├── order │ │ │ ├── mod.rs │ │ │ ├── order_id.rs │ │ │ └── rpc.rs │ │ ├── pos │ │ │ ├── config.rs │ │ │ ├── config_builder.rs │ │ │ ├── delegation_id.rs │ │ │ ├── mod.rs │ │ │ └── pool_id.rs │ │ ├── pow.rs │ │ ├── tokens │ │ │ ├── issuance.rs │ │ │ ├── mod.rs │ │ │ ├── nft.rs │ │ │ ├── rpc.rs │ │ │ ├── token_id.rs │ │ │ └── tokens_utils.rs │ │ ├── transaction │ │ │ ├── account_nonce.rs │ │ │ ├── account_outpoint.rs │ │ │ ├── input.rs │ │ │ ├── mod.rs │ │ │ ├── output │ │ │ │ ├── classic_multisig.rs │ │ │ │ ├── htlc.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── output_value.rs │ │ │ │ ├── stakelock.rs │ │ │ │ └── timelock.rs │ │ │ ├── printout.rs │ │ │ ├── signature │ │ │ │ ├── inputsig │ │ │ │ │ ├── arbitrary_message │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── tests.rs │ │ │ │ │ ├── authorize_hashed_timelock_contract_spend.rs │ │ │ │ │ ├── authorize_pubkey_spend.rs │ │ │ │ │ ├── authorize_pubkeyhash_spend.rs │ │ │ │ │ ├── classical_multisig │ │ │ │ │ │ ├── authorize_classical_multisig.rs │ │ │ │ │ │ ├── encode_decode_multisig_spend.rs │ │ │ │ │ │ ├── mod.rs │ │ │ │ │ │ └── multisig_partial_signature.rs │ │ │ │ │ ├── htlc.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── standard_signature.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── sighash │ │ │ │ │ ├── hashable.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── sighashtype.rs │ │ │ │ └── tests │ │ │ │ │ ├── mixed_sighash_types.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── sign_and_mutate.rs │ │ │ │ │ ├── sign_and_verify.rs │ │ │ │ │ └── utils.rs │ │ │ ├── signed_transaction.rs │ │ │ ├── signed_transaction_intent.rs │ │ │ ├── transaction_v1.rs │ │ │ └── utxo_outpoint.rs │ │ └── upgrades │ │ │ ├── chainstate_upgrade │ │ │ ├── builder.rs │ │ │ └── mod.rs │ │ │ ├── chainstate_upgrades_builder.rs │ │ │ ├── consensus_upgrade.rs │ │ │ ├── mod.rs │ │ │ └── netupgrade.rs │ ├── lib.rs │ ├── primitives │ │ ├── amount │ │ │ ├── decimal.rs │ │ │ ├── mod.rs │ │ │ ├── rpc.rs │ │ │ ├── serde_support.rs │ │ │ ├── signed.rs │ │ │ └── tests.rs │ │ ├── bech32_encoding │ │ │ ├── error.rs │ │ │ ├── mod.rs │ │ │ └── tests.rs │ │ ├── compact.rs │ │ ├── error.rs │ │ ├── hash_encoded.rs │ │ ├── height.rs │ │ ├── id │ │ │ ├── mod.rs │ │ │ └── with_id.rs │ │ ├── mod.rs │ │ ├── per_thousand.rs │ │ ├── rational.rs │ │ ├── semver.rs │ │ ├── time.rs │ │ ├── user_agent.rs │ │ └── version_tag.rs │ ├── size_estimation │ │ ├── mod.rs │ │ └── tests.rs │ ├── text_summary.rs │ ├── time_getter.rs │ └── uint │ │ ├── endian.rs │ │ ├── impls.rs │ │ ├── internal_macros.rs │ │ └── mod.rs └── tests │ └── transaction.rs ├── consensus ├── Cargo.toml └── src │ ├── error.rs │ ├── lib.rs │ ├── pos │ ├── block_sig.rs │ ├── effective_pool_balance.rs │ ├── error.rs │ ├── hash_check.rs │ ├── input_data.rs │ ├── kernel.rs │ ├── mod.rs │ └── target.rs │ ├── pow │ ├── error.rs │ ├── helpers.rs │ ├── input_data.rs │ ├── mod.rs │ └── work.rs │ └── validator.rs ├── crypto ├── Cargo.toml ├── README └── src │ ├── ephemeral_e2e │ ├── error.rs │ └── mod.rs │ ├── hash │ ├── internal.rs │ └── mod.rs │ ├── kdf │ ├── argon2.rs │ └── mod.rs │ ├── key │ ├── extended.rs │ ├── hdkd │ │ ├── chain_code.rs │ │ ├── child_number.rs │ │ ├── derivable.rs │ │ ├── derivation_path.rs │ │ ├── mod.rs │ │ └── u31.rs │ ├── key_holder.rs │ ├── mod.rs │ ├── secp256k1 │ │ ├── extended_keys.rs │ │ └── mod.rs │ └── signature │ │ └── mod.rs │ ├── lib.rs │ ├── symkey │ ├── chacha20poly1305 │ │ ├── XCHACHA20POLY1305_TEST_VECTORS.tv │ │ └── mod.rs │ └── mod.rs │ ├── util │ ├── eq.rs │ └── mod.rs │ └── vrf │ ├── mod.rs │ ├── primitives.rs │ ├── schnorrkel │ ├── data.rs │ └── mod.rs │ └── transcript │ ├── mod.rs │ ├── no_rng.rs │ ├── traits.rs │ └── with_rng.rs ├── deny.toml ├── dns-server ├── Cargo.toml └── src │ ├── config.rs │ ├── crawler_p2p │ ├── crawler │ │ ├── address_data.rs │ │ ├── mod.rs │ │ └── tests │ │ │ ├── mock_crawler.rs │ │ │ └── mod.rs │ ├── crawler_manager │ │ ├── mod.rs │ │ ├── storage.rs │ │ ├── storage_impl.rs │ │ └── tests │ │ │ ├── mock_manager.rs │ │ │ └── mod.rs │ └── mod.rs │ ├── dns_server │ ├── mod.rs │ └── tests.rs │ ├── error.rs │ └── main.rs ├── do_checks.sh ├── logging ├── Cargo.toml └── src │ ├── lib.rs │ ├── log_style.rs │ ├── tracing_utils.rs │ └── utils.rs ├── mempool ├── Cargo.toml ├── src │ ├── config.rs │ ├── error │ │ ├── ban_score.rs │ │ └── mod.rs │ ├── event.rs │ ├── interface │ │ ├── mempool_interface.rs │ │ ├── mempool_interface_impl.rs │ │ └── mod.rs │ ├── lib.rs │ ├── pool │ │ ├── entry.rs │ │ ├── fee.rs │ │ ├── feerate.rs │ │ ├── mod.rs │ │ ├── orphans │ │ │ ├── detect.rs │ │ │ ├── mod.rs │ │ │ └── test.rs │ │ ├── tests │ │ │ ├── basic.rs │ │ │ ├── mod.rs │ │ │ ├── orphans.rs │ │ │ └── utils.rs │ │ ├── tx_pool │ │ │ ├── collect_txs.rs │ │ │ ├── feerate_points.rs │ │ │ ├── memory_usage_estimator.rs │ │ │ ├── mod.rs │ │ │ ├── reorg.rs │ │ │ ├── rolling_fee_rate.rs │ │ │ ├── store │ │ │ │ ├── mem_usage.rs │ │ │ │ └── mod.rs │ │ │ ├── tests │ │ │ │ ├── accumulator.rs │ │ │ │ ├── basic.rs │ │ │ │ ├── expiry.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── reorg.rs │ │ │ │ ├── replacement.rs │ │ │ │ └── utils.rs │ │ │ └── tx_verifier │ │ │ │ ├── chainstate_handle.rs │ │ │ │ ├── mod.rs │ │ │ │ └── utxo_view.rs │ │ └── work_queue │ │ │ ├── mod.rs │ │ │ └── test.rs │ ├── rpc.rs │ ├── rpc_event.rs │ └── tx_accumulator │ │ └── mod.rs └── types │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── tx_options.rs │ ├── tx_origin.rs │ └── tx_status.rs ├── mintscript ├── Cargo.toml └── src │ ├── checker │ ├── hashlock.rs │ ├── mod.rs │ ├── signature.rs │ └── timelock.rs │ ├── lib.rs │ ├── script │ ├── display.rs │ ├── mod.rs │ └── verify.rs │ ├── tests │ ├── checkers.rs │ ├── hashlock_checker.rs │ ├── mod.rs │ ├── script.rs │ ├── translate │ │ ├── mocks.rs │ │ ├── mod.rs │ │ ├── snap.translate.reward.acctspend_00.txt │ │ ├── snap.translate.reward.acctspend_01.txt │ │ ├── snap.translate.reward.acctspend_02.txt │ │ ├── snap.translate.reward.burn_00.txt │ │ ├── snap.translate.reward.burn_01.txt │ │ ├── snap.translate.reward.concludeorder_00.txt │ │ ├── snap.translate.reward.concludeorder_01.txt │ │ ├── snap.translate.reward.concludeorder_02.txt │ │ ├── snap.translate.reward.concludeorder_03.txt │ │ ├── snap.translate.reward.createorder_00.txt │ │ ├── snap.translate.reward.createorder_01.txt │ │ ├── snap.translate.reward.delegate_00.txt │ │ ├── snap.translate.reward.delegate_01.txt │ │ ├── snap.translate.reward.fillorder_00.txt │ │ ├── snap.translate.reward.fillorder_01.txt │ │ ├── snap.translate.reward.fillorder_02.txt │ │ ├── snap.translate.reward.htlc_00.txt │ │ ├── snap.translate.reward.htlc_01.txt │ │ ├── snap.translate.reward.htlc_02.txt │ │ ├── snap.translate.reward.htlc_03.txt │ │ ├── snap.translate.reward.htlc_04.txt │ │ ├── snap.translate.reward.mint_00.txt │ │ ├── snap.translate.reward.mint_01.txt │ │ ├── snap.translate.reward.mint_02.txt │ │ ├── snap.translate.reward.newpool_00.txt │ │ ├── snap.translate.reward.prodblock_00.txt │ │ ├── snap.translate.reward.prodblock_01.txt │ │ ├── snap.translate.reward.prodblock_02.txt │ │ ├── snap.translate.reward.prodblock_03.txt │ │ ├── snap.translate.reward.prodblock_04.txt │ │ ├── snap.translate.reward.transfer_00.txt │ │ ├── snap.translate.reward.transfer_01.txt │ │ ├── snap.translate.reward.transfer_02.txt │ │ ├── snap.translate.reward.transfer_03.txt │ │ ├── snap.translate.reward.transfertl_00.txt │ │ ├── snap.translate.reward.transfertl_01.txt │ │ ├── snap.translate.reward.transfertl_02.txt │ │ ├── snap.translate.reward.transfertl_03.txt │ │ ├── snap.translate.reward.transfertl_04.txt │ │ ├── snap.translate.sigonly.acctspend_00.txt │ │ ├── snap.translate.sigonly.acctspend_01.txt │ │ ├── snap.translate.sigonly.acctspend_02.txt │ │ ├── snap.translate.sigonly.burn_00.txt │ │ ├── snap.translate.sigonly.burn_01.txt │ │ ├── snap.translate.sigonly.concludeorder_00.txt │ │ ├── snap.translate.sigonly.concludeorder_01.txt │ │ ├── snap.translate.sigonly.concludeorder_02.txt │ │ ├── snap.translate.sigonly.concludeorder_03.txt │ │ ├── snap.translate.sigonly.createorder_00.txt │ │ ├── snap.translate.sigonly.createorder_01.txt │ │ ├── snap.translate.sigonly.delegate_00.txt │ │ ├── snap.translate.sigonly.delegate_01.txt │ │ ├── snap.translate.sigonly.fillorder_00.txt │ │ ├── snap.translate.sigonly.fillorder_01.txt │ │ ├── snap.translate.sigonly.fillorder_02.txt │ │ ├── snap.translate.sigonly.htlc_00.txt │ │ ├── snap.translate.sigonly.htlc_01.txt │ │ ├── snap.translate.sigonly.htlc_02.txt │ │ ├── snap.translate.sigonly.htlc_03.txt │ │ ├── snap.translate.sigonly.htlc_04.txt │ │ ├── snap.translate.sigonly.mint_00.txt │ │ ├── snap.translate.sigonly.mint_01.txt │ │ ├── snap.translate.sigonly.mint_02.txt │ │ ├── snap.translate.sigonly.newpool_00.txt │ │ ├── snap.translate.sigonly.prodblock_00.txt │ │ ├── snap.translate.sigonly.prodblock_01.txt │ │ ├── snap.translate.sigonly.prodblock_02.txt │ │ ├── snap.translate.sigonly.prodblock_03.txt │ │ ├── snap.translate.sigonly.prodblock_04.txt │ │ ├── snap.translate.sigonly.transfer_00.txt │ │ ├── snap.translate.sigonly.transfer_01.txt │ │ ├── snap.translate.sigonly.transfer_02.txt │ │ ├── snap.translate.sigonly.transfer_03.txt │ │ ├── snap.translate.sigonly.transfertl_00.txt │ │ ├── snap.translate.sigonly.transfertl_01.txt │ │ ├── snap.translate.sigonly.transfertl_02.txt │ │ ├── snap.translate.sigonly.transfertl_03.txt │ │ ├── snap.translate.sigonly.transfertl_04.txt │ │ ├── snap.translate.tlockonly.acctspend_00.txt │ │ ├── snap.translate.tlockonly.acctspend_01.txt │ │ ├── snap.translate.tlockonly.acctspend_02.txt │ │ ├── snap.translate.tlockonly.burn_00.txt │ │ ├── snap.translate.tlockonly.burn_01.txt │ │ ├── snap.translate.tlockonly.concludeorder_00.txt │ │ ├── snap.translate.tlockonly.concludeorder_01.txt │ │ ├── snap.translate.tlockonly.concludeorder_02.txt │ │ ├── snap.translate.tlockonly.concludeorder_03.txt │ │ ├── snap.translate.tlockonly.createorder_00.txt │ │ ├── snap.translate.tlockonly.createorder_01.txt │ │ ├── snap.translate.tlockonly.delegate_00.txt │ │ ├── snap.translate.tlockonly.delegate_01.txt │ │ ├── snap.translate.tlockonly.fillorder_00.txt │ │ ├── snap.translate.tlockonly.fillorder_01.txt │ │ ├── snap.translate.tlockonly.fillorder_02.txt │ │ ├── snap.translate.tlockonly.htlc_00.txt │ │ ├── snap.translate.tlockonly.htlc_01.txt │ │ ├── snap.translate.tlockonly.htlc_02.txt │ │ ├── snap.translate.tlockonly.htlc_03.txt │ │ ├── snap.translate.tlockonly.htlc_04.txt │ │ ├── snap.translate.tlockonly.mint_00.txt │ │ ├── snap.translate.tlockonly.mint_01.txt │ │ ├── snap.translate.tlockonly.mint_02.txt │ │ ├── snap.translate.tlockonly.newpool_00.txt │ │ ├── snap.translate.tlockonly.prodblock_00.txt │ │ ├── snap.translate.tlockonly.prodblock_01.txt │ │ ├── snap.translate.tlockonly.prodblock_02.txt │ │ ├── snap.translate.tlockonly.prodblock_03.txt │ │ ├── snap.translate.tlockonly.prodblock_04.txt │ │ ├── snap.translate.tlockonly.transfer_00.txt │ │ ├── snap.translate.tlockonly.transfer_01.txt │ │ ├── snap.translate.tlockonly.transfer_02.txt │ │ ├── snap.translate.tlockonly.transfer_03.txt │ │ ├── snap.translate.tlockonly.transfertl_00.txt │ │ ├── snap.translate.tlockonly.transfertl_01.txt │ │ ├── snap.translate.tlockonly.transfertl_02.txt │ │ ├── snap.translate.tlockonly.transfertl_03.txt │ │ ├── snap.translate.tlockonly.transfertl_04.txt │ │ ├── snap.translate.txn.acctspend_00.txt │ │ ├── snap.translate.txn.acctspend_01.txt │ │ ├── snap.translate.txn.acctspend_02.txt │ │ ├── snap.translate.txn.burn_00.txt │ │ ├── snap.translate.txn.burn_01.txt │ │ ├── snap.translate.txn.concludeorder_00.txt │ │ ├── snap.translate.txn.concludeorder_01.txt │ │ ├── snap.translate.txn.concludeorder_02.txt │ │ ├── snap.translate.txn.concludeorder_03.txt │ │ ├── snap.translate.txn.createorder_00.txt │ │ ├── snap.translate.txn.createorder_01.txt │ │ ├── snap.translate.txn.delegate_00.txt │ │ ├── snap.translate.txn.delegate_01.txt │ │ ├── snap.translate.txn.fillorder_00.txt │ │ ├── snap.translate.txn.fillorder_01.txt │ │ ├── snap.translate.txn.fillorder_02.txt │ │ ├── snap.translate.txn.htlc_00.txt │ │ ├── snap.translate.txn.htlc_01.txt │ │ ├── snap.translate.txn.htlc_02.txt │ │ ├── snap.translate.txn.htlc_03.txt │ │ ├── snap.translate.txn.htlc_04.txt │ │ ├── snap.translate.txn.mint_00.txt │ │ ├── snap.translate.txn.mint_01.txt │ │ ├── snap.translate.txn.mint_02.txt │ │ ├── snap.translate.txn.newpool_00.txt │ │ ├── snap.translate.txn.prodblock_00.txt │ │ ├── snap.translate.txn.prodblock_01.txt │ │ ├── snap.translate.txn.prodblock_02.txt │ │ ├── snap.translate.txn.prodblock_03.txt │ │ ├── snap.translate.txn.prodblock_04.txt │ │ ├── snap.translate.txn.transfer_00.txt │ │ ├── snap.translate.txn.transfer_01.txt │ │ ├── snap.translate.txn.transfer_02.txt │ │ ├── snap.translate.txn.transfer_03.txt │ │ ├── snap.translate.txn.transfertl_00.txt │ │ ├── snap.translate.txn.transfertl_01.txt │ │ ├── snap.translate.txn.transfertl_02.txt │ │ ├── snap.translate.txn.transfertl_03.txt │ │ └── snap.translate.txn.transfertl_04.txt │ └── utils.rs │ └── translate.rs ├── mocks ├── Cargo.toml └── src │ ├── chainstate.rs │ ├── lib.rs │ └── mempool.rs ├── networking ├── Cargo.toml └── src │ ├── error.rs │ ├── lib.rs │ ├── test_helpers.rs │ ├── transport │ ├── buffered_transcoder.rs │ ├── impls │ │ ├── channel.rs │ │ ├── mod.rs │ │ ├── socks5.rs │ │ ├── stream_adapter │ │ │ ├── identity.rs │ │ │ ├── mod.rs │ │ │ ├── noise.rs │ │ │ ├── traits.rs │ │ │ └── wrapped_transport │ │ │ │ ├── mod.rs │ │ │ │ ├── tests.rs │ │ │ │ ├── wrapped_listener.rs │ │ │ │ └── wrapped_socket.rs │ │ └── tcp.rs │ ├── message_codec.rs │ ├── mod.rs │ └── traits │ │ ├── listener.rs │ │ ├── mod.rs │ │ ├── socket.rs │ │ └── stream.rs │ └── types │ └── mod.rs ├── node-daemon ├── Cargo.toml ├── docs │ ├── README.md │ ├── RPC.md │ └── RPC_DEV.md ├── src │ └── main.rs └── tests │ ├── rpc_docs.rs │ └── tui.rs ├── node-gui ├── Cargo.toml ├── app.manifest ├── backend │ ├── Cargo.toml │ └── src │ │ ├── account_id.rs │ │ ├── backend_impl.rs │ │ ├── chainstate_event_handler.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── messages.rs │ │ ├── p2p_event_handler.rs │ │ └── wallet_events │ │ └── mod.rs ├── build.rs ├── icon.rc └── src │ ├── main.rs │ ├── main_window │ ├── main_menu.rs │ ├── main_widget │ │ ├── mod.rs │ │ └── tabs │ │ │ ├── cold_wallet.rs │ │ │ ├── mod.rs │ │ │ ├── networking.rs │ │ │ ├── settings.rs │ │ │ ├── summary.rs │ │ │ └── wallet │ │ │ ├── addresses.rs │ │ │ ├── console.rs │ │ │ ├── delegation.rs │ │ │ ├── left_panel.rs │ │ │ ├── mod.rs │ │ │ ├── send.rs │ │ │ ├── stake.rs │ │ │ ├── top_panel.rs │ │ │ └── transactions.rs │ └── mod.rs │ └── widgets │ ├── confirm_broadcast.rs │ ├── create_hw_wallet.rs │ ├── esc_handler.rs │ ├── mod.rs │ ├── new_wallet_account.rs │ ├── opaque.rs │ ├── popup_dialog.rs │ ├── wallet_mnemonic.rs │ ├── wallet_set_password.rs │ └── wallet_unlock.rs ├── node-lib ├── Cargo.toml ├── src │ ├── config_files │ │ ├── blockprod.rs │ │ ├── chainstate │ │ │ └── mod.rs │ │ ├── chainstate_launcher.rs │ │ ├── mempool.rs │ │ ├── mod.rs │ │ ├── p2p.rs │ │ └── rpc.rs │ ├── lib.rs │ ├── mock_time.rs │ ├── node_controller.rs │ ├── options.rs │ ├── rpc.rs │ └── runner.rs └── tests │ └── cli.rs ├── orders-accounting ├── Cargo.toml └── src │ ├── cache.rs │ ├── data.rs │ ├── error.rs │ ├── lib.rs │ ├── operations.rs │ ├── price_calculation.rs │ ├── storage │ ├── db.rs │ ├── in_memory.rs │ └── mod.rs │ ├── tests │ ├── mod.rs │ └── operations.rs │ └── view.rs ├── p2p ├── Cargo.toml ├── README.md ├── backend-test-suite │ ├── Cargo.toml │ └── src │ │ ├── ban.rs │ │ ├── block_announcement.rs │ │ ├── connect.rs │ │ ├── events.rs │ │ ├── lib.rs │ │ └── utils.rs ├── benches │ └── benches.rs ├── src │ ├── ban_config.rs │ ├── config.rs │ ├── disconnection_reason.rs │ ├── error.rs │ ├── interface │ │ ├── mod.rs │ │ ├── p2p_interface.rs │ │ ├── p2p_interface_impl.rs │ │ ├── p2p_interface_impl_delegation.rs │ │ └── types.rs │ ├── lib.rs │ ├── message.rs │ ├── net │ │ ├── default_backend │ │ │ ├── backend.rs │ │ │ ├── default_networking_service.rs │ │ │ ├── mod.rs │ │ │ ├── peer.rs │ │ │ ├── tests.rs │ │ │ └── types.rs │ │ ├── mod.rs │ │ └── types.rs │ ├── peer_manager │ │ ├── addr_list_response_cache.rs │ │ ├── address_groups.rs │ │ ├── config.rs │ │ ├── dns_seed.rs │ │ ├── mod.rs │ │ ├── peer_context.rs │ │ ├── peerdb │ │ │ ├── address_data │ │ │ │ ├── mod.rs │ │ │ │ └── tests.rs │ │ │ ├── address_tables │ │ │ │ ├── mod.rs │ │ │ │ └── table.rs │ │ │ ├── config.rs │ │ │ ├── mod.rs │ │ │ ├── salt.rs │ │ │ ├── storage.rs │ │ │ ├── storage_impl.rs │ │ │ ├── storage_load.rs │ │ │ └── tests.rs │ │ ├── peerdb_common │ │ │ ├── mod.rs │ │ │ ├── storage.rs │ │ │ └── storage_impl.rs │ │ ├── peers_eviction │ │ │ ├── mod.rs │ │ │ └── tests.rs │ │ └── tests │ │ │ ├── addr_list_response_caching.rs │ │ │ ├── addresses.rs │ │ │ ├── ban.rs │ │ │ ├── connections.rs │ │ │ ├── discouragement.rs │ │ │ ├── eviction.rs │ │ │ ├── mod.rs │ │ │ ├── peer_types.rs │ │ │ ├── ping.rs │ │ │ ├── utils.rs │ │ │ └── whitelist.rs │ ├── peer_manager_event.rs │ ├── protocol.rs │ ├── rpc.rs │ ├── sync │ │ ├── chainstate_handle.rs │ │ ├── mod.rs │ │ ├── peer │ │ │ ├── block_manager.rs │ │ │ ├── mod.rs │ │ │ ├── pending_transactions.rs │ │ │ ├── requested_transactions.rs │ │ │ └── transaction_manager.rs │ │ ├── peer_activity.rs │ │ ├── peer_common │ │ │ ├── known_transactions.rs │ │ │ └── mod.rs │ │ ├── sync_status.rs │ │ └── tests │ │ │ ├── ban_scores.rs │ │ │ ├── block_announcement.rs │ │ │ ├── block_list_request.rs │ │ │ ├── block_response.rs │ │ │ ├── header_list_request.rs │ │ │ ├── header_list_response.rs │ │ │ ├── helpers │ │ │ ├── mod.rs │ │ │ └── test_node_group.rs │ │ │ ├── mod.rs │ │ │ ├── network_sync.rs │ │ │ ├── no_discouragement_after_tx_reorg.rs │ │ │ ├── peer_events.rs │ │ │ └── tx_announcement.rs │ ├── test_helpers.rs │ ├── tests │ │ ├── bad_time_diff.rs │ │ ├── correct_handshake.rs │ │ ├── disable_networking.rs │ │ ├── disconnect_on_will_disconnect_msg.rs │ │ ├── helpers │ │ │ ├── mod.rs │ │ │ ├── test_node.rs │ │ │ └── test_node_group.rs │ │ ├── incorrect_handshake.rs │ │ ├── misbehavior.rs │ │ ├── mod.rs │ │ ├── peer_discovery_on_stale_tip.rs │ │ ├── same_handshake_nonce.rs │ │ └── unsupported_version.rs │ └── utils │ │ ├── mod.rs │ │ ├── oneshot_nofail.rs │ │ └── rate_limiter │ │ ├── mod.rs │ │ └── tests.rs ├── test-utils │ ├── Cargo.toml │ └── src │ │ ├── lib.rs │ │ └── panic_handling.rs ├── tests │ ├── backend_channels.rs │ ├── backend_noise.rs │ ├── backend_tcp.rs │ └── shutdown.rs └── types │ ├── Cargo.toml │ └── src │ ├── bannable_address.rs │ ├── global_ip.rs │ ├── ip_address.rs │ ├── lib.rs │ ├── p2p_event.rs │ ├── peer_address.rs │ ├── peer_id.rs │ ├── services.rs │ ├── socket_addr_ext.rs │ └── socket_address.rs ├── pos-accounting ├── Cargo.toml └── src │ ├── data.rs │ ├── error.rs │ ├── lib.rs │ ├── pool │ ├── delegation.rs │ ├── delta │ │ ├── data.rs │ │ ├── mod.rs │ │ ├── operator_impls.rs │ │ └── view_impl.rs │ ├── helpers.rs │ ├── mod.rs │ ├── operations.rs │ ├── pool_data.rs │ ├── storage │ │ ├── helpers.rs │ │ ├── mod.rs │ │ └── view_impls.rs │ ├── tests │ │ ├── delta_tests.rs │ │ ├── mod.rs │ │ ├── operations_tests.rs │ │ ├── simulation_tests.rs │ │ └── undo_tests.rs │ └── view.rs │ └── storage │ ├── in_memory.rs │ └── mod.rs ├── randomness ├── Cargo.toml └── src │ └── lib.rs ├── rpc ├── Cargo.toml ├── README.md ├── description-macro │ ├── Cargo.toml │ └── src │ │ ├── describe_impl.rs │ │ ├── lib.rs │ │ └── value_hint.rs ├── description │ ├── Cargo.toml │ └── src │ │ ├── display.rs │ │ ├── lib.rs │ │ └── value_hint.rs ├── examples │ ├── simple_server.rs │ └── subscription.rs ├── src │ ├── error.rs │ ├── lib.rs │ ├── rpc_auth │ │ └── mod.rs │ ├── rpc_creds.rs │ └── subscription.rs ├── tests │ └── basic │ │ ├── HINT_ADJACENTLY_TAGGED.txt │ │ ├── HINT_RENDER.md │ │ ├── HINT_TAGGED.txt │ │ ├── HINT_UNTAGGED.txt │ │ ├── SUBSYS_RPC.md │ │ ├── desc.rs │ │ └── main.rs └── types │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── string.rs │ └── tests.rs ├── run_kani.sh ├── rustfmt.toml ├── script ├── Cargo.toml └── src │ ├── context.rs │ ├── error.rs │ ├── interpreter.rs │ ├── lib.rs │ ├── opcodes.rs │ ├── script.rs │ ├── test │ ├── mod.rs │ └── test_vectors_4opc.csv.gz │ └── util.rs ├── serialization ├── Cargo.toml ├── core │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── tests │ │ ├── compact_encoding.rs │ │ ├── compatibility.rs │ │ ├── complex_types.rs │ │ ├── containers.rs │ │ ├── simple_derive.rs │ │ ├── simple_types.rs │ │ └── utils │ │ └── mod.rs ├── src │ ├── encoded.rs │ ├── extras │ │ ├── mod.rs │ │ └── non_empty_vec.rs │ ├── hex.rs │ ├── hex_encoded.rs │ ├── json_encoded.rs │ └── lib.rs └── tagged │ ├── Cargo.toml │ ├── derive │ ├── Cargo.toml │ └── src │ │ ├── direct.rs │ │ ├── lib.rs │ │ └── tagged.rs │ ├── src │ ├── derive_support.rs │ └── lib.rs │ └── tests │ └── derive.rs ├── src └── lib.rs ├── storage ├── Cargo.toml ├── backend-test-suite │ ├── Cargo.toml │ └── src │ │ ├── basic.rs │ │ ├── concurrent.rs │ │ ├── frontend.rs │ │ ├── lib.rs │ │ ├── model.rs │ │ ├── prelude.rs │ │ └── property.rs ├── core │ ├── Cargo.toml │ └── src │ │ ├── adaptor │ │ ├── locking.rs │ │ └── mod.rs │ │ ├── backend.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── types.rs │ │ └── util.rs ├── failing │ ├── Cargo.toml │ └── src │ │ ├── backend.rs │ │ ├── config │ │ ├── builder.rs │ │ └── mod.rs │ │ └── lib.rs ├── inmemory │ ├── Cargo.toml │ ├── src │ │ └── lib.rs │ └── tests │ │ └── backend.rs ├── lmdb │ ├── Cargo.toml │ ├── src │ │ ├── error.rs │ │ ├── initial_map_size.rs │ │ ├── lib.rs │ │ ├── memsize.rs │ │ ├── resize_callback.rs │ │ └── resize_tests.rs │ └── tests │ │ └── backend.rs ├── sqlite │ ├── Cargo.toml │ ├── src │ │ ├── error.rs │ │ ├── lib.rs │ │ └── queries.rs │ └── tests │ │ └── backend.rs └── src │ ├── database │ ├── internal.rs │ ├── mod.rs │ └── raw.rs │ ├── lib.rs │ ├── order_preserving_value.rs │ ├── schema.rs │ └── test.rs ├── subsystem ├── Cargo.toml ├── examples │ └── stopwatch.rs ├── src │ ├── calls │ │ ├── blocking.rs │ │ ├── handle.rs │ │ └── mod.rs │ ├── error.rs │ ├── lib.rs │ ├── manager │ │ ├── manager_impl.rs │ │ ├── mod.rs │ │ └── shutdown_signal.rs │ ├── subsystem.rs │ ├── task.rs │ └── wrappers.rs └── tests │ ├── async_calls.rs │ ├── basic.rs │ ├── blocking.rs │ ├── helpers │ └── mod.rs │ ├── passive.rs │ ├── sample_subsystems │ └── mod.rs │ ├── shutdown_timeout.rs │ └── trivial.rs ├── test-rpc-functions ├── Cargo.toml └── src │ ├── empty.rs │ ├── interface │ ├── mod.rs │ ├── rpc_test_interface.rs │ └── rpc_test_interface_impl.rs │ ├── lib.rs │ └── rpc.rs ├── test-utils ├── Cargo.toml ├── src │ ├── basic_test_time_getter.rs │ ├── lib.rs │ ├── mock_time_getter.rs │ ├── nft_utils.rs │ ├── random.rs │ ├── test_dir.rs │ └── threading.rs └── tests │ └── dir.rs ├── test ├── Cargo.toml ├── README.md ├── functional │ ├── .gitignore │ ├── README.md │ ├── base58 │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── py.typed │ ├── blockprod_generate_blocks_all_sources.py │ ├── blockprod_generate_pos_blocks.py │ ├── blockprod_generate_pos_blocks_rand_genesis_keys.py │ ├── blockprod_generate_pos_genesis_blocks.py │ ├── blockprod_generate_pow_blocks.py │ ├── blockprod_ibd.py │ ├── blockprod_ibd_genesis.py │ ├── blockprod_pos_pledge_incentives.py │ ├── combine_logs.py │ ├── combined_log_template.html │ ├── create_cache.py │ ├── example_test.py │ ├── feature_db_reinit.py │ ├── feature_lmdb_backend_test.py │ ├── mempool_basic_reorg.py │ ├── mempool_eviction.py │ ├── mempool_feerate_points.py │ ├── mempool_ibd.py │ ├── mempool_local_orphan_rejected.py │ ├── mempool_orphan_peer_disconnected.py │ ├── mempool_submit_tx.py │ ├── mempool_timelocked_tx.py │ ├── p2p_ping.py │ ├── p2p_relay_transactions.py │ ├── p2p_submit_orphan.py │ ├── p2p_syncing_test.py │ ├── scalecodec │ │ ├── __init__.py │ │ ├── base.py │ │ ├── constants.py │ │ ├── exceptions.py │ │ ├── types.py │ │ ├── updater.py │ │ └── utils │ │ │ ├── __init__.py │ │ │ ├── math.py │ │ │ └── ss58.py │ ├── test-shell.md │ ├── test_framework │ │ ├── .mintlayer │ │ │ └── config.toml │ │ ├── __init__.py │ │ ├── address.py │ │ ├── authproxy.py │ │ ├── bdb.py │ │ ├── bip340_test_vectors.csv │ │ ├── blocktools.py │ │ ├── coverage.py │ │ ├── descriptors.py │ │ ├── key.py │ │ ├── messages.py │ │ ├── mintlayer.py │ │ ├── muhash.py │ │ ├── netutil.py │ │ ├── p2p.py │ │ ├── ripemd160.py │ │ ├── script.py │ │ ├── script_util.py │ │ ├── segwit_addr.py │ │ ├── siphash.py │ │ ├── socks5.py │ │ ├── test_framework.py │ │ ├── test_node.py │ │ ├── test_shell.py │ │ ├── util.py │ │ ├── wallet.py │ │ ├── wallet_cli_controller.py │ │ ├── wallet_controller_common.py │ │ ├── wallet_rpc_controller.py │ │ └── wallet_util.py │ ├── test_runner.py │ ├── wallet_account_info.py │ ├── wallet_account_info_rpc.py │ ├── wallet_cold_wallet_send.py │ ├── wallet_cold_wallet_send_rpc.py │ ├── wallet_conflict.py │ ├── wallet_connect_to_rpc.py │ ├── wallet_create_pool_for_another_wallet.py │ ├── wallet_create_pool_for_another_wallet_rpc.py │ ├── wallet_data_deposit.py │ ├── wallet_decommission_genesis.py │ ├── wallet_decommission_request.py │ ├── wallet_delegations.py │ ├── wallet_delegations_rpc.py │ ├── wallet_generate_addresses.py │ ├── wallet_get_address_usage.py │ ├── wallet_high_fee.py │ ├── wallet_htlc_refund.py │ ├── wallet_htlc_spend.py │ ├── wallet_list_txs.py │ ├── wallet_multisig_address.py │ ├── wallet_nfts.py │ ├── wallet_orders.py │ ├── wallet_pos_test_base.py │ ├── wallet_recover_accounts.py │ ├── wallet_select_utxos.py │ ├── wallet_set_lookahead_size.py │ ├── wallet_sign_message.py │ ├── wallet_sign_message_rpc.py │ ├── wallet_submit_tx.py │ ├── wallet_sweep_address.py │ ├── wallet_sweep_delegation.py │ ├── wallet_tokens.py │ ├── wallet_tokens_change_authority.py │ ├── wallet_tokens_change_metadata_uri.py │ ├── wallet_tokens_change_metadata_uri_rpc.py │ ├── wallet_tokens_change_supply.py │ ├── wallet_tokens_freeze.py │ ├── wallet_tokens_transfer_from_multisig_addr.py │ ├── wallet_tokens_transfer_from_multisig_addr_rpc.py │ ├── wallet_tx_compose.py │ ├── wallet_tx_intent.py │ └── wallet_watch_address.py ├── runner │ └── functional.rs └── src │ └── bin │ ├── test_node.rs │ ├── test_rpc_wallet.rs │ ├── test_wallet.rs │ └── test_wallet_address_generator.rs ├── tokens-accounting ├── Cargo.toml └── src │ ├── cache.rs │ ├── data.rs │ ├── error.rs │ ├── lib.rs │ ├── operations.rs │ ├── storage │ ├── db.rs │ ├── in_memory.rs │ └── mod.rs │ ├── tests │ ├── mod.rs │ └── operations_tests.rs │ └── view.rs ├── trezor-common ├── Cargo.toml └── src │ ├── lib.rs │ └── tests │ └── mod.rs ├── utils ├── Cargo.toml ├── benches │ └── benches.rs ├── build.rs ├── log_error │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── networking │ ├── Cargo.toml │ └── src │ │ ├── broadcaster.rs │ │ ├── ip_or_socket_address.rs │ │ ├── lib.rs │ │ ├── network_address.rs │ │ ├── network_address_tests.rs │ │ └── resolvable_name.rs ├── src │ ├── array_2d.rs │ ├── atomics │ │ ├── atomic_traits.rs │ │ ├── mod.rs │ │ └── simple_atomic.rs │ ├── blockuntilzero.rs │ ├── bloom_filters │ │ ├── bloom_filter.rs │ │ ├── mod.rs │ │ ├── rolling_bloom_filter │ │ │ ├── cyclic_array.rs │ │ │ └── mod.rs │ │ └── tests.rs │ ├── clap_utils.rs │ ├── concurrency_impl │ │ ├── loom.rs │ │ ├── mod.rs │ │ └── regular.rs │ ├── config_setting.rs │ ├── const_nonzero.rs │ ├── const_value.rs │ ├── cookie.rs │ ├── counttracker.rs │ ├── debug_panic.rs │ ├── default_data_dir.rs │ ├── displayable_option.rs │ ├── ensure.rs │ ├── env_utils.rs │ ├── eventhandler.rs │ ├── exp_rand │ │ ├── mod.rs │ │ └── test.rs │ ├── graph_traversals.rs │ ├── lib.rs │ ├── log_utils.rs │ ├── maybe_encrypted.rs │ ├── newtype.rs │ ├── once_destructor.rs │ ├── qrcode.rs │ ├── root_user.rs │ ├── rust_backtrace.rs │ ├── set_flag.rs │ ├── shallow_clone.rs │ ├── sorted.rs │ ├── tap_log.rs │ ├── try_as.rs │ └── workspace_path.rs ├── tests │ ├── log_error.rs │ └── simple_atomic.rs ├── typename-derive │ ├── Cargo.toml │ └── src │ │ └── lib.rs └── typename │ ├── Cargo.toml │ └── src │ └── lib.rs ├── utxo ├── Cargo.toml └── src │ ├── cache.rs │ ├── error.rs │ ├── lib.rs │ ├── storage │ ├── in_memory.rs │ ├── mod.rs │ ├── rw_impls.rs │ ├── test.rs │ └── view_impls.rs │ ├── tests │ ├── mod.rs │ ├── simulation.rs │ ├── simulation_with_undo.rs │ └── test_helper.rs │ ├── undo.rs │ ├── utxo.rs │ ├── utxo_entry.rs │ └── view.rs ├── wallet ├── Cargo.toml ├── README.md ├── build.rs ├── src │ ├── account │ │ ├── currency_grouper │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── output_cache │ │ │ ├── mod.rs │ │ │ └── tests.rs │ │ ├── tests.rs │ │ ├── transaction_list │ │ │ └── mod.rs │ │ └── utxo_selector │ │ │ ├── mod.rs │ │ │ ├── output_group.rs │ │ │ └── tests.rs │ ├── destination_getters.rs │ ├── key_chain │ │ ├── account_key_chain │ │ │ ├── mod.rs │ │ │ └── tests.rs │ │ ├── leaf_key_chain │ │ │ └── mod.rs │ │ ├── master_key_chain │ │ │ └── mod.rs │ │ ├── mod.rs │ │ ├── tests.rs │ │ ├── vrf_key_chain │ │ │ └── mod.rs │ │ └── with_purpose.rs │ ├── lib.rs │ ├── send_request │ │ └── mod.rs │ ├── signer │ │ ├── mod.rs │ │ ├── software_signer │ │ │ ├── mod.rs │ │ │ └── tests.rs │ │ ├── tests │ │ │ ├── fixed_signature_tests.rs │ │ │ ├── generic_tests.rs │ │ │ └── mod.rs │ │ └── trezor_signer │ │ │ ├── mod.rs │ │ │ ├── test_utils │ │ │ ├── auto_confirmer.rs │ │ │ └── mod.rs │ │ │ └── tests.rs │ ├── version.rs │ ├── wallet │ │ ├── mod.rs │ │ └── tests.rs │ └── wallet_events.rs ├── storage │ ├── Cargo.toml │ └── src │ │ ├── internal │ │ ├── mod.rs │ │ ├── password.rs │ │ ├── store_tx.rs │ │ └── test.rs │ │ ├── is_transaction_seal.rs │ │ ├── lib.rs │ │ └── schema.rs ├── types │ ├── Cargo.toml │ └── src │ │ ├── account_id.rs │ │ ├── account_info.rs │ │ ├── chain_info.rs │ │ ├── currency.rs │ │ ├── hw_data.rs │ │ ├── keys.rs │ │ ├── lib.rs │ │ ├── partially_signed_transaction.rs │ │ ├── scan_blockchain.rs │ │ ├── seed_phrase.rs │ │ ├── signature_status.rs │ │ ├── utxo_types.rs │ │ ├── wallet_tx.rs │ │ ├── wallet_type.rs │ │ └── with_locked.rs ├── wallet-address-generator-lib │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── wallet-address-generator │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── wallet-cli-commands │ ├── Cargo.toml │ └── src │ │ ├── command_handler │ │ ├── local_state.rs │ │ └── mod.rs │ │ ├── errors.rs │ │ ├── helper_types.rs │ │ └── lib.rs ├── wallet-cli-lib │ ├── Cargo.toml │ ├── src │ │ ├── cli_event_loop.rs │ │ ├── config.rs │ │ ├── console.rs │ │ ├── errors.rs │ │ ├── lib.rs │ │ └── repl │ │ │ ├── interactive │ │ │ ├── key_bindings.rs │ │ │ ├── log.rs │ │ │ ├── mod.rs │ │ │ ├── wallet_completions.rs │ │ │ └── wallet_prompt.rs │ │ │ ├── mod.rs │ │ │ └── non_interactive │ │ │ ├── log.rs │ │ │ └── mod.rs │ └── tests │ │ ├── basic.rs │ │ ├── cli_test_framework.rs │ │ └── staking.rs ├── wallet-cli │ ├── Cargo.toml │ └── src │ │ └── main.rs ├── wallet-controller │ ├── Cargo.toml │ └── src │ │ ├── helpers.rs │ │ ├── lib.rs │ │ ├── mnemonic.rs │ │ ├── read.rs │ │ ├── runtime_wallet.rs │ │ ├── sync │ │ ├── mod.rs │ │ └── tests │ │ │ └── mod.rs │ │ ├── synced_controller.rs │ │ └── types │ │ ├── balances.rs │ │ ├── block_info.rs │ │ ├── mod.rs │ │ ├── seed_phrase.rs │ │ ├── standalone_key.rs │ │ └── transaction.rs ├── wallet-node-client │ ├── Cargo.toml │ ├── src │ │ ├── handles_client │ │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── node_traits.rs │ │ └── rpc_client │ │ │ ├── client_impl.rs │ │ │ ├── cold_wallet_client.rs │ │ │ └── mod.rs │ └── tests │ │ └── call_tests.rs ├── wallet-rpc-client │ ├── Cargo.toml │ └── src │ │ ├── handles_client │ │ └── mod.rs │ │ ├── lib.rs │ │ ├── rpc_client │ │ ├── client_impl.rs │ │ └── mod.rs │ │ └── wallet_rpc_traits.rs ├── wallet-rpc-daemon │ ├── Cargo.toml │ ├── README.md │ ├── docs │ │ └── RPC.md │ ├── src │ │ └── main.rs │ └── tests │ │ └── rpc_docs.rs ├── wallet-rpc-lib │ ├── Cargo.toml │ ├── src │ │ ├── cmdline.rs │ │ ├── config.rs │ │ ├── lib.rs │ │ ├── rpc │ │ │ ├── interface.rs │ │ │ ├── mod.rs │ │ │ ├── server_impl.rs │ │ │ └── types.rs │ │ └── service │ │ │ ├── events.rs │ │ │ ├── handle.rs │ │ │ ├── mod.rs │ │ │ └── worker.rs │ └── tests │ │ ├── basic.rs │ │ └── utils.rs └── wallet-test-node │ ├── Cargo.toml │ └── src │ └── lib.rs └── wasm-wrappers ├── Cargo.toml ├── README.md ├── WASM-API.md ├── js-bindings-test ├── index.html ├── knip.json ├── node-entry.js ├── package.json ├── tests │ ├── defs.ts │ ├── main.ts │ ├── test_address_generation.ts │ ├── test_encode_other_inputs.ts │ ├── test_encode_other_outputs.ts │ ├── test_htlc.ts │ ├── test_misc.ts │ ├── test_orders.ts │ ├── test_signed_transaction_intent.ts │ ├── test_transaction_and_witness_encoding.ts │ └── utils.ts ├── tsconfig.json └── web-entry.js ├── src ├── encode_input.rs ├── encode_output.rs ├── error.rs ├── lib.rs ├── tests.rs ├── types.rs └── utils.rs └── wasm-doc-gen ├── Cargo.toml └── src ├── main.rs └── run_options.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | # cargo build --all --target=aarch64-unknown-linux-gnu 2 | [target.aarch64-unknown-linux-gnu] 3 | linker = "aarch64-linux-gnu-gcc" 4 | [target.x86_64-pc-windows-msvc] 5 | rustflags = ["-C", "target-feature=+crt-static"] 6 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @erubboli @azarovh @ImplOfAnImpl @OBorce 2 | -------------------------------------------------------------------------------- /.github/actions-rs/grcov.yml: -------------------------------------------------------------------------------- 1 | output-type: html 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | **/target/ 4 | # These are backup files generated by rustfmt 5 | **/*.rs.bk 6 | 7 | .DS_Store 8 | 9 | # Intellij IDEA 10 | .idea/ 11 | *.iml 12 | /customSpec.json 13 | 14 | # VSCode 15 | .vscode/ 16 | 17 | #exclude python env 18 | env/ 19 | 20 | #exclude env 21 | .env 22 | 23 | # Test Python cache 24 | test/**/__pycache__ 25 | 26 | # Files generated for the testing system 27 | test/config.ini 28 | 29 | # The cache for docker container dependency 30 | .cargo/* 31 | 32 | # But do not ignore the cargo.toml file 33 | !.cargo/config.toml 34 | 35 | # The cache for chain data in container 36 | .local 37 | 38 | # direnv cache 39 | .direnv 40 | 41 | # Python compiled files 42 | *.pyc 43 | 44 | # wasm 45 | wasm-wrappers/pkg/ 46 | wasm-wrappers/js-bindings-test/dist/ 47 | 48 | # 'mintlayer-data' will be mapped to home directories of docker containers, so everything 49 | # inside it will be generated by the containers. 50 | build-tools/docker/example-mainnet/mintlayer-data/* 51 | # Same for example-mainnet-dns-server. 52 | build-tools/docker/example-mainnet-dns-server/mintlayer-data/* 53 | -------------------------------------------------------------------------------- /.gitlab/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @muursh @TheQuantumPhysicist @erubboli 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | This project adheres to No Code of Conduct. We are all adults. We accept anyone's contributions. Nothing else matters. 4 | 5 | For more information please visit the [No Code of Conduct](https://github.com/domgetter/NCoC) homepage. 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2023 RBB S.r.l 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | Mintlayer runs a responsible disclosure program for security issues, as such all security issues should be reported to security@mintlayer.org or enrico@mintlayer.org or samer.afach@mintlayer.org. 2 | 3 | If you disclose a valid security issue then you may be eligible for a bounty paid in ML see the details [here](https://www.mintlayer.org/bug-bounties/). 4 | 5 | It's best to err on the side of caution, if you find something you think is security related but not eligible for the bounty or something you're not 100% sure about then let us know on the above email addresses anyway as we treat each report on a report by report basis so you may still be paid a bounty. 6 | 7 | GPG keys for Enrico and Sam can be found [here for Enrico](https://www.mintlayer.org/assets/keys/enrico) and [here for Sam](https://www.mintlayer.org/assets/keys/samer). 8 | 9 | Security issues may not be publicly announced until Mintlayer agrees. 10 | -------------------------------------------------------------------------------- /accounting/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "accounting" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | common = { path = "../common" } 12 | serialization = { path = "../serialization" } 13 | utils = { path = "../utils" } 14 | 15 | thiserror.workspace = true 16 | parity-scale-codec.workspace = true 17 | 18 | [dev-dependencies] 19 | proptest.workspace = true 20 | rstest.workspace = true 21 | -------------------------------------------------------------------------------- /accounting/src/delta/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod combine; 17 | pub mod delta_amount_collection; 18 | pub mod delta_data_collection; 19 | 20 | #[cfg(test)] 21 | mod tests; 22 | -------------------------------------------------------------------------------- /accounting/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod block_undo; 17 | mod delta; 18 | mod error; 19 | 20 | pub use crate::{ 21 | block_undo::{BlockRewardUndo, BlockUndo, BlockUndoError, TxUndo}, 22 | delta::{ 23 | combine::{combine_amount_delta, combine_data_with_delta}, 24 | delta_amount_collection::DeltaAmountCollection, 25 | delta_data_collection::{ 26 | undo::{DataDeltaUndo, DeltaDataUndoCollection}, 27 | DataDelta, DeltaDataCollection, GetDataResult, 28 | }, 29 | }, 30 | error::Error, 31 | }; 32 | -------------------------------------------------------------------------------- /api-server/api-server-common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-server-common" 3 | edition.workspace = true 4 | rust-version.workspace = true 5 | version.workspace = true 6 | license.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | common = { path = "../../common" } 12 | crypto = { path = "../../crypto/" } 13 | logging = { path = "../../logging" } 14 | orders-accounting = { path = "../../orders-accounting" } 15 | pos-accounting = { path = "../../pos-accounting" } 16 | serialization = { path = "../../serialization" } 17 | mempool = { path = "../../mempool" } 18 | chainstate = { path = "../../chainstate" } 19 | 20 | async-trait.workspace = true 21 | bb8-postgres = "0.8" 22 | clap = { workspace = true, features = ["derive"] } 23 | futures = { workspace = true, default-features = false } 24 | parity-scale-codec.workspace = true 25 | thiserror.workspace = true 26 | tokio = { workspace = true, features = ["full"] } 27 | tokio-postgres = "0.7" 28 | 29 | 30 | [dev-dependencies] 31 | chainstate-test-framework = { path = "../../chainstate/test-framework" } 32 | test-utils = { path = "../../test-utils" } 33 | 34 | rstest.workspace = true 35 | -------------------------------------------------------------------------------- /api-server/api-server-common/src/storage/impls/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub const CURRENT_STORAGE_VERSION: u32 = 21; 17 | 18 | pub mod in_memory; 19 | pub mod postgres; 20 | -------------------------------------------------------------------------------- /api-server/api-server-common/src/storage/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod impls; 17 | pub mod storage_api; 18 | -------------------------------------------------------------------------------- /api-server/scanner-daemon/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-blockchain-scanner-daemon" 3 | edition.workspace = true 4 | rust-version.workspace = true 5 | version.workspace = true 6 | license.workspace = true 7 | authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [dependencies] 12 | api-server-common = { path = "../api-server-common" } 13 | api-blockchain-scanner-lib = { path = "../scanner-lib" } 14 | common = { path = "../../common" } 15 | logging = { path = "../../logging" } 16 | node-comm = { path = "../../wallet/wallet-node-client" } 17 | node-lib = { path = "../../node-lib" } 18 | rpc = { path = "../../rpc" } 19 | utils = { path = "../../utils" } 20 | utils-networking = { path = "../../utils/networking" } 21 | 22 | clap = { workspace = true, features = ["derive"] } 23 | thiserror.workspace = true 24 | tokio = { workspace = true, features = ["full"] } 25 | -------------------------------------------------------------------------------- /api-server/scanner-lib/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod blockchain_state; 17 | pub mod sync; 18 | -------------------------------------------------------------------------------- /api-server/stack-test-suite/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-server-stack-test-suite" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | [dev-dependencies] 9 | api-blockchain-scanner-lib = { path = "../scanner-lib" } 10 | api-server-common = { path = "../api-server-common" } 11 | api-web-server = { path = "../web-server" } 12 | chainstate = { path = "../../chainstate" } 13 | chainstate-test-framework = { path = "../../chainstate/test-framework" } 14 | common = { path = "../../common" } 15 | crypto = { path = "../../crypto" } 16 | randomness = { path = "../../randomness" } 17 | serialization = { path = "../../serialization" } 18 | test-utils = { path = "../../test-utils" } 19 | utils = { path = "../../utils" } 20 | pos-accounting = { path = "../../pos-accounting" } 21 | node-comm = { path = "../../wallet/wallet-node-client" } 22 | mempool = { path = "../../mempool" } 23 | 24 | async-trait.workspace = true 25 | axum.workspace = true 26 | hex.workspace = true 27 | libtest-mimic.workspace = true 28 | reqwest = "0.11" 29 | serde.workspace = true 30 | serde_json.workspace = true 31 | tokio = { workspace = true, features = ["full"] } 32 | rstest.workspace = true 33 | -------------------------------------------------------------------------------- /api-server/storage-test-suite/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "api-server-backend-test-suite" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | [dependencies] 9 | api-server-common = { path = "../api-server-common" } 10 | chainstate-test-framework = { path = "../../chainstate/test-framework" } 11 | common = { path = "../../common" } 12 | crypto = { path = "../../crypto/" } 13 | logging = { path = "../../logging" } 14 | test-utils = { path = "../../test-utils" } 15 | utils = { path = "../../utils" } 16 | pos-accounting = { path = "../../pos-accounting" } 17 | randomness = { path = "../../randomness" } 18 | serialization = { path = "../../serialization" } 19 | 20 | async-trait.workspace = true 21 | chrono.workspace = true 22 | futures = { workspace = true, default-features = false } 23 | libtest-mimic.workspace = true 24 | proptest.workspace = true 25 | rand.workspace = true 26 | tokio = { workspace = true, features = ["full"] } 27 | 28 | [[test]] 29 | name = "postgres" 30 | harness = false 31 | 32 | [[test]] 33 | name = "in_memory" 34 | harness = false 35 | -------------------------------------------------------------------------------- /api-server/storage-test-suite/tests/containers/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod with_container; 17 | -------------------------------------------------------------------------------- /blockprod/src/config.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// The blockprod subsystem configuration. 17 | #[derive(Debug)] 18 | pub struct BlockProdConfig { 19 | /// Skip the initial block download check for block production. 20 | pub skip_ibd_check: bool, 21 | /// Minimum number of connected peers to enable block production. 22 | pub min_peers_to_produce_blocks: usize, 23 | /// If true, blocks with non-PoS consensus types will always be created with timestamps 24 | /// bigger than or equal to the current time. 25 | pub use_current_time_if_non_pos: bool, 26 | } 27 | -------------------------------------------------------------------------------- /blockprod/src/interface/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod blockprod_interface; 17 | pub mod blockprod_interface_impl; 18 | -------------------------------------------------------------------------------- /build-tools/assets/logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mintlayer/mintlayer-core/85ef3a57e87c6b9f48e223f9cb5d6846d5388946/build-tools/assets/logo.icns -------------------------------------------------------------------------------- /build-tools/assets/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mintlayer/mintlayer-core/85ef3a57e87c6b9f48e223f9cb5d6846d5388946/build-tools/assets/logo.ico -------------------------------------------------------------------------------- /build-tools/assets/node-gui-icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mintlayer/mintlayer-core/85ef3a57e87c6b9f48e223f9cb5d6846d5388946/build-tools/assets/node-gui-icon_512.png -------------------------------------------------------------------------------- /build-tools/code-docs/build-rpc-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get the dir where the script is located 4 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" 5 | 6 | cd ${SCRIPT_DIR}/../../ 7 | UPDATE_EXPECT=1 cargo test -p node-daemon --test rpc_docs 8 | UPDATE_EXPECT=1 cargo test -p wallet-rpc-daemon --test rpc_docs --features trezor 9 | -------------------------------------------------------------------------------- /build-tools/code-docs/build-wasm-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get the dir where the script is located 4 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" 5 | 6 | cd ${SCRIPT_DIR}/../../ 7 | cargo run -p wasm-doc-gen -- -o wasm-wrappers/WASM-API.md 8 | -------------------------------------------------------------------------------- /build-tools/codecheck/requirements.txt: -------------------------------------------------------------------------------- 1 | toml==0.10.2 2 | -------------------------------------------------------------------------------- /build-tools/coverage/grcov.yml: -------------------------------------------------------------------------------- 1 | output-type: lcov 2 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.api-blockchain-scanner-daemon: -------------------------------------------------------------------------------- 1 | # Build Stage 2 | FROM mintlayer-builder:latest AS builder 3 | 4 | # Runtime Stage 5 | FROM mintlayer-runner-base 6 | 7 | COPY --from=builder /usr/src/target/release/api-blockchain-scanner-daemon /usr/bin 8 | 9 | CMD ["api-blockchain-scanner-daemon"] 10 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.api-web-server: -------------------------------------------------------------------------------- 1 | # Build Stage 2 | FROM mintlayer-builder:latest AS builder 3 | 4 | # Runtime Stage 5 | FROM mintlayer-runner-base 6 | 7 | COPY --from=builder /usr/src/target/release/api-web-server /usr/bin 8 | 9 | CMD ["api-web-server"] 10 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.builder: -------------------------------------------------------------------------------- 1 | # Note: this "source" stage only exists so that we could copy the source tree into 2 | # the "builder" stage excluding the "build-tools" directory. This is to avoid rebuilding 3 | # all the images every time when a file in "build-tools" is modified. Note that for most 4 | # of the contents of "build-tools" this could be solved by adding them to .dockerignore, 5 | # but there are files (e.g. entrypoint.sh) that are needed inside images, so they can't 6 | # be ignored. 7 | # 8 | # TODO: dockerfile 1.7 syntax allows specifying --exclude for COPY, so the same can be done 9 | # without an additional stage. But at the moment of writing this it's still experimental. 10 | # Switch to using it when it becomes stable. 11 | FROM rust as source 12 | COPY . /src 13 | RUN rm -r /src/build-tools 14 | 15 | FROM rust AS builder 16 | 17 | WORKDIR /usr/src/ 18 | 19 | RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* 20 | 21 | COPY --from=source /src/ /usr/src/ 22 | 23 | ARG NUM_JOBS=1 24 | RUN cargo build --release -j${NUM_JOBS} 25 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.dns-server: -------------------------------------------------------------------------------- 1 | # Build Stage 2 | FROM mintlayer-builder:latest AS builder 3 | 4 | # Runtime Stage 5 | FROM mintlayer-runner-base 6 | 7 | COPY --from=builder /usr/src/target/release/dns-server /usr/bin 8 | 9 | CMD ["dns-server"] 10 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.node-daemon: -------------------------------------------------------------------------------- 1 | # Build Stage 2 | FROM mintlayer-builder:latest AS builder 3 | 4 | # Runtime Stage 5 | FROM mintlayer-runner-base 6 | 7 | COPY --from=builder /usr/src/target/release/node-daemon /usr/bin/ 8 | 9 | CMD ["node-daemon"] 10 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.runner-base: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm-slim 2 | 3 | RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/* 4 | 5 | WORKDIR /home/mintlayer 6 | 7 | # Define mintlayer directory as a volume; this will cause docker to create an anonymous 8 | # volume for it if the user forgets to mount it explicitly. 9 | VOLUME ["/home/mintlayer"] 10 | 11 | # Note: using an entrypoint script solves 2 problems: 12 | # 1) We need to run the dockered app as a non-root user, for security purposes. 13 | # 2) If the source of a bind mount doesn't exist when it's mounted, docker will create it 14 | # automatically and the directory will be owned by root (if the host is Linux). The only way 15 | # to change its ownership is to explicitly call 'chown' inside CMD or ENTRYPOINT. 16 | COPY build-tools/docker/entrypoint.sh /entrypoint.sh 17 | ENTRYPOINT ["/entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.wallet-cli: -------------------------------------------------------------------------------- 1 | # Build Stage 2 | FROM mintlayer-builder:latest AS builder 3 | 4 | # Runtime Stage 5 | FROM mintlayer-runner-base 6 | 7 | COPY --from=builder /usr/src/target/release/wallet-cli /usr/bin/wallet-cli 8 | 9 | CMD ["wallet-cli"] 10 | -------------------------------------------------------------------------------- /build-tools/docker/Dockerfile.wallet-rpc-daemon: -------------------------------------------------------------------------------- 1 | # Build Stage 2 | FROM mintlayer-builder:latest AS builder 3 | 4 | # Runtime Stage 5 | FROM mintlayer-runner-base 6 | 7 | COPY --from=builder /usr/src/target/release/wallet-rpc-daemon /usr/bin 8 | 9 | CMD ["wallet-rpc-daemon"] 10 | -------------------------------------------------------------------------------- /build-tools/docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | ML_USER_ID=${ML_USER_ID:-10001} 6 | ML_GROUP_ID=${ML_GROUP_ID:-10001} 7 | 8 | # Create a group and a user; but first check if they already exist (in case an existing 9 | # container is re-used). 10 | if [[ ! $(id -g mintlayer 2> /dev/null) ]]; then 11 | groupadd -g "$ML_GROUP_ID" mintlayer 12 | fi 13 | if [[ ! $(id -u mintlayer 2> /dev/null) ]]; then 14 | # Note: /home/mintlayer should already be mounted to a host directory (or a volume), 15 | # so it must exist. 16 | useradd -u "$ML_USER_ID" -g mintlayer -d /home/mintlayer --no-create-home mintlayer 17 | fi 18 | 19 | # Change the owner of /home/mintlayer (and therefore the host directory where it's mounted). 20 | chown mintlayer:mintlayer /home/mintlayer 21 | 22 | # Launch the passed program using the "mintlayer" user. 23 | # Note: 24 | # 1) 'exec' will replace the current shell process with the specified program; this is needed 25 | # for signals to be propagated corectly. 26 | # 2) 'gosu' also uses the 'exec' syscall to launch the program (unlike 'su') and is needed 27 | # for the same reason. 28 | exec gosu mintlayer "$@" 29 | -------------------------------------------------------------------------------- /build-tools/docker/example-mainnet-dns-server/.env: -------------------------------------------------------------------------------- 1 | # This will be used as a prefix for container and volume names 2 | # (if not specified, `docker compose` will use the name of the parent directory as the project name). 3 | COMPOSE_PROJECT_NAME=mintlayer-mainnet-dns-server 4 | 5 | # Dockerhub username, from which the docker images will be pulled. 6 | ML_DOCKERHUB_USERNAME=mintlayer 7 | # The image tag to use, e.g. "v1.0.2" or "latest". 8 | ML_DOCKER_IMAGE_TAG=latest 9 | 10 | # The user and group ids that will be used to run the software. 11 | ML_USER_ID=10001 12 | ML_GROUP_ID=10001 13 | 14 | # The dns server will be available on this port. 15 | DNS_SERVER_HOST_PORT=53 16 | 17 | # Parameters for the dns-server. 18 | DNS_SERVER_HOST_PARAM=seed.example.com 19 | DNS_SERVER_NAMESERVER_PARAM=seed-ns.example.com 20 | DNS_SERVER_MBOX_PARAM= 21 | -------------------------------------------------------------------------------- /build-tools/docker/example-mainnet-dns-server/README.md: -------------------------------------------------------------------------------- 1 | Here is an example `docker compose` project that runs the DNS server inside a Docker container. 2 | 3 | How to use: 4 | ---------- 5 | 1. Copy this directory to another location. Edit the `.env` file, specifying the required settings. 6 | 7 | 2. `cd` to the copied project directory. 8 | 9 | To start the server, run `docker compose up`. 10 | To shut it down, run `docket compose down`. 11 | 12 | (See `example-mainnet/README.md` for more info on what additional parameters can be specified for `docker compose` and how to make logging more verbose). 13 | -------------------------------------------------------------------------------- /build-tools/docker/example-mainnet-dns-server/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | dns-server: 3 | image: $ML_DOCKERHUB_USERNAME/dns-server:$ML_DOCKER_IMAGE_TAG 4 | volumes: 5 | - ./mintlayer-data:/home/mintlayer 6 | command: dns-server 7 | environment: 8 | # Note: mainnet is the default network and 53 is the default port, so no need to specify them 9 | # here; we do it mainly for demonstration purposes. 10 | ML_DNS_SRV_NETWORK: mainnet 11 | ML_DNS_SRV_BIND_ADDR: 0.0.0.0:53 12 | # Addresses taken from predefined_peer_addresses for mainnet. 13 | ML_DNS_SRV_RESERVED_NODES: 51.159.232.144:3031,51.159.179.229:3031,151.115.35.206:3031,172.232.50.132:3031,103.3.61.21:3031 14 | ML_DNS_SRV_HOST: $DNS_SERVER_HOST_PARAM 15 | ML_DNS_SRV_NAMESERVER: $DNS_SERVER_NAMESERVER_PARAM 16 | ML_DNS_SRV_MBOX: $DNS_SERVER_MBOX_PARAM 17 | RUST_LOG: 18 | ports: 19 | - "$DNS_SERVER_HOST_PORT:53/udp" 20 | -------------------------------------------------------------------------------- /build-tools/linux-systemd-service/logrotate.d/README.md: -------------------------------------------------------------------------------- 1 | Assuming you use the systemd services of mintlayer, this is the logrotate file you can use. Make sure logrotate is installed. For Debian/Ubuntu: 2 | ``` 3 | sudo apt-get install logrotate 4 | ``` 5 | Then place it in the directory: 6 | ``` 7 | /etc/logrotate.d/ 8 | ``` 9 | 10 | This will ensure that your logs don't grow infinitely large. 11 | -------------------------------------------------------------------------------- /build-tools/linux-systemd-service/logrotate.d/mintlayer: -------------------------------------------------------------------------------- 1 | # The file names are based on the defaults we chose in the systemd services. Change to whatever you chose. 2 | # To test and FORCE rotation: logrotate -vf /etc/logrotate.d/mintlayer 3 | # To test without forcing: logrotate -v /etc/logrotate.d/mintlayer 4 | /var/log/mintlayer-node-testnet-stdout.log 5 | /var/log/mintlayer-node-testnet-stderr.log 6 | /var/log/mintlayer-wallet-rpc-testnet-stdout.log 7 | /var/log/mintlayer-wallet-rpc-testnet-stdout.log { 8 | # Rotate at 50 MB size 9 | size 50M 10 | # Keep the last 7 files 11 | rotate 7 12 | compress 13 | # Don't compress the first file 14 | delaycompress 15 | # A non-existing file is OK. Don't error. 16 | missingok 17 | # Don't rotate if the log file is empty 18 | notifempty 19 | # Ensure that the handle to the file remains open, 20 | # so logrotate copies the file and empties it 21 | # instead of renaming 22 | copytruncate 23 | } 24 | -------------------------------------------------------------------------------- /build-tools/osx/DeveloperIDG2CA.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mintlayer/mintlayer-core/85ef3a57e87c6b9f48e223f9cb5d6846d5388946/build-tools/osx/DeveloperIDG2CA.cer -------------------------------------------------------------------------------- /build-tools/p2p-test/.env: -------------------------------------------------------------------------------- 1 | # We want to name our containers explicitly to avoid the extra "-1" suffix. 2 | # This variable contains the base name for the containers. 3 | BASE_NAME=ml-p2p-test 4 | 5 | # We still want to specify the project name, because it'll be used as the base name for volumes 6 | # (otherwise the directory name will be used, which may or may not be consistent with BASE_NAME). 7 | COMPOSE_PROJECT_NAME=ml-p2p-test 8 | 9 | DATA_DIR_IN_CONTAINER=/root/.mintlayer 10 | RPC_PORT=13030 11 | 12 | COMMON_NODE_ARGS="--rpc-bind-address 0.0.0.0:$RPC_PORT --force-allow-run-as-root" 13 | 14 | SPECIAL_NODE=node01 15 | ORDINARY_NODES_LIST="node02 node03 node04 node05 node06 node07 node08 node09 node10 node11 node12 node13 node14 node15" 16 | -------------------------------------------------------------------------------- /build-tools/p2p-test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:1.75 2 | 3 | WORKDIR /src/ 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y \ 7 | ca-certificates \ 8 | nmap procps net-tools iputils-ping dnsutils \ 9 | && rm -rf /var/lib/apt/lists/* 10 | 11 | COPY . . 12 | 13 | ARG NUM_JOBS=16 14 | RUN cargo build --release -j${NUM_JOBS} --bin node-daemon 15 | RUN cargo build --release -j${NUM_JOBS} --bin wallet-cli 16 | 17 | RUN cp /src/target/release/node-daemon /usr/bin 18 | RUN cp /src/target/release/wallet-cli /usr/bin 19 | -------------------------------------------------------------------------------- /build-tools/p2p-test/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .github 3 | .gitlab 4 | .vscode 5 | build-tools 6 | target 7 | -------------------------------------------------------------------------------- /build-tools/p2p-test/docker-compose-base.yml: -------------------------------------------------------------------------------- 1 | services: 2 | node: 3 | build: 4 | context: ../.. 5 | dockerfile: build-tools/p2p-test/Dockerfile 6 | 7 | # Note: the node in SPECIAL_NODE is supposed to be started earlier than everything else, so it 8 | # won't have any peers on the first start and will have to perform an early dns seed query. 9 | # The other nodes will obtain remote peer addresses from the "special" one. 10 | # Also note that we pass it as a reserved node; this is needed because for non-reserved 11 | # addresses only one outbound connection is allowed per address group and all our nodes 12 | # are in the same address group. 13 | command: bash -c " 14 | node-daemon testnet \ 15 | $COMMON_NODE_ARGS \ 16 | $(dig +short $ORDINARY_NODES_LIST | xargs printf '--p2p-boot-nodes %s ') \ 17 | --p2p-reserved-nodes $(dig +short $SPECIAL_NODE) \ 18 | " 19 | environment: 20 | - RUST_LOG 21 | -------------------------------------------------------------------------------- /build-tools/p2p-test/print_connected_peers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | 6 | SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) 7 | 8 | print_peers() { 9 | local node_id=$1 10 | echo "Node ${node_id}'s peers:" 11 | "${SCRIPT_DIR}/run_wallet_cmd.sh" "$node_id" node-list-connected-peers-json 2> /dev/null | \ 12 | jq -c '.[] | [.peer_id, .address, .software_version, .peer_role]' 13 | echo 14 | } 15 | 16 | if [[ $# -lt 1 ]]; then 17 | for i in {1..15} 18 | do 19 | print_peers "$i" 20 | done 21 | else 22 | for i in "$@" 23 | do 24 | print_peers "$i" 25 | done 26 | fi 27 | -------------------------------------------------------------------------------- /build-tools/p2p-test/print_ip_addresses.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | 6 | SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) 7 | 8 | cd "$SCRIPT_DIR" 9 | 10 | for i in {1..15} 11 | do 12 | NODE_NAME_SUFFIX=$(printf '%02d' "$i") 13 | # Note: from address resolution perspective, it doesn't matter which container to execute 'dig' 14 | # in. But since some containers may be down, it makes sense to use the one the address 15 | # of which we're trying to resolve. 16 | ADDR=$(docker compose exec "node${NODE_NAME_SUFFIX}" dig +short "node${NODE_NAME_SUFFIX}") 17 | echo "node${NODE_NAME_SUFFIX}: $ADDR" 18 | done 19 | -------------------------------------------------------------------------------- /build-tools/p2p-test/prune_node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | 6 | SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) 7 | 8 | source "$SCRIPT_DIR/.env" 9 | 10 | if [[ $# -lt 1 ]]; then 11 | echo "Stop the specified node, remove its data, start it again" 12 | echo "Usage: $(basename "$0") container_idx" 13 | echo " node_idx - the index of the node, e.g. 1, 2, 3 etc" 14 | exit 1 15 | fi 16 | 17 | NODE_NAME_SUFFIX=$(printf '%02d' "$1") 18 | shift 19 | 20 | cd "$SCRIPT_DIR" 21 | 22 | docker compose stop "node${NODE_NAME_SUFFIX}" 23 | docker compose rm --force "node${NODE_NAME_SUFFIX}" 24 | docker volume rm "${BASE_NAME}_data${NODE_NAME_SUFFIX}" 25 | docker compose up -d "node${NODE_NAME_SUFFIX}" 26 | -------------------------------------------------------------------------------- /build-tools/p2p-test/run_wallet_cmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | 6 | SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) 7 | 8 | source "$SCRIPT_DIR/.env" 9 | 10 | if [[ $# -lt 2 ]]; then 11 | echo "Run a wallet command on the specified node" 12 | echo "Usage: $(basename "$0") container_idx wallet_cmd [wallet_cmd_params...]" 13 | echo " node_idx - the index of the node, e.g. 1, 2, 3 etc" 14 | echo " wallet_cmd - the command to send to the wallet, e.g. node-list-connected-peers" 15 | echo " wallet_cmd_params - optional parameters for the specified command" 16 | exit 1 17 | fi 18 | 19 | cd "$SCRIPT_DIR" 20 | 21 | NODE_NAME_SUFFIX=$(printf '%02d' "$1") 22 | shift 23 | 24 | NODE=node${NODE_NAME_SUFFIX} 25 | 26 | docker compose exec "${NODE}" bash -c "echo $@ > /tmp/cmd.txt" 27 | # Note: by default, 'docker compose exec' will print everything to stdout, even if originally 28 | # it was printed to stderr, e.g. the logs, making it a PITA to parse the normal output. 29 | # The '-T' AKA '--no-TTY' option solves this somehow. But the logs become non-colored in this case 30 | # though. 31 | docker compose exec -T "${NODE}" wallet-cli testnet --commands-file /tmp/cmd.txt 32 | -------------------------------------------------------------------------------- /build-tools/staking-test/Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .github 3 | .gitlab 4 | .vscode 5 | target 6 | -------------------------------------------------------------------------------- /build-tools/staking-test/node_runner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o nounset 5 | 6 | NODE_INDEX=$1 7 | 8 | node-daemon \ 9 | --datadir=$WORK_DIR_IN_CONTAINER/node$NODE_INDEX $COMMON_NODE_DAEMON_ARGS \ 10 | $(dig +short $NODES_LIST | xargs printf '--p2p-reserved-nodes %s ') 11 | -------------------------------------------------------------------------------- /chainstate/constraints-value-accumulator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "constraints-value-accumulator" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | common = { path = "../../common" } 12 | crypto = { path = "../../crypto" } 13 | orders-accounting = { path = "../../orders-accounting" } 14 | pos-accounting = { path = "../../pos-accounting" } 15 | tokens-accounting = { path = "../../tokens-accounting" } 16 | randomness = { path = "../../randomness" } 17 | utils = { path = "../../utils" } 18 | utxo = { path = "../../utxo" } 19 | 20 | thiserror.workspace = true 21 | 22 | [dev-dependencies] 23 | accounting = { path = "../../accounting" } 24 | test-utils = { path = "../../test-utils" } 25 | 26 | rstest.workspace = true 27 | -------------------------------------------------------------------------------- /chainstate/constraints-value-accumulator/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod constraints_tests; 17 | mod homomorphism; 18 | mod orders_constraints; 19 | -------------------------------------------------------------------------------- /chainstate/launcher/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "chainstate-launcher" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | [dependencies] 9 | chainstate = { path = ".." } 10 | chainstate-storage = { path = "../storage" } 11 | common = { path = "../../common" } 12 | logging = { path = "../../logging" } 13 | storage = { path = "../../storage" } 14 | storage-inmemory = { path = "../../storage/inmemory" } 15 | storage-lmdb = { path = "../../storage/lmdb" } 16 | subsystem = { path = "../../subsystem" } 17 | utils = { path = "../../utils" } 18 | -------------------------------------------------------------------------------- /chainstate/src/detail/info.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use serde::{Deserialize, Serialize}; 17 | 18 | use common::{ 19 | chain::{block::timestamp::BlockTimestamp, GenBlock}, 20 | primitives::{BlockHeight, Id}, 21 | }; 22 | 23 | #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, rpc::description::HasValueHint)] 24 | pub struct ChainInfo { 25 | pub best_block_height: BlockHeight, 26 | pub best_block_id: Id, 27 | pub best_block_timestamp: BlockTimestamp, 28 | pub median_time: BlockTimestamp, 29 | pub is_initial_block_download: bool, 30 | } 31 | -------------------------------------------------------------------------------- /chainstate/src/detail/orphan_blocks/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod orphans_refs; 17 | pub use orphans_refs::*; 18 | 19 | mod pool; 20 | pub use pool::*; 21 | 22 | mod orphans_proxy; 23 | pub use orphans_proxy::*; 24 | 25 | mod orphans_proxy_impl; 26 | mod pool_impl; 27 | -------------------------------------------------------------------------------- /chainstate/src/interface/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod chainstate_interface; 17 | pub mod chainstate_interface_impl; 18 | pub mod chainstate_interface_impl_delegation; 19 | -------------------------------------------------------------------------------- /chainstate/src/rpc/types/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod account; 17 | pub mod block; 18 | pub mod block_reward; 19 | pub mod consensus_data; 20 | pub mod event; 21 | pub mod input; 22 | pub mod output; 23 | pub mod signed_transaction; 24 | pub mod token; 25 | -------------------------------------------------------------------------------- /chainstate/storage/src/internal/version.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use serialization::{Decode, Encode}; 17 | 18 | #[derive(Debug, Encode, Decode, Clone, Copy, Eq, PartialEq)] 19 | pub struct ChainstateStorageVersion(u32); 20 | 21 | impl ChainstateStorageVersion { 22 | pub const CURRENT: Self = Self(11); 23 | 24 | pub fn new(value: u32) -> Self { 25 | Self(value) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chainstate/storage/src/is_transaction_seal.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// Prevent more types from implementing [crate::TransactionRo] and [crate::TransactionRw] 17 | pub trait Seal {} 18 | 19 | impl Seal for crate::internal::StoreTxRo<'_, B> {} 20 | impl Seal for crate::internal::StoreTxRw<'_, B> {} 21 | 22 | #[cfg(any(test, feature = "mock"))] 23 | impl Seal for crate::mock::MockStoreTxRo {} 24 | #[cfg(any(test, feature = "mock"))] 25 | impl Seal for crate::mock::MockStoreTxRw {} 26 | -------------------------------------------------------------------------------- /chainstate/storage/src/mock/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | //! A mock version of the blockchain storage. 17 | 18 | mod mock_impl; 19 | mod mock_impl_accounting; 20 | 21 | pub use mock_impl::{MockStore, MockStoreTxRo, MockStoreTxRw}; 22 | 23 | #[cfg(test)] 24 | mod tests; 25 | -------------------------------------------------------------------------------- /chainstate/test-framework/src/tx_verification_strategy/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod disposable_strategy; 17 | pub mod randomized_strategy; 18 | 19 | pub use { 20 | disposable_strategy::DisposableTransactionVerificationStrategy, 21 | randomized_strategy::RandomizedTransactionVerificationStrategy, 22 | }; 23 | -------------------------------------------------------------------------------- /chainstate/test-suite/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #[cfg(test)] 17 | mod tests; 18 | -------------------------------------------------------------------------------- /chainstate/tx-verifier/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod transaction_verifier; 17 | 18 | pub use transaction_verifier::{ 19 | check_transaction::{check_transaction, CheckTransactionError}, 20 | error, 21 | flush::flush_to_storage, 22 | input_check, 23 | storage::{ 24 | TransactionVerifierStorageError, TransactionVerifierStorageMut, 25 | TransactionVerifierStorageRef, 26 | }, 27 | timelock_check, 28 | tokens_check::{check_nft_issuance_data, check_tokens_issuance}, 29 | TransactionSource, TransactionVerifier, 30 | }; 31 | -------------------------------------------------------------------------------- /chainstate/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "chainstate-types" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | common = { path = "../../common/" } 12 | crypto = { path = "../../crypto" } 13 | logging = { path = '../../logging' } 14 | pos-accounting = { path = "../../pos-accounting" } 15 | serialization = { path = "../../serialization" } 16 | storage = { path = "../../storage/" } 17 | 18 | derive_more.workspace = true 19 | enum-iterator.workspace = true 20 | generic-array.workspace = true 21 | num-derive.workspace = true 22 | num-traits.workspace = true 23 | parity-scale-codec.workspace = true 24 | static_assertions.workspace = true 25 | thiserror.workspace = true 26 | -------------------------------------------------------------------------------- /chainstate/types/src/epoch_data.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use serialization::{Decode, Encode}; 17 | 18 | use crate::pos_randomness::PoSRandomness; 19 | 20 | #[derive(Debug, Encode, Decode, Clone)] 21 | pub struct EpochData { 22 | randomness: PoSRandomness, 23 | } 24 | 25 | impl EpochData { 26 | pub fn new(randomness: PoSRandomness) -> Self { 27 | Self { randomness } 28 | } 29 | 30 | pub fn randomness(&self) -> &PoSRandomness { 31 | &self.randomness 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | disallowed-methods = [] 2 | disallowed-types = [] 3 | enforced-import-renames = [] 4 | large-error-threshold = 256 5 | -------------------------------------------------------------------------------- /common/src/chain/chaintrust/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod asymptote; 17 | -------------------------------------------------------------------------------- /common/src/chain/transaction/signature/inputsig/classical_multisig/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod authorize_classical_multisig; 17 | pub mod encode_decode_multisig_spend; 18 | pub mod multisig_partial_signature; 19 | -------------------------------------------------------------------------------- /common/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod address; 17 | pub mod chain; 18 | pub mod primitives; 19 | pub mod size_estimation; 20 | pub mod text_summary; 21 | pub mod time_getter; 22 | pub mod uint; 23 | 24 | pub use uint::{Uint128, Uint256, Uint512, UintConversionError}; 25 | -------------------------------------------------------------------------------- /common/src/text_summary.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use crate::chain::ChainConfig; 17 | 18 | pub trait TextSummary { 19 | fn text_summary(&self, chain_config: &ChainConfig) -> String; 20 | } 21 | -------------------------------------------------------------------------------- /consensus/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "consensus" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | [dependencies] 9 | chainstate-types = { path = "../chainstate/types" } 10 | common = { path = "../common" } 11 | crypto = { path = "../crypto" } 12 | logging = { path = "../logging" } 13 | pos-accounting = { path = "../pos-accounting" } 14 | randomness = { path = "../randomness" } 15 | serialization = { path = "../serialization" } 16 | utils = { path = "../utils" } 17 | utxo = { path = "../utxo" } 18 | 19 | itertools.workspace = true 20 | num.workspace = true 21 | parity-scale-codec.workspace = true 22 | thiserror.workspace = true 23 | 24 | [dev-dependencies] 25 | test-utils = { path = "../test-utils" } 26 | 27 | rstest.workspace = true 28 | -------------------------------------------------------------------------------- /crypto/README: -------------------------------------------------------------------------------- 1 | crypto provides the basic crypto primitives required for mintlayer 2 | 3 | if you have any questions about the crypto subsystem speak to ben 4 | do not use crypto primitives without understanding what you are doing - speak to amin, ben and sam for clarification 5 | 6 | hashing 7 | 8 | - blake2 9 | - sha1 !!! DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING 10 | - sha2 11 | - sha3 12 | - ripemd160 13 | 14 | sigs 15 | 16 | - secp256k1 schnorr signatures 17 | 18 | encryption 19 | 20 | - chacha20poly1305 21 | 22 | example of use from another subsystem 23 | add your dependencies to your cargo.toml file 24 | 25 | ``` 26 | crypto = {path = "../crypto"} 27 | 28 | ``` 29 | 30 | then you can use it like such 31 | 32 | ``` 33 | use crypto::hash::hash; 34 | use crypto::Blake2b; 35 | let mut buf_blake2 = Vec::new(); 36 | hash::((b"a").to_vec(), &mut buf_blake2); //your result is now stored in buf_blake2b 37 | 38 | ``` 39 | 40 | see the tests in hash.rs for more examples of usage. 41 | -------------------------------------------------------------------------------- /crypto/src/ephemeral_e2e/error.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #[derive(thiserror::Error, Debug, PartialEq, Eq, Clone)] 17 | pub enum Error { 18 | #[error("Symmetric key creation from shared secret failed: {0}")] 19 | SymmetricKeyCreationFailed(String), 20 | #[error("Symmetric encryption failed: {0}")] 21 | SymmetricEncryptionFailed(String), 22 | #[error("Symmetric decryption failed: {0}")] 23 | SymmetricDecryptionFailed(String), 24 | #[error("Deserialization failed: {0}")] 25 | DeserializationFailed(String), 26 | } 27 | -------------------------------------------------------------------------------- /crypto/src/key/hdkd/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod chain_code; 17 | pub mod child_number; 18 | pub mod derivable; 19 | pub mod derivation_path; 20 | pub mod u31; 21 | -------------------------------------------------------------------------------- /crypto/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod ephemeral_e2e; 17 | pub mod hash; 18 | pub mod kdf; 19 | pub mod key; 20 | pub mod symkey; 21 | pub mod util; 22 | pub mod vrf; 23 | -------------------------------------------------------------------------------- /crypto/src/vrf/primitives.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use serialization::{Decode, Encode}; 17 | 18 | use super::schnorrkel::data::SchnorrkelVRFReturn; 19 | 20 | #[must_use] 21 | #[derive(Clone, Debug, Eq, PartialEq, Encode, Decode, serde::Serialize)] 22 | pub enum VRFReturn { 23 | Schnorrkel(SchnorrkelVRFReturn), 24 | } 25 | 26 | impl From for VRFReturn { 27 | fn from(r: SchnorrkelVRFReturn) -> Self { 28 | VRFReturn::Schnorrkel(r) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /crypto/src/vrf/transcript/traits.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | /// A wrapper trait for a transcript that can be signed 17 | pub trait SignableTranscript: schnorrkel::context::SigningTranscript { 18 | /// The extra transcript is built during signature as per the specs in Schnorrkel. 19 | /// This function is necessary to customize the rng object that will be used. 20 | fn make_extra_transcript(&self) -> Self; 21 | fn attach_u64(self, label: &'static [u8], value: u64) -> Self; 22 | fn attach_raw_data>(self, label: &'static [u8], value: T) -> Self; 23 | } 24 | -------------------------------------------------------------------------------- /dns-server/src/crawler_p2p/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | //! # Mintlayer network crawler 17 | 18 | pub mod crawler; 19 | pub mod crawler_manager; 20 | -------------------------------------------------------------------------------- /logging/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "logging" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | log.workspace = true 12 | thiserror.workspace = true 13 | tokio = { workspace = true, default-features = false, features = ["rt", "sync"] } 14 | tracing.workspace = true 15 | tracing-subscriber.workspace = true 16 | -------------------------------------------------------------------------------- /logging/src/tracing_utils.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use std::future::Future; 17 | 18 | use tokio::task::JoinHandle; 19 | use tracing::{Instrument, Span}; 20 | 21 | pub fn spawn_in_current_span(future: F) -> JoinHandle 22 | where 23 | F: Future + Send + 'static, 24 | F::Output: Send + 'static, 25 | { 26 | tokio::spawn(future.in_current_span()) 27 | } 28 | 29 | pub fn spawn_in_span(future: F, span: Span) -> JoinHandle 30 | where 31 | F: Future + Send + 'static, 32 | F::Output: Send + 'static, 33 | { 34 | tokio::spawn(future.instrument(span)) 35 | } 36 | -------------------------------------------------------------------------------- /mempool/src/interface/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod mempool_interface; 17 | mod mempool_interface_impl; 18 | 19 | pub use mempool_interface::MempoolInterface; 20 | pub use mempool_interface_impl::make_mempool; 21 | -------------------------------------------------------------------------------- /mempool/src/pool/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use super::*; 17 | use crate::config::*; 18 | use utils::*; 19 | 20 | use common::{ 21 | chain::{ 22 | output_value::OutputValue, signature::inputsig::InputWitness, Destination, 23 | OutPointSourceId, TxInput, TxOutput, 24 | }, 25 | primitives::{Amount, Id, Idable, H256}, 26 | }; 27 | 28 | mod basic; 29 | mod orphans; 30 | mod utils; 31 | -------------------------------------------------------------------------------- /mempool/src/pool/tx_pool/memory_usage_estimator.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use super::MempoolStore; 17 | 18 | pub trait MemoryUsageEstimator: Send + Sync + 'static { 19 | fn estimate_memory_usage(&self, store: &MempoolStore) -> usize; 20 | } 21 | 22 | /// Estimate memory usage by asking the mempool store 23 | pub struct StoreMemoryUsageEstimator; 24 | 25 | impl MemoryUsageEstimator for StoreMemoryUsageEstimator { 26 | fn estimate_memory_usage(&self, store: &MempoolStore) -> usize { 27 | store.memory_usage() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /mempool/types/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mempool-types" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | [dependencies] 9 | 10 | p2p-types = { path = '../../p2p/types' } 11 | rpc-description = { path = '../../rpc/description' } 12 | 13 | serde.workspace = true 14 | -------------------------------------------------------------------------------- /mempool/types/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod tx_options; 17 | pub mod tx_origin; 18 | mod tx_status; 19 | 20 | pub use tx_options::TxOptions; 21 | pub use tx_status::TxStatus; 22 | -------------------------------------------------------------------------------- /mintscript/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mintscript" 3 | edition.workspace = true 4 | rust-version.workspace = true 5 | version.workspace = true 6 | license.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | common = { path = "../common" } 12 | crypto = { path = "../crypto" } 13 | orders-accounting = { path = "../orders-accounting" } 14 | pos-accounting = { path = "../pos-accounting" } 15 | serialization = { path = "../serialization" } 16 | tokens-accounting = { path = "../tokens-accounting" } 17 | utils = { path = "../utils" } 18 | utxo = { path = "../utxo" } 19 | 20 | static_assertions.workspace = true 21 | thiserror.workspace = true 22 | 23 | [dev-dependencies] 24 | 25 | crypto = { path = '../crypto' } 26 | test-utils = { path = '../test-utils' } 27 | serialization = { path = '../serialization' } 28 | 29 | hex.workspace = true 30 | rstest.workspace = true 31 | expect-test.workspace = true 32 | -------------------------------------------------------------------------------- /mintscript/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod checker; 17 | pub mod script; 18 | pub mod translate; 19 | 20 | pub use checker::{ScriptChecker, SignatureContext, TimelockContext}; 21 | pub use script::{ScriptResult, WitnessScript}; 22 | pub use translate::{InputInfo, TranslateInput}; 23 | 24 | #[cfg(test)] 25 | mod tests; 26 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.acctspend_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.acctspend_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.acctspend_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.burn_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.burn_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.concludeorder_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.concludeorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.concludeorder_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.concludeorder_03.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.createorder_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.createorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.delegate_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.delegate_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.fillorder_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.fillorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.fillorder_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.htlc_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.htlc_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.htlc_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.htlc_03.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.htlc_04.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.mint_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.mint_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.mint_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal account spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.newpool_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000253f0022f209dfa5c224294e4aaf337dc062ec9f689fcc04b4f2196a71fad3758, 0x0101085353) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.prodblock_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200032318d5bcf9bd716cad704d6052b9ea8419b7f691be78be7e76d393a4ed86448a, 0x0101086060) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.prodblock_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200034696310c540f0a749bc023003c3c698dcc61bbb75a4b37f429f250eb8b7554b1, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.prodblock_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200024efcfcb197750301c44ffc5a8b176159a2c5de0b9945c5998245054efea6ac89, 0x0101086363) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.prodblock_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002e7759586e15d0e2b961f097a714515c4e145f4963f24ce99063f3ec9d0211e7a, 0x0101086464) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.prodblock_04.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200024efcfcb197750301c44ffc5a8b176159a2c5de0b9945c5998245054efea6ac89, 0x0101086565) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfer_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfer_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfer_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfer_03.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfertl_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfertl_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfertl_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfertl_03.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.reward.transfertl_04.txt: -------------------------------------------------------------------------------- 1 | ERROR: Illegal output spend -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.acctspend_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002819f7f36a2790938e5f45ac07053110b8e985fbf7cff8a60a403e95b2a2c24fc, 0x0101085454) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.acctspend_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Delegation f5f5…f5f5 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.acctspend_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002819f7f36a2790938e5f45ac07053110b8e985fbf7cff8a60a403e95b2a2c24fc, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.burn_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.burn_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.concludeorder_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000236d8c927b785e27385737e82cdde2e06dc510ab8545d6eab0ca05c36040a437c, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.concludeorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Order with id 8888…8888 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.concludeorder_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000236d8c927b785e27385737e82cdde2e06dc510ab8545d6eab0ca05c36040a437c, 0x0101084444) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.concludeorder_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000236d8c927b785e27385737e82cdde2e06dc510ab8545d6eab0ca05c36040a437c, 0x0101084545) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.createorder_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.createorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.delegate_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.delegate_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.fillorder_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.fillorder_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.fillorder_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.htlc_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003574c6b846c9a4c555ea75d771d5a40564b9ef37419682da12573e1d8ac27d71e, 0x0101085454) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.htlc_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002a3fe239606e407ea161143e42c7c3ef0059573466950a910b28289df247df7a3, 0x0101085858) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.htlc_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200039315c9da756f584d5a7fff618d230bf13115a43d63e7c7d464bb513ab6be7bbc, 0x0101085353) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.htlc_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x041c9bb73a209c49363022813e7197ac80c761d80b, 0x0101085454) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.htlc_04.txt: -------------------------------------------------------------------------------- 1 | signature(0x04d55789fd7dd4b58f8bdb889a0d31cac70e67df92, 0x0101085555) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.mint_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Token with id a1a1…a1a1 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.mint_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003745607a08b12634e402eec525ddaaaaab73cc3951cd232cb88ad934f4be717f6, 0x0101085757) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.mint_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003745607a08b12634e402eec525ddaaaaab73cc3951cd232cb88ad934f4be717f6, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.newpool_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200039315c9da756f584d5a7fff618d230bf13115a43d63e7c7d464bb513ab6be7bbc, 0x0101085353) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.prodblock_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Stake pool e0e0…e0e0 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.prodblock_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Stake pool e1e1…e1e1 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.prodblock_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Stake pool e2e2…e2e2 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.prodblock_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200024efcfcb197750301c44ffc5a8b176159a2c5de0b9945c5998245054efea6ac89, 0x0101086464) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.prodblock_04.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200024efcfcb197750301c44ffc5a8b176159a2c5de0b9945c5998245054efea6ac89, 0x0101086565) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfer_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003e843fa18427b5e71eb6b94eaffcbf52ddc8dc6e843d259f31d7d5566ddc1b6c2, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfer_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002a3fe239606e407ea161143e42c7c3ef0059573466950a910b28289df247df7a3, 0x0101085151) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfer_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x011212121212121212121212121212121212121212, 0x0101085252) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfer_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x011212121212121212121212121212121212121212, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfertl_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003e843fa18427b5e71eb6b94eaffcbf52ddc8dc6e843d259f31d7d5566ddc1b6c2, 0x0101085d5d) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfertl_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002a3fe239606e407ea161143e42c7c3ef0059573466950a910b28289df247df7a3, 0x0101085959) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfertl_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000253f0022f209dfa5c224294e4aaf337dc062ec9f689fcc04b4f2196a71fad3758, 0x0101085a5a) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfertl_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200039315c9da756f584d5a7fff618d230bf13115a43d63e7c7d464bb513ab6be7bbc, 0x0101085b5b) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.sigonly.transfertl_04.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002ebcadc73233ea7fc2c8e2e5bcafc7dd4b46444a60d9b5bc9a965d2c6d8a44ebb, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.acctspend_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.acctspend_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.acctspend_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.burn_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.burn_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.concludeorder_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.concludeorder_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.concludeorder_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.concludeorder_03.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.createorder_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.createorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.delegate_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.delegate_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.fillorder_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.fillorder_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.fillorder_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.htlc_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.htlc_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.htlc_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.htlc_03.txt: -------------------------------------------------------------------------------- 1 | after_seconds(124) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.htlc_04.txt: -------------------------------------------------------------------------------- 1 | after_blocks(1000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.mint_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.mint_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.mint_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.newpool_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.prodblock_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.prodblock_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.prodblock_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.prodblock_03.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.prodblock_04.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfer_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfer_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfer_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfer_03.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfertl_00.txt: -------------------------------------------------------------------------------- 1 | after_blocks(600) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfertl_01.txt: -------------------------------------------------------------------------------- 1 | until_height(155554) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfertl_02.txt: -------------------------------------------------------------------------------- 1 | after_seconds(31536000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfertl_03.txt: -------------------------------------------------------------------------------- 1 | until_time(1718120714) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.tlockonly.transfertl_04.txt: -------------------------------------------------------------------------------- 1 | until_height(999999) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.acctspend_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002819f7f36a2790938e5f45ac07053110b8e985fbf7cff8a60a403e95b2a2c24fc, 0x0101085454) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.acctspend_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Delegation f5f5…f5f5 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.acctspend_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002819f7f36a2790938e5f45ac07053110b8e985fbf7cff8a60a403e95b2a2c24fc, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.burn_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.burn_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.concludeorder_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000236d8c927b785e27385737e82cdde2e06dc510ab8545d6eab0ca05c36040a437c, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.concludeorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Order with id 8888…8888 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.concludeorder_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000236d8c927b785e27385737e82cdde2e06dc510ab8545d6eab0ca05c36040a437c, 0x0101084444) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.concludeorder_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x02000236d8c927b785e27385737e82cdde2e06dc510ab8545d6eab0ca05c36040a437c, 0x0101084545) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.createorder_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.createorder_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.delegate_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.delegate_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Attempt to spend an unspendable output -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.fillorder_00.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.fillorder_01.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.fillorder_02.txt: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.htlc_00.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | Hash160(0x50000000000000000000000000000000000000000d, 0x0606060606060606060606060606060606060606060606060606060606060606), 3 | signature(0x020003574c6b846c9a4c555ea75d771d5a40564b9ef37419682da12573e1d8ac27d71e, 0x0101085454), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.htlc_01.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | Hash160(0x50000000000000000000000000000000000000000d, 0x0606060606060606060606060606060606060606060606060606060606060606), 3 | signature(0x020002a3fe239606e407ea161143e42c7c3ef0059573466950a910b28289df247df7a3, 0x0101085858), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.htlc_02.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | Hash160(0x50000000000000000000000000000000000000000d, 0x0606060606060606060606060606060606060606060606060606060606060606), 3 | signature(0x0200039315c9da756f584d5a7fff618d230bf13115a43d63e7c7d464bb513ab6be7bbc, 0x0101085353), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.htlc_03.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | after_seconds(124), 3 | signature(0x041c9bb73a209c49363022813e7197ac80c761d80b, 0x0101085454), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.htlc_04.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | after_blocks(1000), 3 | signature(0x04d55789fd7dd4b58f8bdb889a0d31cac70e67df92, 0x0101085555), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.mint_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Token with id a1a1…a1a1 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.mint_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003745607a08b12634e402eec525ddaaaaab73cc3951cd232cb88ad934f4be717f6, 0x0101085757) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.mint_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003745607a08b12634e402eec525ddaaaaab73cc3951cd232cb88ad934f4be717f6, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.newpool_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200039315c9da756f584d5a7fff618d230bf13115a43d63e7c7d464bb513ab6be7bbc, 0x0101085353) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.prodblock_00.txt: -------------------------------------------------------------------------------- 1 | ERROR: Stake pool e0e0…e0e0 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.prodblock_01.txt: -------------------------------------------------------------------------------- 1 | ERROR: Stake pool e1e1…e1e1 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.prodblock_02.txt: -------------------------------------------------------------------------------- 1 | ERROR: Stake pool e2e2…e2e2 does not exist -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.prodblock_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200024efcfcb197750301c44ffc5a8b176159a2c5de0b9945c5998245054efea6ac89, 0x0101086464) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.prodblock_04.txt: -------------------------------------------------------------------------------- 1 | signature(0x0200024efcfcb197750301c44ffc5a8b176159a2c5de0b9945c5998245054efea6ac89, 0x0101086565) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfer_00.txt: -------------------------------------------------------------------------------- 1 | signature(0x020003e843fa18427b5e71eb6b94eaffcbf52ddc8dc6e843d259f31d7d5566ddc1b6c2, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfer_01.txt: -------------------------------------------------------------------------------- 1 | signature(0x020002a3fe239606e407ea161143e42c7c3ef0059573466950a910b28289df247df7a3, 0x0101085151) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfer_02.txt: -------------------------------------------------------------------------------- 1 | signature(0x011212121212121212121212121212121212121212, 0x0101085252) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfer_03.txt: -------------------------------------------------------------------------------- 1 | signature(0x011212121212121212121212121212121212121212, 0x0000) 2 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfertl_00.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | after_blocks(600), 3 | signature(0x020003e843fa18427b5e71eb6b94eaffcbf52ddc8dc6e843d259f31d7d5566ddc1b6c2, 0x0101085d5d), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfertl_01.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | until_height(155554), 3 | signature(0x020002a3fe239606e407ea161143e42c7c3ef0059573466950a910b28289df247df7a3, 0x0101085959), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfertl_02.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | after_seconds(31536000), 3 | signature(0x02000253f0022f209dfa5c224294e4aaf337dc062ec9f689fcc04b4f2196a71fad3758, 0x0101085a5a), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfertl_03.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | until_time(1718120714), 3 | signature(0x0200039315c9da756f584d5a7fff618d230bf13115a43d63e7c7d464bb513ab6be7bbc, 0x0101085b5b), 4 | ]) 5 | -------------------------------------------------------------------------------- /mintscript/src/tests/translate/snap.translate.txn.transfertl_04.txt: -------------------------------------------------------------------------------- 1 | threshold(2, [ 2 | until_height(999999), 3 | signature(0x020002ebcadc73233ea7fc2c8e2e5bcafc7dd4b46444a60d9b5bc9a965d2c6d8a44ebb, 0x0000), 4 | ]) 5 | -------------------------------------------------------------------------------- /mocks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mocks" 3 | license.workspace =true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | chainstate = { path = "../chainstate/" } 12 | chainstate-types = { path = "../chainstate/types" } 13 | common = { path = "../common/" } 14 | mempool = { path = "../mempool/" } 15 | orders-accounting = { path = '../orders-accounting/' } 16 | pos-accounting = { path = '../pos-accounting/' } 17 | subsystem = { path = "../subsystem/" } 18 | tokens-accounting = { path = '../tokens-accounting/' } 19 | utils = { path = "../utils/" } 20 | utils-networking = { path = "../utils/networking" } 21 | utxo = { path = "../utxo/" } 22 | p2p-types = { path = "../p2p/types" } 23 | 24 | async-trait.workspace = true 25 | mockall.workspace = true 26 | tokio = { workspace = true, default-features = false, features = ["io-util", "macros", "net", "rt", "rt-multi-thread", "sync", "time"] } 27 | -------------------------------------------------------------------------------- /mocks/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod chainstate; 17 | mod mempool; 18 | 19 | pub use crate::chainstate::MockChainstateInterface; 20 | pub use crate::mempool::MockMempoolInterface; 21 | -------------------------------------------------------------------------------- /networking/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod error; 17 | pub mod test_helpers; 18 | pub mod transport; 19 | pub mod types; 20 | 21 | pub type Result = core::result::Result; 22 | -------------------------------------------------------------------------------- /networking/src/transport/impls/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod channel; 17 | pub mod socks5; 18 | pub mod stream_adapter; 19 | pub mod tcp; 20 | -------------------------------------------------------------------------------- /networking/src/transport/impls/stream_adapter/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod identity; 17 | pub mod noise; 18 | pub mod traits; 19 | pub mod wrapped_transport; 20 | 21 | use self::traits::StreamAdapter; 22 | -------------------------------------------------------------------------------- /networking/src/transport/impls/stream_adapter/wrapped_transport/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod wrapped_listener; 17 | pub mod wrapped_socket; 18 | 19 | #[cfg(test)] 20 | mod tests; 21 | -------------------------------------------------------------------------------- /networking/src/transport/traits/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod listener; 17 | mod socket; 18 | mod stream; 19 | 20 | pub use listener::TransportListener; 21 | pub use socket::{ConnectedSocketInfo, TransportSocket}; 22 | pub use stream::PeerStream; 23 | -------------------------------------------------------------------------------- /networking/src/transport/traits/stream.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use async_trait::async_trait; 17 | use tokio::io::{AsyncRead, AsyncWrite}; 18 | 19 | /// An abstraction layer over some network stream that can be used to send and receive messages. 20 | #[async_trait] 21 | pub trait PeerStream: Unpin + Send + AsyncRead + AsyncWrite {} 22 | -------------------------------------------------------------------------------- /networking/src/types/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] 17 | pub enum ConnectionDirection { 18 | Inbound, 19 | Outbound, 20 | } 21 | -------------------------------------------------------------------------------- /node-daemon/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "node-daemon" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [dependencies] 12 | logging = { path = "../logging" } 13 | node-lib = { path = "../node-lib/" } 14 | utils = { path = "../utils" } 15 | 16 | anyhow.workspace = true 17 | tokio = { workspace = true, default-features = false } 18 | 19 | [dev-dependencies] 20 | 21 | rpc-description = { path = "../rpc/description" } 22 | 23 | assert_cmd.workspace = true 24 | expect-test.workspace = true 25 | -------------------------------------------------------------------------------- /node-daemon/docs/README.md: -------------------------------------------------------------------------------- 1 | ## node-daemon 2 | 3 | For more information about the node-daemon, please visit [the main readme file](/README.md). 4 | 5 | ### RPC commands 6 | 7 | You can find the documentation for all available RPC commands [in this readme file](RPC.md). 8 | 9 | ### RPC examples 10 | 11 | To use the commands mentioned above, we provide simple examples on how to do it with CURL [in this readme file](/rpc/README.md). 12 | -------------------------------------------------------------------------------- /node-gui/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Mintlayer Node GUI 10 | 11 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /node-gui/icon.rc: -------------------------------------------------------------------------------- 1 | #pragma code_page(65001) // UTF-8 encoding 2 | IDI_ICON1 ICON "../build-tools/assets/logo.ico" 3 | 4 | // Add this manifest section 5 | 1 24 "app.manifest" -------------------------------------------------------------------------------- /node-gui/src/widgets/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod confirm_broadcast; 17 | #[cfg(feature = "trezor")] 18 | pub mod create_hw_wallet; 19 | pub mod esc_handler; 20 | pub mod new_wallet_account; 21 | pub mod opaque; 22 | pub mod popup_dialog; 23 | pub mod wallet_mnemonic; 24 | pub mod wallet_set_password; 25 | pub mod wallet_unlock; 26 | -------------------------------------------------------------------------------- /node-lib/src/mock_time.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use std::time::Duration; 17 | 18 | use common::chain::config::ChainType; 19 | use logging::log; 20 | 21 | /// Sets mock time (seconds since UNIX epoch) 22 | pub fn set_mock_time(chain_type: ChainType, time: u64) -> Result<(), crate::Error> { 23 | anyhow::ensure!( 24 | chain_type == ChainType::Regtest, 25 | "Mock time allowed on regtest chain only" 26 | ); 27 | log::info!("set mock time to {time}"); 28 | common::primitives::time::set(Duration::from_secs(time))?; 29 | Ok(()) 30 | } 31 | -------------------------------------------------------------------------------- /orders-accounting/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "orders-accounting" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | accounting = { path = "../accounting" } 12 | common = { path = "../common" } 13 | crypto = { path = "../crypto" } 14 | logging = { path = "../logging" } 15 | randomness = { path = "../randomness" } 16 | serialization = { path = "../serialization" } 17 | utils = { path = "../utils" } 18 | 19 | parity-scale-codec.workspace = true 20 | strum.workspace = true 21 | thiserror.workspace = true 22 | 23 | [dev-dependencies] 24 | test-utils = { path = "../test-utils" } 25 | 26 | rstest.workspace = true 27 | -------------------------------------------------------------------------------- /orders-accounting/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | mod operations; 17 | -------------------------------------------------------------------------------- /p2p/backend-test-suite/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "p2p-backend-test-suite" 3 | license.workspace = true 4 | version.workspace = true 5 | edition.workspace = true 6 | rust-version.workspace = true 7 | 8 | [dependencies] 9 | chainstate = { path = "../../chainstate/" } 10 | common = { path = "../../common" } 11 | logging = { path = "../../logging" } 12 | networking = { path = "../../networking" } 13 | p2p = { path = "../../p2p" } 14 | p2p-test-utils = { path = "../test-utils" } 15 | serialization = { path = "../../serialization" } 16 | subsystem = { path = "../../subsystem/" } 17 | test-utils = { path = "../../test-utils/" } 18 | utils = { path = "../../utils/" } 19 | 20 | libtest-mimic.workspace = true 21 | rlimit.workspace = true 22 | tokio = { workspace = true, default-features = false, features = ["io-util", "macros", "net", "rt", "rt-multi-thread", "sync", "time"] } 23 | tracing.workspace = true 24 | -------------------------------------------------------------------------------- /p2p/src/interface/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2022 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod p2p_interface; 17 | pub mod p2p_interface_impl; 18 | pub mod p2p_interface_impl_delegation; 19 | pub mod types; 20 | -------------------------------------------------------------------------------- /p2p/src/peer_manager/peerdb_common/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod storage; 17 | pub mod storage_impl; 18 | 19 | pub use storage::{StorageVersion, TransactionRo, TransactionRw, Transactional}; 20 | -------------------------------------------------------------------------------- /p2p/src/sync/peer/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | pub mod block_manager; 17 | pub mod requested_transactions; 18 | pub mod transaction_manager; 19 | 20 | mod pending_transactions; 21 | -------------------------------------------------------------------------------- /p2p/src/sync/sync_status.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2024 RBB S.r.l 2 | // opensource@mintlayer.org 3 | // SPDX-License-Identifier: MIT 4 | // Licensed under the MIT License; 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | use common::primitives::time::Time; 17 | 18 | /// Certain information about the current state of block syncing that other parts of p2p 19 | /// (namely, the peer manager) may be interested in. 20 | #[derive(Clone, Debug, Eq, PartialEq)] 21 | pub struct PeerBlockSyncStatus { 22 | pub expecting_blocks_since: Option