Skip to content

Commit

Permalink
more adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Nov 26, 2024
1 parent 8f5d8c9 commit 6333192
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion fendermint/testing/contract-test/tests/staking/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl StateMachine for StakingMachine {
block_hash: *block_hash,
next_configuration_number: *next_configuration_number,
msgs: Vec::new(),
activities: Default::default(),
activity: Default::default(),
};
let checkpoint_hash = checkpoint.clone().abi_hash();

Expand Down
6 changes: 3 additions & 3 deletions fendermint/vm/actor_interface/src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ pub mod registry {
pub diamond_cut_facet: Address,
pub diamond_loupe_facet: Address,
pub ownership_facet: Address,
pub validator_reward_facet: Address,
pub activity_facet: Address,
pub subnet_getter_selectors: Vec<FunctionSelector>,
pub subnet_manager_selectors: Vec<FunctionSelector>,
pub subnet_rewarder_selectors: Vec<FunctionSelector>,
Expand All @@ -485,7 +485,7 @@ pub mod registry {
pub subnet_actor_diamond_cut_selectors: Vec<FunctionSelector>,
pub subnet_actor_diamond_loupe_selectors: Vec<FunctionSelector>,
pub subnet_actor_ownership_selectors: Vec<FunctionSelector>,
pub validator_reward_selectors: Vec<FunctionSelector>,
pub subnet_actor_activity_selectors: Vec<FunctionSelector>,
pub creation_privileges: u8, // 0 = Unrestricted, 1 = Owner.
}
}
Expand Down Expand Up @@ -542,7 +542,7 @@ pub mod subnet {
],
next_configuration_number: 1,
msgs: vec![],
activities: Default::default(),
activity: Default::default(),
};

let param_type = BottomUpCheckpoint::param_type();
Expand Down
12 changes: 6 additions & 6 deletions fendermint/vm/interpreter/src/fvm/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ where

let num_msgs = msgs.len();

let full_activity_rollup = state.activities_tracker().commit_activity()?;
let full_activity_rollup = state.activity_tracker().commit_activity()?;

// Construct checkpoint.
let checkpoint = BottomUpCheckpoint {
Expand All @@ -103,7 +103,7 @@ where
block_hash,
next_configuration_number,
msgs,
activities: full_activity_rollup.compressed()?,
activity: full_activity_rollup.compressed()?,
};

// Save the checkpoint in the ledger.
Expand Down Expand Up @@ -249,21 +249,21 @@ where
block_hash: cp.block_hash,
next_configuration_number: cp.next_configuration_number,
msgs: convert_tokenizables(cp.msgs)?,
activities: checkpoint::CompressedActivityRollup {
activity: checkpoint::CompressedActivityRollup {
consensus: checkpoint::CompressedSummary {
stats: checkpoint::AggregatedStats {
total_active_validators: cp
.activities
.activity
.consensus
.stats
.total_active_validators,
total_num_blocks_committed: cp
.activities
.activity
.consensus
.stats
.total_num_blocks_committed,
},
data_root_commitment: cp.activities.consensus.data_root_commitment,
data_root_commitment: cp.activity.consensus.data_root_commitment,
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion fendermint/vm/interpreter/src/fvm/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ where
let mut block_end_events = BlockEndEvents::default();

if let Some(pubkey) = state.block_producer() {
state.activities_tracker().record_block_committed(pubkey)?;
state.activity_tracker().record_block_committed(pubkey)?;
}

let next_gas_market = state.finalize_gas_market()?;
Expand Down
2 changes: 1 addition & 1 deletion fendermint/vm/interpreter/src/fvm/state/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ where
self.executor.context().network.chain_id
}

pub fn activities_tracker(&mut self) -> ActorActivityTracker<DB> {
pub fn activity_tracker(&mut self) -> ActorActivityTracker<DB> {
ActorActivityTracker { executor: self }
}

Expand Down
4 changes: 2 additions & 2 deletions fendermint/vm/interpreter/src/fvm/state/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<DB: Blockstore + Clone> GatewayCaller<DB> {
state: &mut FvmExecState<DB>,
checkpoint: checkpointing_facet::BottomUpCheckpoint,
power_table: &[Validator<Power>],
activities: checkpointing_facet::FullActivityRollup,
activity: checkpointing_facet::FullActivityRollup,
) -> anyhow::Result<FvmApplyRet> {
// Construct a Merkle tree from the power table, which we can use to validate validator set membership
// when the signatures are submitted in transactions for accumulation.
Expand All @@ -141,7 +141,7 @@ impl<DB: Blockstore + Clone> GatewayCaller<DB> {
checkpoint,
tree.root_hash().0,
total_power,
activities,
activity,
)
})?
.into_return())
Expand Down
6 changes: 3 additions & 3 deletions fendermint/vm/interpreter/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ fn deploy_contracts(
let diamond_loupe_facet = facets.remove(0);
let diamond_cut_facet = facets.remove(0);
let ownership_facet = facets.remove(0);
let validator_reward_facet = facets.remove(0);
let activity_facet = facets.remove(0);

debug_assert_eq!(facets.len(), 2, "SubnetRegistry has 2 facets of its own");

Expand All @@ -608,7 +608,7 @@ fn deploy_contracts(
diamond_cut_facet: diamond_cut_facet.facet_address,
diamond_loupe_facet: diamond_loupe_facet.facet_address,
ownership_facet: ownership_facet.facet_address,
validator_reward_facet: validator_reward_facet.facet_address,
activity_facet: activity_facet.facet_address,
subnet_getter_selectors: getter_facet.function_selectors,
subnet_manager_selectors: manager_facet.function_selectors,
subnet_rewarder_selectors: rewarder_facet.function_selectors,
Expand All @@ -617,7 +617,7 @@ fn deploy_contracts(
subnet_actor_diamond_cut_selectors: diamond_cut_facet.function_selectors,
subnet_actor_diamond_loupe_selectors: diamond_loupe_facet.function_selectors,
subnet_actor_ownership_selectors: ownership_facet.function_selectors,
validator_reward_selectors: validator_reward_facet.function_selectors,
subnet_actor_activity_selectors: activity_facet.function_selectors,
creation_privileges: 0,
};

Expand Down
8 changes: 4 additions & 4 deletions ipc/api/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use fvm_shared::econ::TokenAmount;
use ipc_actors_abis::{
checkpointing_facet, gateway_getter_facet, gateway_manager_facet, gateway_messenger_facet,
lib_gateway, register_subnet_facet, subnet_actor_checkpointing_facet, subnet_actor_diamond,
subnet_actor_getter_facet, top_down_finality_facet, validator_reward_facet,
subnet_actor_getter_facet, top_down_finality_facet, subnet_actor_activity_facet,
xnet_messaging_facet,
};

Expand Down Expand Up @@ -191,7 +191,7 @@ macro_rules! bottom_up_checkpoint_conversion {
.into_iter()
.map($module::IpcEnvelope::try_from)
.collect::<Result<Vec<_>, _>>()?,
activities: checkpoint.activity_rollup.try_into()?,
activity: checkpoint.activity_rollup.try_into()?,
})
}
}
Expand All @@ -210,7 +210,7 @@ macro_rules! bottom_up_checkpoint_conversion {
.into_iter()
.map(IpcEnvelope::try_from)
.collect::<Result<Vec<_>, _>>()?,
activity_rollup: value.activities.into(),
activity_rollup: value.activity.into(),
})
}
}
Expand Down Expand Up @@ -284,7 +284,7 @@ base_type_conversion!(subnet_actor_checkpointing_facet);
base_type_conversion!(gateway_getter_facet);
base_type_conversion!(gateway_messenger_facet);
base_type_conversion!(lib_gateway);
base_type_conversion!(validator_reward_facet);
base_type_conversion!(subnet_actor_activity_facet);
base_type_conversion!(checkpointing_facet);

cross_msg_types!(gateway_getter_facet);
Expand Down
2 changes: 1 addition & 1 deletion ipc/provider/src/manager/evm/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ impl ValidatorRewarder for EthSubnetManager {
let claim = ValidatorClaim {
// Even though it's the same struct but still need to do a mapping due to
// different crate from ethers-rs
data: validator_reward_facet::ValidatorData {
data: subnet_actor_activity_facet::ValidatorData {
validator: data.validator,
blocks_committed: data.blocks_committed,
},
Expand Down
2 changes: 1 addition & 1 deletion ipc/provider/src/manager/subnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use anyhow::Result;
use async_trait::async_trait;
use fvm_shared::clock::ChainEpoch;
use fvm_shared::{address::Address, econ::TokenAmount};
use ipc_actors_abis::validator_reward_facet::ValidatorClaim;
use ipc_actors_abis::subnet_actor_activity_facet::ValidatorClaim;
use ipc_api::checkpoint::{
consensus::ValidatorData, BottomUpCheckpoint, BottomUpCheckpointBundle, QuorumReachedEvent,
Signature,
Expand Down

0 comments on commit 6333192

Please sign in to comment.