From f54873f686d85b0670a8cd7886a209574c5f1169 Mon Sep 17 00:00:00 2001 From: Cayle Sharrock Date: Tue, 6 Feb 2024 09:44:49 +0000 Subject: [PATCH] feat: implement inflating tail emission This PR primarily adds tail emission inflation as a featuer; but it does so using feature gates, which were broken in a few places, and so a big part of this PR is resolving issues related to feature gates. == Tail emission inflation Adds a feature tari_feature_mainnet_emission to allow for tail emission inflation. See https://github.com/tari-project/tari/issues/6122 This change necessitates the addition of 2 new consensus constants: `inflation_bips` -- the annual inflation rate of the total supply. and `tail_emission_epoch_length`, which controls the tail emission inflation. These replace `tail_emission`. We update the Protobuf definition for ConsensusConstants to account for the new fields. == Getting Feature flags working When formally implementing compiler features, the setting of the `TARI_NETWORK` and (from now) `TARI_TARGET_NETWORK` envar and the related compiler flags matter. These changes require that when tests run, the correct network flags are set. For example, blocks::genesis_block::test::stagenet_genesis_sanity_check should only run when TARI_NETWORK=stagenet. While writing this PR, I uncovered a problem: There is not a 1:1 mapping between the build _target_ and the actual network the binary may run on. E.g. the mainnet build can run on either stagenet or mainnet. Unfortunately the `TARI_NETWORK` envar was used to set both of these variables. Without using feature flags, this discrepency went unnoticed. With feature flags, a lot of tests that implicitly assumed say a mainnet target and a stagenet run would simply fail, with no way to resolve the issue. Since these are 2 different things, this commit introduced `TARI_TARGET_NETWORK` whicg sets the **build target**. In most contexts, this then decouples the configured network, which is specified by the `TARI_NETWORK` envar as usual. The other changes in this commit revolve around updating merkle roots and the correct faucet sets to make the target/network/faucet combination consistent. == CI workflows The CI is configured to run tests for each of * Testnet (Esme) * Nextnet (Nextnet) * Mainnet (Mainnet, with some tests specifying stagenet) --- .config/nextest.toml | 12 + .github/workflows/base_node_binaries.yml | 2 + .github/workflows/build_dockers_workflow.yml | 3 + .github/workflows/build_libffis.yml | 2 + .github/workflows/ci.yml | 9 +- Cargo.lock | 1014 ++++++++--------- applications/minotari_app_grpc/Cargo.toml | 1 + applications/minotari_app_grpc/build.rs | 3 + .../minotari_app_grpc/proto/types.proto | 2 + .../src/conversions/consensus_constants.rs | 53 +- .../src/network_check.rs | 6 +- .../minotari_console_wallet/Cargo.toml | 2 + applications/minotari_console_wallet/build.rs | 3 + .../minotari_merge_mining_proxy/Cargo.toml | 1 + .../minotari_merge_mining_proxy/build.rs | 4 +- applications/minotari_node/Cargo.toml | 1 + applications/minotari_node/build.rs | 4 +- base_layer/core/Cargo.toml | 2 + base_layer/core/build.rs | 4 + base_layer/core/src/blocks/genesis_block.rs | 36 +- .../core/src/consensus/consensus_constants.rs | 134 +-- .../core/src/consensus/consensus_manager.rs | 15 +- base_layer/core/src/consensus/emission.rs | 220 +++- .../core/src/proof_of_work/sha3x_pow.rs | 1 + .../core/src/transactions/coinbase_builder.rs | 2 +- .../transaction_components/test.rs | 24 +- .../core/src/validation/chain_balance.rs | 10 +- base_layer/core/src/validation/test.rs | 4 +- .../core/tests/helpers/sample_blockchains.rs | 24 +- base_layer/core/tests/helpers/sync.rs | 9 +- base_layer/core/tests/tests/mempool.rs | 12 +- base_layer/core/tests/tests/node_service.rs | 15 +- .../core/tests/tests/node_state_machine.rs | 11 +- base_layer/tari_mining_helper_ffi/Cargo.toml | 5 +- base_layer/tari_mining_helper_ffi/build.rs | 28 + base_layer/tari_mining_helper_ffi/src/lib.rs | 11 +- buildtools/multinet_envs.sh | 4 + common/Cargo.toml | 2 + common/build.rs | 1 + common/src/configuration/network.rs | 13 +- common/tari_features/Cargo.toml | 5 +- common/tari_features/README.md | 107 ++ common/tari_features/src/lib.rs | 7 +- common/tari_features/src/resolver.rs | 26 +- 44 files changed, 1133 insertions(+), 721 deletions(-) create mode 100644 base_layer/tari_mining_helper_ffi/build.rs create mode 100644 common/tari_features/README.md diff --git a/.config/nextest.toml b/.config/nextest.toml index b305587ac3..01af9351fd 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -3,3 +3,15 @@ slow-timeout = { period = "60s", terminate-after=2} [profile.ci.junit] # this can be some other profile, too path = "junit.xml" + +[profile.intellij] +retries = 0 +slow-timeout = { period = "30s" } +failure-output = "immediate-final" +fail-fast = false + +[profile.intellij.junit] # this can be some other profile, too +path = "junit.xml" + + + diff --git a/.github/workflows/base_node_binaries.yml b/.github/workflows/base_node_binaries.yml index b0aa019e03..48578c1f66 100644 --- a/.github/workflows/base_node_binaries.yml +++ b/.github/workflows/base_node_binaries.yml @@ -102,8 +102,10 @@ jobs: run: | source buildtools/multinet_envs.sh ${{ github.ref_name }} echo ${TARI_NETWORK} + echo ${TARI_TARGET_NETWORK} echo ${TARI_NETWORK_DIR} echo "TARI_NETWORK=${TARI_NETWORK}" >> $GITHUB_ENV + echo "TARI_TARGET_NETWORK=${TARI_TARGET_NETWORK}" >> $GITHUB_ENV echo "TARI_NETWORK_DIR=${TARI_NETWORK_DIR}" >> $GITHUB_ENV echo "TARI_NETWORK_DIR=${TARI_NETWORK_DIR}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/build_dockers_workflow.yml b/.github/workflows/build_dockers_workflow.yml index f656b24b66..e0e07ea4cf 100644 --- a/.github/workflows/build_dockers_workflow.yml +++ b/.github/workflows/build_dockers_workflow.yml @@ -119,6 +119,8 @@ jobs: source tari/buildtools/multinet_envs.sh ${{github.ref_name}} echo ${TARI_NETWORK} echo "TARI_NETWORK=${TARI_NETWORK}" >> $GITHUB_ENV + echo ${TARI_TARGET_NETWORK} + echo "TARI_TARGET_NETWORK=${TARI_TARGET_NETWORK}" >> $GITHUB_ENV - name: environment setup shell: bash @@ -225,6 +227,7 @@ jobs: APP_NAME=${{ matrix.builds.app_name }} APP_EXEC=${{ matrix.builds.app_exec }} TARI_NETWORK=${{ env.TARI_NETWORK }} + TARI_TARGET_NETWORK=${{ env.TARI_TARGET_NETWORK }} ${{ env.DOCKER_SUBTAG }} tags: | ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build_libffis.yml b/.github/workflows/build_libffis.yml index e2bdef9cb8..ecd208c3eb 100644 --- a/.github/workflows/build_libffis.yml +++ b/.github/workflows/build_libffis.yml @@ -102,8 +102,10 @@ jobs: run: | source buildtools/multinet_envs.sh ${{ github.ref_name }} echo ${TARI_NETWORK} + echo ${TARI_TARGET_NETWORK} echo ${TARI_NETWORK_CHANGELOG} echo "TARI_NETWORK=${TARI_NETWORK}" >> $GITHUB_ENV + echo "TARI_TARGET_NETWORK=${TARI_TARGET_NETWORK}" >> $GITHUB_ENV echo "TARI_NETWORK_CHANGELOG=${TARI_NETWORK_CHANGELOG}" >> $GITHUB_ENV - name: Declare Android/iOS envs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8772a340f..fa791d1f17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,6 +167,12 @@ jobs: permissions: checks: write pull-requests: write + strategy: + matrix: + tari_target_network: ["testnet", "nextnet", "mainnet"] + env: + TARI_TARGET_NETWORK: ${{ matrix.tari_target_network }} + RUST_LOG: debug steps: - name: checkout uses: actions/checkout@v4 @@ -192,8 +198,9 @@ jobs: ~/.cargo/registry/CACHEDIR.TAG ~/.cargo/git target - key: tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly-${{ hashFiles('**/Cargo.lock') }} + key: tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.tari_target_network }} restore-keys: | + tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.tari_target_network }} tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly-${{ hashFiles('**/Cargo.lock') }} tari-${{ runner.os }}-${{ runner.cpu-model }}-${{ env.toolchain }}-nightly - name: Install cargo-nextest diff --git a/Cargo.lock b/Cargo.lock index e77795b755..618555991d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,9 +109,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -143,9 +143,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arc-swap" @@ -195,27 +195,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", -] - -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", + "syn 2.0.48", ] [[package]] @@ -336,9 +327,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64-compat" @@ -412,9 +403,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -485,9 +476,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf617fabf5cdbdc92f774bfe5062d870f228b80056d41180797abf48bed4056e" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ "borsh-derive", "cfg_aliases", @@ -495,15 +486,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f404657a7ea7b5249e36808dff544bc88a28f26e0ac40009f674b7a009d14be3" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" dependencies = [ "once_cell", - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "syn_derive", ] @@ -515,9 +506,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", @@ -559,9 +550,9 @@ checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "ea31d69bda4949c1c1562c1e6f042a1caefac98cdc8a298260a2ff41c1e2d42b" [[package]] name = "byteorder" @@ -708,22 +699,22 @@ checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -732,15 +723,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -849,7 +840,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -892,9 +883,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "config" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" dependencies = [ "async-trait", "json5", @@ -911,15 +902,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -943,7 +934,7 @@ dependencies = [ "console-api", "crossbeam-channel", "crossbeam-utils", - "futures 0.3.29", + "futures 0.3.30", "hdrhistogram", "humantime 2.1.0", "prost-types", @@ -960,9 +951,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "convert_case" @@ -972,9 +963,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -982,9 +973,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -997,9 +988,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1089,11 +1080,10 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crossbeam" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "cfg-if", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -1103,56 +1093,46 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -1180,7 +1160,7 @@ dependencies = [ "crossterm_winapi 0.9.1", "futures-core", "libc", - "mio 0.8.9", + "mio 0.8.10", "parking_lot 0.12.1", "signal-hook", "signal-hook-mio", @@ -1196,7 +1176,7 @@ dependencies = [ "bitflags 1.3.2", "crossterm_winapi 0.9.1", "libc", - "mio 0.8.9", + "mio 0.8.10", "parking_lot 0.12.1", "signal-hook", "signal-hook-mio", @@ -1229,9 +1209,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -1295,7 +1275,7 @@ dependencies = [ "derive_more", "drain_filter_polyfill", "either", - "futures 0.3.29", + "futures 0.3.30", "gherkin", "globwalk", "humantime 2.1.0", @@ -1305,7 +1285,7 @@ dependencies = [ "lazy-regex", "linked-hash-map", "once_cell", - "pin-project 1.1.3", + "pin-project 1.1.4", "regex", "sealed", "serde", @@ -1325,7 +1305,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.48", "synthez", ] @@ -1345,15 +1325,15 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", - "fiat-crypto 0.2.2", + "fiat-crypto 0.2.6", "platforms", "rustc_version", "subtle", @@ -1368,7 +1348,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1408,9 +1388,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "decimal-rs" @@ -1441,9 +1421,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -1543,9 +1523,9 @@ dependencies = [ [[package]] name = "diesel" -version = "2.1.3" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2268a214a6f118fce1838edba3d1561cf0e78d8de785475957a580a7f8c69d33" +checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8" dependencies = [ "bigdecimal", "chrono", @@ -1568,7 +1548,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1588,7 +1568,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1663,9 +1643,9 @@ checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -1687,14 +1667,15 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", "serde", "sha2 0.10.8", + "subtle", "zeroize", ] @@ -1706,9 +1687,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -1758,6 +1739,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" version = "0.7.1" @@ -1783,9 +1774,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime 2.1.0", "is-terminal", @@ -1794,6 +1785,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime 2.1.0", + "log", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1802,12 +1806,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1865,9 +1869,9 @@ checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" [[package]] name = "fiat-crypto" -version = "0.2.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" [[package]] name = "fixed-hash" @@ -1926,9 +1930,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1963,9 +1967,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1978,9 +1982,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1988,15 +1992,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -2005,38 +2009,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-test" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ad78d6c79a3c76f8bc7496240d0586e069ed6797824fdd8c41d7c42b145b8d" +checksum = "ce388237b32ac42eca0df1ba55ed3bbda4eaf005d7d4b5dbc0b20ab962928ac9" dependencies = [ "futures-core", "futures-executor", @@ -2045,15 +2049,15 @@ dependencies = [ "futures-sink", "futures-task", "futures-util", - "pin-project 1.1.3", + "pin-project 1.1.4", "pin-utils", ] [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures 0.1.31", "futures-channel", @@ -2081,9 +2085,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -2111,7 +2115,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.38", + "syn 2.0.48", "textwrap 0.16.0", "thiserror", "typed-builder", @@ -2119,17 +2123,17 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git2" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "libgit2-sys", "log", @@ -2145,7 +2149,7 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -2183,7 +2187,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap 2.2.2", "slab", "tokio", "tokio-util 0.7.10", @@ -2192,9 +2196,13 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hashbrown" @@ -2207,17 +2215,17 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", "byteorder", "flate2", "nom", @@ -2230,7 +2238,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes 1.5.0", "headers-core", "http", @@ -2274,9 +2282,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -2298,9 +2306,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -2316,18 +2324,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes 1.5.0", "fnv", @@ -2336,9 +2344,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes 1.5.0", "http", @@ -2374,9 +2382,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes 1.5.0", "futures-channel", @@ -2389,7 +2397,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -2423,9 +2431,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2472,9 +2480,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2490,7 +2498,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "same-file", "walkdir", "winapi-util", @@ -2551,12 +2559,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -2603,13 +2611,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.5", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2641,24 +2649,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -2700,9 +2708,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -2727,7 +2735,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -2741,15 +2749,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.149" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.16.1+1.7.1" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", @@ -2772,6 +2780,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "libsqlite3-sys" version = "0.25.2" @@ -2822,9 +2841,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" dependencies = [ "cc", "libc", @@ -2840,9 +2859,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lmdb-zero" @@ -2939,9 +2958,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memoffset" @@ -2952,15 +2971,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "merlin" version = "3.0.0" @@ -3018,9 +3028,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -3043,6 +3053,7 @@ dependencies = [ "tari_comms", "tari_core", "tari_crypto", + "tari_features", "tari_script", "tari_utilities", "thiserror", @@ -3058,7 +3069,7 @@ version = "1.0.0-pre.8" dependencies = [ "clap 3.2.25", "dialoguer", - "futures 0.3.29", + "futures 0.3.30", "json5", "log", "minotari_app_grpc", @@ -3110,7 +3121,8 @@ dependencies = [ "console-subscriber", "crossterm 0.25.0", "digest 0.10.7", - "futures 0.3.29", + "env_logger 0.11.1", + "futures 0.3.30", "log", "log4rs", "minotari_app_grpc", @@ -3165,7 +3177,8 @@ dependencies = [ "clap 3.2.25", "config", "crossterm 0.25.0", - "futures 0.3.29", + "env_logger 0.11.1", + "futures 0.3.30", "hex", "hyper", "jsonrpc", @@ -3205,7 +3218,7 @@ dependencies = [ "crossbeam", "crossterm 0.25.0", "derivative", - "futures 0.3.29", + "futures 0.3.30", "hex", "log", "log4rs", @@ -3233,6 +3246,7 @@ name = "minotari_mining_helper_ffi" version = "1.0.0-pre.8" dependencies = [ "borsh", + "env_logger 0.11.1", "hex", "libc", "rand", @@ -3240,6 +3254,7 @@ dependencies = [ "tari_comms", "tari_core", "tari_crypto", + "tari_features", "tari_utilities", "thiserror", ] @@ -3259,7 +3274,8 @@ dependencies = [ "crossterm 0.23.2", "derive_more", "either", - "futures 0.3.29", + "env_logger 0.11.1", + "futures 0.3.30", "log", "log-mdc", "log4rs", @@ -3316,7 +3332,7 @@ dependencies = [ "digest 0.10.7", "env_logger 0.7.1", "fs2", - "futures 0.3.29", + "futures 0.3.30", "itertools 0.10.5", "libsqlite3-sys", "log", @@ -3357,7 +3373,7 @@ dependencies = [ "cbindgen", "chacha20poly1305", "chrono", - "futures 0.3.29", + "futures 0.3.30", "itertools 0.10.5", "libc", "log", @@ -3414,9 +3430,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -3542,7 +3558,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "memoffset 0.6.5", + "memoffset", ] [[package]] @@ -3610,6 +3626,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" @@ -3623,13 +3645,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3644,19 +3666,18 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" dependencies = [ "autocfg", "num-integer", @@ -3676,9 +3697,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -3690,27 +3711,27 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.5", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" dependencies = [ - "atomic-polyfill", "critical-section", + "portable-atomic", ] [[package]] @@ -3727,11 +3748,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.61" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -3748,7 +3769,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3759,18 +3780,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.1.6+3.1.4" +version = "300.2.2+3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439fac53e092cd7442a3660c85dde4643ab3b5bd39040912388dcdabf6b88085" +checksum = "8bbfad0063610ac26ee79f7484739e2b07555a75c42453b89263830b5c8103bc" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.97" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -3830,9 +3851,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -3844,11 +3865,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3954,11 +3975,11 @@ checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5" [[package]] name = "pem" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "serde", ] @@ -3973,15 +3994,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", @@ -3990,9 +4011,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" dependencies = [ "pest", "pest_generator", @@ -4000,22 +4021,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" dependencies = [ "once_cell", "pest", @@ -4039,7 +4060,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.1.0", + "indexmap 2.2.2", ] [[package]] @@ -4049,7 +4070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27e1f8e085bfa9b85763fe3ddaacbe90a09cd847b3833129153a6cb063bbe132" dependencies = [ "aes", - "base64 0.21.5", + "base64 0.21.7", "bitfield", "block-padding", "blowfish", @@ -4076,7 +4097,7 @@ dependencies = [ "md-5", "nom", "num-bigint-dig", - "num-derive 0.4.1", + "num-derive 0.4.2", "num-traits", "p256", "p384", @@ -4105,11 +4126,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ - "pin-project-internal 1.1.3", + "pin-project-internal 1.1.4", ] [[package]] @@ -4125,13 +4146,13 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4169,15 +4190,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "platforms" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "plotters" @@ -4230,6 +4251,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -4254,9 +4281,9 @@ dependencies = [ [[package]] name = "primeorder" -version = "0.13.2" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ "elliptic-curve", ] @@ -4292,6 +4319,15 @@ dependencies = [ "toml_edit 0.20.7", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -4318,9 +4354,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -4444,9 +4480,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -4521,9 +4557,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -4531,9 +4567,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -4571,24 +4607,24 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -4603,9 +4639,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -4632,11 +4668,11 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes 1.5.0", "encoding_rs", "futures-core", @@ -4654,9 +4690,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -4695,9 +4733,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -4739,9 +4777,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ef35bf3e7fe15a53c4ab08a998e42271eab13eb0db224126bc7bc4c4bad96d" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ "const-oid", "digest 0.10.7", @@ -4790,15 +4828,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4820,7 +4858,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -4836,11 +4874,11 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -4885,9 +4923,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safemem" @@ -4906,11 +4944,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4940,7 +4978,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -4953,7 +4991,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -4995,15 +5033,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] @@ -5020,20 +5058,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -5042,20 +5080,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -5086,11 +5124,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.27" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.2", "itoa", "ryu", "serde", @@ -5181,7 +5219,7 @@ checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", "mio 0.7.14", - "mio 0.8.9", + "mio 0.8.10", "signal-hook", ] @@ -5196,9 +5234,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -5215,9 +5253,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smart-default" @@ -5227,7 +5265,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -5260,9 +5298,9 @@ dependencies = [ [[package]] name = "snow" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e87c18a6608909007e75a60e04d03eda77b601c94de1c74d9a9dc2c04ab789a" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ "aes-gcm", "blake2", @@ -5274,16 +5312,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -5308,9 +5336,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -5419,9 +5447,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -5437,7 +5465,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -5464,7 +5492,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3d2c2202510a1e186e63e596d9318c91a8cbe85cd1a56a7be0c333e5f59ec8d" dependencies = [ - "syn 2.0.38", + "syn 2.0.48", "synthez-codegen", "synthez-core", ] @@ -5475,7 +5503,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f724aa6d44b7162f3158a57bccd871a77b39a4aef737e01bcdff41f4772c7746" dependencies = [ - "syn 2.0.38", + "syn 2.0.48", "synthez-core", ] @@ -5488,7 +5516,7 @@ dependencies = [ "proc-macro2", "quote", "sealed", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -5593,6 +5621,7 @@ dependencies = [ "blake2", "config", "dirs-next 1.0.2", + "env_logger 0.11.1", "git2", "log", "log4rs", @@ -5601,7 +5630,7 @@ dependencies = [ "prost-build", "serde", "serde_json", - "serde_yaml 0.9.27", + "serde_yaml 0.9.31", "sha2 0.10.8", "structopt", "tari_crypto", @@ -5630,7 +5659,7 @@ dependencies = [ name = "tari_common_types" version = "1.0.0-pre.8" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "blake2", "borsh", "chacha20poly1305", @@ -5653,7 +5682,7 @@ version = "1.0.0-pre.8" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.1", + "bitflags 2.4.2", "blake2", "bytes 1.5.0", "chrono", @@ -5662,14 +5691,14 @@ dependencies = [ "derivative", "digest 0.10.7", "env_logger 0.7.1", - "futures 0.3.29", + "futures 0.3.30", "lmdb-zero", "log", "log-mdc", "multiaddr", "nom", "once_cell", - "pin-project 1.1.3", + "pin-project 1.1.4", "prost", "rand", "serde", @@ -5701,7 +5730,7 @@ name = "tari_comms_dht" version = "1.0.0-pre.8" dependencies = [ "anyhow", - "bitflags 2.4.1", + "bitflags 2.4.2", "blake2", "chacha20 0.7.3", "chacha20poly1305", @@ -5710,8 +5739,8 @@ dependencies = [ "diesel", "diesel_migrations", "digest 0.10.7", - "env_logger 0.10.1", - "futures 0.3.29", + "env_logger 0.10.2", + "futures 0.3.30", "futures-test", "futures-util", "lmdb-zero", @@ -5744,7 +5773,7 @@ dependencies = [ name = "tari_comms_rpc_macros" version = "1.0.0-pre.8" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "proc-macro2", "prost", "quote", @@ -5762,7 +5791,7 @@ dependencies = [ "chrono", "diesel", "diesel_migrations", - "futures 0.3.29", + "futures 0.3.30", "log", "num-derive 0.3.3", "num-traits", @@ -5794,7 +5823,7 @@ version = "1.0.0-pre.8" dependencies = [ "async-trait", "bincode", - "bitflags 2.4.1", + "bitflags 2.4.2", "blake2", "borsh", "bytes 0.5.6", @@ -5805,9 +5834,10 @@ dependencies = [ "decimal-rs", "derivative", "digest 0.10.7", + "env_logger 0.11.1", "env_logger 0.7.1", "fs2", - "futures 0.3.29", + "futures 0.3.30", "hex", "integer-encoding", "libsqlite3-sys", @@ -5840,6 +5870,7 @@ dependencies = [ "tari_comms_dht", "tari_comms_rpc_macros", "tari_crypto", + "tari_features", "tari_hash_domains", "tari_key_manager", "tari_metrics", @@ -5885,6 +5916,9 @@ dependencies = [ [[package]] name = "tari_features" version = "1.0.0-pre.8" +dependencies = [ + "log", +] [[package]] name = "tari_hash_domains" @@ -5903,7 +5937,7 @@ dependencies = [ "config", "csv", "cucumber", - "futures 0.3.29", + "futures 0.3.30", "indexmap 1.9.3", "libc", "log", @@ -5956,7 +5990,7 @@ dependencies = [ "diesel", "diesel_migrations", "digest 0.10.7", - "futures 0.3.29", + "futures 0.3.30", "js-sys", "log", "rand", @@ -5996,7 +6030,7 @@ name = "tari_metrics" version = "1.0.0-pre.8" dependencies = [ "anyhow", - "futures 0.3.29", + "futures 0.3.30", "log", "once_cell", "prometheus", @@ -6033,7 +6067,7 @@ dependencies = [ "clap 3.2.25", "config", "fs2", - "futures 0.3.29", + "futures 0.3.30", "lmdb-zero", "log", "pgp", @@ -6084,7 +6118,7 @@ version = "1.0.0-pre.8" dependencies = [ "anyhow", "async-trait", - "futures 0.3.29", + "futures 0.3.30", "futures-test", "log", "tari_shutdown", @@ -6099,7 +6133,7 @@ dependencies = [ name = "tari_shutdown" version = "1.0.0-pre.8" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "tokio", ] @@ -6120,7 +6154,7 @@ dependencies = [ name = "tari_test_utils" version = "1.0.0-pre.8" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "futures-test", "rand", "tari_comms", @@ -6150,22 +6184,21 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -6202,22 +6235,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -6242,12 +6275,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -6262,10 +6296,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -6314,18 +6349,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes 1.5.0", "libc", - "mio 0.8.9", + "mio 0.8.10", "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -6343,13 +6378,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -6450,7 +6485,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.2", "serde", "serde_spanned", "toml_datetime", @@ -6463,7 +6498,18 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.2", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.2", "toml_datetime", "winnow", ] @@ -6487,11 +6533,11 @@ dependencies = [ "hyper", "hyper-timeout", "percent-encoding", - "pin-project 1.1.3", + "pin-project 1.1.4", "prost", "prost-derive", "rustls-native-certs", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.4", "tokio", "tokio-rustls", "tokio-stream", @@ -6511,7 +6557,7 @@ checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", "axum", - "base64 0.21.5", + "base64 0.21.7", "bytes 1.5.0", "futures-core", "futures-util", @@ -6521,7 +6567,7 @@ dependencies = [ "hyper", "hyper-timeout", "percent-encoding", - "pin-project 1.1.3", + "pin-project 1.1.4", "prost", "tokio", "tokio-stream", @@ -6567,7 +6613,7 @@ dependencies = [ "futures-util", "hdrhistogram", "indexmap 1.9.3", - "pin-project 1.1.3", + "pin-project 1.1.4", "pin-project-lite", "rand", "slab", @@ -6610,7 +6656,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -6629,15 +6675,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.1.3", + "pin-project 1.1.4", "tracing", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "once_cell", @@ -6703,9 +6749,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tui" @@ -6746,7 +6792,7 @@ checksum = "29a3151c41d0b13e3d011f98adc24434560ef06673a155a6c7f66b9879eecce2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -6793,9 +6839,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -6820,9 +6866,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" @@ -6881,12 +6927,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", ] @@ -6898,9 +6944,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", ] @@ -6978,8 +7024,8 @@ dependencies = [ "mime", "mime_guess", "percent-encoding", - "pin-project 1.1.3", - "rustls-pemfile 1.0.3", + "pin-project 1.1.4", + "rustls-pemfile 1.0.4", "scoped-tls", "serde", "serde_json", @@ -6999,9 +7045,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -7009,24 +7055,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -7036,9 +7082,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7046,28 +7092,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -7079,7 +7125,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7128,20 +7174,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -7162,21 +7199,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -7207,12 +7229,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7225,12 +7241,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7243,12 +7253,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7261,12 +7265,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7279,12 +7277,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7297,12 +7289,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7315,12 +7301,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7335,9 +7315,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] @@ -7363,9 +7343,9 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek", "rand_core", @@ -7388,7 +7368,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.29", + "futures 0.3.30", "log", "nohash-hasher", "parking_lot 0.12.1", @@ -7407,9 +7387,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -7422,7 +7402,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] diff --git a/applications/minotari_app_grpc/Cargo.toml b/applications/minotari_app_grpc/Cargo.toml index 24ea0a9949..68138a4c7b 100644 --- a/applications/minotari_app_grpc/Cargo.toml +++ b/applications/minotari_app_grpc/Cargo.toml @@ -31,6 +31,7 @@ tonic = { version = "0.8.3", features = ["tls"]} zeroize = "1" [build-dependencies] +tari_features = { version = "1.0.0-pre.7", path = "../../common/tari_features" } tonic-build = "0.8.4" [package.metadata.cargo-machete] diff --git a/applications/minotari_app_grpc/build.rs b/applications/minotari_app_grpc/build.rs index c059857769..f8084fb744 100644 --- a/applications/minotari_app_grpc/build.rs +++ b/applications/minotari_app_grpc/build.rs @@ -1,7 +1,10 @@ // Copyright 2022 The Tari Project // SPDX-License-Identifier: BSD-3-Clause +use tari_features::resolver::build_features; + fn main() -> Result<(), Box> { + build_features(); tonic_build::configure().build_client(true).build_server(true).compile( &[ "proto/base_node.proto", diff --git a/applications/minotari_app_grpc/proto/types.proto b/applications/minotari_app_grpc/proto/types.proto index 474e2bc3ab..7bb77bb207 100644 --- a/applications/minotari_app_grpc/proto/types.proto +++ b/applications/minotari_app_grpc/proto/types.proto @@ -141,4 +141,6 @@ message ConsensusConstants { uint64 validator_node_registration_min_lock_height = 32; uint64 validator_node_registration_shuffle_interval_epoch = 33; repeated PermittedRangeProofs permitted_range_proof_types = 34; + uint64 inflation_bips = 35; + uint64 tail_epoch_length = 36; } diff --git a/applications/minotari_app_grpc/src/conversions/consensus_constants.rs b/applications/minotari_app_grpc/src/conversions/consensus_constants.rs index 80fac7416e..55c262264e 100644 --- a/applications/minotari_app_grpc/src/conversions/consensus_constants.rs +++ b/applications/minotari_app_grpc/src/conversions/consensus_constants.rs @@ -29,7 +29,10 @@ use crate::tari_rpc as grpc; impl From for grpc::ConsensusConstants { #[allow(clippy::too_many_lines)] fn from(cc: ConsensusConstants) -> Self { + #[cfg(not(tari_feature_mainnet_emission))] let (emission_initial, emission_decay, emission_tail) = cc.emission_amounts(); + #[cfg(tari_feature_mainnet_emission)] + let (emission_initial, emission_decay, inflation_bips, tail_epoch_length) = cc.emission_amounts(); let weight_params = cc.transaction_weight_params().params(); let input_version_range = cc.input_version_range().clone().into_inner(); let input_version_range = grpc::Range { @@ -100,7 +103,8 @@ impl From for grpc::ConsensusConstants { let proof_of_work = HashMap::from_iter([(0u32, randomx_pow), (1u32, sha3x_pow)]); - Self { + #[cfg(not(tari_feature_mainnet_emission))] + let result = Self { coinbase_min_maturity: cc.coinbase_min_maturity(), blockchain_version: cc.blockchain_version().into(), future_time_limit: cc.ftl().as_u64(), @@ -111,6 +115,8 @@ impl From for grpc::ConsensusConstants { emission_initial: emission_initial.into(), emission_decay: emission_decay.to_vec(), emission_tail: emission_tail.into(), + inflation_bips: 0, + tail_epoch_length: 0, min_sha3x_pow_difficulty: cc.min_pow_difficulty(PowAlgorithm::Sha3x).into(), block_weight_inputs: weight_params.input_weight, block_weight_outputs: weight_params.output_weight, @@ -136,6 +142,49 @@ impl From for grpc::ConsensusConstants { validator_node_registration_shuffle_interval_epoch: cc .validator_node_registration_shuffle_interval() .as_u64(), - } + }; + + #[cfg(tari_feature_mainnet_emission)] + let result = Self { + coinbase_min_maturity: cc.coinbase_min_maturity(), + blockchain_version: cc.blockchain_version().into(), + future_time_limit: cc.ftl().as_u64(), + difficulty_block_window: cc.difficulty_block_window(), + max_block_transaction_weight: cc.max_block_transaction_weight(), + pow_algo_count: cc.pow_algo_count(), + median_timestamp_count: u64::try_from(cc.median_timestamp_count()).unwrap_or(0), + emission_initial: emission_initial.into(), + emission_decay: emission_decay.to_vec(), + emission_tail: 0, + inflation_bips, + tail_epoch_length, + min_sha3x_pow_difficulty: cc.min_pow_difficulty(PowAlgorithm::Sha3x).into(), + block_weight_inputs: weight_params.input_weight, + block_weight_outputs: weight_params.output_weight, + block_weight_kernels: weight_params.kernel_weight, + max_script_byte_size: cc.max_script_byte_size() as u64, + faucet_value: cc.faucet_value().as_u64(), + effective_from_height: cc.effective_from_height(), + input_version_range: Some(input_version_range), + kernel_version_range: Some(kernel_version_range), + valid_blockchain_version_range: Some(valid_blockchain_version_range), + proof_of_work, + transaction_weight: Some(transaction_weight), + max_randomx_seed_height: cc.max_randomx_seed_height(), + output_version_range: Some(output_version_range), + permitted_output_types, + permitted_range_proof_types, + validator_node_validity_period: cc.validator_node_validity_period_epochs().as_u64(), + epoch_length: cc.epoch_length(), + validator_node_registration_min_deposit_amount: cc + .validator_node_registration_min_deposit_amount() + .as_u64(), + validator_node_registration_min_lock_height: cc.validator_node_registration_min_lock_height(), + validator_node_registration_shuffle_interval_epoch: cc + .validator_node_registration_shuffle_interval() + .as_u64(), + }; + + result } } diff --git a/applications/minotari_app_utilities/src/network_check.rs b/applications/minotari_app_utilities/src/network_check.rs index ab742bb7cd..02e798cb0d 100644 --- a/applications/minotari_app_utilities/src/network_check.rs +++ b/applications/minotari_app_utilities/src/network_check.rs @@ -48,13 +48,13 @@ impl From for ExitError { } } -#[cfg(tari_network_mainnet)] +#[cfg(tari_target_network_mainnet)] pub const TARGET_NETWORK: Target = Target::MainNet; -#[cfg(tari_network_nextnet)] +#[cfg(tari_target_network_nextnet)] pub const TARGET_NETWORK: Target = Target::NextNet; -#[cfg(all(not(tari_network_mainnet), not(tari_network_nextnet)))] +#[cfg(all(not(tari_target_network_mainnet), not(tari_target_network_nextnet)))] pub const TARGET_NETWORK: Target = Target::TestNet; pub fn is_network_choice_valid(network: Network) -> Result { diff --git a/applications/minotari_console_wallet/Cargo.toml b/applications/minotari_console_wallet/Cargo.toml index 23fef36500..f78b7d1f9d 100644 --- a/applications/minotari_console_wallet/Cargo.toml +++ b/applications/minotari_console_wallet/Cargo.toml @@ -83,6 +83,8 @@ features = ["crossterm"] [build-dependencies] tari_features = { path = "../../common/tari_features" } +env_logger = "0.11.1" + [features] default = ["libtor"] diff --git a/applications/minotari_console_wallet/build.rs b/applications/minotari_console_wallet/build.rs index cf807ca2a4..0dfc8c5cd3 100644 --- a/applications/minotari_console_wallet/build.rs +++ b/applications/minotari_console_wallet/build.rs @@ -5,7 +5,9 @@ use tari_features::resolver::build_features; #[cfg(windows)] fn main() { + env_logger::init(); build_features(); + (); use std::env; println!("cargo:rerun-if-changed=icon.res"); let mut path = env::current_dir().unwrap(); @@ -15,6 +17,7 @@ fn main() { #[cfg(not(windows))] pub fn main() { + env_logger::init(); build_features(); // Build as usual } diff --git a/applications/minotari_merge_mining_proxy/Cargo.toml b/applications/minotari_merge_mining_proxy/Cargo.toml index db2c050d1a..2ba719bef4 100644 --- a/applications/minotari_merge_mining_proxy/Cargo.toml +++ b/applications/minotari_merge_mining_proxy/Cargo.toml @@ -47,3 +47,4 @@ url = "2.1.1" [build-dependencies] tari_features = { path = "../../common/tari_features"} +env_logger = "0.11.1" diff --git a/applications/minotari_merge_mining_proxy/build.rs b/applications/minotari_merge_mining_proxy/build.rs index cf807ca2a4..4db5fc3837 100644 --- a/applications/minotari_merge_mining_proxy/build.rs +++ b/applications/minotari_merge_mining_proxy/build.rs @@ -5,7 +5,8 @@ use tari_features::resolver::build_features; #[cfg(windows)] fn main() { - build_features(); + env_logger::init(); + (); use std::env; println!("cargo:rerun-if-changed=icon.res"); let mut path = env::current_dir().unwrap(); @@ -15,6 +16,7 @@ fn main() { #[cfg(not(windows))] pub fn main() { + env_logger::init(); build_features(); // Build as usual } diff --git a/applications/minotari_node/Cargo.toml b/applications/minotari_node/Cargo.toml index 58c194821c..47cabde757 100644 --- a/applications/minotari_node/Cargo.toml +++ b/applications/minotari_node/Cargo.toml @@ -59,6 +59,7 @@ libtor = ["tari_libtor"] [build-dependencies] tari_features = { path = "../../common/tari_features"} +env_logger = "0.11.1" [package.metadata.cargo-machete] ignored = [ diff --git a/applications/minotari_node/build.rs b/applications/minotari_node/build.rs index cf807ca2a4..d5a2827985 100644 --- a/applications/minotari_node/build.rs +++ b/applications/minotari_node/build.rs @@ -5,7 +5,9 @@ use tari_features::resolver::build_features; #[cfg(windows)] fn main() { + env_logger::init(); build_features(); + (); use std::env; println!("cargo:rerun-if-changed=icon.res"); let mut path = env::current_dir().unwrap(); @@ -15,6 +17,6 @@ fn main() { #[cfg(not(windows))] pub fn main() { + env_logger::init(); build_features(); - // Build as usual } diff --git a/base_layer/core/Cargo.toml b/base_layer/core/Cargo.toml index 94295fc658..138248aa53 100644 --- a/base_layer/core/Cargo.toml +++ b/base_layer/core/Cargo.toml @@ -105,6 +105,8 @@ quickcheck = "1.0" [build-dependencies] tari_common = { path = "../../common", features = ["build"] } +tari_features = { path = "../../common/tari_features"} +env_logger = "0.11.1" [[bench]] name = "mempool" diff --git a/base_layer/core/build.rs b/base_layer/core/build.rs index ca7f1901fc..921141ebe1 100644 --- a/base_layer/core/build.rs +++ b/base_layer/core/build.rs @@ -20,7 +20,11 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +use tari_features::resolver::build_features; + fn main() { + env_logger::init(); + build_features(); tari_common::build::ProtobufCompiler::new() .include_paths(&["src/proto"]) .proto_paths(&[ diff --git a/base_layer/core/src/blocks/genesis_block.rs b/base_layer/core/src/blocks/genesis_block.rs index 5dca13f990..4cbef714fe 100644 --- a/base_layer/core/src/blocks/genesis_block.rs +++ b/base_layer/core/src/blocks/genesis_block.rs @@ -105,23 +105,23 @@ fn print_mr_values(block: &mut Block, print: bool) { pub fn get_stagenet_genesis_block() -> ChainBlock { let mut block = get_stagenet_genesis_block_raw(); - + eprintln!("Network: {:?}", Network::get_current_or_default()); // Add faucet utxos - enable/disable as required let add_faucet_utxos = true; if add_faucet_utxos { // NB! Update 'consensus_constants.rs/pub fn igor()/ConsensusConstants {faucet_value: ?}' with total value // NB: `stagenet_genesis_sanity_check` must pass - let file_contents = include_str!("faucets/esmeralda_faucet.json"); + let file_contents = include_str!("faucets/stagenet_faucet.json"); add_faucet_utxos_to_genesis_block(file_contents, &mut block); // Enable print only if you need to generate new Merkle roots, then disable it again - let print_values = false; + let print_values = true; print_mr_values(&mut block, print_values); // Hardcode the Merkle roots once they've been computed above block.header.kernel_mr = - FixedHash::from_hex("3f4011ec1e8ddfbd66fb7331c5623b38f529a66e81233d924df85f2070b2aacb").unwrap(); + FixedHash::from_hex("a08ff15219beea81d4131465290443fb3bd99d28b8af85975dbb2c77cb4cb5a0").unwrap(); block.header.output_mr = - FixedHash::from_hex("3e40efda288a57d3319c63388dd47ffe4b682baaf6a3b58622ec94d77ad712a2").unwrap(); + FixedHash::from_hex("435f13e21be06b0d0ae9ad3869ac7c723edd933983fa2e26df843c82594b3245").unwrap(); block.header.validator_node_mr = FixedHash::from_hex("277da65c40b2cf99db86baedb903a3f0a38540f3a94d40c826eecac7e27d5dfc").unwrap(); } @@ -163,17 +163,17 @@ pub fn get_nextnet_genesis_block() -> ChainBlock { if add_faucet_utxos { // NB! Update 'consensus_constants.rs/pub fn igor()/ConsensusConstants {faucet_value: ?}' with total value // NB: `nextnet_genesis_sanity_check` must pass - let file_contents = include_str!("faucets/esmeralda_faucet.json"); + let file_contents = include_str!("faucets/nextnet_faucet.json"); add_faucet_utxos_to_genesis_block(file_contents, &mut block); // Enable print only if you need to generate new Merkle roots, then disable it again - let print_values = false; + let print_values = true; print_mr_values(&mut block, print_values); // Hardcode the Merkle roots once they've been computed above block.header.kernel_mr = - FixedHash::from_hex("3f4011ec1e8ddfbd66fb7331c5623b38f529a66e81233d924df85f2070b2aacb").unwrap(); + FixedHash::from_hex("36881d87e25183f5189d2dca5f7da450c399e7006dafd9bd9240f73a5fb3f0ad").unwrap(); block.header.output_mr = - FixedHash::from_hex("3e40efda288a57d3319c63388dd47ffe4b682baaf6a3b58622ec94d77ad712a2").unwrap(); + FixedHash::from_hex("7b65d5140485b44e33eef3690d46c41e4dc5c4520ad7464d7740f376f4f0a728").unwrap(); block.header.validator_node_mr = FixedHash::from_hex("277da65c40b2cf99db86baedb903a3f0a38540f3a94d40c826eecac7e27d5dfc").unwrap(); } @@ -368,6 +368,7 @@ mod test { use tari_common_types::{epoch::VnEpoch, types::Commitment}; use tari_utilities::ByteArray; + use Network; use super::*; use crate::{ @@ -383,14 +384,7 @@ mod test { }; #[test] - fn stagenet_genesis_sanity_check() { - // Note: Generate new data for `pub fn get_stagenet_genesis_block()` and `fn get_stagenet_genesis_block_raw()` - // if consensus values change, e.g. new faucet or other - let block = get_stagenet_genesis_block(); - check_block(Network::StageNet, &block, 100, 1); - } - - #[test] + #[cfg(tari_target_network_nextnet)] fn nextnet_genesis_sanity_check() { // Note: Generate new data for `pub fn get_nextnet_genesis_block()` and `fn get_stagenet_genesis_block_raw()` // if consensus values change, e.g. new faucet or other @@ -399,11 +393,13 @@ mod test { } #[test] - fn esmeralda_genesis_sanity_check() { + #[cfg(tari_target_network_mainnet)] + fn stagenet_genesis_sanity_check() { + Network::set_current(Network::StageNet).unwrap(); // Note: Generate new data for `pub fn get_esmeralda_genesis_block()` and `fn get_esmeralda_genesis_block_raw()` // if consensus values change, e.g. new faucet or other - let block = get_esmeralda_genesis_block(); - check_block(Network::Esmeralda, &block, 100, 1); + let block = get_stagenet_genesis_block(); + check_block(Network::StageNet, &block, 100, 1); } #[test] diff --git a/base_layer/core/src/consensus/consensus_constants.rs b/base_layer/core/src/consensus/consensus_constants.rs index d5729296ac..8704f446b6 100644 --- a/base_layer/core/src/consensus/consensus_constants.rs +++ b/base_layer/core/src/consensus/consensus_constants.rs @@ -31,12 +31,14 @@ use tari_common_types::epoch::VnEpoch; use tari_script::{script, OpcodeVersion}; use tari_utilities::epoch_time::EpochTime; +#[cfg(not(tari_feature_mainnet_emission))] +use crate::transactions::tari_amount::T; use crate::{ borsh::SerializedSize, consensus::network::NetworkConsensus, proof_of_work::{Difficulty, PowAlgorithm}, transactions::{ - tari_amount::{uT, MicroMinotari, T}, + tari_amount::{uT, MicroMinotari}, transaction_components::{ OutputFeatures, OutputFeaturesVersion, @@ -50,6 +52,8 @@ use crate::{ }, }; +#[cfg(tari_feature_mainnet_emission)] +const ANNUAL_BLOCKS: u64 = 30 /* blocks/hr */ * 24 /* hr /d */ * 366 /* days / yr */; /// This is the inner struct used to control all consensus values. #[derive(Debug, Clone)] pub struct ConsensusConstants { @@ -78,7 +82,14 @@ pub struct ConsensusConstants { /// would be 1/4 pub(in crate::consensus) emission_decay: &'static [u64], /// This is the emission curve tail amount + #[cfg(not(tari_feature_mainnet_emission))] pub(in crate::consensus) emission_tail: MicroMinotari, + /// The tail emission inflation rate in bips + #[cfg(tari_feature_mainnet_emission)] + pub(in crate::consensus) inflation_bips: u64, + /// The length, in blocks of each tail emission epoch (where the reward is held constant) + #[cfg(tari_feature_mainnet_emission)] + pub(in crate::consensus) tail_epoch_length: u64, /// This is the maximum age a Monero merge mined seed can be reused /// Monero forces a change every height mod 2048 blocks max_randomx_seed_height: u64, @@ -166,10 +177,22 @@ impl ConsensusConstants { } /// This gets the emission curve values as (initial, decay, tail) + #[cfg(not(tari_feature_mainnet_emission))] pub fn emission_amounts(&self) -> (MicroMinotari, &'static [u64], MicroMinotari) { (self.emission_initial, self.emission_decay, self.emission_tail) } + /// This gets the emission curve values as (initial, decay, inflation_bips, epoch_length) + #[cfg(tari_feature_mainnet_emission)] + pub fn emission_amounts(&self) -> (MicroMinotari, &'static [u64], u64, u64) { + ( + self.emission_initial, + self.emission_decay, + self.inflation_bips, + self.tail_epoch_length, + ) + } + /// The min height maturity a coinbase utxo must have. pub fn coinbase_min_maturity(&self) -> u64 { self.coinbase_min_maturity @@ -380,7 +403,12 @@ impl ConsensusConstants { median_timestamp_count: 11, emission_initial: 18_462_816_327 * uT, emission_decay: &ESMERALDA_DECAY_PARAMS, + #[cfg(not(tari_feature_mainnet_emission))] emission_tail: 800 * T, + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: 10, + #[cfg(tari_feature_mainnet_emission)] + tail_epoch_length: 100, max_randomx_seed_height: u64::MAX, max_extra_field_size: 200, proof_of_work: algos, @@ -443,7 +471,12 @@ impl ConsensusConstants { median_timestamp_count: 11, emission_initial: 5_538_846_115 * uT, emission_decay: &EMISSION_DECAY, + #[cfg(not(tari_feature_mainnet_emission))] emission_tail: 100.into(), + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: 1, + #[cfg(tari_feature_mainnet_emission)] + tail_epoch_length: ANNUAL_BLOCKS, max_randomx_seed_height: u64::MAX, max_extra_field_size: 200, proof_of_work: algos, @@ -499,7 +532,12 @@ impl ConsensusConstants { median_timestamp_count: 11, emission_initial: ESMERALDA_INITIAL_EMISSION, emission_decay: &ESMERALDA_DECAY_PARAMS, + #[cfg(not(tari_feature_mainnet_emission))] emission_tail: 800 * T, + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: 1, + #[cfg(tari_feature_mainnet_emission)] + tail_epoch_length: ANNUAL_BLOCKS, max_randomx_seed_height: 3000, max_extra_field_size: 200, proof_of_work: algos, @@ -554,7 +592,12 @@ impl ConsensusConstants { median_timestamp_count: 11, emission_initial: INITIAL_EMISSION, emission_decay: &EMISSION_DECAY, + #[cfg(not(tari_feature_mainnet_emission))] emission_tail: 800 * T, + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: 1, + #[cfg(tari_feature_mainnet_emission)] + tail_epoch_length: ANNUAL_BLOCKS, max_randomx_seed_height: 3000, max_extra_field_size: 200, proof_of_work: algos, @@ -603,7 +646,12 @@ impl ConsensusConstants { median_timestamp_count: 11, emission_initial: INITIAL_EMISSION, emission_decay: &EMISSION_DECAY, + #[cfg(not(tari_feature_mainnet_emission))] emission_tail: 800 * T, + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: 1, + #[cfg(tari_feature_mainnet_emission)] + tail_epoch_length: ANNUAL_BLOCKS, max_randomx_seed_height: 3000, max_extra_field_size: 200, proof_of_work: algos, @@ -654,7 +702,12 @@ impl ConsensusConstants { median_timestamp_count: 11, emission_initial: 10_000_000.into(), emission_decay: &EMISSION_DECAY, + #[cfg(not(tari_feature_mainnet_emission))] emission_tail: 100.into(), + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: 1, + #[cfg(tari_feature_mainnet_emission)] + tail_epoch_length: ANNUAL_BLOCKS, max_randomx_seed_height: u64::MAX, max_extra_field_size: 200, proof_of_work: algos, @@ -835,11 +888,21 @@ impl ConsensusConstantsBuilder { mut self, intial_amount: MicroMinotari, decay: &'static [u64], - tail_amount: MicroMinotari, + #[cfg(not(tari_feature_mainnet_emission))] tail_amount: MicroMinotari, + #[cfg(tari_feature_mainnet_emission)] inflation_bips: u64, + #[cfg(tari_feature_mainnet_emission)] epoch_length: u64, ) -> Self { self.consensus.emission_initial = intial_amount; self.consensus.emission_decay = decay; - self.consensus.emission_tail = tail_amount; + #[cfg(not(tari_feature_mainnet_emission))] + { + self.consensus.emission_tail = tail_amount; + } + #[cfg(tari_feature_mainnet_emission)] + { + self.consensus.inflation_bips = inflation_bips; + self.consensus.tail_epoch_length = epoch_length; + } self } @@ -868,6 +931,7 @@ impl ConsensusConstantsBuilder { #[cfg(test)] mod test { + #[cfg(not(tari_feature_mainnet_emission))] use std::convert::TryFrom; use crate::{ @@ -935,6 +999,7 @@ mod test { } #[test] + #[cfg(not(tari_feature_mainnet_emission))] fn esmeralda_schedule() { let esmeralda = ConsensusConstants::esmeralda(); let schedule = EmissionSchedule::new( @@ -970,41 +1035,7 @@ mod test { } #[test] - fn nextnet_schedule() { - let nextnet = ConsensusConstants::nextnet(); - let schedule = EmissionSchedule::new( - nextnet[0].emission_initial, - nextnet[0].emission_decay, - nextnet[0].emission_tail, - ); - // No genesis block coinbase - assert_eq!(schedule.block_reward(0), MicroMinotari(0)); - // Coinbases starts at block 1 - let coinbase_offset = 1; - let first_reward = schedule.block_reward(coinbase_offset); - assert_eq!(first_reward, nextnet[0].emission_initial * uT); - assert_eq!(schedule.supply_at_block(coinbase_offset), first_reward); - // 'half_life_block' at approximately '(total supply - faucet value) / 2' - #[allow(clippy::cast_possible_truncation)] - let half_life_block = (365.0 * 24.0 * 30.0 * 2.76) as u64; - assert_eq!( - schedule.supply_at_block(half_life_block + coinbase_offset), - 7_483_280_506_356_578 * uT - ); - // Tail emission starts after block 3,255,552 + coinbase_offset - let mut rewards = schedule - .iter() - .skip(3255552 + usize::try_from(coinbase_offset).unwrap()); - let (block_num, reward, supply) = rewards.next().unwrap(); - assert_eq!(block_num, 3255553 + coinbase_offset); - assert_eq!(reward, 800_000_415 * uT); - let total_supply_up_to_tail_emission = supply + nextnet[0].faucet_value; - assert_eq!(total_supply_up_to_tail_emission, 20_999_999_999_819_869 * uT); - let (_, reward, _) = rewards.next().unwrap(); - assert_eq!(reward, nextnet[0].emission_tail); - } - - #[test] + #[cfg(not(tari_feature_mainnet_emission))] fn stagenet_schedule() { let stagenet = ConsensusConstants::stagenet(); let schedule = EmissionSchedule::new( @@ -1039,33 +1070,6 @@ mod test { assert_eq!(reward, stagenet[0].emission_tail); } - #[test] - fn igor_schedule() { - let igor = ConsensusConstants::igor(); - let schedule = EmissionSchedule::new(igor[0].emission_initial, igor[0].emission_decay, igor[0].emission_tail); - // No genesis block coinbase - assert_eq!(schedule.block_reward(0), MicroMinotari(0)); - // Coinbases starts at block 1 - let coinbase_offset = 1; - let first_reward = schedule.block_reward(coinbase_offset); - assert_eq!(first_reward, igor[0].emission_initial * uT); - assert_eq!(schedule.supply_at_block(coinbase_offset), first_reward); - // Tail emission starts after block 11_084_819 - let rewards = schedule.iter().skip(11_084_819 - 25); - let mut previous_reward = MicroMinotari(0); - for (block_num, reward, supply) in rewards { - if reward == previous_reward { - assert_eq!(block_num, 11_084_819 + 1); - assert_eq!(supply, MicroMinotari(6_326_198_792_915_738)); - // These set of constants does not result in a tail emission equal to the specified tail emission - assert_ne!(reward, igor[0].emission_tail); - assert_eq!(reward, MicroMinotari(2_097_151)); - break; - } - previous_reward = reward; - } - } - // This function is to ensure all OutputType variants are assessed in the tests fn cycle_output_type_enum(output_type: OutputType) -> OutputType { match output_type { diff --git a/base_layer/core/src/consensus/consensus_manager.rs b/base_layer/core/src/consensus/consensus_manager.rs index e315848c9f..57cd30fd06 100644 --- a/base_layer/core/src/consensus/consensus_manager.rs +++ b/base_layer/core/src/consensus/consensus_manager.rs @@ -82,9 +82,7 @@ impl ConsensusManager { } } - /// Get a pointer to the emission schedule - /// The height provided here, decides the emission curve to use. It swaps to the integer curve upon reaching - /// 1_000_000_000 + /// Get a reference to the emission parameters pub fn emission_schedule(&self) -> &EmissionSchedule { &self.inner.emission } @@ -238,11 +236,22 @@ impl ConsensusManagerBuilder { self.consensus_constants = self.network.create_consensus_constants(); } + #[cfg(not(tari_feature_mainnet_emission))] let emission = EmissionSchedule::new( self.consensus_constants[0].emission_initial, self.consensus_constants[0].emission_decay, self.consensus_constants[0].emission_tail, ); + + #[cfg(tari_feature_mainnet_emission)] + let emission = EmissionSchedule::new( + self.consensus_constants[0].emission_initial, + self.consensus_constants[0].emission_decay, + self.consensus_constants[0].inflation_bips, + self.consensus_constants[0].tail_epoch_length, + self.consensus_constants[0].faucet_value(), + ); + let inner = ConsensusManagerInner { consensus_constants: self.consensus_constants, network: self.network, diff --git a/base_layer/core/src/consensus/emission.rs b/base_layer/core/src/consensus/emission.rs index d6cfc671bc..70ec7313c4 100644 --- a/base_layer/core/src/consensus/emission.rs +++ b/base_layer/core/src/consensus/emission.rs @@ -20,8 +20,6 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::cmp; - use crate::transactions::tari_amount::MicroMinotari; pub trait Emission { @@ -29,32 +27,55 @@ pub trait Emission { fn supply_at_block(&self, height: u64) -> MicroMinotari; } -/// The Minotari emission schedule. The emission schedule determines how much Minotari is mined as a block reward at -/// every block. -/// -/// NB: We don't know what the final emission schedule will be on Minotari yet, so do not give any weight to values or -/// formulae provided in this file, they will almost certainly change ahead of main-net release. +/// The Minotari emission schedule with constant tail emission. The emission schedule determines how much Minotari is +/// mined as a block reward at every block. #[derive(Debug, Clone)] pub struct EmissionSchedule { initial: MicroMinotari, decay: &'static [u64], + #[cfg(not(tari_feature_mainnet_emission))] tail: MicroMinotari, + #[cfg(tari_feature_mainnet_emission)] + inflation_bips: u64, + #[cfg(tari_feature_mainnet_emission)] + epoch_length: u64, // The number of blocks in an inflation epoch + #[cfg(tari_feature_mainnet_emission)] + initial_supply: MicroMinotari, // The supply at block 0, from faucets or premine } impl EmissionSchedule { /// Create a new emission schedule instance. /// - /// The Emission schedule follows a similar pattern to Monero; with an exponentially decaying emission rate with - /// a constant tail emission rate. + /// ## Primary emission schedule + /// + /// The Emission schedule follows a similar pattern to Monero; with an initially exponentially decaying emission + /// rate and a tail emission. /// - /// The block reward is given by - /// $$ r_n = \mathrm{MAX}(\mathrm(intfloor(r_{n-1} * (1 - \epsilon)), t) n > 0 $$ + /// + /// The decay portion is given by + /// $$ r_n = \lfloor r_{n-1} * (1 - \epsilon) \rfloor, n > 0 $$ /// $$ r_0 = A_0 $$ /// /// where /// * $$A_0$$ is the genesis block reward /// * $$1 - \epsilon$$ is the decay rate - /// * $$t$$ is the constant tail emission rate + /// + /// The decay parameters are determined as described in [#decay_parameters]. + /// + /// ## Tail emission + /// + /// If the feature `mainnet_emission` is not enabled, the tail emission is constant. It is triggered if the reward + /// would fall below the `tail` value. + /// + /// If the feature `mainnet_emission` is enabled, the tail emission is calculated as follows: + /// + /// At each block, the reward is multiplied by `EPOCH_LENGTH` (approximately a year's worth of blocks) to + /// calculate `annual_supply`. + /// If `annual_supply/current_supply` is less than `0.01*inflation_bips`% then we enter tail emission mode. + /// + /// Every `EPOCH_LENGTH` blocks, the inflation rate is recalculated based on the current supply. + /// + /// ## Decay parameters /// /// The `intfloor` function is an integer-math-based multiplication of an integer by a fraction that's very close /// to one (e.g. 0.998,987,123,432)` that @@ -97,12 +118,29 @@ impl EmissionSchedule { /// /// The shift right operation will overflow if shifting more than 63 bits. `new` will panic if any of the decay /// values are greater than or equal to 64. - pub fn new(initial: MicroMinotari, decay: &'static [u64], tail: MicroMinotari) -> EmissionSchedule { + pub fn new( + initial: MicroMinotari, + decay: &'static [u64], + #[cfg(not(tari_feature_mainnet_emission))] tail: MicroMinotari, + #[cfg(tari_feature_mainnet_emission)] inflation_bips: u64, + #[cfg(tari_feature_mainnet_emission)] epoch_length: u64, + #[cfg(tari_feature_mainnet_emission)] initial_supply: MicroMinotari, + ) -> EmissionSchedule { assert!( decay.iter().all(|i| *i < 64), "Decay value would overflow. All `decay` values must be less than 64" ); - EmissionSchedule { initial, decay, tail } + #[cfg(not(tari_feature_mainnet_emission))] + let params = EmissionSchedule { initial, decay, tail }; + #[cfg(tari_feature_mainnet_emission)] + let params = EmissionSchedule { + initial, + decay, + inflation_bips, + epoch_length, + initial_supply, + }; + params } /// Utility function to calculate the decay parameters that are provided in [EmissionSchedule::new]. This function @@ -113,7 +151,7 @@ impl EmissionSchedule { /// /// Input : `k`: A string representing a floating point number of (nearly) arbitrary precision, and less than one. /// - /// Returns: An array of powers of negative two when when applied as a shift right and sum operation is very + /// Returns: An array of powers of negative two when applied as a shift right and sum operation is very /// close to (1-k)*n. /// /// None - If k is not a valid floating point number less than one. @@ -173,18 +211,6 @@ impl EmissionSchedule { /// the emission curve if you're interested in the supply as well as the reward. /// /// This is an infinite iterator, and each value returned is a tuple of (block number, reward, and total supply) - /// - /// ```edition2018 - /// use tari_core::{ - /// consensus::emission::EmissionSchedule, - /// transactions::tari_amount::MicroMinotari, - /// }; - /// // Print the reward and supply for first 100 blocks - /// let schedule = EmissionSchedule::new(10.into(), &[3], 1.into()); - /// for (n, reward, supply) in schedule.iter().take(100) { - /// println!("{:3} {:9} {:9}", n, reward, supply); - /// } - /// ``` pub fn iter(&self) -> EmissionRate { EmissionRate::new(self) } @@ -203,15 +229,26 @@ pub struct EmissionRate<'a> { supply: MicroMinotari, reward: MicroMinotari, schedule: &'a EmissionSchedule, + #[cfg(tari_feature_mainnet_emission)] + epoch: u64, + #[cfg(tari_feature_mainnet_emission)] + epoch_counter: u64, } impl<'a> EmissionRate<'a> { fn new(schedule: &'a EmissionSchedule) -> EmissionRate<'a> { EmissionRate { block_num: 0, + #[cfg(not(tari_feature_mainnet_emission))] supply: MicroMinotari(0), + #[cfg(tari_feature_mainnet_emission)] + supply: schedule.initial_supply, reward: MicroMinotari(0), schedule, + #[cfg(tari_feature_mainnet_emission)] + epoch: 0, + #[cfg(tari_feature_mainnet_emission)] + epoch_counter: 0, } } @@ -227,21 +264,54 @@ impl<'a> EmissionRate<'a> { self.reward } + fn next_decay_reward(&self) -> MicroMinotari { + let r = self.reward.as_u64(); + self.schedule + .decay + .iter() + .fold(self.reward, |sum, i| sum - MicroMinotari::from(r >> *i)) + } + /// Calculates the next reward by multiplying the decay factor by the previous block reward using integer math. /// /// We write the decay factor, 1 - k, as a sum of fraction powers of two. e.g. if we wanted 0.25 as our k, then /// (1-k) would be 0.75 = 1/2 plus 1/4 (1/2^2). /// /// Then we calculate k.R = (1 - e).R = R - e.R = R - (0.5 * R + 0.25 * R) = R - R >> 1 - R >> 2 - fn next_reward(&self) -> MicroMinotari { - let r = self.reward.as_u64(); - let next = self - .schedule - .decay - .iter() - .fold(self.reward, |sum, i| sum - MicroMinotari::from(r >> *i)); + #[cfg(not(tari_feature_mainnet_emission))] + fn next_reward(&mut self) { + let reward = std::cmp::max(self.next_decay_reward(), self.schedule.tail); + self.reward = reward; + } - cmp::max(next, self.schedule.tail) + #[cfg(tari_feature_mainnet_emission)] + fn new_tail_emission(&self) -> MicroMinotari { + let epoch_issuance = self.supply / 100 * self.schedule.inflation_bips; + let reward = epoch_issuance / self.schedule.epoch_length; // in uT + (reward / 1_000_000) * 1_000_000 // truncate to nearest whole XTR + } + + #[cfg(tari_feature_mainnet_emission)] + fn next_reward(&mut self) { + // Inflation phase + if self.epoch > 0 { + self.epoch_counter += 1; + if self.epoch_counter >= self.schedule.epoch_length { + self.epoch_counter = 0; + self.epoch += 1; + self.reward = self.new_tail_emission(); + } + } else { + // Decay phase + let cutoff = self.new_tail_emission(); + let next_decay_reward = self.next_decay_reward(); + if self.epoch == 0 && next_decay_reward > cutoff { + self.reward = next_decay_reward; + } else { + self.epoch = 1; + self.reward = cutoff; + } + } } } @@ -252,11 +322,11 @@ impl Iterator for EmissionRate<'_> { self.block_num += 1; if self.block_num == 1 { self.reward = self.schedule.initial; - self.supply = self.schedule.initial; + self.supply = self.supply.checked_add(self.reward)?; return Some((self.block_num, self.reward, self.supply)); } - self.reward = self.next_reward(); - // Once we've reached max supply, the iterator is done + self.next_reward(); // Has side effect + // Once we've reached max supply, the iterator is done self.supply = self.supply.checked_add(self.reward)?; Some((self.block_num, self.reward, self.supply)) } @@ -280,12 +350,15 @@ impl Emission for EmissionSchedule { #[cfg(test)] mod test { + #[cfg(not(tari_feature_mainnet_emission))] + use crate::consensus::emission::Emission; use crate::{ - consensus::emission::{Emission, EmissionSchedule}, - transactions::tari_amount::{uT, MicroMinotari, T}, + consensus::emission::EmissionSchedule, + transactions::tari_amount::{MicroMinotari, T}, }; #[test] + #[cfg(not(tari_feature_mainnet_emission))] fn schedule() { let schedule = EmissionSchedule::new( MicroMinotari::from(10_000_100), @@ -302,6 +375,70 @@ mod test { } #[test] + #[cfg(tari_feature_mainnet_emission)] + fn mainnet_emission() { + let epoch_length = 30 * 24 * 366; + let halflife = 3 * 30 * 24 * 365; + let a0 = MicroMinotari::from(12_923_971_428); + let decay = &[21u64, 22, 23, 25, 26, 37, 38, 40]; + let premine = 6_300_000_000 * T; + let schedule = EmissionSchedule::new(a0, decay, 1, epoch_length, premine); + let mut iter = schedule.iter(); + assert_eq!(iter.block_num, 0); + assert_eq!(iter.reward, MicroMinotari::from(0)); + assert_eq!(iter.supply, premine); + let (num, reward, supply) = iter.next().unwrap(); + // Block 1 + assert_eq!(num, 1); + assert_eq!(reward, MicroMinotari::from(12_923_971_428)); + assert_eq!(supply, MicroMinotari::from(6_300_012_923_971_428)); + // Block 2 + let (num, reward, supply) = iter.next().unwrap(); + assert_eq!(num, 2); + assert_eq!(reward, MicroMinotari::from(12_923_960_068)); + assert_eq!(supply, MicroMinotari::from(6_300_025_847_931_496)); + + // Block 788,400. 50% Mined + let mut iter = iter.skip_while(|(num, _, _)| *num < halflife); + let (num, reward, supply) = iter.next().unwrap(); + assert_eq!(num, halflife); + assert_eq!(reward.as_u64(), 6_463_480_936); + let total_supply = 21_000_000_000 * T - premine; + let residual = (supply - premine) * 2 - total_supply; + // Within 0.01% of mining half the total supply + assert!(residual < total_supply / 10000, "Residual: {}", residual); + // Head to tail emission + let mut iter = iter.skip_while(|(num, _, _)| *num < 3_220_980); + let (num, reward, supply) = iter.next().unwrap(); + assert_eq!(num, 3_220_980); + assert_eq!(reward, MicroMinotari::from(764_000_449)); + assert_eq!(supply, MicroMinotari::from(20_140_382_328_948_420)); + let (num, reward, _) = iter.next().unwrap(); + assert_eq!(num, 3_220_981); + assert_eq!(reward, 764 * T); + let (num, reward, _) = iter.next().unwrap(); + assert_eq!(num, 3_220_982); + assert_eq!(reward, 764 * T); + // Next boosting + let mut iter = iter.skip((epoch_length - 3) as usize); + let (num, reward, supply) = iter.next().unwrap(); + assert_eq!(num, 3_484_500); + assert_eq!(reward, 764 * T); + assert_eq!(supply, MicroMinotari::from(20_341_711_608_948_420)); + let (num, reward, _) = iter.next().unwrap(); + assert_eq!(num, 3_484_501); + assert_eq!(reward, 771 * T); + let (num, reward, supply) = iter.next().unwrap(); + assert_eq!(num, 3_484_502); + assert_eq!(reward, 771 * T); + // Check supply inflation. Because of rounding, it could be between 98 and 100 bips + let epoch_supply = 771 * T * epoch_length; + let inflation = (10000 * epoch_supply / supply).as_u64(); // 1 bip => 100 + assert!(inflation < 100 && inflation > 98, "Inflation: {} bips", inflation); + } + + #[test] + #[cfg(not(tari_feature_mainnet_emission))] fn huge_block_number() { // let mut n = (std::i32::MAX - 1) as u64; let height = 262_800_000; // 1000 years' problem @@ -315,6 +452,7 @@ mod test { } #[test] + #[cfg(not(tari_feature_mainnet_emission))] fn generate_emission_schedule_as_iterator() { const INITIAL: u64 = 10_000_100; let schedule = EmissionSchedule::new( @@ -355,7 +493,9 @@ mod test { #[test] #[allow(clippy::identity_op)] + #[cfg(not(tari_feature_mainnet_emission))] fn emission() { + use crate::transactions::tari_amount::uT; let emission = EmissionSchedule::new(1 * T, &[1, 2], 100 * uT); let mut emission = emission.iter(); // decay is 1 - 0.25 - 0.125 = 0.625 diff --git a/base_layer/core/src/proof_of_work/sha3x_pow.rs b/base_layer/core/src/proof_of_work/sha3x_pow.rs index 783e642c41..c1953826b2 100644 --- a/base_layer/core/src/proof_of_work/sha3x_pow.rs +++ b/base_layer/core/src/proof_of_work/sha3x_pow.rs @@ -96,6 +96,7 @@ pub mod test { } #[test] + #[cfg(tari_target_network_testnet)] fn validate_max_target() { let mut header = get_header(); header.nonce = 631; diff --git a/base_layer/core/src/transactions/coinbase_builder.rs b/base_layer/core/src/transactions/coinbase_builder.rs index c8ae1811ab..cb2f27087f 100644 --- a/base_layer/core/src/transactions/coinbase_builder.rs +++ b/base_layer/core/src/transactions/coinbase_builder.rs @@ -662,7 +662,7 @@ mod test { let block_reward = rules.emission_schedule().block_reward(42) + missing_fee; let builder = CoinbaseBuilder::new(key_manager.clone()); let builder = builder - .with_block_height(4200000) + .with_block_height(4_200_000) .with_fees(1 * uT) .with_spend_key_id(p.spend_key_id.clone()) .with_encryption_key_id(TariKeyId::default()) diff --git a/base_layer/core/src/transactions/transaction_components/test.rs b/base_layer/core/src/transactions/transaction_components/test.rs index d68ca986a7..a4b55b580b 100644 --- a/base_layer/core/src/transactions/transaction_components/test.rs +++ b/base_layer/core/src/transactions/transaction_components/test.rs @@ -291,6 +291,17 @@ fn kernel_hash() { .with_lock_height(500) .build() .unwrap(); + #[cfg(tari_target_network_nextnet)] + assert_eq!( + &k.hash().to_hex(), + "c1f6174935d08358809fcf244a9a1edb078b74a1ae18ab4c7dd501b0294a2a94" + ); + #[cfg(tari_target_network_mainnet)] + assert_eq!( + &k.hash().to_hex(), + "b94992cb59695ebad3786e9f51a220e91c627f8b38f51bcf6c87297325d1b410" + ); + #[cfg(tari_target_network_testnet)] assert_eq!( &k.hash().to_hex(), "38b03d013f941e86c027969fbbc190ca2a28fa2d7ac075d50dbfb6232deee646" @@ -310,10 +321,21 @@ fn kernel_metadata() { .with_lock_height(500) .build() .unwrap(); + #[cfg(tari_target_network_mainnet)] + assert_eq!( + &k.hash().to_hex(), + "75a357c2769098b19a6aedc7e46f6be305f4f1a1831556cd380b0b0f20bfdf12" + ); + #[cfg(tari_target_network_nextnet)] + assert_eq!( + &k.hash().to_hex(), + "22e39392dfeae9653c73437880be71e99f4b8a2b23289d54f57b8931deebfeed" + ); + #[cfg(tari_target_network_testnet)] assert_eq!( &k.hash().to_hex(), "ebc852fbac798c25ce497b416f69ec11a97e186aacaa10e2bb4ca5f5a0f197f2" - ) + ); } #[test] diff --git a/base_layer/core/src/validation/chain_balance.rs b/base_layer/core/src/validation/chain_balance.rs index ff69eb2e60..4059608ada 100644 --- a/base_layer/core/src/validation/chain_balance.rs +++ b/base_layer/core/src/validation/chain_balance.rs @@ -92,8 +92,14 @@ impl ChainBalanceValidator { } fn get_emission_commitment_at(&self, height: u64) -> Commitment { - let total_supply = - self.rules.get_total_emission_at(height) + self.rules.consensus_constants(height).faucet_value(); + // With inflating tail emission, we **must** know the value of the premine as part of the supply calc in order + // to determine the correct inflation curve. So we need to include the premine in the emission curve. + let total_supply = self.rules.get_total_emission_at(height) + + if cfg!(tari_feature_mainnet_emission) { + MicroMinotari::from(0) + } else { + self.rules.consensus_constants(height).faucet_value() + }; debug!( target: LOG_TARGET, "Expected emission at height {} is {}", height, total_supply diff --git a/base_layer/core/src/validation/test.rs b/base_layer/core/src/validation/test.rs index b4a1748d3f..e2204bc715 100644 --- a/base_layer/core/src/validation/test.rs +++ b/base_layer/core/src/validation/test.rs @@ -353,7 +353,9 @@ async fn chain_balance_validation() { #[allow(clippy::too_many_lines)] async fn chain_balance_validation_burned() { let factories = CryptoFactories::default(); - let consensus_manager = ConsensusManagerBuilder::new(Network::Esmeralda).build().unwrap(); + let network = Network::get_current_or_default(); + eprintln!("Network: {:?}", network); + let consensus_manager = ConsensusManagerBuilder::new(network).build().unwrap(); let genesis = consensus_manager.get_genesis_block(); let faucet_value = 5000 * uT; let key_manager = create_memory_db_key_manager(); diff --git a/base_layer/core/tests/helpers/sample_blockchains.rs b/base_layer/core/tests/helpers/sample_blockchains.rs index a958186ec3..ca03ddbaf0 100644 --- a/base_layer/core/tests/helpers/sample_blockchains.rs +++ b/base_layer/core/tests/helpers/sample_blockchains.rs @@ -170,6 +170,20 @@ pub async fn create_blockchain_db_no_cut_through() -> ( (db, blocks, outputs, consensus_manager, key_manager) } +#[cfg(not(tari_feature_mainnet_emission))] +pub fn consensus_constants(network: Network) -> ConsensusConstantsBuilder { + ConsensusConstantsBuilder::new(network) + .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) + .with_coinbase_lockheight(1) +} + +#[cfg(tari_feature_mainnet_emission)] +pub fn consensus_constants(network: Network) -> ConsensusConstantsBuilder { + ConsensusConstantsBuilder::new(network) + .with_emission_amounts(100_000_000.into(), &EMISSION, 10, 1000) + .with_coinbase_lockheight(1) +} + /// Create a new blockchain database containing only the Genesis block #[allow(dead_code)] pub async fn create_new_blockchain( @@ -182,10 +196,7 @@ pub async fn create_new_blockchain( MemoryDbKeyManager, ) { let key_manager = create_memory_db_key_manager(); - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .with_coinbase_lockheight(1) - .build(); + let consensus_constants = consensus_constants(network).build(); let (block0, output) = create_genesis_block(&consensus_constants, &key_manager).await; let consensus_manager = ConsensusManagerBuilder::new(network) .add_consensus_constants(consensus_constants) @@ -243,10 +254,7 @@ pub async fn create_new_blockchain_lmdb( MemoryDbKeyManager, ) { let key_manager = create_memory_db_key_manager(); - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .with_coinbase_lockheight(1) - .build(); + let consensus_constants = consensus_constants(network).build(); let (block0, output) = create_genesis_block(&consensus_constants, &key_manager).await; let consensus_manager = ConsensusManagerBuilder::new(network) .add_consensus_constants(consensus_constants) diff --git a/base_layer/core/tests/helpers/sync.rs b/base_layer/core/tests/helpers/sync.rs index a15cf7981f..93a77d1fbc 100644 --- a/base_layer/core/tests/helpers/sync.rs +++ b/base_layer/core/tests/helpers/sync.rs @@ -43,7 +43,7 @@ use tari_core::{ }, blocks::ChainBlock, chain_storage::{BlockchainDatabaseConfig, DbTransaction}, - consensus::{ConsensusConstantsBuilder, ConsensusManager, ConsensusManagerBuilder}, + consensus::{ConsensusManager, ConsensusManagerBuilder}, mempool::MempoolServiceConfig, proof_of_work::{randomx_factory::RandomXFactory, Difficulty}, test_helpers::blockchain::TempDatabase, @@ -64,10 +64,9 @@ use tokio::sync::{broadcast, watch}; use crate::helpers::{ block_builders::{append_block, create_genesis_block}, nodes::{create_network_with_multiple_base_nodes_with_config, NodeInterfaces}, + sample_blockchains, }; -static EMISSION: [u64; 2] = [10, 10]; - /// Helper function to initialize header sync with a single peer pub fn initialize_sync_headers_with_ping_pong_data( local_node_interfaces: &NodeInterfaces, @@ -152,9 +151,7 @@ pub async fn create_network_with_multiple_nodes( let network = Network::LocalNet; let temp_dir = tempdir().unwrap(); let key_manager = create_memory_db_key_manager(); - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .build(); + let consensus_constants = sample_blockchains::consensus_constants(network).build(); let (initial_block, coinbase_wallet_output) = create_genesis_block(&consensus_constants, &key_manager).await; let consensus_manager = ConsensusManagerBuilder::new(network) .add_consensus_constants(consensus_constants) diff --git a/base_layer/core/tests/tests/mempool.rs b/base_layer/core/tests/tests/mempool.rs index 8601ea4c95..ed9b11a165 100644 --- a/base_layer/core/tests/tests/mempool.rs +++ b/base_layer/core/tests/tests/mempool.rs @@ -1036,16 +1036,14 @@ async fn test_reorg() { mempool.process_reorg(vec![], vec![reorg_block4.into()]).await.unwrap(); } -static EMISSION: [u64; 2] = [10, 10]; #[tokio::test(flavor = "multi_thread", worker_threads = 1)] #[allow(clippy::too_many_lines)] #[allow(clippy::identity_op)] async fn receive_and_propagate_transaction() { let temp_dir = tempdir().unwrap(); let network = Network::LocalNet; - let consensus_constants = ConsensusConstantsBuilder::new(network) + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network) .with_coinbase_lockheight(100) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) .build(); let key_manager = create_memory_db_key_manager(); let (block0, utxo) = create_genesis_block(&consensus_constants, &key_manager).await; @@ -1172,9 +1170,7 @@ async fn receive_and_propagate_transaction() { async fn consensus_validation_large_tx() { let network = Network::LocalNet; // We dont want to compute the 19500 limit of local net, so we create smaller blocks - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .with_coinbase_lockheight(1) + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network) .with_max_block_transaction_weight(500) .build(); let (mut store, mut blocks, mut outputs, consensus_manager, key_manager) = @@ -1357,9 +1353,7 @@ async fn consensus_validation_large_tx() { async fn validation_reject_min_fee() { let network = Network::LocalNet; // We dont want to compute the 19500 limit of local net, so we create smaller blocks - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .with_coinbase_lockheight(1) + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network) .with_max_block_transaction_weight(500) .build(); let (mut store, mut blocks, mut outputs, consensus_manager, key_manager) = diff --git a/base_layer/core/tests/tests/node_service.rs b/base_layer/core/tests/tests/node_service.rs index c03a0d7b23..cc36517d53 100644 --- a/base_layer/core/tests/tests/node_service.rs +++ b/base_layer/core/tests/tests/node_service.rs @@ -32,7 +32,7 @@ use tari_core::{ }, blocks::{ChainBlock, NewBlock}, chain_storage::BlockchainDatabaseConfig, - consensus::{ConsensusConstantsBuilder, ConsensusManager, ConsensusManagerBuilder, NetworkConsensus}, + consensus::{ConsensusManager, ConsensusManagerBuilder, NetworkConsensus}, mempool::TxStorageResponse, proof_of_work::{randomx_factory::RandomXFactory, Difficulty, PowAlgorithm}, transactions::{ @@ -88,9 +88,7 @@ async fn propagate_and_forward_many_valid_blocks() { let carol_node_identity = random_node_identity(); let dan_node_identity = random_node_identity(); let network = Network::LocalNet; - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .build(); + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network).build(); let (block0, outputs) = create_genesis_block_with_utxos(&[T, T], &consensus_constants, &key_manager).await; let (tx01, _tx01_out) = spend_utxos( @@ -222,7 +220,6 @@ async fn propagate_and_forward_many_valid_blocks() { dan_node.shutdown().await; } -static EMISSION: [u64; 2] = [10, 10]; #[tokio::test(flavor = "multi_thread", worker_threads = 1)] #[allow(clippy::too_many_lines)] async fn propagate_and_forward_invalid_block_hash() { @@ -237,9 +234,7 @@ async fn propagate_and_forward_invalid_block_hash() { let carol_node_identity = random_node_identity(); let network = Network::LocalNet; let key_manager = create_memory_db_key_manager(); - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .build(); + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network).build(); let (block0, genesis_coinbase) = create_genesis_block(&consensus_constants, &key_manager).await; let rules = ConsensusManager::builder(network) .add_consensus_constants(consensus_constants) @@ -370,9 +365,7 @@ async fn propagate_and_forward_invalid_block() { let dan_node_identity = random_node_identity(); let key_manager = create_memory_db_key_manager(); let network = Network::LocalNet; - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .build(); + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network).build(); let (block0, _) = create_genesis_block(&consensus_constants, &key_manager).await; let rules = ConsensusManager::builder(network) .add_consensus_constants(consensus_constants) diff --git a/base_layer/core/tests/tests/node_state_machine.rs b/base_layer/core/tests/tests/node_state_machine.rs index 01761fba4f..0ba6678eb9 100644 --- a/base_layer/core/tests/tests/node_state_machine.rs +++ b/base_layer/core/tests/tests/node_state_machine.rs @@ -37,7 +37,7 @@ use tari_core::{ SyncValidators, }, chain_storage::BlockchainDatabaseConfig, - consensus::{ConsensusConstantsBuilder, ConsensusManagerBuilder}, + consensus::ConsensusManagerBuilder, mempool::MempoolServiceConfig, proof_of_work::{randomx_factory::RandomXFactory, Difficulty}, test_helpers::blockchain::create_test_blockchain_db, @@ -66,15 +66,12 @@ use crate::helpers::{ }, }; -static EMISSION: [u64; 2] = [10, 10]; #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn test_listening_lagging() { let network = Network::LocalNet; let temp_dir = tempdir().unwrap(); let key_manager = create_memory_db_key_manager(); - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .build(); + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network).build(); let (prev_block, _) = create_genesis_block(&consensus_constants, &key_manager).await; let consensus_manager = ConsensusManagerBuilder::new(network) .add_consensus_constants(consensus_constants) @@ -158,9 +155,7 @@ async fn test_listening_initial_fallen_behind() { let network = Network::LocalNet; let temp_dir = tempdir().unwrap(); let key_manager = create_memory_db_key_manager(); - let consensus_constants = ConsensusConstantsBuilder::new(network) - .with_emission_amounts(100_000_000.into(), &EMISSION, 100.into()) - .build(); + let consensus_constants = crate::helpers::sample_blockchains::consensus_constants(network).build(); let (gen_block, _) = create_genesis_block(&consensus_constants, &key_manager).await; let consensus_manager = ConsensusManagerBuilder::new(network) .add_consensus_constants(consensus_constants) diff --git a/base_layer/tari_mining_helper_ffi/Cargo.toml b/base_layer/tari_mining_helper_ffi/Cargo.toml index 65aa2219b4..fe99f0627f 100644 --- a/base_layer/tari_mining_helper_ffi/Cargo.toml +++ b/base_layer/tari_mining_helper_ffi/Cargo.toml @@ -19,8 +19,11 @@ hex = "0.4.2" [dev-dependencies] tari_core = { path = "../core", features = ["transactions", "base_node"]} - rand = "0.8" +[build-dependencies] +tari_features = { path = "../../common/tari_features"} +env_logger = "0.11.1" + [lib] crate-type = ["staticlib","cdylib"] diff --git a/base_layer/tari_mining_helper_ffi/build.rs b/base_layer/tari_mining_helper_ffi/build.rs new file mode 100644 index 0000000000..4258c6f760 --- /dev/null +++ b/base_layer/tari_mining_helper_ffi/build.rs @@ -0,0 +1,28 @@ +// Copyright 2019, The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use tari_features::resolver::build_features; + +fn main() { + env_logger::init(); + build_features(); +} diff --git a/base_layer/tari_mining_helper_ffi/src/lib.rs b/base_layer/tari_mining_helper_ffi/src/lib.rs index 5909511f1c..7888e0f7c6 100644 --- a/base_layer/tari_mining_helper_ffi/src/lib.rs +++ b/base_layer/tari_mining_helper_ffi/src/lib.rs @@ -386,8 +386,12 @@ mod tests { #[test] fn detect_change_in_consensus_encoding() { - const NONCE: u64 = 11937686248184272944; - let difficulty = Difficulty::from_u64(35357).expect("Failed to create difficulty"); + #[cfg(tari_target_network_mainnet)] + let (nonce, difficulty) = (5341281394393564685, Difficulty::from_u64(12916).unwrap()); + #[cfg(tari_target_network_nextnet)] + let (nonce, difficulty) = (3515524755266397098, Difficulty::from_u64(2607).unwrap()); + #[cfg(not(any(tari_target_network_mainnet, tari_target_network_nextnet)))] + let (nonce, difficulty) = (16356716071633903313, Difficulty::from_u64(2051).unwrap()); unsafe { let mut error = -1; let error_ptr = &mut error as *mut c_int; @@ -396,10 +400,11 @@ mod tests { #[allow(clippy::cast_possible_truncation)] let len = header_bytes.len() as u32; let byte_vec = byte_vector_create(header_bytes.as_ptr(), len, error_ptr); - inject_nonce(byte_vec, NONCE, error_ptr); + inject_nonce(byte_vec, nonce, error_ptr); assert_eq!(error, 0); let result = share_difficulty(byte_vec, error_ptr); if result != difficulty.as_u64() { + eprintln!("old nonce = {nonce}, old diff = {:?}", difficulty); // Use this to generate new NONCE and DIFFICULTY // Use ONLY if you know encoding has changed let (difficulty, nonce) = generate_nonce_with_min_difficulty(min_difficulty()).unwrap(); diff --git a/buildtools/multinet_envs.sh b/buildtools/multinet_envs.sh index 10e2bd488c..54d0424dcd 100644 --- a/buildtools/multinet_envs.sh +++ b/buildtools/multinet_envs.sh @@ -7,21 +7,25 @@ case "$tagnet" in v*-pre.*) echo "esme" export TARI_NETWORK=esme + export TARI_TARGET_NETWORK=testnet export TARI_NETWORK_DIR=testnet ;; v*-rc.*) echo "nextnet" export TARI_NETWORK=nextnet + export TARI_TARGET_NETWORK=nextnet export TARI_NETWORK_DIR=nextnet ;; v*-dan.*) echo "dan" export TARI_NETWORK=igor + export TARI_TARGET_NETWORK=testnet export TARI_NETWORK_DIR=testnetdan ;; *) echo "mainnet" export TARI_NETWORK=mainnet + export TARI_TARGET_NETWORK=mainnet export TARI_NETWORK_DIR=mainnet ;; esac diff --git a/common/Cargo.toml b/common/Cargo.toml index d69ccc45d3..0f165d7f3d 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -34,6 +34,7 @@ structopt = { version = "0.3.13", default_features = false } tempfile = "3.1.0" thiserror = "1.0.29" toml = { version = "0.5", optional = true } +env_logger = "0.11.1" [dev-dependencies] tari_test_utils = { path = "../infrastructure/test_utils"} @@ -41,3 +42,4 @@ toml = "0.5.8" [build-dependencies] tari_features = { path = "./tari_features"} +env_logger = "0.11.1" diff --git a/common/build.rs b/common/build.rs index 0f5c3f4939..6086865347 100644 --- a/common/build.rs +++ b/common/build.rs @@ -4,6 +4,7 @@ use tari_features::resolver::build_features; pub fn main() { + env_logger::init(); build_features(); // Build as usual } diff --git a/common/src/configuration/network.rs b/common/src/configuration/network.rs index a78aa7d4a1..f61df29ae1 100644 --- a/common/src/configuration/network.rs +++ b/common/src/configuration/network.rs @@ -80,17 +80,17 @@ impl Network { /// The default network for all applications impl Default for Network { - #[cfg(tari_network_mainnet)] + #[cfg(tari_target_network_mainnet)] fn default() -> Self { - Network::StageNet + Network::MainNet } - #[cfg(tari_network_nextnet)] + #[cfg(tari_target_network_nextnet)] fn default() -> Self { Network::NextNet } - #[cfg(all(not(tari_network_mainnet), not(tari_network_nextnet)))] + #[cfg(not(any(tari_target_network_mainnet, tari_target_network_nextnet)))] fn default() -> Self { Network::Esmeralda } @@ -191,6 +191,11 @@ mod test { #[test] fn network_default() { let network = Network::default(); + #[cfg(tari_target_network_mainnet)] + assert_eq!(network, Network::MainNet); + #[cfg(tari_target_network_nextnet)] + assert_eq!(network, Network::NextNet); + #[cfg(not(any(tari_target_network_mainnet, tari_target_network_nextnet)))] assert_eq!(network, Network::Esmeralda); } diff --git a/common/tari_features/Cargo.toml b/common/tari_features/Cargo.toml index 2686f30d9e..cef0255274 100644 --- a/common/tari_features/Cargo.toml +++ b/common/tari_features/Cargo.toml @@ -13,4 +13,7 @@ edition = "2018" # So you're thinking about adding a dependency here? # This crate is utilized in the compilation of _most_ of our other crates. You're probably about -# to create a cyclic depedency. Please think hard whether this change is actually required. \ No newline at end of file +# to create a cyclic depedency. Please think hard whether this change is actually required. +log = "0.4.8" +[dependencies] +log = "0.4.20" diff --git a/common/tari_features/README.md b/common/tari_features/README.md new file mode 100644 index 0000000000..3b0c92dd3d --- /dev/null +++ b/common/tari_features/README.md @@ -0,0 +1,107 @@ +# Feature gating + +## Step 1: define features + +In build.rs, we define our features. + +Features have a +* name - will also be the attribute name you use in code +* description - a short description of the features +* issue tracking number on Github +* The current status. + +#### Status + +* New: New feature, may not even be working or compiling. Will be present on `testnet` +* Testing: Feature is undergoing testing on `nextnet`. Does not exist on `mainnet` or `stagenet`. +* Active: Feature is live and gate has been removed. Will be running on all networks. +* Removed: Feature has been cancelled. Can not be invoked anywhere. + +In `build.rs`, we maintain the list of feature flags. For example: + +```rust +const FEATURE_LIST: [Feature; 4] = [ + Feature::new("add_pair", "Allows you to add two numbers together", Some(123), Status::New), + Feature::new("about_to_launch", "Live in NextNet. If we stabilise, will go to mainnet", Some(123), Status::Testing), + Feature::new("live_feature", "This feature has been stabilised and is live!", Some(150), Status::Active), + Feature::new("old_feature", "We decided not to go with this featuree", Some(145), Status::Removed), +]; +``` + +## Step 2: Demarcate feature flag code + +In your code, you can now use any of the flags as attributes to mark code belonging to a feature. + +Example + +```rust +#[cfg(tari_feature_add_pair)] +use add_pair::add_pair; + +fn main() { + println!("Hello world!"); + #[cfg(tari_feature_add_pair)] + println!("40 + 2 = {}", add_pair(40, 2)); + println!("foo={}", foo()); + println!("Bye, world!"); +} + +#[cfg(tari_feature_add_pair)] +fn foo() -> usize { + 1 +} + +#[cfg(not(tari_feature_add_pair))] +fn foo() -> usize { + 2 +} +``` + +## Step 3: Specify the target network when building + +This PoC uses the `TARI_NETWORK` envar to specify the target network, but in principle, we can also read the `Cargo.toml` +file, or compiler flags. + +`$ TARI_NETWORK=dibbler cargo run -vv` + +Filtered output: + +```text +Building for Dibbler +These features are ACTIVE on mainnet (no special code handling is done) +live_feature. This feature has been stabilised and is live!. Tracking issue: https://github.com/tari-project/tari/issues/150 + +These features are DEPRECATED and will never be compiled +old_feature. We decided not to go with this featuree. Tracking issue: https://github.com/tari-project/tari/issues/145 + +** Activating add_pair. Allows you to add two numbers together. Tracking issue: https://github.com/tari-project/tari/issues/123 ** +** Activating about_to_launch. Live in NextNet. If we stabilise, will go to mainnet. Tracking issue: https://github.com/tari-project/tari/issues/123 ** + +Finished dev [unoptimized + debuginfo] target(s) in 7.44s + Running `target/debug/feature_gates` +Hello world! +40 + 2 = 42 +foo=1 +Bye, world! +``` + +Or compiling for MainNet: + +`$ TARI_NETWORK=mainnet cargo run -vv` + +Filtered output: + +```text +Building for MainNet + +These features are ACTIVE on mainnet (no special code handling is done) +live_feature. This feature has been stabilised and is live!. Tracking issue: https://github.com/tari-project/tari/issues/150 + +These features are DEPRECATED and will never be compiled +old_feature. We decided not to go with this featuree. Tracking issue: https://github.com/tari-project/tari/issues/145 + Finished dev [unoptimized + debuginfo] target(s) in 6.15s + Running `target/debug/feature_gates` +Hello world! +foo=2 +Bye, world! +``` diff --git a/common/tari_features/src/lib.rs b/common/tari_features/src/lib.rs index af18a20069..77fea0a116 100644 --- a/common/tari_features/src/lib.rs +++ b/common/tari_features/src/lib.rs @@ -27,4 +27,9 @@ mod status; pub use feature::Feature; pub use status::Status; -pub const FEATURE_LIST: [Feature; 0] = []; +pub const FEATURE_LIST: [Feature; 1] = [Feature::new( + "mainnet_emission", + "Introduces the inflating tail emission for mainnet", + Some(6122), + Status::Testing, +)]; diff --git a/common/tari_features/src/resolver.rs b/common/tari_features/src/resolver.rs index 3edb0edfc7..d8aee762c8 100644 --- a/common/tari_features/src/resolver.rs +++ b/common/tari_features/src/resolver.rs @@ -22,6 +22,8 @@ use std::fmt::Display; +use log::info; + use crate::{Feature, FEATURE_LIST}; pub enum Target { @@ -64,10 +66,10 @@ impl Display for Target { // Identify the target network by // 1. Checking whether --config tari-network=xxx was passed in as a config flag to cargo (or from Cargo.toml) // 2. Checking the environment variable TARI_NETWORK is set -// 3. default to mainnet +// 3. default to testnet (should be mainnet after launch) pub fn identify_target() -> Target { - check_envar("CARGO_CFG_TARI_NETWORK") - .or_else(|| check_envar("TARI_NETWORK")) + check_envar("CARGO_CFG_TARI_TARGET_NETWORK") + .or_else(|| check_envar("TARI_TARGET_NETWORK")) .unwrap_or(Target::TestNet) } @@ -79,19 +81,21 @@ pub fn check_envar(envar: &str) -> Option { } pub fn list_active_features() { - println!("These features are ACTIVE on mainnet (no special code handling is done)"); + info!("These features are ACTIVE on mainnet (no special code handling is done)"); FEATURE_LIST .iter() .filter(|f| f.is_active()) - .for_each(|f| println!("{}", f)); + .for_each(|f| info!("{}", f)); + info!("End of ACTIVE feature list"); } pub fn list_removed_features() { - println!("These features are DEPRECATED and will never be compiled"); + info!("These features are DEPRECATED and will never be compiled"); FEATURE_LIST .iter() .filter(|f| f.was_removed()) - .for_each(|f| println!("{}", f)); + .for_each(|f| info!("{}", f)); + info!("End of DEPRECATED feature list"); } pub fn resolve_features(target: Target) -> Result<(), String> { @@ -110,17 +114,17 @@ pub fn resolve_features(target: Target) -> Result<(), String> { } pub fn activate_feature(feature: &Feature) { - println!("** Activating {} **", feature); + info!("** Activating {} **", feature); println!("cargo:rustc-cfg={}", feature.attr_name()); } pub fn build_features() { // Make sure to rebuild when the network changes - println!("cargo:rerun-if-env-changed=TARI_NETWORK"); + println!("cargo:rerun-if-env-changed=TARI_TARGET_NETWORK"); let target = identify_target(); - println!("cargo:rustc-cfg=tari_network_{}", target.as_key_str()); - println!("Building for {}", target); + println!("cargo:rustc-cfg=tari_target_network_{}", target.as_key_str()); + info!("Building for {}", target); list_active_features(); list_removed_features(); if let Err(e) = resolve_features(target) {