Skip to content

Commit

Permalink
Merge branch 'development' into core-prune-inputs
Browse files Browse the repository at this point in the history
* development:
  feat: language detection for mnemonic seed words (tari-project#3590)
  chore: minor clippy fixes (tari-project#3576)
  fix: be more permissive of responses for the incorrect request_id (tari-project#3588)
  feat: track ping failures and disconnect (tari-project#3597)
  chore: upgrade tokio deps tari-project#3581 (tari-project#3595)
  feat: standardize output hash for unblinded output, transaction output and transaction input (tari-project#3592)
  fix: allow bullet proof value only rewinding off one-sided transaction (tari-project#3587)
  refactor: update miningcore repository links (tari-project#3593)
  refactor: clean up unwraps in wallet_ffi (tari-project#3585)
  fix: update daily test start times and seed phrase (tari-project#3584)
  fix: allow bullet proof value only rewinding in atomic swaps (tari-project#3586)
  v0.21.2
  fix: remove delay from last request latency call
  • Loading branch information
sdbondi committed Nov 21, 2021
2 parents 6e46b9e + 57f51bc commit 461a1ec
Show file tree
Hide file tree
Showing 206 changed files with 4,585 additions and 3,112 deletions.
334 changes: 90 additions & 244 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ The Tari Base Node, Tari Console Wallet, Tari Stratum Transcoder and Tari Mining
default installation as described in [Installing using binaries](#installing-using-binaries), all these applications
will be available.

For MiningCore see [here](https://github.com/StriderDM/miningcore/tree/tari#runtime-requirements-on-linux) and [here](https://github.com/StriderDM/miningcore/tree/tari#runtime-requirements-on-windows).
For MiningCore see [here](https://github.com/tari-project/miningcore/master/tari#runtime-requirements-on-linux) and [here](https://github.com/tari-project/miningcore/tree/master#runtime-requirements-on-windows).

#### Configuration prerequisites

Expand Down Expand Up @@ -453,7 +453,7 @@ transcoder_host_address = "127.0.0.1:7879"

For MiningCore:

See example configuration [here](https://github.com/StriderDM/miningcore/blob/tari/examples/tari_pool.json).
See example configuration [here](https://github.com/tari-project/miningcore/blob/master/examples/tari_pool.json).

For the Tari Mining Node there are some additional settings under section **`mining_node`** that can be changed:
* For SHA3 Mining:
Expand Down
44 changes: 11 additions & 33 deletions RFC/src/RFC-0250_Covenants.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,105 +206,83 @@ little-endian 64-byte unsigned integer.

The output set is returned unaltered. This rule is implicit for an empty (0 byte) covenant.

```yaml
op_byte: 0x20
op_byte: 0x20<br>
args: []
```

##### and(A, B)

The intersection (\\(A \cap B\\)) of the resulting output set for covenant rules \\(A\\) and \\(B\\).

```yaml
op_byte: 0x21
op_byte: 0x21<br>
args: [Covenant, Covenant]
```

##### or(A, B)

The union (\\(A \cup B\\)) of the resulting output set for covenant rules \\(A\\) and \\(B\\).

```yaml
op_byte: 0x22
op_byte: 0x22<br>
args: [Covenant, Covenant]
```

##### xor(A, B)

The symmetric difference (\\(A \triangle B\\)) of the resulting output set for covenant rules \\(A\\) and \\(B\\).
This is, outputs that match either \\(A\\) or \\(B\\) but not both.

```yaml
op_byte: 0x23
op_byte: 0x23<br>
args: [Covenant, Covenant]
```

##### not(A)

Returns the compliment of `A`. That is, all the elements of `A` are removed from the
resultant output set.

```yaml
op_byte: 0x24
op_byte: 0x24<br>
args: [Covenant]
```

##### empty()

Returns an empty set. This will always fail and, if used alone, prevents the UTXO from ever being spent.
A more useful reason to use `empty` is in conjunction a conditional e.g. `if_else(Condition(older_rel(10)), A, empty)`

```yaml
op_byte: 0x25
op_byte: 0x25<br>
args: []
```

#### Filters

##### filter_output_hash_eq(hash)

Filters for a single output that matches the hash. This filter only returns zero or one outputs.

```yaml
op_byte: 0x30
op_byte: 0x30<br>
args: [Hash]
```

##### filter_fields_preserved(fields)

Filter for outputs where all given fields in the input are preserved in the output.

```yaml
op_byte: 0x31
op_byte: 0x31<br>
args: [Fields]
```

##### filter_field_int_eq(field, int)

Filters for outputs whose field value matches the given integer value. If the given field cannot be cast
to an unsigned 64-bit integer, the transaction/block is rejected.

```yaml
op_byte: 0x32
op_byte: 0x32<br>
args: [Field, VarInt]
```

##### filter_fields_hashed_eq(fields, hash)

```yaml
op_byte: 0x33
op_byte: 0x33<br>
args: [Fields, VarInt]
```

##### filter_relative_height(height)

Checks the block height that current [UTXO] (i.e. the current input) was mined plus `height` is greater than or
equal to the current block height. If so, the `identity()` is returned, otherwise `empty()`.

```yaml
op_byte: 0x34
op_byte: 0x34<br>
args: [VarInt]
```

#### Encoding / Decoding

Expand Down
14 changes: 7 additions & 7 deletions applications/daily_tests/automatic_recovery_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function main() {
description: "Seed words to use during recovery",
type: "string",
default:
"pigeon marble letter canal hard close kit cash coin still melt random require long shaft antenna tent turkey neck divert enrich iron analyst abandon",
"cactus pool fuel skull chair casino season disorder flat crash wrist whisper decorate narrow oxygen remember minor among happy cricket embark blue ship sick",
})
.option("log", {
alias: "l",
Expand All @@ -34,19 +34,19 @@ async function main() {
.alias("help", "h").argv;

for (let i = 0; i < argv.numWallets; i++) {
let { identity, timeDiffMinutes, height, blockRate, recoveredAmount } =
let { identity, timeDiffMinutes, numOutputs, rate, recoveredAmount } =
await run(argv);

console.log(
"Wallet (Pubkey:",
identity.public_key,
") recovered to a block height of",
height,
"completed in",
") scanned",
numOutputs,
"outputs, completed in",
timeDiffMinutes,
"minutes (",
blockRate,
"blocks/min).",
rate,
"outputs/min).",
recoveredAmount,
"µT recovered for instance ",
i,
Expand Down
2 changes: 1 addition & 1 deletion applications/daily_tests/automatic_sync_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function run(options) {
"true";
// Set pruning horizon in config file if `pruned` command line arg is present
if (options.syncType === SyncType.Pruned) {
process.env[`TARI_BASE_NODE__${NETWORK}__PRUNING_HORIZON`] = 1000;
process.env[`TARI_BASE_NODE__${NETWORK}__PRUNING_HORIZON`] = 20;
}

if (options.forceSyncPeer) {
Expand Down
10 changes: 5 additions & 5 deletions applications/daily_tests/cron_jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function runWalletRecoveryTest(instances) {
recoveredAmount,
} = await walletRecoveryTest({
seedWords:
"abandon rely pave boil case broken volume bracket own false sketch ordinary gown bitter strong unhappy shoulder salad season student public will monkey inquiry",
"cactus pool fuel skull chair casino season disorder flat crash wrist whisper decorate narrow oxygen remember minor among happy cricket embark blue ship sick",
log: LOG_FILE,
numWallets: instances,
baseDir,
Expand Down Expand Up @@ -126,13 +126,13 @@ async function main() {
});

// ------------------------- CRON ------------------------- //
new CronJob("0 7 * * *", () => runWalletRecoveryTest(1)).start();
new CronJob("0 2 * * *", () => runWalletRecoveryTest(1)).start();
//new CronJob("30 7 * * *", () => runWalletRecoveryTest(5)).start();
new CronJob("0 6 * * *", () =>
new CronJob("0 1 * * *", () =>
runBaseNodeSyncTest(SyncType.Archival)
).start();
new CronJob("30 6 * * *", () => runBaseNodeSyncTest(SyncType.Pruned)).start();
new CronJob("0 4 * * *", () =>
new CronJob("30 1 * * *", () => runBaseNodeSyncTest(SyncType.Pruned)).start();
new CronJob("0 0 * * *", () =>
git.pull(__dirname).catch((err) => {
failed("Failed to update git repo");
console.error(err);
Expand Down
6 changes: 5 additions & 1 deletion applications/daily_tests/washing_machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,18 @@ function WashingMachine(options) {
`🚀 Launching washing machine (numTransactions = ${numTransactions}, numRounds = ${numRounds}, sleep = ${sleepAfterRound}s)`
);

debug(`Connecting to wallet1 at ${wallet1Grpc}...`);
await this.wallet1.connect(wallet1Grpc);
debug(`Connected.`);

debug("Compiling and starting applications...");
let wallet2Process = null;
// Start wallet2
if (wallet2Grpc) {
this.wallet2 = new WalletClient();
debug(`Connecting to wallet2 at ${wallet2Grpc}...`);
await this.wallet2.connect(wallet2Grpc);
} else {
debug("Compiling wallet2...");
const port = await getFreePort(20000, 25000);
wallet2Process = createGrpcWallet(
baseNodeSeed,
Expand All @@ -148,6 +151,7 @@ function WashingMachine(options) {
true
);
wallet2Process.baseDir = "./wallet";
debug("Starting wallet2...");
await wallet2Process.startNew();
this.wallet2 = await wallet2Process.connectClient();
}
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_app_grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["The Tari Development Community"]
description = "This crate is to provide a single source for all cross application grpc files and conversions to and from tari::core"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "0.21.1"
version = "0.21.2"
edition = "2018"

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::convert::TryFrom;
use tari_core::{proto::utils::try_convert_all, transactions::aggregated_body::AggregateBody};
use tari_core::{tari_utilities::convert::try_convert_all, transactions::aggregated_body::AggregateBody};

use crate::tari_rpc as grpc;

Expand Down
6 changes: 4 additions & 2 deletions applications/tari_app_grpc/src/conversions/output_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +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 crate::tari_rpc as grpc;
use std::convert::TryFrom;
use tari_core::transactions::transaction::{OutputFeatures, OutputFlags};

use tari_core::transactions::transaction_entities::{OutputFeatures, OutputFlags};

use crate::tari_rpc as grpc;

impl TryFrom<grpc::OutputFeatures> for OutputFeatures {
type Error = String;
Expand Down
6 changes: 4 additions & 2 deletions applications/tari_app_grpc/src/conversions/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
// 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 crate::tari_rpc as grpc;
use std::convert::{TryFrom, TryInto};

use tari_common_types::transaction::{self as tx, TxId};
use tari_core::{
crypto::{ristretto::RistrettoSecretKey, tari_utilities::ByteArray},
transactions::transaction::Transaction,
transactions::transaction_entities::Transaction,
};

use crate::tari_rpc as grpc;

impl From<Transaction> for grpc::Transaction {
fn from(source: Transaction) -> Self {
Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use crate::tari_rpc as grpc;
use std::convert::{TryFrom, TryInto};
use tari_common_types::types::{Commitment, PublicKey};
use tari_core::transactions::transaction::TransactionInput;
use tari_core::transactions::transaction_entities::TransactionInput;
use tari_crypto::{
script::{ExecutionStack, TariScript},
tari_utilities::{ByteArray, Hashable},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
// 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 crate::tari_rpc as grpc;
use std::convert::{TryFrom, TryInto};

use tari_crypto::tari_utilities::{ByteArray, Hashable};

use tari_common_types::types::Commitment;
use tari_core::transactions::{
tari_amount::MicroTari,
transaction::{KernelFeatures, TransactionKernel},
transaction_entities::{KernelFeatures, TransactionKernel},
};
use tari_crypto::tari_utilities::{ByteArray, Hashable};

use crate::tari_rpc as grpc;

impl TryFrom<grpc::TransactionKernel> for TransactionKernel {
type Error = String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@
// 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 crate::tari_rpc as grpc;
use std::convert::{TryFrom, TryInto};

use tari_common_types::types::{BulletRangeProof, Commitment, PublicKey};
use tari_core::{
crypto::{
script::TariScript,
tari_utilities::{ByteArray, Hashable},
},
transactions::transaction::TransactionOutput,
transactions::transaction_entities::TransactionOutput,
};

use crate::tari_rpc as grpc;

impl TryFrom<grpc::TransactionOutput> for TransactionOutput {
type Error = String;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use tari_core::{
script::{ExecutionStack, TariScript},
tari_utilities::ByteArray,
},
transactions::{tari_amount::MicroTari, transaction::UnblindedOutput},
transactions::{tari_amount::MicroTari, transaction_entities::UnblindedOutput},
};

impl From<UnblindedOutput> for grpc::UnblindedOutput {
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_app_utilities/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tari_app_utilities"
version = "0.21.1"
version = "0.21.2"
authors = ["The Tari Development Community"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion applications/tari_base_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["The Tari Development Community"]
description = "The tari full base node implementation"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "0.21.1"
version = "0.21.2"
edition = "2018"

[dependencies]
Expand Down
Loading

0 comments on commit 461a1ec

Please sign in to comment.