Skip to content

Commit 0514cd9

Browse files
committed
fix: revert genesis and manifest changes to match f3-proofs-cache baseline
1 parent c033b3a commit 0514cd9

3 files changed

Lines changed: 20 additions & 21 deletions

File tree

fendermint/actors-custom-car/src/manifest.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use anyhow::{anyhow, Context};
44
use cid::Cid;
55
use fendermint_actor_chainmetadata::CHAINMETADATA_ACTOR_NAME;
66
use fendermint_actor_eam::IPC_EAM_ACTOR_NAME;
7-
use fendermint_actor_f3_cert_manager::F3_CERT_MANAGER_ACTOR_NAME;
87
use fendermint_actor_gas_market_eip1559::ACTOR_NAME as GAS_MARKET_EIP1559_ACTOR_NAME;
98
use fvm_ipld_blockstore::Blockstore;
109
use fvm_ipld_encoding::CborStore;
@@ -13,7 +12,6 @@ use std::collections::HashMap;
1312
// array of required actors
1413
pub const REQUIRED_ACTORS: &[&str] = &[
1514
CHAINMETADATA_ACTOR_NAME,
16-
F3_CERT_MANAGER_ACTOR_NAME,
1715
IPC_EAM_ACTOR_NAME,
1816
GAS_MARKET_EIP1559_ACTOR_NAME,
1917
];

fendermint/app/src/cmd/genesis.rs

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -368,29 +368,18 @@ async fn fetch_f3_params_from_parent(
368368
// We use a dummy subnet ID here since F3 data is at the chain level, not subnet-specific
369369
let lotus_client = LotusJsonRPCClient::new(jsonrpc_client, SubnetID::default());
370370

371-
// Fetch F3 certificate which contains instance ID and finalized epochs
371+
// Fetch F3 certificate which contains instance ID
372372
let certificate = lotus_client.f3_get_certificate().await?;
373373

374374
match certificate {
375375
Some(cert) => {
376+
// Use the fetched certificate's instance ID to get its base power table.
377+
// The finalized chain starts empty and subsequent certificates will be
378+
// fetched and processed properly.
376379
let instance_id = cert.gpbft_instance;
377-
tracing::info!("Found F3 instance ID: {}", instance_id);
380+
tracing::info!("Starting F3 from instance ID: {}", instance_id);
378381

379-
// Extract finalized epochs from the EC chain
380-
let finalized_epochs: Vec<i64> =
381-
cert.ec_chain.iter().map(|entry| entry.epoch).collect();
382-
383-
if finalized_epochs.is_empty() {
384-
return Err(anyhow::anyhow!("F3 certificate has empty EC chain"));
385-
}
386-
387-
tracing::info!(
388-
"Found {} finalized epochs, latest: {}",
389-
finalized_epochs.len(),
390-
finalized_epochs.iter().max().unwrap_or(&0)
391-
);
392-
393-
// Get power table for this instance
382+
// Get base power table for this instance
394383
let power_table_response = lotus_client.f3_get_power_table(instance_id).await?;
395384

396385
// Convert power entries
@@ -416,7 +405,7 @@ async fn fetch_f3_params_from_parent(
416405
Ok(Some(ipc::F3Params {
417406
instance_id,
418407
power_table,
419-
finalized_epochs,
408+
finalized_epochs: Vec::new(), // Start with empty finalized chain
420409
}))
421410
}
422411
None => Err(anyhow::anyhow!(

fendermint/vm/interpreter/src/genesis.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,16 @@ struct DeployConfig<'a> {
535535
deployer_addr: ethers::types::Address,
536536
}
537537

538+
/// Get the commit SHA for genesis contract deployment.
539+
/// For genesis, we use a default value as genesis is typically built at compile time.
540+
fn get_genesis_commit_sha() -> [u8; 32] {
541+
// Use default value for genesis (matches test default)
542+
let default_sha = b"c7d8f53f";
543+
let mut result = [0u8; 32];
544+
result[..default_sha.len()].copy_from_slice(default_sha);
545+
result
546+
}
547+
538548
fn deploy_contracts(
539549
ipc_contracts: Vec<ContractSourceAndName>,
540550
top_level_contracts: &EthContractMap,
@@ -565,7 +575,9 @@ fn deploy_contracts(
565575
GatewayParams::new(SubnetID::new(config.chain_id.into(), vec![]))
566576
};
567577

568-
let params = ConstructorParameters::new(ipc_params, validators)
578+
// Get commit SHA for genesis deployment
579+
let commit_sha = get_genesis_commit_sha();
580+
let params = ConstructorParameters::new(ipc_params, validators, commit_sha)
569581
.context("failed to create gateway constructor")?;
570582

571583
let facets = deployer

0 commit comments

Comments
 (0)