From ae94fd7f4b0616d3b42e76e29d6956c581691d8f Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 20 Sep 2023 14:57:17 +0200 Subject: [PATCH 1/9] info --- bindings/python/iota_sdk/types/node_info.py | 234 ++++++++++++++++---- 1 file changed, 191 insertions(+), 43 deletions(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 09e38ec91e..219425d5c8 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -28,15 +28,27 @@ class NodeInfoStatus: """Node status. Attributes: - is_healthy: Whether the node is healthy. - latest_milestone: The latest milestone info. - confirmed_milestone: The latest confirmed milestone info. - pruning_index: The pruning index of the node. + is_healthy: Tells whether the node is healthy or not. + accepted_tangle_time: A notion of time that is anchored to the latest accepted block. + relative_accepted_tangle_time: The time after Accepted Tangle Time has advanced with the system clock. + confirmed_tangle_time: A notion of time that is anchored to the latest confirmed block. + relative_confirmed_tangle_time: The time after Confirmed Tangle Time has advanced with the system clock. + latest_commitment_id: The latest slot that the node has committed to. + latest_finalized_slot: The index of the latest finalized slot. + latest_accepted_block_slot: The slot index of the latest accepted block. + latest_confirmed_block_slot: The slot index of the latest confirmed block. + pruning_epoch: The index of the slot before which the tangle history is pruned. """ is_healthy: bool - latest_milestone: NodeInfoMilestone - confirmed_milestone: NodeInfoMilestone - pruning_index: int + accepted_tangle_time: str + relative_accepted_tangle_time: int + confirmed_tangle_time: int + relative_confirmed_tangle_time: int + latest_commitment_id: HexStr + latest_finalized_slot: str + latest_accepted_block_slot: str + latest_confirmed_block_slot: str + pruning_epoch: str @json @@ -45,28 +57,35 @@ class NodeInfoMetrics: """Node metrics. Attributes: - blocks_per_second: The blocks per second gossiped in the network. - referenced_blocks_per_second: The referenced blocks per second in the network. - referenced_rate: The percentage of blocks that get referenced. + blocks_per_second: The current rate of new blocks per second. + confirmed_blocks_per_second: The current rate of confirmed blocks per second. + confirmation_rate: The ratio of confirmed blocks to new blocks of the last confirmed slot. """ blocks_per_second: float - referenced_block_per_second: float - referenced_rate: float + confirmed_blocks_per_second: float + confirmation_rate: float @json @dataclass class RentStructure: - """Rent structure for the storage deposit. + """ + The rent structure according to TIP-19. Attributes: - v_byte_cost: The cost of base coin per virtual byte. - v_byte_factor_data: The weight factor used for key fields in the outputs. - v_byte_factor_key: The weight factor used for data fields in the outputs. + v_byte_cost: Defines the rent of a single virtual byte denoted in IOTA tokens. + v_byte_factor_data: Defines the factor to be used for data only fields. + v_byte_factor_key: Defines the factor to be used for key/lookup generating fields. + v_byte_factor_block_issuer_key: Defines the factor to be used for block issuer feature public keys. + v_byte_factor_staking_feature: Defines the factor to be used for staking feature. + v_byte_factor_delegation: Defines the factor to be used for delegation output. """ v_byte_cost: int v_byte_factor_data: int v_byte_factor_key: int + v_byte_factor_block_issuer_key: int + v_byte_factor_staking_feature: int + v_byte_factor_delegation: int @json @@ -90,19 +109,150 @@ class NodeInfoProtocol: @json @dataclass -class PendingProtocolParameter: - """Pending protocol parameters. +class WorkScoreStructure: + """ + Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. Attributes: - type: Type of change. - target_milestone_index: Milestone index at which the new protocol parameters become active. - protocol_version: The new protocol version. - params: The new protocol parameters. + data_kilobyte: Data_kilobyte accounts for the network traffic per kilobyte. + block: Block accounts for work done to process a block in the node software. + missing_parent: Missing_parent is used to multiply for each missing parent if there are not enough strong ones. + input: Input accounts for loading the UTXO from the database and performing the mana calculations. + context_input: Context_input accounts for loading and checking the context input. + output: Output accounts for storing the UTXO in the database. + native_token: Native_token accounts for calculations done with native tokens. + staking: Staking accounts for the existence of a staking feature in the output. + block_issuer: BlockIssuer accounts for the existence of a block issuer feature in the output. + allotment: Allotment accounts for accessing the account-based ledger to transform the mana to block issuance credits. + signature_ed25519: SignatureEd25519 accounts for an Ed25519 signature check. + min_strong_parents_threshold: MinStrongParentsThreshold is the minimum amount of strong parents in a basic block, otherwise, the issuer gets slashed. """ - type: int - target_milestone_index: int - protocol_version: int - params: str + data_kilobyte: int + block: int + missing_parent: int + input: int + context_input: int + output: int + native_token: int + staking: int + block_issuer: int + allotment: int + signature_ed25519: int + min_strong_parents_threshold: int + + +@json +@dataclass +class CongestionControlParameters: + """ + Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). + + Attributes: + rmc_min: Rmc_min is the minimum value of the reference Mana cost. + increase: Increase is the increase step size of the reference Mana cost. + decrease: Decrease is the decrease step size of the reference Mana cost. + increase_threshold: Increase_threshold is the threshold for increasing the reference Mana cost. + decrease_threshold: Decrease_threshold is the threshold for decreasing the reference Mana cost. + scheduler_rate: Scheduler_rate is the rate at which the scheduler runs in workscore units per second. + min_mana: Min_mana is the minimum amount of Mana that an account must have to have a block scheduled. + max_buffer_size: Max_buffer_size is the maximum size of the buffer. + """ + rmc_min: str + increase: str + decrease: str + increase_threshold: int + decrease_threshold: int + scheduler_rate: int + min_mana: str + max_buffer_size: int + + +@json +@dataclass +class VersionSignaling: + """ + The version signaling parameters. + + Attributes: + window_size: The size of the window in epochs to find which version of protocol parameters was most signaled, from current_epoch - window_size to current_epoch. + window_target_ratio: The target number of supporters for a version to win in a window_size. + activation_offset: The offset in epochs to activate the new version of protocol parameters. + """ + window_size: int + window_target_ratio: int + activation_offset: int + + +@json +@dataclass +class ProtocolParameters: + """ + The protocol parameters. + + Attributes: + version: Protocol version used by the network. + network_name: The Name of the network from which the networkId is derived. + bech32_hrp: Tells whether the node supports mainnet or testnet addresses. + Value `iota` indicates that the node supports mainnet addresses. + Value `atoi` indicates that the node supports testnet addresses. + rent_structure: The rent structure according to TIP-19. + work_score_structure: Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. + token_supply: Current supply of the base token. Plain string encoded number. + genesis_unix_timestamp: The genesis timestamp at which the slots start to count. + slot_duration_in_seconds: The duration of a slot, in seconds. + slots_per_epoch_exponent: The number of slots in an epoch expressed as an exponent of 2. + mana_bits_count: The number of bits used to represent Mana. + mana_generation_rate: The amount of potential Mana generated by 1 IOTA in 1 slot. + mana_generation_rate_exponent: The scaling of mana_generation_rate expressed as an exponent of 2. + mana_decay_factors: A lookup table of epoch index diff to mana decay factor (slice index 0 = 1 epoch). + mana_decay_factors_exponent: The scaling of mana_decay_factors expressed as an exponent of 2. + mana_decay_factor_epochs_sum: An integer approximation of the sum of decay over epochs. + mana_decay_factor_epochs_sum_exponent: The scaling of mana_decay_factor_epochs_sum expressed as an exponent of 2. + staking_unbonding_period: The unbonding period in epochs before an account can stop staking. + liveness_threshold: Determine if a block is eligible by evaluating issuing_time and commitments in its past cone to ATT and last_committed_slot respectively. + min_committable_age: Min_committable_age is the minimum age relative to the accepted tangle time slot index that a slot can be committed. + max_committable_age: Max_committable_age is the maximum age for a slot commitment to be included in a block relative to the slot index of the block issuing time. + epoch_nearing_threshold: Determine the slot that should trigger a new committee selection for the next and upcoming epoch. + congestion_control_parameters: Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). + version_signaling: The version signaling parameters. + """ + version: int + network_name: str + bech32_hrp: str + rent_structure: RentStructure + work_score_structure: WorkScoreStructure + token_supply: str + genesis_unix_timestamp: int + slot_duration_in_seconds: int + slots_per_epoch_exponent: int + mana_bits_count: int + mana_generation_rate: int + mana_generation_rate_exponent: int + mana_decay_factors: List[int] + mana_decay_factors_exponent: int + mana_decay_factor_epochs_sum: int + mana_decay_factor_epochs_sum_exponent: int + staking_unbonding_period: str + liveness_threshold: str + min_committable_age: str + max_committable_age: str + epoch_nearing_threshold: str + congestion_control_parameters: CongestionControlParameters + version_signaling: VersionSignaling + + +@json +@dataclass +class ProtocolStartParameters: + """ + Protocol Parameters with start epoch. + + Attributes: + start_epoch: The start epoch of the set of protocol parameters. + parameters: The protocol parameters. + """ + start_epoch: str + parameters: ProtocolParameters @dataclass @@ -110,19 +260,19 @@ class NodeInfoBaseToken: """The base coin info. Attributes: - name: Name of the base coin. - ticker_symbol: Base coin ticker symbol. - unit: Base coin unit. - decimals: Number of decimals. - use_metric_prefix: Whether the coin uses a metric prefix. - subunit: Base coin subunit. + name: The name of the base token of the network. + ticker_symbol: Ticker symbol of the token to be displayed on trading platforms. + unit: The primary unit of the token. + subunit: The name of the smallest possible denomination of the primary unit. subunit * 10^decimals = unit. + decimals: Number of decimals the primary unit is divisible up to. + use_metric_prefix: Whether to use metric prefixes for displaying unit. """ name: str ticker_symbol: str unit: str + subunit: Optional[str] = None decimals: int use_metric_prefix: bool - subunit: Optional[str] = None @json @@ -132,22 +282,20 @@ class NodeInfo: Attributes: name: The name of the node (e.g. Hornet). - version: The version of the node. + version: The semantic version of the node. status: The status of the node. - metrics: Some node metrics. - supported_protocol_versions: Supported protocol versions by the ndoe. - protocol: Information about the running protocol. - pending_protocol_parameters: A list of pending (not yet active) protocol parameters. - base_token: Information about the base token. - features: List of features supported by the node. + metrics: Node metrics. + protocol_parameters: Supported protocol versions by the node. + base_token: Gives info about the base token the network uses. + features: The features that are supported by the node. + For example, a node could support the feature, which would allow the BIC to be included by the node account. + All features must be lowercase. """ name: str version: str status: NodeInfoStatus metrics: NodeInfoMetrics - supported_protocol_version: List[int] - protocol: NodeInfoProtocol - pending_protocol_parameters: List[PendingProtocolParameter] + protocol_parameters: List[ProtocolStartParameters] base_token: NodeInfoBaseToken features: List[str] From bab5aac21e884ae72506e54454ddb92f928eb75e Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 20 Sep 2023 14:58:59 +0200 Subject: [PATCH 2/9] fix class comment --- bindings/python/iota_sdk/types/node_info.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 219425d5c8..f392b78005 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -69,8 +69,7 @@ class NodeInfoMetrics: @json @dataclass class RentStructure: - """ - The rent structure according to TIP-19. + """The rent structure according to TIP-19. Attributes: v_byte_cost: Defines the rent of a single virtual byte denoted in IOTA tokens. @@ -110,8 +109,7 @@ class NodeInfoProtocol: @json @dataclass class WorkScoreStructure: - """ - Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. + """Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. Attributes: data_kilobyte: Data_kilobyte accounts for the network traffic per kilobyte. @@ -144,8 +142,7 @@ class WorkScoreStructure: @json @dataclass class CongestionControlParameters: - """ - Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). + """Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). Attributes: rmc_min: Rmc_min is the minimum value of the reference Mana cost. @@ -170,8 +167,7 @@ class CongestionControlParameters: @json @dataclass class VersionSignaling: - """ - The version signaling parameters. + """The version signaling parameters. Attributes: window_size: The size of the window in epochs to find which version of protocol parameters was most signaled, from current_epoch - window_size to current_epoch. @@ -186,8 +182,7 @@ class VersionSignaling: @json @dataclass class ProtocolParameters: - """ - The protocol parameters. + """The protocol parameters. Attributes: version: Protocol version used by the network. @@ -244,8 +239,7 @@ class ProtocolParameters: @json @dataclass class ProtocolStartParameters: - """ - Protocol Parameters with start epoch. + """Protocol Parameters with start epoch. Attributes: start_epoch: The start epoch of the set of protocol parameters. From 2f9a19b8ee2e1ec35a0072d8da7f86dec6bf2a7a Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 20 Sep 2023 15:25:36 +0200 Subject: [PATCH 3/9] updated methods and removed old types --- .../python/iota_sdk/types/client_options.py | 6 +-- .../python/iota_sdk/types/network_info.py | 4 +- bindings/python/iota_sdk/types/node_info.py | 43 +++---------------- 3 files changed, 12 insertions(+), 41 deletions(-) diff --git a/bindings/python/iota_sdk/types/client_options.py b/bindings/python/iota_sdk/types/client_options.py index 78279e653a..7ee7965163 100644 --- a/bindings/python/iota_sdk/types/client_options.py +++ b/bindings/python/iota_sdk/types/client_options.py @@ -5,7 +5,7 @@ from dataclasses import dataclass from typing import List, Optional from iota_sdk.types.common import json -from iota_sdk.types.node_info import NodeInfoProtocol +from iota_sdk.types.node_info import ProtocolParameters @json @@ -68,7 +68,7 @@ class ClientOptions: The User-Agent header for requests. broker_options (MqttBrokerOptions): Options for the MQTT broker. - protocol_parameters (NodeInfoProtocol): + protocol_parameters (ProtocolParameters): Protocol parameters. api_timeout (Duration): Timeout for API requests. @@ -85,6 +85,6 @@ class ClientOptions: quorum_threshold: Optional[int] = None user_agent: Optional[str] = None broker_options: Optional[MqttBrokerOptions] = None - protocol_parameters: Optional[NodeInfoProtocol] = None + protocol_parameters: Optional[ProtocolParameters] = None api_timeout: Optional[Duration] = None max_parallel_api_requests: Optional[int] = None diff --git a/bindings/python/iota_sdk/types/network_info.py b/bindings/python/iota_sdk/types/network_info.py index 9272a1d667..a3e615f0b1 100644 --- a/bindings/python/iota_sdk/types/network_info.py +++ b/bindings/python/iota_sdk/types/network_info.py @@ -4,7 +4,7 @@ from __future__ import annotations from dataclasses import dataclass from iota_sdk.types.common import json -from iota_sdk.types.node_info import NodeInfoProtocol +from iota_sdk.types.node_info import ProtocolParameters @json @@ -12,4 +12,4 @@ class NetworkInfo: """Network related information. """ - protocol_parameters: NodeInfoProtocol + protocol_parameters: ProtocolParameters diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index f392b78005..e88260e4a5 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -7,21 +7,6 @@ from iota_sdk.types.common import HexStr, json -@json -@dataclass -class NodeInfoMilestone: - """Milestone info. - - Attributes: - index: The milestone index. - timestamp: The milestone timestamp. - milestone_id: The milestone ID. - """ - index: int - timestamp: Optional[int] = None - milestone_id: Optional[HexStr] = None - - @json @dataclass class NodeInfoStatus: @@ -45,9 +30,13 @@ class NodeInfoStatus: confirmed_tangle_time: int relative_confirmed_tangle_time: int latest_commitment_id: HexStr + # TODO Replace with a proper SlotIndex type latest_finalized_slot: str + # TODO Replace with a proper SlotIndex type latest_accepted_block_slot: str + # TODO Replace with a proper SlotIndex type latest_confirmed_block_slot: str + # TODO Replace with a proper SlotIndex type pruning_epoch: str @@ -87,25 +76,6 @@ class RentStructure: v_byte_factor_delegation: int -@json -@dataclass -class NodeInfoProtocol: - """Protocol info. - - Attributes: - network_name: The human friendly name of the network. - bech32_hrp: The HRP prefix used for Bech32 addresses in the network. - token_supply: TokenSupply defines the current token supply on the network. - version: The version of the protocol running. - rent_structure: The rent structure used by given node/network. - """ - network_name: str - bech32_hrp: str - token_supply: str - version: int - rent_structure: RentStructure - - @json @dataclass class WorkScoreStructure: @@ -231,6 +201,7 @@ class ProtocolParameters: liveness_threshold: str min_committable_age: str max_committable_age: str + # TODO Replace with a proper SlotIndex type epoch_nearing_threshold: str congestion_control_parameters: CongestionControlParameters version_signaling: VersionSignaling @@ -238,7 +209,7 @@ class ProtocolParameters: @json @dataclass -class ProtocolStartParameters: +class ProtocolParametersResponse: """Protocol Parameters with start epoch. Attributes: @@ -289,7 +260,7 @@ class NodeInfo: version: str status: NodeInfoStatus metrics: NodeInfoMetrics - protocol_parameters: List[ProtocolStartParameters] + protocol_parameters: List[ProtocolParametersResponse] base_token: NodeInfoBaseToken features: List[str] From 092d61137ea502ffcdebb734af1a39a105ab92c5 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 20 Sep 2023 16:40:55 +0200 Subject: [PATCH 4/9] updated to Protocolparams tip --- bindings/python/iota_sdk/types/node_info.py | 52 ++++++++++++++------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index e88260e4a5..4e06757651 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -112,7 +112,7 @@ class WorkScoreStructure: @json @dataclass class CongestionControlParameters: - """Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). + """Congestion Control Parameters defines the parameters used by to calculate the Reference Mana Cost (RMC). Attributes: rmc_min: Rmc_min is the minimum value of the reference Mana cost. @@ -123,6 +123,7 @@ class CongestionControlParameters: scheduler_rate: Scheduler_rate is the rate at which the scheduler runs in workscore units per second. min_mana: Min_mana is the minimum amount of Mana that an account must have to have a block scheduled. max_buffer_size: Max_buffer_size is the maximum size of the buffer. + max_validation_buffer_size: The maximum number of blocks in the validation buffer. """ rmc_min: str increase: str @@ -132,12 +133,13 @@ class CongestionControlParameters: scheduler_rate: int min_mana: str max_buffer_size: int + max_validation_buffer_size: int @json @dataclass class VersionSignaling: - """The version signaling parameters. + """Version Signaling defines the parameters used by signaling protocol parameters upgrade. Attributes: window_size: The size of the window in epochs to find which version of protocol parameters was most signaled, from current_epoch - window_size to current_epoch. @@ -149,12 +151,36 @@ class VersionSignaling: activation_offset: int +@json +@dataclass +class ManaStructure: + """Mana Structure defines the parameters used by mana calculation. + + Attributes: + mana_bits_count: The number of bits used to represent Mana. + mana_generation_rate: The amount of potential Mana generated by 1 IOTA in 1 slot. + mana_generation_rate_exponent: The scaling of mana_generation_rate expressed as an exponent of 2. + mana_decay_factors: A lookup table of epoch index diff to mana decay factor (slice index 0 = 1 epoch). + mana_decay_factors_exponent: The scaling of mana_decay_factors expressed as an exponent of 2. + mana_decay_factor_epochs_sum: An integer approximation of the sum of decay over epochs. + mana_decay_factor_epochs_sum_exponent: The scaling of mana_decay_factor_epochs_sum expressed as an exponent of 2. + """ + mana_bits_count: int + mana_generation_rate: int + mana_generation_rate_exponent: int + mana_decay_factors: List[int] + mana_decay_factors_exponent: int + mana_decay_factor_epochs_sum: int + mana_decay_factor_epochs_sum_exponent: int + + @json @dataclass class ProtocolParameters: """The protocol parameters. Attributes: + type: Set to value 0 to denote a IOTA 2.0 protocol parameter. version: Protocol version used by the network. network_name: The Name of the network from which the networkId is derived. bech32_hrp: Tells whether the node supports mainnet or testnet addresses. @@ -166,14 +192,10 @@ class ProtocolParameters: genesis_unix_timestamp: The genesis timestamp at which the slots start to count. slot_duration_in_seconds: The duration of a slot, in seconds. slots_per_epoch_exponent: The number of slots in an epoch expressed as an exponent of 2. - mana_bits_count: The number of bits used to represent Mana. - mana_generation_rate: The amount of potential Mana generated by 1 IOTA in 1 slot. - mana_generation_rate_exponent: The scaling of mana_generation_rate expressed as an exponent of 2. - mana_decay_factors: A lookup table of epoch index diff to mana decay factor (slice index 0 = 1 epoch). - mana_decay_factors_exponent: The scaling of mana_decay_factors expressed as an exponent of 2. - mana_decay_factor_epochs_sum: An integer approximation of the sum of decay over epochs. - mana_decay_factor_epochs_sum_exponent: The scaling of mana_decay_factor_epochs_sum expressed as an exponent of 2. + mana_structure: Mana Structure defines the parameters used by mana calculation. staking_unbonding_period: The unbonding period in epochs before an account can stop staking. + validation_blocks_per_slot: Validation Blocks Per Slot is the number of validation blocks that each validator should issue each slot. + punishment_epochs: The number of epochs worth of Mana that a node is punished with for each additional validation block it issues. liveness_threshold: Determine if a block is eligible by evaluating issuing_time and commitments in its past cone to ATT and last_committed_slot respectively. min_committable_age: Min_committable_age is the minimum age relative to the accepted tangle time slot index that a slot can be committed. max_committable_age: Max_committable_age is the maximum age for a slot commitment to be included in a block relative to the slot index of the block issuing time. @@ -181,6 +203,7 @@ class ProtocolParameters: congestion_control_parameters: Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). version_signaling: The version signaling parameters. """ + type: int version: int network_name: str bech32_hrp: str @@ -190,13 +213,10 @@ class ProtocolParameters: genesis_unix_timestamp: int slot_duration_in_seconds: int slots_per_epoch_exponent: int - mana_bits_count: int - mana_generation_rate: int - mana_generation_rate_exponent: int - mana_decay_factors: List[int] - mana_decay_factors_exponent: int - mana_decay_factor_epochs_sum: int - mana_decay_factor_epochs_sum_exponent: int + mana_structure: ManaStructure + staking_unbonding_period: str + validation_blocks_per_slot: int + punishment_epochs: str staking_unbonding_period: str liveness_threshold: str min_committable_age: str From f243b0f499bd8e777ab8fcf57e216607cfc75696 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 20 Sep 2023 16:59:13 +0200 Subject: [PATCH 5/9] ew --- bindings/python/iota_sdk/types/node_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 4e06757651..980fcbe4b1 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -112,7 +112,7 @@ class WorkScoreStructure: @json @dataclass class CongestionControlParameters: - """Congestion Control Parameters defines the parameters used by to calculate the Reference Mana Cost (RMC). + """Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). Attributes: rmc_min: Rmc_min is the minimum value of the reference Mana cost. From 4b0e0083e9e55f319b77a1a885b4b2ef5247ef6c Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 21 Sep 2023 12:40:48 +0200 Subject: [PATCH 6/9] kbi kibi kibi a byte after midnight --- bindings/python/iota_sdk/types/node_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 980fcbe4b1..3411cbc8a1 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -82,7 +82,7 @@ class WorkScoreStructure: """Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. Attributes: - data_kilobyte: Data_kilobyte accounts for the network traffic per kilobyte. + data_kibibyte: Data_kibibyte accounts for the network traffic per kibibyte. block: Block accounts for work done to process a block in the node software. missing_parent: Missing_parent is used to multiply for each missing parent if there are not enough strong ones. input: Input accounts for loading the UTXO from the database and performing the mana calculations. @@ -95,7 +95,7 @@ class WorkScoreStructure: signature_ed25519: SignatureEd25519 accounts for an Ed25519 signature check. min_strong_parents_threshold: MinStrongParentsThreshold is the minimum amount of strong parents in a basic block, otherwise, the issuer gets slashed. """ - data_kilobyte: int + data_kibibyte: int block: int missing_parent: int input: int From 321ce3cc7f44fad0e5b72c297c7ec2c1c48eafe3 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Fri, 22 Sep 2023 12:55:31 +0200 Subject: [PATCH 7/9] Dupdate --- bindings/python/iota_sdk/types/node_info.py | 52 ++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 3411cbc8a1..70cdfda8da 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -58,7 +58,7 @@ class NodeInfoMetrics: @json @dataclass class RentStructure: - """The rent structure according to TIP-19. + """Rent structure for the storage deposit. Attributes: v_byte_cost: Defines the rent of a single virtual byte denoted in IOTA tokens. @@ -82,7 +82,7 @@ class WorkScoreStructure: """Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. Attributes: - data_kibibyte: Data_kibibyte accounts for the network traffic per kibibyte. + data_byte: Data_kibibyte accounts for the network traffic per kibibyte. block: Block accounts for work done to process a block in the node software. missing_parent: Missing_parent is used to multiply for each missing parent if there are not enough strong ones. input: Input accounts for loading the UTXO from the database and performing the mana calculations. @@ -95,7 +95,7 @@ class WorkScoreStructure: signature_ed25519: SignatureEd25519 accounts for an Ed25519 signature check. min_strong_parents_threshold: MinStrongParentsThreshold is the minimum amount of strong parents in a basic block, otherwise, the issuer gets slashed. """ - data_kibibyte: int + data_byte: int block: int missing_parent: int input: int @@ -115,17 +115,17 @@ class CongestionControlParameters: """Congestion Control Parameters defines the parameters used to calculate the Reference Mana Cost (RMC). Attributes: - rmc_min: Rmc_min is the minimum value of the reference Mana cost. - increase: Increase is the increase step size of the reference Mana cost. - decrease: Decrease is the decrease step size of the reference Mana cost. - increase_threshold: Increase_threshold is the threshold for increasing the reference Mana cost. - decrease_threshold: Decrease_threshold is the threshold for decreasing the reference Mana cost. - scheduler_rate: Scheduler_rate is the rate at which the scheduler runs in workscore units per second. - min_mana: Min_mana is the minimum amount of Mana that an account must have to have a block scheduled. - max_buffer_size: Max_buffer_size is the maximum size of the buffer. + min_reference_mana_cost: The minimum value of the reference Mana cost. + increase: The increase step size of the reference Mana cost. + decrease: The decrease step size of the reference Mana cost. + increase_threshold: The threshold for increasing the reference Mana cost. + decrease_threshold: The threshold for decreasing the reference Mana cost. + scheduler_rate: The rate at which the scheduler runs in workscore units per second. + min_mana: The minimum amount of Mana that an account must have to have a block scheduled. + max_buffer_size: The maximum size of the buffer in the scheduler. max_validation_buffer_size: The maximum number of blocks in the validation buffer. """ - rmc_min: str + min_reference_mana_cost: str increase: str decrease: str increase_threshold: int @@ -157,21 +157,21 @@ class ManaStructure: """Mana Structure defines the parameters used by mana calculation. Attributes: - mana_bits_count: The number of bits used to represent Mana. - mana_generation_rate: The amount of potential Mana generated by 1 IOTA in 1 slot. - mana_generation_rate_exponent: The scaling of mana_generation_rate expressed as an exponent of 2. - mana_decay_factors: A lookup table of epoch index diff to mana decay factor (slice index 0 = 1 epoch). - mana_decay_factors_exponent: The scaling of mana_decay_factors expressed as an exponent of 2. - mana_decay_factor_epochs_sum: An integer approximation of the sum of decay over epochs. - mana_decay_factor_epochs_sum_exponent: The scaling of mana_decay_factor_epochs_sum expressed as an exponent of 2. + bits_count: The number of bits used to represent Mana. + generation_rate: The amount of potential Mana generated by 1 IOTA in 1 slot. + generation_rate_exponent: The scaling of generation_rate expressed as an exponent of 2. + decay_factors: A lookup table of epoch index diff to mana decay factor (slice index 0 = 1 epoch). + decay_factors_exponent: The scaling of decay_factors expressed as an exponent of 2. + decay_factor_epochs_sum: An integer approximation of the sum of decay over epochs. + decay_factor_epochs_sum_exponent: The scaling of decay_factor_epochs_sum expressed as an exponent of 2. """ - mana_bits_count: int - mana_generation_rate: int - mana_generation_rate_exponent: int - mana_decay_factors: List[int] - mana_decay_factors_exponent: int - mana_decay_factor_epochs_sum: int - mana_decay_factor_epochs_sum_exponent: int + bits_count: int + generation_rate: int + generation_rate_exponent: int + decay_factors: List[int] + decay_factors_exponent: int + decay_factor_epochs_sum: int + decay_factor_epochs_sum_exponent: int @json From d3d9b62cb55d66baa88c6c3ff9276a62be11b7ad Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Mon, 25 Sep 2023 14:23:34 +0200 Subject: [PATCH 8/9] fixed comment --- bindings/python/iota_sdk/types/node_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 70cdfda8da..2c0872b6f9 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -186,7 +186,7 @@ class ProtocolParameters: bech32_hrp: Tells whether the node supports mainnet or testnet addresses. Value `iota` indicates that the node supports mainnet addresses. Value `atoi` indicates that the node supports testnet addresses. - rent_structure: The rent structure according to TIP-19. + rent_structure: The rent structure used by a given node/network. work_score_structure: Work structure lists the Work Score of each type, it is used to denote the computation costs of processing an object. token_supply: Current supply of the base token. Plain string encoded number. genesis_unix_timestamp: The genesis timestamp at which the slots start to count. From cba7335e645b7dc5295cb4a32f175c893be6fac0 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 27 Sep 2023 12:16:34 +0200 Subject: [PATCH 9/9] changed int to str --- bindings/python/iota_sdk/types/node_info.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/iota_sdk/types/node_info.py b/bindings/python/iota_sdk/types/node_info.py index 2c0872b6f9..8ad83cc791 100644 --- a/bindings/python/iota_sdk/types/node_info.py +++ b/bindings/python/iota_sdk/types/node_info.py @@ -26,9 +26,9 @@ class NodeInfoStatus: """ is_healthy: bool accepted_tangle_time: str - relative_accepted_tangle_time: int - confirmed_tangle_time: int - relative_confirmed_tangle_time: int + relative_accepted_tangle_time: str + confirmed_tangle_time: str + relative_confirmed_tangle_time: str latest_commitment_id: HexStr # TODO Replace with a proper SlotIndex type latest_finalized_slot: str @@ -210,7 +210,7 @@ class ProtocolParameters: rent_structure: RentStructure work_score_structure: WorkScoreStructure token_supply: str - genesis_unix_timestamp: int + genesis_unix_timestamp: str slot_duration_in_seconds: int slots_per_epoch_exponent: int mana_structure: ManaStructure