Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-744 - Set BlockchainBridge free from blocking caused by RPC calls #456

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
e908666
Added base comments
Syther007 Sep 27, 2023
8b71081
GH-744: removed .wait() from handle_request_balances_to_pay_payables
Syther007 Sep 27, 2023
99e36a5
GH-744: added future return type to get_transaction_fee_balance
Syther007 Oct 2, 2023
4fba6f1
Fixed error mapping for .get_token_balance
Syther007 Oct 3, 2023
7d0d075
GH-744: Fixed failing tests, all tests passing
Syther007 Oct 3, 2023
159ad22
GH-744: Added future return to ReportAccountsPayable
Syther007 Oct 4, 2023
5b25bce
GH-744: Fixed more errors
Syther007 Oct 9, 2023
ffe6b81
GH-744: Added batch lifetime
Syther007 Oct 10, 2023
cb2f3e4
Revert "GH-744: Added batch lifetime"
Syther007 Oct 10, 2023
e5482f7
GH-744: Fixed more errors
Syther007 Oct 13, 2023
8093caf
GH-744: small clean up
Syther007 Oct 17, 2023
85529d0
GH-744: Moved batch_payable_tools functions
Syther007 Oct 24, 2023
aa811db
GH-744: send_payables_within_batch accounts changed to Vec
Syther007 Oct 25, 2023
d1659ec
GH-744: added blockchain_interface_slim
Syther007 Oct 30, 2023
0877056
Added blockchain_interface_utils.js
Syther007 Nov 1, 2023
a075b5d
GH-744: process_payments is working with futures
Syther007 Nov 3, 2023
70ee731
GH-744: Fixed a few more tests in blockchain_interface_utils
Syther007 Nov 6, 2023
2f03dbe
GH-744: Fixed test useing test_gas_limit_is_between_limits
Syther007 Nov 6, 2023
ba6a7f9
Changed sign_transaction_data amount data type to u128
Syther007 Nov 7, 2023
c7725b1
GH-744 converted handle_retrieve_transactions return type to future
Syther007 Nov 8, 2023
2a16982
GH-744: Fixed some error with handle_retrieve_transactions
Syther007 Nov 8, 2023
93189ec
GH-744: update_start_block_message_works test works
Syther007 Nov 13, 2023
231cce3
GH-744: Added get_batch_web3 Mock
Syther007 Nov 13, 2023
25593c5
GH-744: Fixed test report_accounts_payable_returns_error_fetching_pen…
Syther007 Nov 13, 2023
c313533
GH-744: fixed test process_payments_returns_error_from_sending_batch
Syther007 Nov 14, 2023
e771cd5
GH-744: fixed test handle_report_accounts_payable_transmits_eleventh_…
Syther007 Nov 20, 2023
d3a3694
GH-744: Edited test handle_report_accounts_payable_transacts_and_send…
Syther007 Nov 21, 2023
6c6a146
GH-744: updated test handle_report_accounts_payable_transacts_and_sen…
Syther007 Nov 22, 2023
e645549
GH-744: FIxed test handle_retrieve_transactions_sends_received_paymen…
Syther007 Nov 22, 2023
5e1dac1
GH-744: Update to test processing_of_received_payments_continues_even…
Syther007 Nov 22, 2023
cae5818
GH-744: Added Future return type to sign_transaction
Syther007 Nov 27, 2023
f7cd59f
GH-744: Added Future return to sign_and_append_payment
Syther007 Nov 27, 2023
6b3a0de
GH-744: sign_and_append_multiple_payments returns futures
Syther007 Dec 4, 2023
05bce93
GH-744: Fixed more test errors
Syther007 Dec 5, 2023
4bc36c7
GH-744: Fixed Lifetime issues
Syther007 Dec 5, 2023
814bfdb
GH-744: fixed some tests
Syther007 Dec 6, 2023
c87a357
GH-744: added new test: sign_transaction_just_works
Syther007 Dec 12, 2023
144064c
GH-744: cleaned up sign_transaction
Syther007 Dec 12, 2023
33fe30d
GH-744: Added tests sign_and_append_payment_just_works, sign_and_appe…
Syther007 Dec 20, 2023
c39d20e
GH-744: Warning clean up
Syther007 Jan 3, 2024
64765ad
GH-744: Cleanup & add todos
Syther007 Feb 5, 2024
9d43873
GH-744: removed Batch_web3
Syther007 Feb 5, 2024
b12ba5d
Merge branch 'master' into GH-744
Syther007 Feb 6, 2024
eb7004e
GH-744: Changes after merge
Syther007 Feb 6, 2024
7d663cc
GH-744: Merging Master, code is compiling
Syther007 Feb 20, 2024
ab424da
GH-744: Removed the generics from BlockchainInterface
Syther007 Feb 26, 2024
b446e14
GH-744: added get_service_fee_balance to Blockchain_interface
Syther007 Feb 27, 2024
f2b3b21
GH-744: Improved merge of retrieve_transactions
Syther007 Feb 28, 2024
4ee4739
GH-744: retrieve_transactions test are all passing
Syther007 Mar 5, 2024
d7b6aac
GH-744: Trying to fix test in BlockChainBridge
Syther007 Mar 12, 2024
3917967
GH-744: working on merging master
Syther007 Mar 15, 2024
7369aa2
GH-744: added testsign_and_append_multiple_payments_works
Syther007 Mar 19, 2024
192f2cf
GH-744: added test send_transaction_works
Syther007 Mar 26, 2024
d551ef8
GH-744: send_transaction_2() is working fine on Utkarsh's machine
utkarshg6 Mar 26, 2024
b58bbe6
GH-744: fixed a few blockchain interface tests
Syther007 Mar 26, 2024
4daefab
GH-744: add new tests for sign_and_append_payment()
utkarshg6 Mar 27, 2024
618fdd2
GH-744: Debugging Connection reset transport error
Syther007 Apr 5, 2024
0f3fdc8
GH-744: Migrated MBCSBuilder to masq_lib, fixed two tests
Syther007 Apr 8, 2024
dbac17b
GH-744: fixed alot of test within blockchain_interface_utils
Syther007 Apr 9, 2024
c75475d
GH-744: Added some tmp tests
Syther007 Apr 16, 2024
e145252
GH-744: Removed futures from send_and_append_multiple_payments functi…
Syther007 Apr 19, 2024
d5121b5
GH-744: Fixed a bunch of test for blockchain_interface_utils
Syther007 Apr 22, 2024
8f18b41
GH-744: added two tested for send_payables
Syther007 Apr 23, 2024
08cb2fe
GH-744: all tests passing on file blockchain_interface_utils
Syther007 Apr 24, 2024
53b2746
GH-744: added new test process_payments_works
Syther007 Apr 24, 2024
3059710
GH-744: Finished tests for process_payments
Syther007 Apr 26, 2024
8343ced
GH-744: added two tested for handle_outbound_payments_instructions
Syther007 Apr 29, 2024
07a7fe4
GH-744: Migrated get_transaction_fee_balance to blockchain_interface_…
Syther007 Apr 30, 2024
3a3bc39
GH-744: migrated get_token_balance to blockchain_interface_util
Syther007 Apr 30, 2024
395487a
GH-744: build_blockchain_agent now returns a Future
Syther007 May 8, 2024
efbba6b
GH-744: refactored build_blockchain_agent
Syther007 May 14, 2024
5a83f82
GH-744: Fixed formatting
Syther007 May 14, 2024
67a2ce9
GH-744: Fixed all test on blockchain_interface_web3/mod.rs
Syther007 May 21, 2024
b5ef74a
GH-744: Finished tests for handle_qualified_payable_msg
Syther007 May 22, 2024
a3e717b
GH-744: added get_gast_price to build_blockchain_agent
Syther007 May 27, 2024
840a204
GH-744: Removed persistent_config from build_blockchain_agent
Syther007 May 27, 2024
99f8e33
GH-744: clean up of build_blockchain_agent
Syther007 May 27, 2024
ea3125f
GH-744: refactored retrieve_transactions
Syther007 May 29, 2024
f023e86
GH-744: Fixed test handle_retrieve_transactions_sends_received_paymen…
Syther007 Jun 3, 2024
aa0692c
GH-744: all tests working on blockchain_bridge.rs
Syther007 Jun 5, 2024
2cfb4a3
GH-744: Cleaned up warnings
Syther007 Jun 7, 2024
17787ca
GH-744: Fixed a bunch of tests & clean up
Syther007 Jun 10, 2024
70fe63c
GH-744: get_transaction_fee_balance now returns a future
Syther007 Jun 17, 2024
6b688f8
GH-744: Migrated all functions back into lower_level_interface
Syther007 Jun 24, 2024
b892b06
GH-744: Fixed test: blockchain_bridge_is_constructed_with_correctly_f…
Syther007 Jun 25, 2024
b86d64d
GH-744: fixed test: blockchain_interface_null_as_result_of_missing_bl…
Syther007 Jun 25, 2024
b0e918b
GH-744: removed blockchain_interface_null
Syther007 Jun 25, 2024
7fb5a3b
GH-744: all tests within lower_level_interface are now working
Syther007 Jun 25, 2024
a32fabe
GH-744: Moved get_transaction_receipt_batch to lower_level_interface
Syther007 Jul 2, 2024
cee7825
GH-744: Added tests for transaction_receipt_batch
Syther007 Jul 2, 2024
df499b6
GH-744: All tests passing on blockchain_birdge
Syther007 Jul 8, 2024
c6c79f4
GH-744: added fn get_transaction_logs to lower_level_interface
Syther007 Jul 9, 2024
591e074
GH-744: added fn submit_payables_in_batch to lower_level_interface
Syther007 Jul 9, 2024
1d9dffc
GH-744: removed unnecessary functions from BlockchainInterface
Syther007 Jul 15, 2024
236247c
GH-744: Todo clean up
Syther007 Jul 15, 2024
3108a0b
GH-744: test: pending_transaction_is_registered_and_monitored_until_i…
Syther007 Jul 23, 2024
00661b8
GH-744: clean up & all tests pasing
Syther007 Jul 23, 2024
108fbaa
GH-744: cleanup of more todos
Syther007 Jul 29, 2024
ff74544
Merge branch 'master' of https://github.com/MASQ-Project/Node into GH…
Syther007 Jul 29, 2024
2288287
GH-744: Compiling after merge
Syther007 Jul 29, 2024
00cc396
GH-744: all but 1 tests are passing after merge
Syther007 Jul 30, 2024
f904a71
GH-744: Fixed pending_transaction_is_registered_and_monitored_until_i…
Syther007 Jul 31, 2024
b60a6a8
GH-744: Removed all warnings
Syther007 Jul 31, 2024
5598918
GH-744: Formatting
Syther007 Jul 31, 2024
01ff73c
GH-744: fixed all clippys warnings
Syther007 Aug 12, 2024
8a3f1e7
GH-744: multinode tests running, but failing on MBCS
Syther007 Aug 13, 2024
fed2a85
GH-744 fixed more multinode tests
Syther007 Aug 20, 2024
cfdb772
GH-744: Added check for wildcard ip inside neighborhood
Syther007 Aug 21, 2024
d54a3d0
GH-744: Fixed all multinode intergration tests
Syther007 Aug 28, 2024
e677373
GH-744: All tests are passing!
Syther007 Aug 28, 2024
1f5940d
GH-744: fixed test send_payables_within_batch_fails_on_submit_batch_c…
Syther007 Sep 2, 2024
0ea951c
GH-744: fixed handle_scan_future tests
Syther007 Sep 2, 2024
aee1544
GH-744: Added a fallback blockchain_service_url
Syther007 Sep 3, 2024
b9e7572
GH-744: changes for self review
Syther007 Sep 13, 2024
b6a0b65
GH-744: Removed gas_price_result from tests
Syther007 Sep 13, 2024
d098022
GH-744: Formatting
Syther007 Sep 16, 2024
ee5d17e
GH-744: Prepare for merge (#567)
utkarshg6 Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
target:
- { name: linux, os: ubuntu-22.04 }
- { name: macos, os: macos-12 }
- { name: macos, os: macos-13 }
- { name: windows, os: windows-2022 }

name: Build node on ${{ matrix.target.os }}
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ stage - MASQ Network and it's developers are not responsible for any activity, o
## Source
The MASQ project was forked from Substratum's Node project in order to carry on development after Substratum ceased
operations in October of 2019. In 2021, Substratum's Node repositories were removed from GitHub, so the fork link
with MASQ was broken, but all credit for the original idea, the original design, and the first two years of MASQ's
development belongs to Substratum.
with MASQ was broken, but all credit for the original idea and the original design belongs to Substratum (and properly attributed through GPLv3 license)

## Running the MASQ Node

Expand Down Expand Up @@ -452,6 +451,4 @@ recommend using a 64-bit version to build.

We do plan to release binaries that will run on 32-bit Windows, but they will likely be built on 64-bit Windows.

Copyright (c) 2019-2022, MASQ Network

Copyright (c) 2017-2019, Substratum LLC and/or its affiliates. All rights reserved.
Copyright (c) 2019-2024, MASQ Network
4 changes: 2 additions & 2 deletions automap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion automap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "automap"
version = "0.8.0"
version = "0.8.2"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Library full of code to make routers map ports through firewalls"
Expand Down
4 changes: 2 additions & 2 deletions dns_utility/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dns_utility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dns_utility"
version = "0.8.0"
version = "0.8.2"
license = "GPL-3.0-only"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
copyright = "Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved."
Expand Down
2 changes: 1 addition & 1 deletion masq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masq"
version = "0.8.0"
version = "0.8.2"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Reference implementation of user interface for MASQ Node"
Expand Down
13 changes: 8 additions & 5 deletions masq/src/commands/configuration_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ impl ConfigurationCommand {
dump_parameter_line(
stream,
"Start block:",
&configuration.start_block.to_string(),
&configuration
.start_block_opt
.map(|m| m.separate_with_commas())
.unwrap_or_else(|| "[Latest]".to_string()),
);
Self::dump_value_list(stream, "Past neighbors:", &configuration.past_neighbors);
let payment_thresholds = Self::preprocess_combined_parameters({
Expand Down Expand Up @@ -333,7 +336,7 @@ mod tests {
exit_byte_rate: 129000000,
exit_service_rate: 160000000,
},
start_block: 3456,
start_block_opt: None,
scan_intervals: UiScanIntervals {
pending_payable_sec: 150500,
payable_sec: 155000,
Expand Down Expand Up @@ -378,7 +381,7 @@ mod tests {
|Max block count: [Unlimited]\n\
|Neighborhood mode: standard\n\
|Port mapping protocol: PCP\n\
|Start block: 3456\n\
|Start block: [Latest]\n\
|Past neighbors: neighbor 1\n\
| neighbor 2\n\
|Payment thresholds: \n\
Expand Down Expand Up @@ -433,7 +436,7 @@ mod tests {
exit_byte_rate: 20,
exit_service_rate: 30,
},
start_block: 3456,
start_block_opt: Some(1234567890u64),
scan_intervals: UiScanIntervals {
pending_payable_sec: 1000,
payable_sec: 1000,
Expand Down Expand Up @@ -476,7 +479,7 @@ mod tests {
|Max block count: 100,000\n\
|Neighborhood mode: zero-hop\n\
|Port mapping protocol: PCP\n\
|Start block: 3456\n\
|Start block: 1,234,567,890\n\
|Past neighbors: [?]\n\
|Payment thresholds: \n\
| Debt threshold: 2,500 gwei\n\
Expand Down
41 changes: 34 additions & 7 deletions masq/src/commands/set_configuration_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use masq_lib::shared_schema::gas_price_arg;
use masq_lib::shared_schema::min_hops_arg;
use masq_lib::short_writeln;
use masq_lib::utils::ExpectValue;
use std::num::IntErrorKind;

#[derive(Debug, PartialEq, Eq)]
pub struct SetConfigurationCommand {
Expand Down Expand Up @@ -35,9 +36,17 @@ impl SetConfigurationCommand {
}

fn validate_start_block(start_block: String) -> Result<(), String> {
match start_block.parse::<u64>() {
Ok(_) => Ok(()),
_ => Err(start_block),
if "latest".eq_ignore_ascii_case(&start_block) || "none".eq_ignore_ascii_case(&start_block) {
Ok(())
} else {
match start_block.parse::<u64>() {
Ok(_) => Ok(()),
Err(e) if e.kind() == &IntErrorKind::PosOverflow => Err(
format!("Unable to parse '{}' into a starting block number or provide 'none' or 'latest' for the latest block number: digits exceed {}.",
start_block, u64::MAX),
),
Err(e) => Err(format!("Unable to parse '{}' into a starting block number or provide 'none' or 'latest' for the latest block number: {}.", start_block, e))
}
}
}

Expand All @@ -59,7 +68,7 @@ impl Command for SetConfigurationCommand {
const SET_CONFIGURATION_ABOUT: &str =
"Sets Node configuration parameters being enabled for this operation when the Node is running.";
const START_BLOCK_HELP: &str =
"Ordinal number of the Ethereum block where scanning for transactions will start.";
"Ordinal number of the Ethereum block where scanning for transactions will start. Use 'latest' or 'none' for Latest block.";

pub fn set_configurationify<'a>(shared_schema_arg: Arg<'a, 'a>) -> Arg<'a, 'a> {
shared_schema_arg.takes_value(true).min_values(1)
Expand Down Expand Up @@ -103,7 +112,7 @@ mod tests {
);
assert_eq!(
START_BLOCK_HELP,
"Ordinal number of the Ethereum block where scanning for transactions will start."
"Ordinal number of the Ethereum block where scanning for transactions will start. Use 'latest' or 'none' for Latest block."
);
}

Expand All @@ -122,10 +131,28 @@ mod tests {
assert!(result.contains("cannot be used with one or more of the other specified arguments"));
}

#[test]
fn validate_start_block_catches_invalid_values() {
assert_eq!(validate_start_block("abc".to_string()), Err("Unable to parse 'abc' into a starting block number or provide 'none' or 'latest' for the latest block number: invalid digit found in string.".to_string()));
assert_eq!(validate_start_block("918446744073709551615".to_string()), Err("Unable to parse '918446744073709551615' into a starting block number or provide 'none' or 'latest' for the latest block number: digits exceed 18446744073709551615.".to_string()));
assert_eq!(validate_start_block("123,456,789".to_string()), Err("Unable to parse '123,456,789' into a starting block number or provide 'none' or 'latest' for the latest block number: invalid digit found in string.".to_string()));
assert_eq!(validate_start_block("123'456'789".to_string()), Err("Unable to parse '123'456'789' into a starting block number or provide 'none' or 'latest' for the latest block number: invalid digit found in string.".to_string()));
}
#[test]
fn validate_start_block_works() {
assert!(validate_start_block("abc".to_string()).is_err());
assert!(validate_start_block("1566".to_string()).is_ok());
assert_eq!(
validate_start_block("18446744073709551615".to_string()),
Ok(())
);
assert_eq!(validate_start_block("1566".to_string()), Ok(()));
assert_eq!(validate_start_block("none".to_string()), Ok(()));
assert_eq!(validate_start_block("None".to_string()), Ok(()));
assert_eq!(validate_start_block("NONE".to_string()), Ok(()));
assert_eq!(validate_start_block("nOnE".to_string()), Ok(()));
assert_eq!(validate_start_block("latest".to_string()), Ok(()));
assert_eq!(validate_start_block("LATEST".to_string()), Ok(()));
assert_eq!(validate_start_block("LaTeST".to_string()), Ok(()));
assert_eq!(validate_start_block("lATEst".to_string()), Ok(()));
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions masq/tests/startup_shutdown_tests_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ fn handles_startup_and_shutdown_integration() {
"zero-hop",
"--data-directory",
dir_path.to_str().unwrap(),
"--blockchain-service-url",
"https://nonexistentblockchainservice.com",
]);

let (stdout, stderr, exit_code) = masq_handle.stop();
Expand Down
2 changes: 1 addition & 1 deletion masq_lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "masq_lib"
version = "0.8.0"
version = "0.8.2"
authors = ["Dan Wiebe <[email protected]>", "MASQ"]
license = "GPL-3.0-only"
description = "Code common to Node and masq; also, temporarily, to dns_utility"
Expand Down
Loading