Skip to content

Commit

Permalink
Merge branch 'master' into optim/resechedule-recoveries
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Sztandera authored Sep 23, 2022
2 parents be4158e + 2501329 commit 83e2d5f
Show file tree
Hide file tree
Showing 24 changed files with 566 additions and 180 deletions.
4 changes: 2 additions & 2 deletions .github/actions/rust-cargo-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inputs:
cache_name:
description: The name of the cache to save/restore
required: true
default: test
default: v2-test

runs:
using: composite
Expand All @@ -41,7 +41,7 @@ runs:
CACHE_SKIP_SAVE: ${{ inputs.save_cache == '' || inputs.save_cache == 'false' }}
with:
version: v0.2.15
shared-key: v2-${{ inputs.cache_name }} # change this to invalidate sccache for this job
shared-key: ${{ inputs.cache_name }} # change this to invalidate sccache for this job
- name: Running ${{ inputs.command }}
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
command: version
components: llvm-tools-preview
github_token: ${{ secrets.GITHUB_TOKEN }}
cache_name: cov
cache_name: v3-cov
save_cache: true
- name: Put LLVM tools into the PATH
run: echo "${HOME}/.rustup/toolchains/$(cat rust-toolchain)-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin" >> $GITHUB_PATH
Expand Down
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion actors/account/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use fvm_ipld_encoding::Cbor;
use fvm_shared::address::Address;

/// State includes the address for the actor
#[derive(Serialize_tuple, Deserialize_tuple, Debug)]
#[derive(Serialize_tuple, Deserialize_tuple, Debug, Clone)]
pub struct State {
pub address: Address,
}
Expand Down
2 changes: 1 addition & 1 deletion actors/cron/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use fvm_shared::address::Address;
use fvm_shared::MethodNum;

/// Cron actor state which holds entries to call during epoch tick
#[derive(Default, Serialize_tuple, Deserialize_tuple)]
#[derive(Default, Serialize_tuple, Deserialize_tuple, Clone, Debug)]
pub struct State {
/// Entries is a set of actors (and corresponding methods) to call during EpochTick.
pub entries: Vec<Entry>,
Expand Down
2 changes: 1 addition & 1 deletion actors/init/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use fvm_shared::error::ExitCode;
use fvm_shared::{ActorID, HAMT_BIT_WIDTH};

/// State is reponsible for creating
#[derive(Serialize_tuple, Deserialize_tuple)]
#[derive(Serialize_tuple, Deserialize_tuple, Clone, Debug)]
pub struct State {
pub address_map: Cid,
pub next_id: ActorID,
Expand Down
2 changes: 1 addition & 1 deletion actors/market/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use super::types::*;
use super::{DealProposal, DealState};

/// Market actor state
#[derive(Clone, Default, Serialize_tuple, Deserialize_tuple)]
#[derive(Clone, Default, Serialize_tuple, Deserialize_tuple, Debug)]
pub struct State {
/// Proposals are deals that have been proposed and not yet cleaned up after expiry or termination.
/// Array<DealID, DealProposal>
Expand Down
1 change: 1 addition & 0 deletions actors/miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fil_actor_market = { path = "../market" }
rand = "0.8.5"
cid = { version = "0.8.3", default-features = false, features = ["serde-codec"] }
multihash = { version = "0.16.1", default-features = false }
test-case = "2.2.1"
[features]
fil-actor = []

9 changes: 2 additions & 7 deletions actors/miner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub use bitfield_queue::*;
use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
use cid::multihash::Code;
use cid::Cid;
pub use commd::*;
pub use deadline_assignment::*;
pub use deadline_info::*;
pub use deadline_state::*;
Expand All @@ -33,6 +34,7 @@ use fvm_shared::econ::TokenAmount;
// They're not expected to ever happen, but if they do, distinguished codes can help us
// diagnose the problem.

use crate::Code::Blake2b256;
pub use beneficiary::*;
use fil_actors_runtime::cbor::{deserialize, serialize, serialize_vec};
use fil_actors_runtime::runtime::builtins::Type;
Expand All @@ -55,9 +57,6 @@ pub use termination::*;
pub use types::*;
pub use vesting_state::*;

use crate::commd::{is_unsealed_sector, CompactCommD};
use crate::Code::Blake2b256;

#[cfg(feature = "fil-actor")]
fil_actors_runtime::wasm_trampoline!(Actor);

Expand Down Expand Up @@ -4864,15 +4863,11 @@ impl ActorCode for Actor {
let res = Self::prove_replica_updates(rt, cbor::deserialize_params(params)?)?;
Ok(RawBytes::serialize(res)?)
}
#[allow(unreachable_code)]
Some(Method::PreCommitSectorBatch2) => {
return Err(actor_error!(unhandled_message, "Invalid method"));
Self::pre_commit_sector_batch2(rt, cbor::deserialize_params(params)?)?;
Ok(RawBytes::default())
}
#[allow(unreachable_code)]
Some(Method::ProveReplicaUpdates2) => {
return Err(actor_error!(unhandled_message, "Invalid method"));
let res = Self::prove_replica_updates2(rt, cbor::deserialize_params(params)?)?;
Ok(RawBytes::serialize(res)?)
}
Expand Down
2 changes: 1 addition & 1 deletion actors/miner/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub const SECTORS_AMT_BITWIDTH: u32 = 5;
/// that limits a miner actor's behavior (i.e. no balance withdrawals)
/// Excess balance as computed by st.GetAvailableBalance will be
/// withdrawable or usable for pre-commit deposit or pledge lock-up.
#[derive(Serialize_tuple, Deserialize_tuple, Clone)]
#[derive(Serialize_tuple, Deserialize_tuple, Clone, Debug)]
pub struct State {
/// Contains static info about this miner
pub info: Cid,
Expand Down
4 changes: 3 additions & 1 deletion actors/miner/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,14 @@ impl Cbor for PreCommitSectorParams {}
pub struct PreCommitSectorBatchParams {
pub sectors: Vec<PreCommitSectorParams>,
}
impl Cbor for PreCommitSectorBatchParams {}

#[derive(Debug, PartialEq, Eq, Clone, Serialize_tuple, Deserialize_tuple)]
pub struct PreCommitSectorBatchParams2 {
pub sectors: Vec<SectorPreCommitInfo>,
}

impl Cbor for PreCommitSectorBatchParams {}
impl Cbor for PreCommitSectorBatchParams2 {}

#[derive(Debug, Default, PartialEq, Eq, Clone, Serialize_tuple, Deserialize_tuple)]
pub struct SectorPreCommitInfo {
Expand Down
Loading

0 comments on commit 83e2d5f

Please sign in to comment.