-
Notifications
You must be signed in to change notification settings - Fork 157
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(f3): add f3_* fields to chain config #4871
Changes from 2 commits
22a43ea
2e06de5
e165f00
fb41fdc
2c6989a
bc3fe2a
aa853b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,6 +228,9 @@ pub struct ChainConfig { | |
pub breeze_gas_tamping_duration: i64, | ||
// FIP0081 gradually comes into effect over this many epochs. | ||
pub fip0081_ramp_duration_epochs: u64, | ||
pub f3_bootstrap_epoch: i64, | ||
pub f3_initial_power_table: Cid, | ||
pub f3_mainfest_server: Option<Cid>, | ||
} | ||
|
||
impl ChainConfig { | ||
|
@@ -249,6 +252,13 @@ impl ChainConfig { | |
breeze_gas_tamping_duration: BREEZE_GAS_TAMPING_DURATION, | ||
// 1 year on mainnet | ||
fip0081_ramp_duration_epochs: 365 * EPOCHS_IN_DAY as u64, | ||
f3_bootstrap_epoch: -1, | ||
f3_initial_power_table: Default::default(), | ||
f3_mainfest_server: Some( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values are from Lotus but I suspect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd best to put this comment in the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
"12D3KooWENMwUF9YxvQxar7uBWJtZkA6amvK4xWmKXfSiHUo2Qq7" | ||
.parse() | ||
.expect("Invalid CID"), | ||
), | ||
} | ||
} | ||
|
||
|
@@ -270,6 +280,13 @@ impl ChainConfig { | |
breeze_gas_tamping_duration: BREEZE_GAS_TAMPING_DURATION, | ||
// 3 days on calibnet | ||
fip0081_ramp_duration_epochs: 3 * EPOCHS_IN_DAY as u64, | ||
f3_bootstrap_epoch: -1, | ||
f3_initial_power_table: Default::default(), | ||
f3_mainfest_server: Some( | ||
"12D3KooWS9vD9uwm8u2uPyJV32QBAhKAmPYwmziAgr3Xzk2FU1Mr" | ||
.parse() | ||
.expect("Invalid CID"), | ||
), | ||
} | ||
} | ||
|
||
|
@@ -288,12 +305,14 @@ impl ChainConfig { | |
breeze_gas_tamping_duration: BREEZE_GAS_TAMPING_DURATION, | ||
// Devnet ramp is 200 epochs in Lotus (subject to change). | ||
fip0081_ramp_duration_epochs: env_or_default(ENV_PLEDGE_RULE_RAMP, 200), | ||
f3_bootstrap_epoch: -1, | ||
f3_initial_power_table: Default::default(), | ||
f3_mainfest_server: None, | ||
} | ||
} | ||
|
||
pub fn butterflynet() -> Self { | ||
use butterflynet::*; | ||
|
||
Self { | ||
network: NetworkChain::Butterflynet, | ||
genesis_cid: Some(GENESIS_CID.to_string()), | ||
|
@@ -313,6 +332,13 @@ impl ChainConfig { | |
ENV_PLEDGE_RULE_RAMP, | ||
365 * EPOCHS_IN_DAY as u64, | ||
), | ||
f3_bootstrap_epoch: -1, | ||
f3_initial_power_table: Default::default(), | ||
f3_mainfest_server: Some( | ||
"12D3KooWJr9jy4ngtJNR7JC1xgLFra3DjEtyxskRYWvBK9TC3Yn6" | ||
.parse() | ||
.expect("Invalid CID"), | ||
), | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great to de-clunk this method which is already pretty bloated. How about moving the F3 init + config + service into
f3/
?For readability, I'd imagine the end the end usage to be along lines of:
After moving it into a separate module, it'd be great to have some basic unit tests if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
de-clunked the method and added unit test