diff --git a/contracts/binding/src/lib.rs b/contracts/binding/src/lib.rs index a617bead0..508f367f3 100644 --- a/contracts/binding/src/lib.rs +++ b/contracts/binding/src/lib.rs @@ -1,67 +1,3 @@ // DO NOT EDIT! This file was generated by build.rs #[macro_use] mod convert; -#[allow(clippy::all)] -pub mod checkpointing_facet; -#[allow(clippy::all)] -pub mod diamond_cut_facet; -#[allow(clippy::all)] -pub mod diamond_loupe_facet; -#[allow(clippy::all)] -pub mod gateway_diamond; -#[allow(clippy::all)] -pub mod gateway_getter_facet; -#[allow(clippy::all)] -pub mod gateway_manager_facet; -#[allow(clippy::all)] -pub mod gateway_messenger_facet; -#[allow(clippy::all)] -pub mod i_diamond; -#[allow(clippy::all)] -pub mod lib_gateway; -#[allow(clippy::all)] -pub mod lib_quorum; -#[allow(clippy::all)] -pub mod lib_staking; -#[allow(clippy::all)] -pub mod lib_staking_change_log; -#[allow(clippy::all)] -pub mod ownership_facet; -#[allow(clippy::all)] -pub mod register_subnet_facet; -#[allow(clippy::all)] -pub mod subnet_actor_checkpointing_facet; -#[allow(clippy::all)] -pub mod subnet_actor_diamond; -#[allow(clippy::all)] -pub mod subnet_actor_getter_facet; -#[allow(clippy::all)] -pub mod subnet_actor_manager_facet; -#[allow(clippy::all)] -pub mod subnet_actor_pause_facet; -#[allow(clippy::all)] -pub mod subnet_actor_reward_facet; -#[allow(clippy::all)] -pub mod subnet_getter_facet; -#[allow(clippy::all)] -pub mod subnet_registry_diamond; -#[allow(clippy::all)] -pub mod top_down_finality_facet; -#[allow(clippy::all)] -pub mod validator_reward_facet; -#[allow(clippy::all)] -pub mod xnet_messaging_facet; - -// The list of contracts need to convert FvmAddress to fvm_shared::Address -fvm_address_conversion!(gateway_manager_facet); -fvm_address_conversion!(gateway_getter_facet); -fvm_address_conversion!(xnet_messaging_facet); -fvm_address_conversion!(gateway_messenger_facet); -fvm_address_conversion!(subnet_actor_checkpointing_facet); -fvm_address_conversion!(subnet_actor_getter_facet); -fvm_address_conversion!(lib_gateway); -fvm_address_conversion!(checkpointing_facet); - -// The list of contracts that need to convert common types between each other -common_type_conversion!(subnet_actor_getter_facet, checkpointing_facet); -common_type_conversion!(subnet_actor_getter_facet, xnet_messaging_facet); diff --git a/contracts/tasks/deploy-registry.ts b/contracts/tasks/deploy-registry.ts index 2ae9245ec..854e1c61d 100644 --- a/contracts/tasks/deploy-registry.ts +++ b/contracts/tasks/deploy-registry.ts @@ -37,11 +37,17 @@ task('deploy-registry') }, { name: 'SubnetActorPauseFacet' }, { name: 'SubnetActorRewardFacet' }, - { name: 'SubnetActorCheckpointingFacet' }, + { + name: 'SubnetActorCheckpointingFacet', + libraries: ['SubnetIDHelper'], + }, { name: 'DiamondCutFacet' }, { name: 'DiamondLoupeFacet' }, { name: 'OwnershipFacet' }, - { name: 'ValidatorRewardFacet' }, + { + name: 'ValidatorRewardFacet', + libraries: ['SubnetIDHelper'], + }, ) const registryFacets = await Deployments.deploy( diff --git a/contracts/tasks/deploy.ts b/contracts/tasks/deploy.ts index ee102c043..fdedcf538 100644 --- a/contracts/tasks/deploy.ts +++ b/contracts/tasks/deploy.ts @@ -7,18 +7,18 @@ task( async (args, hre: HardhatRuntimeEnvironment) => { await hre.run('compile') - console.log() - console.log( - '==== LIBRARY DEPLOYMENT ===========================================================================', - ) - await hre.run('deploy-libraries') - console.log() + // console.log() + // console.log( + // '==== LIBRARY DEPLOYMENT ===========================================================================', + // ) + // await hre.run('deploy-libraries') + // console.log() - console.log( - '==== GATEWAY DEPLOYMENT ===========================================================================', - ) - await hre.run('deploy-gateway') - console.log() + // console.log( + // '==== GATEWAY DEPLOYMENT ===========================================================================', + // ) + // await hre.run('deploy-gateway') + // console.log() console.log( '==== REGISTRY DEPLOYMENT ==========================================================================', diff --git a/contracts/tasks/validator-rewarder.ts b/contracts/tasks/validator-rewarder.ts index 679c8fc29..86e37e4d3 100644 --- a/contracts/tasks/validator-rewarder.ts +++ b/contracts/tasks/validator-rewarder.ts @@ -20,3 +20,27 @@ task('validator-rewarder-deploy') libraries: [], }) }) + +// step 2. set the subnet for the rewarder +// sample command: pnpm exec hardhat validator-rewarder-set-subnet --network calibrationnet 314159 +task('validator-rewarder-set-subnet') + .setDescription('Deploy example subnet validator rewarder contract') + .addPositionalParam('root', 'the chain id of parent subnet') + .addPositionalParam('address', 'the address of the subnet actor contract, L2 only') + .setAction(async (args: TaskArguments, hre: HardhatRuntimeEnvironment) => { + await hre.run('compile') + + const [deployer] = await hre.getUnnamedAccounts() + const balance = await hre.ethers.provider.getBalance(deployer) + console.log( + `Set validator rewarder subnet with account: ${deployer} and balance: ${hre.ethers.utils.formatEther(balance.toString())}`, + ) + + // only L2 for now + const subnetId = { root: args.root, route: [args.address] } + console.log('pointing to', subnetId) + + const contracts = await Deployments.resolve(hre, 'ValidatorRewarderMap') + const contract = contracts.contracts.ValidatorRewarderMap + await contract.setSubnet(subnetId) + }) \ No newline at end of file diff --git a/fendermint/vm/interpreter/src/genesis.rs b/fendermint/vm/interpreter/src/genesis.rs index 9d9b6a48e..03331ec0c 100644 --- a/fendermint/vm/interpreter/src/genesis.rs +++ b/fendermint/vm/interpreter/src/genesis.rs @@ -18,9 +18,7 @@ use fendermint_eth_hardhat::{ContractSourceAndName, Hardhat, FQN}; use fendermint_vm_actor_interface::diamond::{EthContract, EthContractMap}; use fendermint_vm_actor_interface::eam::EthAddress; use fendermint_vm_actor_interface::ipc::IPC_CONTRACTS; -use fendermint_vm_actor_interface::{ - account, burntfunds, chainmetadata, cron, eam, gas_market, init, ipc, reward, system, EMPTY_ARR, -}; +use fendermint_vm_actor_interface::{account, burntfunds, chainmetadata, cron, eam, gas_market, init, ipc, reward, system, EMPTY_ARR, activity}; use fendermint_vm_core::{chainid, Timestamp}; use fendermint_vm_genesis::{ActorMeta, Collateral, Genesis, Power, PowerScale, Validator}; use futures_util::io::Cursor; @@ -452,6 +450,17 @@ impl GenesisBuilder { ) .context("failed to create default eip1559 gas market actor")?; + let tracker_state = fendermint_actor_activity_tracker::State::new(state.store())?; + state + .create_custom_actor( + fendermint_actor_activity_tracker::IPC_ACTIVITY_TRACKER_ACTOR_NAME, + activity::ACTIVITY_TRACKER_ACTOR_ID, + &tracker_state, + TokenAmount::zero(), + None, + ) + .context("failed to create activity tracker actor")?; + // STAGE 2: Create non-builtin accounts which do not have a fixed ID. // The next ID is going to be _after_ the accounts, which have already been assigned an ID by the `Init` actor.