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

feat: Set neuron visibility. #239

Merged
merged 15 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
752 changes: 521 additions & 231 deletions Cargo.lock

Large diffs are not rendered by default.

32 changes: 18 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ repository = "https://github.com/dfinity/quill"
license = "Apache-2.0"

[dependencies]
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-management-canister-types = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
ledger-canister = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" }
# To update this section, it is recommended that
# ./scripts/point-to-ic-repo-commit-id.sh be used. That also updates the files
# in the candid directory. (This core would be unnecessary if this code also
# lived in the ic repo.)
ic-base-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-management-canister-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
icp-ledger = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }
ledger-canister = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" }

candid = "0.10.2"
candid_parser = "0.1.2"
Expand Down
69 changes: 65 additions & 4 deletions candid/governance.did
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ type AccountIdentifier = record { hash : blob };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
ManageNeuron : ManageNeuron;
UpdateCanisterSettings : UpdateCanisterSettings;
InstallCode : InstallCode;
StopOrStartCanister : StopOrStartCanister;
CreateServiceNervousSystem : CreateServiceNervousSystem;
ExecuteNnsFunction : ExecuteNnsFunction;
RewardNodeProvider : RewardNodeProvider;
Expand All @@ -10,7 +13,7 @@ type Action = variant {
SetDefaultFollowees : SetDefaultFollowees;
RewardNodeProviders : RewardNodeProviders;
ManageNetworkEconomics : NetworkEconomics;
ApproveGenesisKyc : ApproveGenesisKyc;
ApproveGenesisKyc : Principals;
AddOrRemoveNodeProvider : AddOrRemoveNodeProvider;
Motion : Motion;
};
Expand All @@ -26,6 +29,14 @@ type By = variant {
Memo : nat64;
};
type Canister = record { id : opt principal };
type CanisterSettings = record {
freezing_threshold : opt nat64;
controllers : opt Controllers;
log_visibility : opt int32;
wasm_memory_limit : opt nat64;
memory_allocation : opt nat64;
compute_allocation : opt nat64;
};
type CanisterStatusResultV2 = record {
status : opt int32;
freezing_threshold : opt nat64;
Expand All @@ -41,10 +52,12 @@ type CanisterSummary = record {
};
type CfNeuron = record {
has_created_neuron_recipes : opt bool;
hotkeys : opt Principals;
nns_neuron_id : nat64;
amount_icp_e8s : nat64;
};
type CfParticipant = record {
controller : opt principal;
hotkey_principal : text;
cf_neurons : vec CfNeuron;
};
Expand Down Expand Up @@ -110,6 +123,7 @@ type Committed_1 = record {
sns_governance_canister_id : opt principal;
};
type Configure = record { operation : opt Operation };
type Controllers = record { controllers : vec principal };
type Countries = record { iso_codes : vec text };
type CreateServiceNervousSystem = record {
url : opt text;
Expand Down Expand Up @@ -158,7 +172,7 @@ type GlobalTimeOfDay = record { seconds_after_utc_midnight : opt nat64 };
type Governance = record {
default_followees : vec record { int32; Followees };
making_sns_proposal : opt MakingSnsProposal;
most_recent_monthly_node_provider_rewards : opt MostRecentMonthlyNodeProviderRewards;
most_recent_monthly_node_provider_rewards : opt MonthlyNodeProviderRewards;
maturity_modulation_last_updated_at_timestamp_seconds : opt nat64;
wait_for_quiet_threshold_seconds : nat64;
metrics : opt GovernanceCachedMetrics;
Expand Down Expand Up @@ -201,11 +215,13 @@ type GovernanceCachedMetrics = record {
not_dissolving_neurons_count : nat64;
total_locked_e8s : nat64;
neurons_fund_total_active_neurons : nat64;
total_voting_power_non_self_authenticating_controller : opt nat64;
total_staked_maturity_e8s_equivalent : nat64;
not_dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 };
total_staked_e8s_ect : nat64;
not_dissolving_neurons_staked_maturity_e8s_equivalent_sum : nat64;
dissolved_neurons_e8s : nat64;
total_staked_e8s_non_self_authenticating_controller : opt nat64;
dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 };
neurons_with_less_than_6_months_dissolve_delay_e8s : nat64;
not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets : vec record {
Expand All @@ -214,11 +230,13 @@ type GovernanceCachedMetrics = record {
};
dissolving_neurons_count_buckets : vec record { nat64; nat64 };
dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 };
non_self_authenticating_controller_neuron_subset_metrics : opt NeuronSubsetMetrics;
dissolving_neurons_count : nat64;
dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
total_staked_maturity_e8s_equivalent_seed : nat64;
community_fund_total_staked_e8s : nat64;
not_dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 };
public_neuron_subset_metrics : opt NeuronSubsetMetrics;
timestamp_seconds : nat64;
seed_neuron_count : nat64;
};
Expand Down Expand Up @@ -247,6 +265,13 @@ type InitialTokenDistribution = record {
developer_distribution : opt DeveloperDistribution;
swap_distribution : opt SwapDistribution;
};
type InstallCode = record {
arg : opt blob;
wasm_module : opt blob;
skip_stopping_before_installing : opt bool;
canister_id : opt principal;
install_mode : opt int32;
};
type KnownNeuron = record {
id : opt NeuronId;
known_neuron_data : opt KnownNeuronData;
Expand All @@ -260,7 +285,9 @@ type LedgerParameters = record {
};
type ListKnownNeuronsResponse = record { known_neurons : vec KnownNeuron };
type ListNeurons = record {
include_public_neurons_in_full_neurons : opt bool;
neuron_ids : vec nat64;
include_empty_neurons_readable_by_caller : opt bool;
include_neurons_readable_by_caller : bool;
};
type ListNeuronsResponse = record {
Expand Down Expand Up @@ -314,9 +341,14 @@ type Migrations = record {
neuron_indexes_migration : opt Migration;
copy_inactive_neurons_to_stable_memory_migration : opt Migration;
};
type MostRecentMonthlyNodeProviderRewards = record {
type MonthlyNodeProviderRewards = record {
minimum_xdr_permyriad_per_icp : opt nat64;
registry_version : opt nat64;
node_providers : vec NodeProvider;
timestamp : nat64;
rewards : vec RewardNodeProvider;
xdr_conversion_rate : opt XdrConversionRate;
maximum_node_provider_rewards_e8s : opt nat64;
};
type Motion = record { motion_text : text };
type NetworkEconomics = record {
Expand Down Expand Up @@ -349,6 +381,7 @@ type Neuron = record {
dissolve_state : opt DissolveState;
followees : vec record { int32; Followees };
neuron_fees_e8s : nat64;
visibility : opt int32;
transfer : opt NeuronStakeTransfer;
known_neuron_data : opt KnownNeuronData;
spawn_at_timestamp_seconds : opt nat64;
Expand Down Expand Up @@ -383,6 +416,7 @@ type NeuronInfo = record {
stake_e8s : nat64;
joined_community_fund_timestamp_seconds : opt nat64;
retrieved_at_timestamp_seconds : nat64;
visibility : opt int32;
known_neuron_data : opt KnownNeuronData;
voting_power : nat64;
age_seconds : nat64;
Expand All @@ -396,6 +430,18 @@ type NeuronStakeTransfer = record {
transfer_timestamp : nat64;
block_height : nat64;
};
type NeuronSubsetMetrics = record {
total_maturity_e8s_equivalent : opt nat64;
maturity_e8s_equivalent_buckets : vec record { nat64; nat64 };
voting_power_buckets : vec record { nat64; nat64 };
total_staked_e8s : opt nat64;
count : opt nat64;
total_staked_maturity_e8s_equivalent : opt nat64;
staked_maturity_e8s_equivalent_buckets : vec record { nat64; nat64 };
staked_e8s_buckets : vec record { nat64; nat64 };
total_voting_power : opt nat64;
count_buckets : vec record { nat64; nat64 };
};
type NeuronsFundAuditInfo = record {
final_neurons_fund_participation : opt NeuronsFundParticipation;
initial_neurons_fund_participation : opt NeuronsFundParticipation;
Expand All @@ -418,13 +464,17 @@ type NeuronsFundMatchedFundingCurveCoefficients = record {
full_participation_milestone_xdr : opt Decimal;
};
type NeuronsFundNeuron = record {
controller : opt principal;
hotkey_principal : opt text;
hotkeys : opt Principals;
is_capped : opt bool;
nns_neuron_id : opt nat64;
amount_icp_e8s : opt nat64;
};
type NeuronsFundNeuronPortion = record {
controller : opt principal;
hotkey_principal : opt principal;
hotkeys : vec principal;
is_capped : opt bool;
maturity_equivalent_icp_e8s : opt nat64;
nns_neuron_id : opt NeuronId;
Expand Down Expand Up @@ -461,6 +511,7 @@ type Operation = variant {
StopDissolving : record {};
StartDissolving : record {};
IncreaseDissolveDelay : IncreaseDissolveDelay;
SetVisibility : SetVisibility;
JoinCommunityFund : record {};
LeaveCommunityFund : record {};
SetDissolveTimestamp : SetDissolveTimestamp;
Expand All @@ -479,6 +530,7 @@ type Params = record {
max_direct_participation_icp_e8s : opt nat64;
};
type Percentage = record { basis_points : opt nat64 };
type Principals = record { principals : vec principal };
type Progress = variant { LastNeuronId : NeuronId };
type Proposal = record {
url : text;
Expand Down Expand Up @@ -581,6 +633,7 @@ type SetSnsTokenSwapOpenTimeWindow = record {
request : opt SetOpenTimeWindowRequest;
swap_canister_id : opt principal;
};
type SetVisibility = record { visibility : opt int32 };
type SettleCommunityFundParticipation = record {
result : opt Result_8;
open_sns_token_swap_proposal_id : opt nat64;
Expand All @@ -602,6 +655,10 @@ type StakeMaturityResponse = record {
maturity_e8s : nat64;
staked_maturity_e8s : nat64;
};
type StopOrStartCanister = record {
action : opt int32;
canister_id : opt principal;
};
type SwapBackgroundInformation = record {
ledger_index_canister_summary : opt CanisterSummary;
fallback_controller_principal_ids : vec principal;
Expand Down Expand Up @@ -646,6 +703,10 @@ type TimeWindow = record {
end_timestamp_seconds : nat64;
};
type Tokens = record { e8s : opt nat64 };
type UpdateCanisterSettings = record {
canister_id : opt principal;
settings : opt CanisterSettings;
};
type UpdateNodeProvider = record { reward_account : opt AccountIdentifier };
type VotingRewardParameters = record {
reward_rate_transition_duration : opt Duration;
Expand All @@ -671,7 +732,7 @@ service : (Governance) -> {
get_metrics : () -> (Result_3) query;
get_monthly_node_provider_rewards : () -> (Result_4);
get_most_recent_monthly_node_provider_rewards : () -> (
opt MostRecentMonthlyNodeProviderRewards,
opt MonthlyNodeProviderRewards,
) query;
get_network_economics_parameters : () -> (NetworkEconomics) query;
get_neuron_ids : () -> (vec nat64) query;
Expand Down
Loading
Loading