Skip to content

Commit 3a726b1

Browse files
committed
Merge branch 'development' into update-feature-dan2-from-dev
* development: fix(p2p/dns): greatly simplify DNS TXT lookup (tari-project#6922) feat: handle outbound pipeline interlock due to connection cleanup (tari-project#6921) chore(ci): build docker with metrics (tari-project#6916)
2 parents 6a3dbc4 + acb7e6e commit 3a726b1

File tree

54 files changed

+1257
-733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1257
-733
lines changed

.github/workflows/build_dockers_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name: Build docker images - workflow_call/on-demand
2020
default: x86-64
2121
features:
2222
type: string
23-
default: 'safe,grpc'
23+
default: 'safe,libtor,metrics'
2424
version:
2525
type: string
2626
description: 'build tag/version'

applications/minotari_app_grpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license.workspace = true
1010
[dependencies]
1111
tari_common_types = { workspace = true }
1212
tari_comms = { workspace = true }
13-
tari_core = { workspace = true }
13+
tari_core = { workspace = true, features = ["transactions", "mempool_proto", "base_node_proto"] }
1414
tari_crypto = { workspace = true }
1515
tari_script = { workspace = true }
1616
tari_max_size = { workspace = true }

applications/minotari_app_grpc/src/conversions/sidechain_feature.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,31 @@ use tari_core::{
3232
transactions::{
3333
tari_amount::MicroMinotari,
3434
transaction_components::{
35-
BuildInfo, CodeTemplateRegistration, ConfidentialOutputData, SideChainFeature, SideChainFeatureData,
36-
SideChainId, TemplateType, ValidatorNodeRegistration, ValidatorNodeSignature,
35+
BuildInfo,
36+
CodeTemplateRegistration,
37+
ConfidentialOutputData,
38+
SideChainFeature,
39+
SideChainFeatureData,
40+
SideChainId,
41+
TemplateType,
42+
ValidatorNodeRegistration,
43+
ValidatorNodeSignature,
3744
},
3845
},
3946
};
4047
use tari_max_size::MaxSizeString;
4148
use tari_sidechain::{
42-
ChainLink, CommandCommitProof, CommandCommitProofV1, CommitProofElement, EvictNodeAtom, EvictionProof,
43-
QuorumCertificate, QuorumDecision, ShardGroup, SidechainBlockCommitProof, SidechainBlockHeader,
49+
ChainLink,
50+
CommandCommitProof,
51+
CommandCommitProofV1,
52+
CommitProofElement,
53+
EvictNodeAtom,
54+
EvictionProof,
55+
QuorumCertificate,
56+
QuorumDecision,
57+
ShardGroup,
58+
SidechainBlockCommitProof,
59+
SidechainBlockHeader,
4460
ValidatorQcSignature,
4561
};
4662
use tari_utilities::ByteArray;

applications/minotari_app_grpc/src/conversions/signature.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
use std::convert::TryFrom;
2424

2525
use tari_common_types::types::{CompressedPublicKey, PrivateKey, UncompressedPublicKey};
26-
use tari_crypto::hashing::DomainSeparation;
27-
use tari_crypto::signatures::CompressedSchnorrSignature;
26+
use tari_crypto::{hashing::DomainSeparation, signatures::CompressedSchnorrSignature};
2827
use tari_utilities::ByteArray;
2928

3029
use crate::tari_rpc as grpc;

applications/minotari_console_wallet/src/automation/commands.rs

Lines changed: 70 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ use minotari_wallet::{
5151
storage::models::WalletTransaction,
5252
},
5353
utxo_scanner_service::handle::UtxoScannerEvent,
54-
TransactionStage, WalletConfig, WalletSqlite,
54+
TransactionStage,
55+
WalletConfig,
56+
WalletSqlite,
5557
};
5658
use serde::{de::DeserializeOwned, Serialize};
5759
use sha2::Sha256;
@@ -63,8 +65,15 @@ use tari_common_types::{
6365
tari_address::TariAddress,
6466
transaction::TxId,
6567
types::{
66-
CompressedCommitment, CompressedPublicKey, FixedHash, HashOutput, PrivateKey, Signature,
67-
UncompressedCommitment, UncompressedPublicKey, UncompressedSignature,
68+
CompressedCommitment,
69+
CompressedPublicKey,
70+
FixedHash,
71+
HashOutput,
72+
PrivateKey,
73+
Signature,
74+
UncompressedCommitment,
75+
UncompressedPublicKey,
76+
UncompressedSignature,
6877
},
6978
wallet_types::WalletType,
7079
};
@@ -83,15 +92,25 @@ use tari_core::{
8392
tari_amount::{uT, MicroMinotari, Minotari},
8493
transaction_components::{
8594
encrypted_data::{PaymentId, TxType},
86-
EncryptedData, OutputFeatures, Transaction, TransactionInput, TransactionInputVersion, TransactionKernel,
87-
TransactionOutput, TransactionOutputVersion, UnblindedOutput, WalletOutput,
95+
EncryptedData,
96+
OutputFeatures,
97+
Transaction,
98+
TransactionInput,
99+
TransactionInputVersion,
100+
TransactionKernel,
101+
TransactionOutput,
102+
TransactionOutputVersion,
103+
UnblindedOutput,
104+
WalletOutput,
88105
},
89106
transaction_key_manager::{TariKeyId, TransactionKeyManagerInterface},
90107
CryptoFactories,
91108
},
92109
};
93110
use tari_crypto::{
94-
commitment::HomomorphicCommitmentFactory, dhke::DiffieHellmanSharedSecret, ristretto::RistrettoSecretKey,
111+
commitment::HomomorphicCommitmentFactory,
112+
dhke::DiffieHellmanSharedSecret,
113+
ristretto::RistrettoSecretKey,
95114
};
96115
use tari_key_manager::{cipher_seed::CipherSeed, SeedWords};
97116
use tari_p2p::{auto_update::AutoUpdateConfig, peer_seeds::SeedPeer, PeerSeedsConfig};
@@ -107,12 +126,27 @@ use super::error::CommandError;
107126
use crate::{
108127
automation::{
109128
utils::{
110-
create_pre_mine_output_dir, get_file_name, move_session_file_to_session_dir, out_dir, read_and_verify,
111-
read_session_info, read_verify_session_info, write_json_object_to_file_as_line, write_to_json_file,
129+
create_pre_mine_output_dir,
130+
get_file_name,
131+
move_session_file_to_session_dir,
132+
out_dir,
133+
read_and_verify,
134+
read_session_info,
135+
read_verify_session_info,
136+
write_json_object_to_file_as_line,
137+
write_to_json_file,
112138
},
113-
PreMineSpendStep1SessionInfo, PreMineSpendStep2OutputsForLeader, PreMineSpendStep2OutputsForSelf,
114-
PreMineSpendStep3OutputsForParties, PreMineSpendStep3OutputsForSelf, PreMineSpendStep4OutputsForLeader,
115-
RecipientInfo, Step2OutputsForLeader, Step2OutputsForSelf, Step3OutputsForParties, Step3OutputsForSelf,
139+
PreMineSpendStep1SessionInfo,
140+
PreMineSpendStep2OutputsForLeader,
141+
PreMineSpendStep2OutputsForSelf,
142+
PreMineSpendStep3OutputsForParties,
143+
PreMineSpendStep3OutputsForSelf,
144+
PreMineSpendStep4OutputsForLeader,
145+
RecipientInfo,
146+
Step2OutputsForLeader,
147+
Step2OutputsForSelf,
148+
Step3OutputsForParties,
149+
Step3OutputsForSelf,
116150
Step4OutputsForLeader,
117151
},
118152
cli::{CliCommands, CliRecipientInfo, MakeItRainTransactionType},
@@ -651,8 +685,8 @@ pub async fn monitor_transactions(
651685
Ok(event) => match &*event {
652686
TransactionEvent::TransactionSendResult(id, status) if tx_ids.contains(id) => {
653687
debug!(target: LOG_TARGET, "tx send event for tx_id: {}, {}", *id, status);
654-
if wait_stage == TransactionStage::DirectSendOrSaf
655-
&& (status.direct_send_result || status.store_and_forward_send_result)
688+
if wait_stage == TransactionStage::DirectSendOrSaf &&
689+
(status.direct_send_result || status.store_and_forward_send_result)
656690
{
657691
results.push(SentTransaction {});
658692
if results.len() == tx_ids.len() {
@@ -1133,25 +1167,17 @@ pub async fn command_runner(
11331167
let out_dir = out_dir(&session_info.session_id)?;
11341168
let out_file_leader = out_dir.join(get_file_name(SPEND_STEP_2_LEADER, Some(args.alias.clone())));
11351169
write_json_object_to_file_as_line(&out_file_leader, true, session_info.clone())?;
1136-
write_json_object_to_file_as_line(
1137-
&out_file_leader,
1138-
false,
1139-
PreMineSpendStep2OutputsForLeader {
1140-
outputs_for_leader,
1141-
alias: args.alias.clone(),
1142-
},
1143-
)?;
1170+
write_json_object_to_file_as_line(&out_file_leader, false, PreMineSpendStep2OutputsForLeader {
1171+
outputs_for_leader,
1172+
alias: args.alias.clone(),
1173+
})?;
11441174

11451175
let out_file_self = out_dir.join(get_file_name(SPEND_STEP_2_SELF, None));
11461176
write_json_object_to_file_as_line(&out_file_self, true, session_info.clone())?;
1147-
write_json_object_to_file_as_line(
1148-
&out_file_self,
1149-
false,
1150-
PreMineSpendStep2OutputsForSelf {
1151-
outputs_for_self,
1152-
alias: args.alias.clone(),
1153-
},
1154-
)?;
1177+
write_json_object_to_file_as_line(&out_file_self, false, PreMineSpendStep2OutputsForSelf {
1178+
outputs_for_self,
1179+
alias: args.alias.clone(),
1180+
})?;
11551181

11561182
println!();
11571183
println!("Concluded step 2 'pre-mine-spend-party-details'");
@@ -1396,19 +1422,15 @@ pub async fn command_runner(
13961422
let out_dir = out_dir(&session_id)?;
13971423
let out_file = out_dir.join(get_file_name(SPEND_STEP_3_SELF, None));
13981424
write_json_object_to_file_as_line(&out_file, true, session_info.clone())?;
1399-
write_json_object_to_file_as_line(
1400-
&out_file,
1401-
false,
1402-
PreMineSpendStep3OutputsForSelf { outputs_for_self },
1403-
)?;
1425+
write_json_object_to_file_as_line(&out_file, false, PreMineSpendStep3OutputsForSelf {
1426+
outputs_for_self,
1427+
})?;
14041428

14051429
let out_file = out_dir.join(get_file_name(SPEND_STEP_3_PARTIES, None));
14061430
write_json_object_to_file_as_line(&out_file, true, session_info.clone())?;
1407-
write_json_object_to_file_as_line(
1408-
&out_file,
1409-
false,
1410-
PreMineSpendStep3OutputsForParties { outputs_for_parties },
1411-
)?;
1431+
write_json_object_to_file_as_line(&out_file, false, PreMineSpendStep3OutputsForParties {
1432+
outputs_for_parties,
1433+
})?;
14121434

14131435
println!();
14141436
println!("Concluded step 3 'pre-mine-spend-encumber-aggregate-utxo'");
@@ -1592,10 +1614,9 @@ pub async fn command_runner(
15921614

15931615
// Metadata signature
15941616
let script_offset = key_manager_service
1595-
.get_script_offset(
1596-
&vec![party_info.pre_mine_script_key_id.clone()],
1597-
&vec![party_info.sender_offset_key_id.clone()],
1598-
)
1617+
.get_script_offset(&vec![party_info.pre_mine_script_key_id.clone()], &vec![party_info
1618+
.sender_offset_key_id
1619+
.clone()])
15991620
.await?;
16001621
let challenge = TransactionOutput::build_metadata_signature_challenge(
16011622
&TransactionOutputVersion::get_current_version(),
@@ -1626,8 +1647,8 @@ pub async fn command_runner(
16261647
},
16271648
};
16281649

1629-
if script_signature.get_signature() == Signature::default().get_signature()
1630-
|| metadata_signature.get_signature() == Signature::default().get_signature()
1650+
if script_signature.get_signature() == Signature::default().get_signature() ||
1651+
metadata_signature.get_signature() == Signature::default().get_signature()
16311652
{
16321653
eprintln!(
16331654
"\nError: Script and/or metadata signatures not created (index {})!\n",
@@ -1660,14 +1681,10 @@ pub async fn command_runner(
16601681
Some(party_info_indexed.alias.clone()),
16611682
));
16621683
write_json_object_to_file_as_line(&out_file, true, session_info.clone())?;
1663-
write_json_object_to_file_as_line(
1664-
&out_file,
1665-
false,
1666-
PreMineSpendStep4OutputsForLeader {
1667-
outputs_for_leader,
1668-
alias: party_info_indexed.alias.clone(),
1669-
},
1670-
)?;
1684+
write_json_object_to_file_as_line(&out_file, false, PreMineSpendStep4OutputsForLeader {
1685+
outputs_for_leader,
1686+
alias: party_info_indexed.alias.clone(),
1687+
})?;
16711688

16721689
println!();
16731690
println!("Concluded step 4 'pre-mine-spend-input-output-sigs'");

applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,66 @@ use std::{
2626
sync::Arc,
2727
};
2828

29-
use crate::{
30-
grpc::{convert_to_transaction_event, wallet_debouncer::WalletDebouncer, TransactionWrapper},
31-
notifier::{CANCELLED, CONFIRMATION, MINED, QUEUED, RECEIVED, SENT},
32-
};
3329
use futures::{
3430
channel::mpsc::{self, Sender},
35-
future, SinkExt,
31+
future,
32+
SinkExt,
3633
};
3734
use log::*;
3835
use minotari_app_grpc::tari_rpc::{
39-
self, payment_recipient::PaymentType, wallet_server, CheckConnectivityResponse, ClaimHtlcRefundRequest,
40-
ClaimHtlcRefundResponse, ClaimShaAtomicSwapRequest, ClaimShaAtomicSwapResponse, CoinSplitRequest,
41-
CoinSplitResponse, CommitmentSignature, CreateBurnTransactionRequest, CreateBurnTransactionResponse,
42-
CreateTemplateRegistrationRequest, CreateTemplateRegistrationResponse, GetAddressResponse, GetBalanceRequest,
43-
GetBalanceResponse, GetCompletedTransactionsRequest, GetCompletedTransactionsResponse, GetConnectivityRequest,
44-
GetIdentityRequest, GetIdentityResponse, GetStateRequest, GetStateResponse, GetTransactionInfoRequest,
45-
GetTransactionInfoResponse, GetUnspentAmountsResponse, GetVersionRequest, GetVersionResponse, ImportUtxosRequest,
46-
ImportUtxosResponse, RegisterValidatorNodeRequest, RegisterValidatorNodeResponse, RevalidateRequest,
47-
RevalidateResponse, SendShaAtomicSwapRequest, SendShaAtomicSwapResponse, SetBaseNodeRequest, SetBaseNodeResponse,
48-
SubmitValidatorEvictionProofRequest, SubmitValidatorEvictionProofResponse, TransactionDirection, TransactionEvent,
49-
TransactionEventRequest, TransactionEventResponse, TransactionInfo, TransactionStatus, TransferRequest,
50-
TransferResponse, TransferResult, ValidateRequest, ValidateResponse,
36+
self,
37+
payment_recipient::PaymentType,
38+
wallet_server,
39+
CheckConnectivityResponse,
40+
ClaimHtlcRefundRequest,
41+
ClaimHtlcRefundResponse,
42+
ClaimShaAtomicSwapRequest,
43+
ClaimShaAtomicSwapResponse,
44+
CoinSplitRequest,
45+
CoinSplitResponse,
46+
CommitmentSignature,
47+
CreateBurnTransactionRequest,
48+
CreateBurnTransactionResponse,
49+
CreateTemplateRegistrationRequest,
50+
CreateTemplateRegistrationResponse,
51+
GetAddressResponse,
52+
GetBalanceRequest,
53+
GetBalanceResponse,
54+
GetCompletedTransactionsRequest,
55+
GetCompletedTransactionsResponse,
56+
GetConnectivityRequest,
57+
GetIdentityRequest,
58+
GetIdentityResponse,
59+
GetStateRequest,
60+
GetStateResponse,
61+
GetTransactionInfoRequest,
62+
GetTransactionInfoResponse,
63+
GetUnspentAmountsResponse,
64+
GetVersionRequest,
65+
GetVersionResponse,
66+
ImportUtxosRequest,
67+
ImportUtxosResponse,
68+
RegisterValidatorNodeRequest,
69+
RegisterValidatorNodeResponse,
70+
RevalidateRequest,
71+
RevalidateResponse,
72+
SendShaAtomicSwapRequest,
73+
SendShaAtomicSwapResponse,
74+
SetBaseNodeRequest,
75+
SetBaseNodeResponse,
76+
SubmitValidatorEvictionProofRequest,
77+
SubmitValidatorEvictionProofResponse,
78+
TransactionDirection,
79+
TransactionEvent,
80+
TransactionEventRequest,
81+
TransactionEventResponse,
82+
TransactionInfo,
83+
TransactionStatus,
84+
TransferRequest,
85+
TransferResponse,
86+
TransferResult,
87+
ValidateRequest,
88+
ValidateResponse,
5189
};
5290
use minotari_wallet::{
5391
connectivity_service::WalletConnectivityInterface,
@@ -59,11 +97,10 @@ use minotari_wallet::{
5997
},
6098
WalletSqlite,
6199
};
62-
use tari_common_types::types::PrivateKey;
63100
use tari_common_types::{
64101
tari_address::TariAddress,
65102
transaction::TxId,
66-
types::{BlockHash, CompressedPublicKey, Signature},
103+
types::{BlockHash, CompressedPublicKey, PrivateKey, Signature},
67104
};
68105
use tari_comms::{multiaddr::Multiaddr, types::CommsPublicKey, CommsNode};
69106
use tari_core::{
@@ -72,7 +109,8 @@ use tari_core::{
72109
tari_amount::MicroMinotari,
73110
transaction_components::{
74111
encrypted_data::{PaymentId, TxType},
75-
OutputFeatures, UnblindedOutput,
112+
OutputFeatures,
113+
UnblindedOutput,
76114
},
77115
},
78116
};
@@ -84,6 +122,11 @@ use tokio::{
84122
};
85123
use tonic::{Request, Response, Status};
86124

125+
use crate::{
126+
grpc::{convert_to_transaction_event, wallet_debouncer::WalletDebouncer, TransactionWrapper},
127+
notifier::{CANCELLED, CONFIRMATION, MINED, QUEUED, RECEIVED, SENT},
128+
};
129+
87130
const LOG_TARGET: &str = "wallet::ui::grpc";
88131

89132
async fn send_transaction_event(

0 commit comments

Comments
 (0)