Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 10 additions & 9 deletions USER-INTERFACE-INTERFACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ Another reason the secrets might be missing is that there are not yet any secret
"exitServiceRate: <number>"
},
"scanIntervals": {
"pendingPayableSec": <number>,
"payableSec": <number>,
"pendingPayableSec": <number>,
"receivableSec": <number>
},
}
Expand Down Expand Up @@ -453,20 +453,21 @@ database password. If you want to know whether the password you have is the corr

* `scanIntervals`: These three intervals describe the length of three different scan cycles running automatically in the
background since the Node has connected to a qualified neighborhood that consists of neighbors enabling a complete
3-hop route. Each parameter can be set independently, but by default are all the same which currently is most desirable
for the consistency of service payments to and from your Node. Technically, there doesn't have to be any lower limit
for the minimum of time you can set; two scans of the same sort would never run at the same time but the next one is
3-hop route. Each parameter can be set independently. Technically, there doesn't have to be any lower limit for
* the minimum of time you can set; two scans of the same sort would never run at the same time but the next one is
always scheduled not earlier than the end of the previous one. These are ever present values, no matter if the user's
set any value, because defaults are prepared.

* `pendingPayableSec`: Amount of seconds between two sequential cycles of scanning for payments that are marked as currently
pending; the payments were sent to pay our debts, the payable. The purpose of this process is to confirm the status of
the pending payment; either the payment transaction was written on blockchain as successful or failed.

* `payableSec`: Amount of seconds between two sequential cycles of scanning aimed to find payable accounts of that meet
* `payableSec`: Amount of seconds between two sequential cycles of scanning aimed to find payable accounts that meet
the criteria set by the Payment Thresholds; these accounts are tracked on behalf of our creditors. If they meet the
Payment Threshold criteria, our Node will send a debt payment transaction to the creditor in question.

* `pendingPayableSec`: The time elapsed since the last payable transaction was processed. This scan operates
on an irregular schedule and is triggered after new transactions are sent or when failed transactions need
to be replaced. The scanner monitors pending transactions and verifies their blockchain status, determining whether
each payment was successfully recorded or failed. Any failed transaction is automatically resubmitted as soon
as the failure is detected.

* `receivableSec`: Amount of seconds between two sequential cycles of scanning for payments on the blockchain that have
been sent by our creditors to us, which are credited against receivables recorded for services provided.

Expand Down
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.2"
version = "0.9.0"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "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.2"
version = "0.9.0"
license = "GPL-3.0-only"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "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.2"
version = "0.9.0"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "MASQ"]
license = "GPL-3.0-only"
description = "Reference implementation of user interface for MASQ Node"
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.2"
version = "0.9.0"
authors = ["Dan Wiebe <dnwiebe@gmail.com>", "MASQ"]
license = "GPL-3.0-only"
description = "Code common to Node and masq; also, temporarily, to dns_utility"
Expand Down
69 changes: 54 additions & 15 deletions masq_lib/src/blockchains/blockchain_records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,82 @@

use crate::blockchains::chains::Chain;
use crate::constants::{
BASE_MAINNET_CONTRACT_CREATION_BLOCK, BASE_MAINNET_FULL_IDENTIFIER,
BASE_SEPOLIA_CONTRACT_CREATION_BLOCK, BASE_SEPOLIA_FULL_IDENTIFIER, DEV_CHAIN_FULL_IDENTIFIER,
ETH_MAINNET_CONTRACT_CREATION_BLOCK, ETH_MAINNET_FULL_IDENTIFIER,
BASE_GAS_PRICE_CEILING_WEI, BASE_MAINNET_CHAIN_ID, BASE_MAINNET_CONTRACT_CREATION_BLOCK,
BASE_MAINNET_FULL_IDENTIFIER, BASE_SEPOLIA_CHAIN_ID, BASE_SEPOLIA_CONTRACT_CREATION_BLOCK,
BASE_SEPOLIA_FULL_IDENTIFIER, DEFAULT_PENDING_PAYABLE_INTERVAL_BASE_SEC,
DEFAULT_PENDING_PAYABLE_INTERVAL_DEV_SEC, DEFAULT_PENDING_PAYABLE_INTERVAL_ETH_SEC,
DEFAULT_PENDING_PAYABLE_INTERVAL_POLYGON_SEC, DEV_CHAIN_FULL_IDENTIFIER, DEV_CHAIN_ID,
DEV_GAS_PRICE_CEILING_WEI, ETH_GAS_PRICE_CEILING_WEI, ETH_MAINNET_CHAIN_ID,
ETH_MAINNET_CONTRACT_CREATION_BLOCK, ETH_MAINNET_FULL_IDENTIFIER, ETH_ROPSTEN_CHAIN_ID,
ETH_ROPSTEN_CONTRACT_CREATION_BLOCK, ETH_ROPSTEN_FULL_IDENTIFIER,
MULTINODE_TESTNET_CONTRACT_CREATION_BLOCK, POLYGON_AMOY_CONTRACT_CREATION_BLOCK,
POLYGON_AMOY_FULL_IDENTIFIER, POLYGON_MAINNET_CONTRACT_CREATION_BLOCK,
POLYGON_MAINNET_FULL_IDENTIFIER,
MULTINODE_TESTNET_CONTRACT_CREATION_BLOCK, POLYGON_AMOY_CHAIN_ID,
POLYGON_AMOY_CONTRACT_CREATION_BLOCK, POLYGON_AMOY_FULL_IDENTIFIER,
POLYGON_GAS_PRICE_CEILING_WEI, POLYGON_MAINNET_CHAIN_ID,
POLYGON_MAINNET_CONTRACT_CREATION_BLOCK, POLYGON_MAINNET_FULL_IDENTIFIER,
};
use ethereum_types::{Address, H160};

pub const CHAINS: [BlockchainRecord; 7] = [
pub static CHAINS: [BlockchainRecord; 7] = [
BlockchainRecord {
self_id: Chain::PolyMainnet,
num_chain_id: 137,
num_chain_id: POLYGON_MAINNET_CHAIN_ID,
literal_identifier: POLYGON_MAINNET_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: POLYGON_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_POLYGON_SEC,
contract: POLYGON_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_MAINNET_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::EthMainnet,
num_chain_id: 1,
num_chain_id: ETH_MAINNET_CHAIN_ID,
literal_identifier: ETH_MAINNET_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: ETH_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_ETH_SEC,
contract: ETH_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_MAINNET_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::BaseMainnet,
num_chain_id: 8453,
num_chain_id: BASE_MAINNET_CHAIN_ID,
literal_identifier: BASE_MAINNET_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: BASE_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_BASE_SEC,
contract: BASE_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_MAINNET_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::BaseSepolia,
num_chain_id: 84532,
num_chain_id: BASE_SEPOLIA_CHAIN_ID,
literal_identifier: BASE_SEPOLIA_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: BASE_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_BASE_SEC,
contract: BASE_SEPOLIA_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_SEPOLIA_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::PolyAmoy,
num_chain_id: 80002,
num_chain_id: POLYGON_AMOY_CHAIN_ID,
literal_identifier: POLYGON_AMOY_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: POLYGON_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_POLYGON_SEC,
contract: POLYGON_AMOY_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_AMOY_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::EthRopsten,
num_chain_id: 3,
num_chain_id: ETH_ROPSTEN_CHAIN_ID,
literal_identifier: ETH_ROPSTEN_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: ETH_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_ETH_SEC,
contract: ETH_ROPSTEN_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_ROPSTEN_CONTRACT_CREATION_BLOCK,
},
BlockchainRecord {
self_id: Chain::Dev,
num_chain_id: 2,
num_chain_id: DEV_CHAIN_ID,
literal_identifier: DEV_CHAIN_FULL_IDENTIFIER,
gas_price_safe_ceiling_minor: DEV_GAS_PRICE_CEILING_WEI,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_DEV_SEC,
contract: MULTINODE_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: MULTINODE_TESTNET_CONTRACT_CREATION_BLOCK,
},
Expand All @@ -69,6 +88,8 @@ pub struct BlockchainRecord {
pub self_id: Chain,
pub num_chain_id: u64,
pub literal_identifier: &'static str,
pub gas_price_safe_ceiling_minor: u128,
pub default_pending_payable_interval_sec: u64,
pub contract: Address,
pub contract_creation_block: u64,
}
Expand Down Expand Up @@ -115,7 +136,11 @@ const POLYGON_MAINNET_CONTRACT_ADDRESS: Address = H160([
mod tests {
use super::*;
use crate::blockchains::chains::chain_from_chain_identifier_opt;
use crate::constants::BASE_MAINNET_CONTRACT_CREATION_BLOCK;
use crate::constants::{
BASE_MAINNET_CONTRACT_CREATION_BLOCK, DEFAULT_PENDING_PAYABLE_INTERVAL_BASE_SEC,
DEFAULT_PENDING_PAYABLE_INTERVAL_DEV_SEC, DEFAULT_PENDING_PAYABLE_INTERVAL_ETH_SEC,
DEFAULT_PENDING_PAYABLE_INTERVAL_POLYGON_SEC, WEIS_IN_GWEI,
};
use std::collections::HashSet;
use std::iter::FromIterator;

Expand Down Expand Up @@ -195,6 +220,8 @@ mod tests {
num_chain_id: 1,
self_id: examined_chain,
literal_identifier: "eth-mainnet",
gas_price_safe_ceiling_minor: 100 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_ETH_SEC,
contract: ETH_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_MAINNET_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -211,6 +238,8 @@ mod tests {
num_chain_id: 3,
self_id: examined_chain,
literal_identifier: "eth-ropsten",
gas_price_safe_ceiling_minor: 100 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_ETH_SEC,
contract: ETH_ROPSTEN_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: ETH_ROPSTEN_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -227,6 +256,8 @@ mod tests {
num_chain_id: 137,
self_id: examined_chain,
literal_identifier: "polygon-mainnet",
gas_price_safe_ceiling_minor: 200 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_POLYGON_SEC,
contract: POLYGON_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_MAINNET_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -243,6 +274,8 @@ mod tests {
num_chain_id: 80002,
self_id: examined_chain,
literal_identifier: "polygon-amoy",
gas_price_safe_ceiling_minor: 200 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_POLYGON_SEC,
contract: POLYGON_AMOY_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: POLYGON_AMOY_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -259,6 +292,8 @@ mod tests {
num_chain_id: 8453,
self_id: examined_chain,
literal_identifier: "base-mainnet",
gas_price_safe_ceiling_minor: 50 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_BASE_SEC,
contract: BASE_MAINNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_MAINNET_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -275,6 +310,8 @@ mod tests {
num_chain_id: 84532,
self_id: examined_chain,
literal_identifier: "base-sepolia",
gas_price_safe_ceiling_minor: 50 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_BASE_SEC,
contract: BASE_SEPOLIA_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: BASE_SEPOLIA_CONTRACT_CREATION_BLOCK,
}
Expand All @@ -291,6 +328,8 @@ mod tests {
num_chain_id: 2,
self_id: examined_chain,
literal_identifier: "dev",
gas_price_safe_ceiling_minor: 200 * WEIS_IN_GWEI as u128,
default_pending_payable_interval_sec: DEFAULT_PENDING_PAYABLE_INTERVAL_DEV_SEC,
contract: MULTINODE_TESTNET_CONTRACT_ADDRESS,
contract_creation_block: MULTINODE_TESTNET_CONTRACT_CREATION_BLOCK,
}
Expand Down
2 changes: 2 additions & 0 deletions masq_lib/src/blockchains/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ mod tests {
num_chain_id: 0,
self_id: Chain::PolyMainnet,
literal_identifier: "",
gas_price_safe_ceiling_minor: 0,
default_pending_payable_interval_sec: 0,
contract: Default::default(),
contract_creation_block: 0,
}
Expand Down
Loading