Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bb8e699
Functionality and tests. What's the big picture now?
dnwiebe Oct 28, 2025
61d70f5
I think that might be it
dnwiebe Oct 28, 2025
6f57d99
Review issues
dnwiebe Oct 30, 2025
cad907e
Starting Node validation
dnwiebe Oct 30, 2025
84e31c5
One test failing
dnwiebe Nov 9, 2025
0fc232b
First Standard Gossip test passing
dnwiebe Nov 10, 2025
cf83017
Some tests are passing. Are all tests passing?
dnwiebe Nov 15, 2025
a0a4503
Do the multinode tests pass in Actions?
dnwiebe Nov 17, 2025
c33fe6d
Formatting
dnwiebe Nov 17, 2025
c84ef09
Adjusted Gossip handling. Multinode tests don't always work.
dnwiebe Dec 1, 2025
47b6353
Now Pass Gossip must contain a Node that accepts connections
dnwiebe Dec 2, 2025
45e87b6
GossipAcceptor unit tests pass
dnwiebe Dec 9, 2025
c5374e6
Just installed Sweep; haven't used yet
dnwiebe Jan 7, 2026
0a72126
provided_and_consumed_services_are_recorded_in_databases seems to pas…
dnwiebe Jan 14, 2026
b6d4de2
Multinode tests passing
dnwiebe Jan 18, 2026
3735030
All tests pass
dnwiebe Jan 18, 2026
9313296
Merge branch 'master' into GH-686-gossip
dnwiebe Jan 18, 2026
db8d8f3
A couple of tests no longer depend on COUNTRY_CODE_FINDER
dnwiebe Jan 18, 2026
8ef7a42
More review issues
dnwiebe Jan 29, 2026
4ebf2f6
Review issues
dnwiebe Jan 29, 2026
53cadb4
Switched a multinode test over from www.example.com to www.testingmca…
dnwiebe Jan 30, 2026
a0015c0
A few review issues
dnwiebe Feb 11, 2026
9ad548f
A few review issues
dnwiebe Feb 16, 2026
f83eb54
More review issues
dnwiebe Feb 17, 2026
3c3ba29
Review issues from cursorbot
dnwiebe Feb 18, 2026
fcebb7c
Formatting
dnwiebe Feb 18, 2026
fd2f6f2
Corrected a comment
dnwiebe Feb 18, 2026
608079d
A little minor cleanup
dnwiebe Feb 24, 2026
db7e56d
resolve import to test
czarte Feb 26, 2026
21f2a2a
formatting
czarte Feb 26, 2026
a82458e
Switched another test from www.example.com to mcafeetesting.com
dnwiebe Mar 2, 2026
1c482e7
Merge branch 'GH-686' of github.com:MASQ-Project/Node into GH-686
dnwiebe Mar 2, 2026
f99d346
example.com -> testingmcafeesites.com
dnwiebe Mar 16, 2026
76d0b97
More example.com -> mcafeetestingsites.com, but not all
dnwiebe Mar 16, 2026
bfef587
Merged in master
dnwiebe Mar 19, 2026
caea7fe
In the process of merging in master
dnwiebe Mar 26, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**/*.rs.bk
.idea/azure/
.idea/inspectionProfiles/Project_Default.xml
.idea/copilot.*

### Node
node_modules
Expand Down
2 changes: 1 addition & 1 deletion masq_lib/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::data_version::DataVersion;
use const_format::concatcp;

pub const DEFAULT_CHAIN: Chain = Chain::BaseMainnet;
pub const CURRENT_SCHEMA_VERSION: usize = 11;
pub const CURRENT_SCHEMA_VERSION: usize = 12;

pub const HIGHEST_RANDOM_CLANDESTINE_PORT: u16 = 9999;
pub const HTTP_PORT: u16 = 80;
Expand Down
26 changes: 14 additions & 12 deletions node/src/daemon/setup_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ mod tests {
("neighborhood-mode", "originate-only", Set),
("neighbors", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678", Set),
("payment-thresholds","1234|50000|1000|1000|20000|20000",Set),
("rate-pack","1|3|3|8",Set),
("rate-pack","100|300|300|800",Set),
#[cfg(not(target_os = "windows"))]
("real-user", "9999:9999:booga", Set),
("scan-intervals","150|150|150",Set),
Expand Down Expand Up @@ -1548,7 +1548,7 @@ mod tests {
("neighborhood-mode", "originate-only", Set),
("neighbors", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678", Set),
("payment-thresholds","1234|50000|1000|1000|20000|20000",Set),
("rate-pack","1|3|3|8",Set),
("rate-pack","100|300|300|800",Set),
#[cfg(not(target_os = "windows"))]
("real-user", "9999:9999:booga", Set),
("scan-intervals","150|150|150",Set),
Expand Down Expand Up @@ -1588,7 +1588,7 @@ mod tests {
("neighborhood-mode", "originate-only"),
("neighbors", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678"),
("payment-thresholds","1234|50000|1000|1000|15000|15000"),
("rate-pack","1|3|3|8"),
("rate-pack","100|300|300|800"),
#[cfg(not(target_os = "windows"))]
("real-user", "9999:9999:booga"),
("scan-intervals","140|130|150"),
Expand Down Expand Up @@ -1623,7 +1623,7 @@ mod tests {
("neighborhood-mode", "originate-only", Set),
("neighbors", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678", Set),
("payment-thresholds","1234|50000|1000|1000|15000|15000",Set),
("rate-pack","1|3|3|8",Set),
("rate-pack","100|300|300|800",Set),
#[cfg(not(target_os = "windows"))]
("real-user", "9999:9999:booga", Set),
("scan-intervals","140|130|150",Set),
Expand Down Expand Up @@ -1664,7 +1664,7 @@ mod tests {
("MASQ_NEIGHBORHOOD_MODE", "originate-only"),
("MASQ_NEIGHBORS", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678"),
("MASQ_PAYMENT_THRESHOLDS","12345|50000|1000|1234|19000|20000"),
("MASQ_RATE_PACK","1|3|3|8"),
("MASQ_RATE_PACK","100|300|300|800"),
#[cfg(not(target_os = "windows"))]
("MASQ_REAL_USER", "9999:9999:booga"),
("MASQ_SCANS", "off"),
Expand Down Expand Up @@ -1696,7 +1696,7 @@ mod tests {
("neighborhood-mode", "originate-only", Configured),
("neighbors", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678", Configured),
("payment-thresholds","12345|50000|1000|1234|19000|20000",Configured),
("rate-pack","1|3|3|8",Configured),
("rate-pack","100|300|300|800",Configured),
#[cfg(not(target_os = "windows"))]
("real-user", "9999:9999:booga", Configured),
("scan-intervals","133|133|111",Configured),
Expand Down Expand Up @@ -1756,7 +1756,9 @@ mod tests {
.write_all(b"neighborhood-mode = \"standard\"\n")
.unwrap();
config_file.write_all(b"scans = \"off\"\n").unwrap();
config_file.write_all(b"rate-pack = \"2|2|2|2\"\n").unwrap();
config_file
.write_all(b"rate-pack = \"200|200|200|200\"\n")
.unwrap();
config_file
.write_all(b"payment-thresholds = \"3333|55|33|646|999|999\"\n")
.unwrap();
Expand Down Expand Up @@ -1799,7 +1801,7 @@ mod tests {
.unwrap();
config_file.write_all(b"scans = \"off\"\n").unwrap();
config_file
.write_all(b"rate-pack = \"55|50|60|61\"\n")
.write_all(b"rate-pack = \"5500|5000|6000|6100\"\n")
.unwrap();
config_file
.write_all(b"payment-thresholds = \"4000|1000|3000|3333|10000|20000\"\n")
Expand Down Expand Up @@ -1864,7 +1866,7 @@ mod tests {
"4000|1000|3000|3333|10000|20000",
Configured,
),
("rate-pack", "55|50|60|61", Configured),
("rate-pack", "5500|5000|6000|6100", Configured),
#[cfg(not(target_os = "windows"))]
(
"real-user",
Expand Down Expand Up @@ -1914,7 +1916,7 @@ mod tests {
("MASQ_NEIGHBORHOOD_MODE", "originate-only"),
("MASQ_NEIGHBORS", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678"),
("MASQ_PAYMENT_THRESHOLDS","1234|50000|1000|1000|20000|20000"),
("MASQ_RATE_PACK","1|3|3|8"),
("MASQ_RATE_PACK","100|300|300|800"),
#[cfg(not(target_os = "windows"))]
("MASQ_REAL_USER", "9999:9999:booga"),
("MASQ_SCANS", "off"),
Expand Down Expand Up @@ -1977,7 +1979,7 @@ mod tests {
Set,
),
("payment-thresholds", "4321|66666|777|987|123456|124444", Set),
("rate-pack", "10|30|13|28", Set),
("rate-pack", "1000|3000|1300|2800", Set),
#[cfg(not(target_os = "windows"))]
("real-user", "6666:6666:agoob", Set),
("scan-intervals", "111|111|111", Set),
Expand Down Expand Up @@ -2011,7 +2013,7 @@ mod tests {
("neighborhood-mode", "originate-only", Configured),
("neighbors", "masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@1.2.3.4:1234,masq://base-sepolia:MTIzNDU2Nzg5MTEyMzQ1Njc4OTIxMjM0NTY3ODkzMTI@5.6.7.8:5678", Configured),
("payment-thresholds","1234|50000|1000|1000|20000|20000",Configured),
("rate-pack","1|3|3|8",Configured),
("rate-pack","100|300|300|800",Configured),
#[cfg(not(target_os = "windows"))]
("real-user", "9999:9999:booga", Configured),
("scan-intervals","150|150|155",Configured),
Expand Down
23 changes: 21 additions & 2 deletions node/src/database/db_initializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::database::db_migrations::db_migrator::{DbMigrator, DbMigratorReal};
use crate::db_config::secure_config_layer::EXAMPLE_ENCRYPTED;
use crate::neighborhood::DEFAULT_MIN_HOPS;
use crate::sub_lib::accountant::{DEFAULT_PAYMENT_THRESHOLDS, DEFAULT_SCAN_INTERVALS};
use crate::sub_lib::neighborhood::DEFAULT_RATE_PACK;
use crate::sub_lib::neighborhood::{DEFAULT_RATE_PACK, DEFAULT_RATE_PACK_LIMITS};
use crate::sub_lib::utils::db_connection_launch_panic;
use masq_lib::blockchains::chains::Chain;
use masq_lib::constants::{
Expand Down Expand Up @@ -256,6 +256,13 @@ impl DbInitializerReal {
false,
"rate pack",
);
Self::set_config_value(
conn,
"rate_pack_limits",
Some(DEFAULT_RATE_PACK_LIMITS),
false,
"rate pack limits",
);
Self::set_config_value(
conn,
"scan_intervals",
Expand Down Expand Up @@ -661,7 +668,7 @@ mod tests {
#[test]
fn constants_have_correct_values() {
assert_eq!(DATABASE_FILE, "node-data.db");
assert_eq!(CURRENT_SCHEMA_VERSION, 11);
assert_eq!(CURRENT_SCHEMA_VERSION, 12);
}

#[test]
Expand Down Expand Up @@ -959,6 +966,12 @@ mod tests {
Some(&DEFAULT_RATE_PACK.to_string()),
false,
);
verify(
&mut config_vec,
"rate_pack_limits",
Some(DEFAULT_RATE_PACK_LIMITS),
false,
);
verify(
&mut config_vec,
"scan_intervals",
Expand Down Expand Up @@ -1071,6 +1084,12 @@ mod tests {
Some(&DEFAULT_RATE_PACK.to_string()),
false,
);
verify(
&mut config_vec,
"rate_pack_limits",
Some(DEFAULT_RATE_PACK_LIMITS),
false,
);
verify(
&mut config_vec,
"scan_intervals",
Expand Down
2 changes: 2 additions & 0 deletions node/src/database/db_migrations/db_migrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::database::db_initializer::ExternalData;
use crate::database::db_migrations::migrations::migration_0_to_1::Migrate_0_to_1;
use crate::database::db_migrations::migrations::migration_10_to_11::Migrate_10_to_11;
use crate::database::db_migrations::migrations::migration_11_to_12::Migrate_11_to_12;
use crate::database::db_migrations::migrations::migration_1_to_2::Migrate_1_to_2;
use crate::database::db_migrations::migrations::migration_2_to_3::Migrate_2_to_3;
use crate::database::db_migrations::migrations::migration_3_to_4::Migrate_3_to_4;
Expand Down Expand Up @@ -82,6 +83,7 @@ impl DbMigratorReal {
&Migrate_8_to_9,
&Migrate_9_to_10,
&Migrate_10_to_11,
&Migrate_11_to_12,
]
}

Expand Down
77 changes: 77 additions & 0 deletions node/src/database/db_migrations/migrations/migration_11_to_12.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright (c) 2019, MASQ (https://masq.ai) and/or its affiliates. All rights reserved.

use crate::database::db_migrations::db_migrator::DatabaseMigration;
use crate::database::db_migrations::migrator_utils::DBMigDeclarator;
use crate::sub_lib::neighborhood::DEFAULT_RATE_PACK_LIMITS;

#[allow(non_camel_case_types)]
pub struct Migrate_11_to_12;

impl DatabaseMigration for Migrate_11_to_12 {
fn migrate<'a>(
&self,
declaration_utils: Box<dyn DBMigDeclarator + 'a>,
) -> rusqlite::Result<()> {
declaration_utils.execute_upon_transaction(&[&format!(
"INSERT INTO config (name, value, encrypted) VALUES ('rate_pack_limits', '{}', 0)",
DEFAULT_RATE_PACK_LIMITS
)])
}

fn old_version(&self) -> usize {
11
}
}

#[cfg(test)]
mod tests {
use crate::database::db_initializer::{
DbInitializationConfig, DbInitializer, DbInitializerReal, DATABASE_FILE,
};
use crate::test_utils::database_utils::{
bring_db_0_back_to_life_and_return_connection, make_external_data, retrieve_config_row,
};
use masq_lib::test_utils::utils::ensure_node_home_directory_exists;
use std::fs::create_dir_all;

#[test]
fn migration_from_11_to_12_is_properly_set() {
let dir_path = ensure_node_home_directory_exists(
"db_migrations",
"migration_from_11_to_12_is_properly_set",
);
create_dir_all(&dir_path).unwrap();
let db_path = dir_path.join(DATABASE_FILE);
let _ = bring_db_0_back_to_life_and_return_connection(&db_path);
let subject = DbInitializerReal::default();

let result = subject.initialize_to_version(
&dir_path,
11,
DbInitializationConfig::create_or_migrate(make_external_data()),
);

assert!(result.is_ok());

let result = subject.initialize_to_version(
&dir_path,
12,
DbInitializationConfig::create_or_migrate(make_external_data()),
);

assert!(result.is_ok());
let connection = result.unwrap();
let (lc_value, lc_encrypted) = retrieve_config_row(connection.as_ref(), "rate_pack_limits");
let (cs_value, cs_encrypted) = retrieve_config_row(connection.as_ref(), "schema_version");
assert_eq!(
lc_value,
Some(
"100-100000000000000|100-100000000000000|100-100000000000000|100-100000000000000"
.to_string()
)
);
assert_eq!(lc_encrypted, false);
assert_eq!(cs_value, Some("12".to_string()));
assert_eq!(cs_encrypted, false)
}
}
1 change: 1 addition & 0 deletions node/src/database/db_migrations/migrations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

pub mod migration_0_to_1;
pub mod migration_10_to_11;
pub mod migration_11_to_12;
pub mod migration_1_to_2;
pub mod migration_2_to_3;
pub mod migration_3_to_4;
Expand Down
6 changes: 5 additions & 1 deletion node/src/db_config/config_dao_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::database::rusqlite_wrappers::TransactionSafeWrapper;
use crate::db_config::config_dao::{ConfigDao, ConfigDaoError, ConfigDaoRecord};
use crate::neighborhood::DEFAULT_MIN_HOPS;
use crate::sub_lib::accountant::{DEFAULT_PAYMENT_THRESHOLDS, DEFAULT_SCAN_INTERVALS};
use crate::sub_lib::neighborhood::DEFAULT_RATE_PACK;
use crate::sub_lib::neighborhood::{DEFAULT_RATE_PACK, DEFAULT_RATE_PACK_LIMITS};
use itertools::Itertools;
use masq_lib::blockchains::chains::Chain;
use masq_lib::constants::{CURRENT_SCHEMA_VERSION, DEFAULT_GAS_PRICE};
Expand Down Expand Up @@ -138,6 +138,10 @@ impl Default for ConfigDaoNull {
"rate_pack".to_string(),
(Some(DEFAULT_RATE_PACK.to_string()), false),
);
data.insert(
"rate_pack_limits".to_string(),
(Some(DEFAULT_RATE_PACK_LIMITS.to_string()), false),
);
data.insert(
"scan_intervals".to_string(),
(Some(DEFAULT_SCAN_INTERVALS.to_string()), false),
Expand Down
Loading
Loading