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-651: Automatic Retries for the URLs in case of DNS Resolve Failure #326

Merged
merged 104 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
d43c110
GH-651: we identified the appropriate place for the new logic
May 26, 2023
781ff60
GH-651: added in a missing Zero hop test
May 26, 2023
870846d
GH-651: add todos for this card
utkarshg6 May 29, 2023
402670e
GH-651: repaired current tests
Syther007 May 29, 2023
5c82b5e
GH-651: Added IBCDHelperReal factory
Syther007 May 29, 2023
c8cb948
GH-651: worked on test: handle_dns_resolve_failure_sent_request_retry
Syther007 May 30, 2023
db7532c
GH-651: Before master merge
Syther007 May 31, 2023
5e223dc
Merge branch 'master' into GH-651
Syther007 May 31, 2023
dd5c84c
GH-651: Repaired master meage
Syther007 May 31, 2023
e91b145
GH-651: Testing is working but stil failing
Syther007 Jun 5, 2023
4e5c9ed
GH-651: Test is now working
Syther007 Jun 5, 2023
b6477e5
GH-651: Added some more Cassertions
Syther007 Jun 6, 2023
f877ed0
GH-651: Test is now working as expected
Syther007 Jun 6, 2023
e604ab3
GH-651: Added new macro: type_id
Syther007 Jun 7, 2023
dcc574b
GH-651: Fixed RouteQueryMessage stop condition
Syther007 Jun 7, 2023
ce141a7
GH-651: started work on stop_on_message
Syther007 Jun 7, 2023
d17c23f
GH-651: Finished stop_on_message
Syther007 Jun 9, 2023
4e00379
GH-651: Added retiring stream key code to test
Syther007 Jun 9, 2023
01319c5
GH-651: Working on improving request_route_and_transmit
Syther007 Jun 9, 2023
4473aa9
GH-651: Changes from Dev meeting
Syther007 Jun 12, 2023
68468f7
GH-651: Fixed a test for error log case
Syther007 Jun 12, 2023
80dc429
GH-651: Fixed all tests
Syther007 Jun 12, 2023
353ea2a
GH-651: Added a todo
Syther007 Jun 13, 2023
1919e00
GH-651: Removed dns_failure_retries after exhausting its retry count
Syther007 Jun 13, 2023
06987ee
GH-651: Added function dns_failure_retries_left
Syther007 Jun 13, 2023
49fca11
GH-651: Refactored handle_dns_resolve_failure function
Syther007 Jun 13, 2023
0b2423b
GH-651: Remove return from request_route_and_transmit
Syther007 Jun 16, 2023
1a4c9f0
GH-651: Formatting
Syther007 Jun 16, 2023
e94f295
GH-651: renamed stream_shutdown_sub to dispatcher_sub
Syther007 Jun 16, 2023
fe0d7fb
GH-651: more renaming
Syther007 Jun 19, 2023
0e1f122
GH-651: created send_dns_failure_response_to_the_browser function
Syther007 Jun 19, 2023
87cf96b
GH-651: Updated dns_resolution_failure_response message
Syther007 Jun 19, 2023
63a02d8
GH-651: Added todo
Syther007 Jun 19, 2023
0c38991
GH-651: Added a new message DnsRetryResultMessage under ProxyServer
Syther007 Jun 20, 2023
3f4a0cf
GH-651: implement Ok result for DnsRetryResultMessage
Syther007 Jun 20, 2023
12cd1b4
GH-651: Fixed some tests
Syther007 Jun 20, 2023
ed97088
GH-651: Refactored resolve_message
Syther007 Jun 21, 2023
f1cfc69
GH-651: Fixed test resolve_message_handles_mailbox_error_from_neighbo…
Syther007 Jun 21, 2023
8b075f1
GH-651: Refactored proxy_server/mod.rs
Syther007 Jun 21, 2023
148486a
GH-651: Removed AddRouteMessage
Syther007 Jun 21, 2023
90ef164
GH-651: Renamed DnsRetryResultMessage to RouteResultMessage
Syther007 Jun 21, 2023
759777f
GH-651: Added TODOs for next session
Syther007 Jun 21, 2023
bbf5e3f
GH-651: Added new struct Hostname
Syther007 Jul 11, 2023
9169ebe
GH-651: Add new test new_http_request_creates_new_entry_inside_dns_re…
Syther007 Jul 14, 2023
0fc3eef
GH-651: complete test new_http_request_creates_new_entry_inside_dns_r…
Syther007 Jul 14, 2023
f937ebf
GH-651: Fixed todos and added a new test
Syther007 Jul 17, 2023
d2ec26d
GH-651: Added test proxy_server_receives_failed_dns_then_a_successful…
Syther007 Jul 19, 2023
3802cb4
GH-651: Remove test proxy_server_receives_failed_dns_then_a_successfu…
Syther007 Jul 19, 2023
c00cbb7
GH-651: Ceanup - tests passing
Syther007 Jul 19, 2023
ebc2af3
GH-651: Fixed test dns_resolution_failure_no_longer_blacklists_exit_n…
Syther007 Jul 21, 2023
b2e4067
GH-651: Added test dns_resolution_failure_automatic_retries_works
Syther007 Jul 21, 2023
ac96dee
Added new test dns_resolution_failure_with_real_nodes
Syther007 Jul 24, 2023
5959f5a
GH-651: Working on test: dns_resolution_failure_with_real_nodes_route…
Syther007 Jul 31, 2023
90ed699
GH-651: Test dns_resolution_failure_with_real_nodes_route_error is wo…
Syther007 Aug 1, 2023
6aa2e99
GH-651: Added new enum MessageTypeLite with test
Syther007 Aug 1, 2023
679137c
GH-651: added new function: wait_for_specific_package
Syther007 Aug 2, 2023
ee8fc59
GH-651: added new function: make_package_for_client
Syther007 Aug 2, 2023
4f38e04
GH-651: Refactoring / cleanup
Syther007 Aug 2, 2023
7f88264
GH-651: fixed routes for function make_package_for_client
Syther007 Aug 2, 2023
f4d8ddf
GH-651: Removed test: dns_resolution_failure_automatic_retries_works
Syther007 Aug 4, 2023
5353d67
GH-651: fixing test dns_resolution_failure_no_longer_blacklists_exit_…
Syther007 Aug 4, 2023
7fb7c96
GH-651: working on dns_resolution_failure_no_longer_blacklists_exit_n…
Syther007 Aug 7, 2023
499ad2d
GH-651: Finished test: dns_resolution_failure_no_longer_blacklists_ex…
Syther007 Aug 7, 2023
c70554c
GH-651: added new logs RouteResultMessage handler
Syther007 Aug 7, 2023
6a971c1
GH-651: Added new test: route_result_message_handler_panics_when_dns_…
Syther007 Aug 8, 2023
1dae7d1
GH-651: Formatting
Syther007 Aug 8, 2023
faacc5a
GH-651: Removed warnings
Syther007 Aug 8, 2023
34192d5
GH-651: ci-matrix multinode_integration_test DEBUG
Syther007 Aug 9, 2023
9a54e6f
GH-651: Increased timeouts
Syther007 Aug 11, 2023
48cc56c
GH-651: Increased Node count for test dns_resolution_failure_with_rea…
Syther007 Aug 11, 2023
6203573
GH-651: Increase timeout for test dns_resolution_failure_with_real_nodes
Syther007 Aug 14, 2023
029cff6
GH-651: changed timeout for test dns_resolution_failure_with_real_nodes
Syther007 Aug 15, 2023
82c93a3
Merge branch 'master' into GH-651
Syther007 Aug 15, 2023
9a895b7
GH-651: added removal of DNS retry entry on a successful client respo…
Syther007 Aug 16, 2023
13ed3e7
GH-651: test clean up
Syther007 Aug 16, 2023
0a80a8b
GH-651: More clean up
Syther007 Aug 16, 2023
477ab06
GH-651: Finished self review
Syther007 Aug 21, 2023
048a1fc
GH651: added modity_config closure to construct_neighborhood
Syther007 Aug 28, 2023
60d1cac
GH-651: formatting
Syther007 Aug 28, 2023
96af33b
GH-651: Working on review 1
Syther007 Sep 1, 2023
5bdec3c
GH-651: More work completed for review 1
Syther007 Sep 4, 2023
635e92e
GH651: Completed more items form review 1
Syther007 Sep 5, 2023
563f8e5
GH651: Completed more items form review 1
Syther007 Sep 6, 2023
54ae3cc
GH651: Completed more items form review 1
Syther007 Sep 6, 2023
07b51c5
GH651: Completed more items form review 1
Syther007 Sep 8, 2023
5273dd2
GH-651: Clean up of peer_actors.proxy_server
Syther007 Sep 8, 2023
90520f6
GH-651 Formatting
Syther007 Sep 8, 2023
49017f6
GH651: Improved TryTransmitToHopperArgs::New
Syther007 Sep 18, 2023
5d1e6e1
GH-651: added new test new_http_request_creates_new_exhausted_entry_i…
Syther007 Sep 18, 2023
065340d
GH-651: Simple Renaming
Syther007 Sep 18, 2023
d8118d9
GH-651: Added condition to test: handle_dns_resolve_failure_sends_mes…
Syther007 Sep 19, 2023
b904b14
GH-651: Fixed System new name
Syther007 Sep 20, 2023
7e26744
GH-651: Removed zsh text
Syther007 Sep 25, 2023
72cf995
Merge remote-tracking branch 'origin/master' into GH-651
Syther007 Nov 21, 2023
529dc85
GH-651: Merged in Master
Syther007 Nov 21, 2023
aa2a9dd
GH-651: doubious test fixed
bertllll Nov 26, 2023
f19b47c
GH-651: Removed test proxy_server_applies_late_wallet_information
Syther007 Nov 27, 2023
09e1bf3
GH-651: Added new test fn dns_resolution_failure_for_wildcard_ip_with…
Syther007 Dec 11, 2023
7e4c773
GH-651: Added new test wildcard_ip_resolves_in_dns_failure
Syther007 Dec 18, 2023
0c8cc86
GH-651: Sends DnsResolveFailure_0v1 for DNS failure & wildcard IP
Syther007 Dec 19, 2023
ca51e89
GH-651: fixed test dns_resolution_failure_for_wildcard_ip_with_real_n…
Syther007 Dec 19, 2023
2445415
GH-651: Ignoring test actual_server_drop
Syther007 Dec 20, 2023
1c76ff2
GH-651: IP wildcard filter added with test
Syther007 Jan 2, 2024
a61ce23
Merge remote-tracking branch 'origin/master' into GH-651
Syther007 Jan 12, 2024
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
30 changes: 29 additions & 1 deletion multinode_integration_tests/src/masq_mock_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use node_lib::sub_lib::cryptde::{encodex, CryptDE};
use node_lib::sub_lib::cryptde_null::CryptDENull;
use node_lib::sub_lib::cryptde_real::CryptDEReal;
use node_lib::sub_lib::framer::Framer;
use node_lib::sub_lib::hopper::{IncipientCoresPackage, MessageType};
use node_lib::sub_lib::hopper::{
ExpiredCoresPackage, IncipientCoresPackage, MessageType, MessageTypeLite,
};
use node_lib::sub_lib::neighborhood::{GossipFailure_0v1, RatePack, DEFAULT_RATE_PACK};
use node_lib::sub_lib::node_addr::NodeAddr;
use node_lib::sub_lib::route::Route;
Expand Down Expand Up @@ -394,6 +396,32 @@ impl MASQMockNode {
Ok((socket_from, socket_to, live_cores_package))
}

pub fn wait_for_specific_package(
&self,
message_type_lite: MessageTypeLite,
immediate_neighbor: SocketAddr,
) -> Option<ExpiredCoresPackage<MessageType>> {
let public_key = self.main_public_key();
let cryptde = CryptDENull::from(public_key, TEST_DEFAULT_MULTINODE_CHAIN);
loop {
if let Ok((_, _, live_cores_package)) =
self.wait_for_package(&JsonMasquerader::new(), Duration::from_secs(2))
{
let (_, intended_exit_public_key) =
CryptDENull::extract_key_pair(public_key.len(), &live_cores_package.payload);
assert_eq!(&intended_exit_public_key, public_key);
let expired_cores_package = live_cores_package
.to_expired(immediate_neighbor, &cryptde, &cryptde)
.unwrap();
if message_type_lite == expired_cores_package.payload.clone().into() {
return Some(expired_cores_package);
}
} else {
return None;
}
}
}

pub fn wait_for_gossip(&self, timeout: Duration) -> Option<(Gossip_0v1, IpAddr)> {
let masquerader = JsonMasquerader::new();
match self.wait_for_package(&masquerader, timeout) {
Expand Down
3 changes: 3 additions & 0 deletions multinode_integration_tests/src/neighborhood_constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use node_lib::neighborhood::neighborhood_database::NeighborhoodDatabase;
use node_lib::neighborhood::node_record::{NodeRecord, NodeRecordMetadata};
use node_lib::neighborhood::AccessibleGossipRecord;
use node_lib::sub_lib::cryptde::PublicKey;
use node_lib::sub_lib::neighborhood::Hops;
use node_lib::sub_lib::utils::time_t_timestamp;
use node_lib::test_utils::neighborhood_test_utils::db_from_node;
use std::collections::{BTreeSet, HashMap};
Expand Down Expand Up @@ -55,6 +56,7 @@ pub fn construct_neighborhood(
cluster: &mut MASQNodeCluster,
model_db: NeighborhoodDatabase,
additional_keys_to_mock: Vec<&PublicKey>,
min_hops: Hops,
Syther007 marked this conversation as resolved.
Show resolved Hide resolved
) -> (
NeighborhoodDatabase,
MASQRealNode,
Expand All @@ -66,6 +68,7 @@ pub fn construct_neighborhood(
.consuming_wallet_info(make_consuming_wallet_info(
model_db.root().public_key().to_string().as_str(),
))
.min_hops(min_hops)
.rate_pack(model_db.root().inner.rate_pack)
.chain(cluster.chain)
.build(),
Expand Down
Loading