Skip to content

Commit ba6fdf5

Browse files
committed
IPC-304: add permissioned flag for new contract version
1 parent afbe59c commit ba6fdf5

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ipc/cli/src/commands/subnet/create.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl CreateSubnet {
4141
.active_validators_limit
4242
.unwrap_or(DEFAULT_ACTIVE_VALIDATORS),
4343
f64_to_token_amount(arguments.min_cross_msg_fee)?,
44+
arguments.permissioned,
4445
)
4546
.await?;
4647

@@ -96,4 +97,9 @@ pub struct CreateSubnetArgs {
9697
help = "Minimum fee for cross-net messages in subnet (in whole FIL)"
9798
)]
9899
pub min_cross_msg_fee: f64,
100+
#[arg(
101+
long,
102+
help = "Deploy static network where validators can't join in a permissionless manner"
103+
)]
104+
pub permissioned: bool,
99105
}

ipc/provider/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ impl IpcProvider {
239239
bottomup_check_period: ChainEpoch,
240240
active_validators_limit: u16,
241241
min_cross_msg_fee: TokenAmount,
242+
permissioned: bool,
242243
) -> anyhow::Result<Address> {
243244
let conn = match self.connection(&parent) {
244245
None => return Err(anyhow!("target parent subnet not found")),
@@ -251,12 +252,13 @@ impl IpcProvider {
251252
let constructor_params = ConstructParams {
252253
parent,
253254
ipc_gateway_addr: subnet_config.gateway_addr(),
254-
consensus: ConsensusType::Mir,
255+
consensus: ConsensusType::Fendermint,
255256
min_validators,
256257
min_validator_stake,
257258
bottomup_check_period,
258259
active_validators_limit,
259260
min_cross_msg_fee,
261+
permissioned,
260262
};
261263

262264
conn.manager()

ipc/provider/src/manager/evm/manager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ impl SubnetManager for EthSubnetManager {
262262
active_validators_limit: params.active_validators_limit,
263263
power_scale: 3,
264264
min_cross_msg_fee: ethers::types::U256::from(min_cross_msg_fee),
265+
permissioned: params.permissioned,
265266
};
266267

267268
log::info!("creating subnet on evm with params: {params:?}");

ipc/sdk/src/subnet.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,12 @@ pub struct ConstructParams {
2424
pub bottomup_check_period: ChainEpoch,
2525
pub active_validators_limit: u16,
2626
pub min_cross_msg_fee: TokenAmount,
27+
pub permissioned: bool,
2728
}
2829

2930
/// Consensus types supported by hierarchical consensus
3031
#[derive(PartialEq, Eq, Clone, Copy, Debug, Deserialize_repr, Serialize_repr)]
3132
#[repr(u64)]
3233
pub enum ConsensusType {
33-
Mir,
34-
}
35-
36-
#[derive(Clone, Debug, Serialize_tuple, Deserialize_tuple, PartialEq, Eq)]
37-
pub struct JoinParams {
38-
pub validator_net_addr: String,
34+
Fendermint,
3935
}

0 commit comments

Comments
 (0)