Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
IPC-304: add permissioned flag for new contract version
Browse files Browse the repository at this point in the history
  • Loading branch information
adlrocha committed Dec 5, 2023
1 parent afbe59c commit ba6fdf5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions ipc/cli/src/commands/subnet/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl CreateSubnet {
.active_validators_limit
.unwrap_or(DEFAULT_ACTIVE_VALIDATORS),
f64_to_token_amount(arguments.min_cross_msg_fee)?,
arguments.permissioned,
)
.await?;

Expand Down Expand Up @@ -96,4 +97,9 @@ pub struct CreateSubnetArgs {
help = "Minimum fee for cross-net messages in subnet (in whole FIL)"
)]
pub min_cross_msg_fee: f64,
#[arg(
long,
help = "Deploy static network where validators can't join in a permissionless manner"
)]
pub permissioned: bool,
}
4 changes: 3 additions & 1 deletion ipc/provider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ impl IpcProvider {
bottomup_check_period: ChainEpoch,
active_validators_limit: u16,
min_cross_msg_fee: TokenAmount,
permissioned: bool,
) -> anyhow::Result<Address> {
let conn = match self.connection(&parent) {
None => return Err(anyhow!("target parent subnet not found")),
Expand All @@ -251,12 +252,13 @@ impl IpcProvider {
let constructor_params = ConstructParams {
parent,
ipc_gateway_addr: subnet_config.gateway_addr(),
consensus: ConsensusType::Mir,
consensus: ConsensusType::Fendermint,
min_validators,
min_validator_stake,
bottomup_check_period,
active_validators_limit,
min_cross_msg_fee,
permissioned,
};

conn.manager()
Expand Down
1 change: 1 addition & 0 deletions ipc/provider/src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ impl SubnetManager for EthSubnetManager {
active_validators_limit: params.active_validators_limit,
power_scale: 3,
min_cross_msg_fee: ethers::types::U256::from(min_cross_msg_fee),
permissioned: params.permissioned,
};

log::info!("creating subnet on evm with params: {params:?}");
Expand Down
8 changes: 2 additions & 6 deletions ipc/sdk/src/subnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,12 @@ pub struct ConstructParams {
pub bottomup_check_period: ChainEpoch,
pub active_validators_limit: u16,
pub min_cross_msg_fee: TokenAmount,
pub permissioned: bool,
}

/// Consensus types supported by hierarchical consensus
#[derive(PartialEq, Eq, Clone, Copy, Debug, Deserialize_repr, Serialize_repr)]
#[repr(u64)]
pub enum ConsensusType {
Mir,
}

#[derive(Clone, Debug, Serialize_tuple, Deserialize_tuple, PartialEq, Eq)]
pub struct JoinParams {
pub validator_net_addr: String,
Fendermint,
}

0 comments on commit ba6fdf5

Please sign in to comment.