Skip to content

Commit 087d682

Browse files
committed
Merge remote-tracking branch 'origin/main' into hm/state-compute
2 parents 408cd6d + 746d129 commit 087d682

File tree

10 files changed

+117
-79
lines changed

10 files changed

+117
-79
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
### Fixed
4747

4848
- [#5458](https://github.com/ChainSafe/forest/pull/5458) Fix stack overflow occurring when running Forest in debug mode.
49+
- [#5475](https://github.com/ChainSafe/forest/pull/5475) Added missing fields for state sector RPC methods that were added in the recent network upgrade.
4950

5051
## Forest v0.25.0 "Bombadil"
5152

build/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@
25942594
"network": {
25952595
"type": "mainnet"
25962596
},
2597-
"version": "v16.0.0-rc3",
2597+
"version": "v16.0.0",
25982598
"bundle_cid": "bafy2bzaceaj3s3rrfbibikplap264uw74qor5yl35mqwokv4lwst4plpwry36",
25992599
"manifest": {
26002600
"actors": [

docs/yarn.lock

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5666,46 +5666,66 @@ __metadata:
56665666
languageName: node
56675667
linkType: hard
56685668

5669-
"bare-events@npm:^2.0.0, bare-events@npm:^2.2.0":
5669+
"bare-events@npm:^2.2.0":
56705670
version: 2.5.3
56715671
resolution: "bare-events@npm:2.5.3"
56725672
checksum: 10c0/fc78e068cd1c7e75ab027121b69f104e315af122f10263734a1f3a7c5a8e2e5934d9a46638f5c9eafadf84d64c01fd87cd3169da4f7f8046df29a17fb1c532f5
56735673
languageName: node
56745674
linkType: hard
56755675

5676-
"bare-fs@npm:^2.1.1":
5677-
version: 2.3.5
5678-
resolution: "bare-fs@npm:2.3.5"
5676+
"bare-events@npm:^2.5.4":
5677+
version: 2.5.4
5678+
resolution: "bare-events@npm:2.5.4"
5679+
checksum: 10c0/877a9cea73d545e2588cdbd6fd01653e27dac48ad6b44985cdbae73e1f57f292d4ba52e25d1fba53674c1053c463d159f3d5c7bc36a2e6e192e389b499ddd627
5680+
languageName: node
5681+
linkType: hard
5682+
5683+
"bare-fs@npm:^4.0.1":
5684+
version: 4.0.2
5685+
resolution: "bare-fs@npm:4.0.2"
56795686
dependencies:
5680-
bare-events: "npm:^2.0.0"
5681-
bare-path: "npm:^2.0.0"
5682-
bare-stream: "npm:^2.0.0"
5683-
checksum: 10c0/ff18cc9be7c557c38e0342681ba3672ae4b01e5696b567d4035e5995255dc6bc7d4df88ed210fa4d3eb940eb29512e924ebb42814c87fc59a2bee8cf83b7c2f9
5687+
bare-events: "npm:^2.5.4"
5688+
bare-path: "npm:^3.0.0"
5689+
bare-stream: "npm:^2.6.4"
5690+
peerDependencies:
5691+
bare-buffer: "*"
5692+
peerDependenciesMeta:
5693+
bare-buffer:
5694+
optional: true
5695+
checksum: 10c0/f6040657cbe7a066a603eaf26a1a9c696b7fce6ddbfb2da23cec22ccf3d23d9195aad82117549f1422ed7ae17c3f91326be900bc72c6aa7651a053137ce2e677
56845696
languageName: node
56855697
linkType: hard
56865698

5687-
"bare-os@npm:^2.1.0":
5688-
version: 2.4.4
5689-
resolution: "bare-os@npm:2.4.4"
5690-
checksum: 10c0/e7d1a7b2100c05da8d25b60d0d48cf850c6f57064577a3f2f51cf18d417fbcfd6967ed2d8314320914ed69e0f2ebcf54eb1b36092dd172d8e8f969cf8cccf041
5699+
"bare-os@npm:^3.0.1":
5700+
version: 3.6.1
5701+
resolution: "bare-os@npm:3.6.1"
5702+
checksum: 10c0/13064789b3d0d3051d6a89424e6d861c08be101798d69faa78821cffb428b36d1fd4e17c824d5a4939bcd96dbff42c11921494139c8e53c3e520bc0e3f83aeee
56915703
languageName: node
56925704
linkType: hard
56935705

5694-
"bare-path@npm:^2.0.0, bare-path@npm:^2.1.0":
5695-
version: 2.1.3
5696-
resolution: "bare-path@npm:2.1.3"
5706+
"bare-path@npm:^3.0.0":
5707+
version: 3.0.0
5708+
resolution: "bare-path@npm:3.0.0"
56975709
dependencies:
5698-
bare-os: "npm:^2.1.0"
5699-
checksum: 10c0/35587e177fc8fa5b13fb90bac8779b5ce49c99016d221ddaefe2232d02bd4295d79b941e14ae19fda75ec42a6fe5fb66c07d83ae7ec11462178e66b7be65ca74
5710+
bare-os: "npm:^3.0.1"
5711+
checksum: 10c0/56a3ca82a9f808f4976cb1188640ac206546ce0ddff582afafc7bd2a6a5b31c3bd16422653aec656eeada2830cfbaa433c6cbf6d6b4d9eba033d5e06d60d9a68
57005712
languageName: node
57015713
linkType: hard
57025714

5703-
"bare-stream@npm:^2.0.0":
5704-
version: 2.6.1
5705-
resolution: "bare-stream@npm:2.6.1"
5715+
"bare-stream@npm:^2.6.4":
5716+
version: 2.6.5
5717+
resolution: "bare-stream@npm:2.6.5"
57065718
dependencies:
57075719
streamx: "npm:^2.21.0"
5708-
checksum: 10c0/f6fe238b4b067fc9ec99e6f9a218239413d1641dfd5bc4defa5fbd0e360ac09e7f454929f5fedd0ee1e7b84d780d32084afe3b60d369ed5f53512dd5fa8b9f8b
5720+
peerDependencies:
5721+
bare-buffer: "*"
5722+
bare-events: "*"
5723+
peerDependenciesMeta:
5724+
bare-buffer:
5725+
optional: true
5726+
bare-events:
5727+
optional: true
5728+
checksum: 10c0/1242286f8f3147e9fd353cdaa9cf53226a807ac0dde8177c13f1463aa4cd1f88e07407c883a1b322b901e9af2d1cd30aacd873529031132c384622972e0419df
57095729
languageName: node
57105730
linkType: hard
57115731

@@ -17928,19 +17948,19 @@ __metadata:
1792817948
linkType: hard
1792917949

1793017950
"tar-fs@npm:^3.0.6":
17931-
version: 3.0.6
17932-
resolution: "tar-fs@npm:3.0.6"
17951+
version: 3.0.8
17952+
resolution: "tar-fs@npm:3.0.8"
1793317953
dependencies:
17934-
bare-fs: "npm:^2.1.1"
17935-
bare-path: "npm:^2.1.0"
17954+
bare-fs: "npm:^4.0.1"
17955+
bare-path: "npm:^3.0.0"
1793617956
pump: "npm:^3.0.0"
1793717957
tar-stream: "npm:^3.1.5"
1793817958
dependenciesMeta:
1793917959
bare-fs:
1794017960
optional: true
1794117961
bare-path:
1794217962
optional: true
17943-
checksum: 10c0/207b7c0f193495668bd9dbad09a0108ce4ffcfec5bce2133f90988cdda5c81fad83c99f963d01e47b565196594f7a17dbd063ae55b97b36268fcc843975278ee
17963+
checksum: 10c0/b70bb2ad0490ab13b48edd10bd648bb54c52b681981cdcdc3aa4517e98ad94c94659ddca1925872ee658d781b9fcdd2b1c808050647f06b1bca157dd2fcae038
1794417964
languageName: node
1794517965
linkType: hard
1794617966

src/networks/actors_bundle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub static ACTOR_BUNDLES: Lazy<Box<[ActorBundleInfo]>> = Lazy::new(|| {
100100
"bafy2bzacecdhvfmtirtojwhw2tyciu4jkbpsbk5g53oe24br27oy62sn4dc4e" @ "v13.0.0" for "mainnet",
101101
"bafy2bzacecbueuzsropvqawsri27owo7isa5gp2qtluhrfsto2qg7wpgxnkba" @ "v14.0.0" for "mainnet",
102102
"bafy2bzaceakwje2hyinucrhgtsfo44p54iw4g6otbv5ghov65vajhxgntr53u" @ "v15.0.0" for "mainnet",
103-
"bafy2bzaceaj3s3rrfbibikplap264uw74qor5yl35mqwokv4lwst4plpwry36" @ "v16.0.0-rc3" for "mainnet",
103+
"bafy2bzaceaj3s3rrfbibikplap264uw74qor5yl35mqwokv4lwst4plpwry36" @ "v16.0.0" for "mainnet",
104104
])
105105
});
106106

src/networks/mainnet/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
use crate::{
55
eth::EthChainId,
66
make_height,
7-
shim::{clock::ChainEpoch, version::NetworkVersion},
7+
shim::{
8+
clock::{ChainEpoch, EPOCHS_IN_DAY},
9+
version::NetworkVersion,
10+
},
811
};
912
use ahash::HashMap;
1013
use cid::Cid;
@@ -75,9 +78,11 @@ pub static HEIGHT_INFOS: Lazy<HashMap<Height, HeightInfo>> = Lazy::new(|| {
7578
make_height!(Waffle, 4_154_640, get_bundle_cid("v14.0.0")),
7679
// Wed 20 Nov 23:00:00 UTC 2024
7780
make_height!(TukTuk, 4_461_240, get_bundle_cid("v15.0.0")),
78-
// TODO(forest): https://github.com/ChainSafe/forest/issues/5041
79-
make_height!(Teep, i64::MAX, get_bundle_cid("v16.0.0-rc3")),
80-
make_height!(Tock, i64::MAX),
81+
// Thu 10 Apr 23:00:00 UTC 2025
82+
make_height!(Teep, 4_867_320, get_bundle_cid("v16.0.0")),
83+
// This epoch, 90 days after Teep is the completion of FIP-0100 where actors will start applying
84+
// the new daily fee to pre-Teep sectors being extended.
85+
make_height!(Tock, 4_867_320 + EPOCHS_IN_DAY * 90),
8186
])
8287
});
8388

src/networks/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl ChainConfig {
275275
f3_bootstrap_epoch: -1,
276276
f3_initial_power_table: None,
277277
f3_contract_address: Some(
278-
EthAddress::from_str("0x476AC9256b9921C9C6a0fC237B7fE05fe9874F50")
278+
EthAddress::from_str("0xA19080A1Bcb82Bb61bcb9691EC94653Eb5315716")
279279
.expect("invalid f3 contract eth address"),
280280
),
281281
f3_contract_poll_interval: DEFAULT_F3_CONTRACT_POLL_INTERVAL,

src/rpc/methods/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ impl RpcMethod<3> for StateSectorExpiration {
23272327
on_time = 0;
23282328
return Ok(());
23292329
}
2330-
let expirations: Amt<fil_actor_miner_state::v13::ExpirationSet, _> =
2330+
let expirations: Amt<fil_actor_miner_state::v16::ExpirationSet, _> =
23312331
Amt::load(&partition.expirations_epochs(), store)?;
23322332
expirations.for_each(|epoch, expiration| {
23332333
if expiration.early_sectors.get(sector_number) {

src/rpc/types/mod.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,28 +258,40 @@ pub struct SectorOnChainInfo {
258258
/// Pledge collected to commit this sector
259259
pub initial_pledge: TokenAmount,
260260

261-
#[schemars(with = "LotusJson<TokenAmount>")]
261+
#[schemars(with = "LotusJson<Option<TokenAmount>>")]
262262
#[serde(with = "crate::lotus_json")]
263263
/// Expected one day projection of reward for sector computed at activation
264264
/// time
265-
pub expected_day_reward: TokenAmount,
265+
pub expected_day_reward: Option<TokenAmount>,
266266

267267
/// Epoch at which this sector's power was most recently updated
268268
pub power_base_epoch: ChainEpoch,
269269

270-
#[schemars(with = "LotusJson<TokenAmount>")]
270+
#[schemars(with = "LotusJson<Option<TokenAmount>>")]
271271
#[serde(with = "crate::lotus_json")]
272272
/// Expected twenty day projection of reward for sector computed at
273273
/// activation time
274-
pub expected_storage_pledge: TokenAmount,
274+
pub expected_storage_pledge: Option<TokenAmount>,
275275

276-
#[schemars(with = "LotusJson<TokenAmount>")]
276+
#[schemars(with = "LotusJson<Option<TokenAmount>>")]
277277
#[serde(with = "crate::lotus_json")]
278-
pub replaced_day_reward: TokenAmount,
278+
pub replaced_day_reward: Option<TokenAmount>,
279279

280280
#[schemars(with = "LotusJson<Option<Cid>>")]
281281
#[serde(with = "crate::lotus_json", rename = "SectorKeyCID")]
282282
pub sector_key_cid: Option<Cid>,
283+
284+
/// The total fee payable per day for this sector. The value of this field is set at the time of
285+
/// sector activation, extension and whenever a sector's `QAP` is changed. This fee is payable for
286+
/// the lifetime of the sector and is aggregated in the deadline's `daily_fee` field.
287+
///
288+
/// This field is not included in the serialized form of the struct prior to the activation of
289+
/// FIP-0100, and is added as the 16th element of the array after that point only for new sectors
290+
/// or sectors that are updated after that point. For old sectors, the value of this field will
291+
/// always be zero.
292+
#[schemars(with = "LotusJson<TokenAmount>")]
293+
#[serde(with = "crate::lotus_json")]
294+
pub daily_fee: TokenAmount,
283295
}
284296

285297
lotus_json_with_self!(SectorOnChainInfo);

src/rpc/types/sector_impl.rs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ impl From<fil_actor_miner_state::v8::SectorOnChainInfo> for SectorOnChainInfo {
1818
deal_weight: info.deal_weight,
1919
verified_deal_weight: info.verified_deal_weight,
2020
initial_pledge: info.initial_pledge.into(),
21-
expected_day_reward: info.expected_day_reward.into(),
22-
expected_storage_pledge: info.expected_storage_pledge.into(),
23-
replaced_day_reward: TokenAmount::default(),
21+
expected_day_reward: Some(info.expected_day_reward.into()),
22+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
23+
replaced_day_reward: None,
2424
sector_key_cid: info.sector_key_cid,
2525
power_base_epoch: info.activation,
26+
daily_fee: TokenAmount::default(),
2627
}
2728
}
2829
}
@@ -44,11 +45,12 @@ impl From<fil_actor_miner_state::v9::SectorOnChainInfo> for SectorOnChainInfo {
4445
deal_weight: info.deal_weight,
4546
verified_deal_weight: info.verified_deal_weight,
4647
initial_pledge: info.initial_pledge.into(),
47-
expected_day_reward: info.expected_day_reward.into(),
48-
expected_storage_pledge: info.expected_storage_pledge.into(),
49-
replaced_day_reward: info.replaced_day_reward.into(),
48+
expected_day_reward: Some(info.expected_day_reward.into()),
49+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
50+
replaced_day_reward: Some(info.replaced_day_reward.into()),
5051
sector_key_cid: info.sector_key_cid,
5152
power_base_epoch: info.activation,
53+
daily_fee: TokenAmount::default(),
5254
}
5355
}
5456
}
@@ -70,11 +72,12 @@ impl From<fil_actor_miner_state::v10::SectorOnChainInfo> for SectorOnChainInfo {
7072
deal_weight: info.deal_weight,
7173
verified_deal_weight: info.verified_deal_weight,
7274
initial_pledge: info.initial_pledge.into(),
73-
expected_day_reward: info.expected_day_reward.into(),
74-
expected_storage_pledge: info.expected_storage_pledge.into(),
75-
replaced_day_reward: info.replaced_day_reward.into(),
75+
expected_day_reward: Some(info.expected_day_reward.into()),
76+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
77+
replaced_day_reward: Some(info.replaced_day_reward.into()),
7678
sector_key_cid: info.sector_key_cid,
7779
power_base_epoch: info.activation,
80+
daily_fee: TokenAmount::default(),
7881
}
7982
}
8083
}
@@ -96,11 +99,12 @@ impl From<fil_actor_miner_state::v11::SectorOnChainInfo> for SectorOnChainInfo {
9699
deal_weight: info.deal_weight,
97100
verified_deal_weight: info.verified_deal_weight,
98101
initial_pledge: info.initial_pledge.into(),
99-
expected_day_reward: info.expected_day_reward.into(),
100-
expected_storage_pledge: info.expected_storage_pledge.into(),
101-
replaced_day_reward: info.replaced_day_reward.into(),
102+
expected_day_reward: Some(info.expected_day_reward.into()),
103+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
104+
replaced_day_reward: Some(info.replaced_day_reward.into()),
102105
sector_key_cid: info.sector_key_cid,
103106
power_base_epoch: info.activation,
107+
daily_fee: TokenAmount::default(),
104108
}
105109
}
106110
}
@@ -118,11 +122,12 @@ impl From<fil_actor_miner_state::v12::SectorOnChainInfo> for SectorOnChainInfo {
118122
deal_weight: info.deal_weight,
119123
verified_deal_weight: info.verified_deal_weight,
120124
initial_pledge: info.initial_pledge.into(),
121-
expected_day_reward: info.expected_day_reward.into(),
122-
expected_storage_pledge: info.expected_storage_pledge.into(),
123-
replaced_day_reward: info.replaced_day_reward.into(),
125+
expected_day_reward: Some(info.expected_day_reward.into()),
126+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
127+
replaced_day_reward: Some(info.replaced_day_reward.into()),
124128
sector_key_cid: info.sector_key_cid,
125129
power_base_epoch: info.power_base_epoch,
130+
daily_fee: TokenAmount::default(),
126131
}
127132
}
128133
}
@@ -140,11 +145,12 @@ impl From<fil_actor_miner_state::v13::SectorOnChainInfo> for SectorOnChainInfo {
140145
deal_weight: info.deal_weight,
141146
verified_deal_weight: info.verified_deal_weight,
142147
initial_pledge: info.initial_pledge.into(),
143-
expected_day_reward: info.expected_day_reward.into(),
144-
expected_storage_pledge: info.expected_storage_pledge.into(),
145-
replaced_day_reward: info.replaced_day_reward.into(),
148+
expected_day_reward: Some(info.expected_day_reward.into()),
149+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
150+
replaced_day_reward: Some(info.replaced_day_reward.into()),
146151
sector_key_cid: info.sector_key_cid,
147152
power_base_epoch: info.power_base_epoch,
153+
daily_fee: TokenAmount::default(),
148154
}
149155
}
150156
}
@@ -162,11 +168,12 @@ impl From<fil_actor_miner_state::v14::SectorOnChainInfo> for SectorOnChainInfo {
162168
deal_weight: info.deal_weight,
163169
verified_deal_weight: info.verified_deal_weight,
164170
initial_pledge: info.initial_pledge.into(),
165-
expected_day_reward: info.expected_day_reward.into(),
166-
expected_storage_pledge: info.expected_storage_pledge.into(),
167-
replaced_day_reward: info.replaced_day_reward.into(),
171+
expected_day_reward: Some(info.expected_day_reward.into()),
172+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
173+
replaced_day_reward: Some(info.replaced_day_reward.into()),
168174
sector_key_cid: info.sector_key_cid,
169175
power_base_epoch: info.power_base_epoch,
176+
daily_fee: TokenAmount::default(),
170177
}
171178
}
172179
}
@@ -184,11 +191,12 @@ impl From<fil_actor_miner_state::v15::SectorOnChainInfo> for SectorOnChainInfo {
184191
deal_weight: info.deal_weight,
185192
verified_deal_weight: info.verified_deal_weight,
186193
initial_pledge: info.initial_pledge.into(),
187-
expected_day_reward: info.expected_day_reward.into(),
188-
expected_storage_pledge: info.expected_storage_pledge.into(),
189-
replaced_day_reward: info.replaced_day_reward.into(),
194+
expected_day_reward: Some(info.expected_day_reward.into()),
195+
expected_storage_pledge: Some(info.expected_storage_pledge.into()),
196+
replaced_day_reward: Some(info.replaced_day_reward.into()),
190197
sector_key_cid: info.sector_key_cid,
191198
power_base_epoch: info.power_base_epoch,
199+
daily_fee: TokenAmount::default(),
192200
}
193201
}
194202
}
@@ -206,20 +214,12 @@ impl From<fil_actor_miner_state::v16::SectorOnChainInfo> for SectorOnChainInfo {
206214
deal_weight: info.deal_weight,
207215
verified_deal_weight: info.verified_deal_weight,
208216
initial_pledge: info.initial_pledge.into(),
209-
expected_day_reward: info
210-
.expected_day_reward
211-
.unwrap_or(TokenAmount::default().into())
212-
.into(),
213-
expected_storage_pledge: info
214-
.expected_storage_pledge
215-
.unwrap_or(TokenAmount::default().into())
216-
.into(),
217-
replaced_day_reward: info
218-
.replaced_day_reward
219-
.unwrap_or(TokenAmount::default().into())
220-
.into(),
217+
expected_day_reward: info.expected_day_reward.map(Into::into),
218+
expected_storage_pledge: info.expected_storage_pledge.map(Into::into),
219+
replaced_day_reward: info.replaced_day_reward.map(Into::into),
221220
sector_key_cid: info.sector_key_cid,
222221
power_base_epoch: info.power_base_epoch,
222+
daily_fee: info.daily_fee.into(),
223223
}
224224
}
225225
}

0 commit comments

Comments
 (0)