Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
625 changes: 290 additions & 335 deletions Cargo.lock

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,32 @@ either = "1"
enumflags2 = "0.7"
ethereum-types = { version = "0.15", features = ["ethbloom"] }
ez-jsonrpc-types = "0.5"
fil_actor_account_state = { version = "21" }
fil_actor_cron_state = { version = "21" }
fil_actor_datacap_state = { version = "21" }
fil_actor_eam_state = { version = "21" }
fil_actor_evm_state = { version = "21" }
fil_actor_init_state = { version = "21" }
fil_actor_market_state = { version = "21" }
fil_actor_miner_state = { version = "21" }
fil_actor_multisig_state = { version = "21" }
fil_actor_power_state = { version = "21" }
fil_actor_reward_state = { version = "21" }
fil_actor_system_state = { version = "21" }
fil_actor_verifreg_state = { version = "21" }
fil_actors_shared = { version = "21", features = ["json"] }
fil_actor_account_state = { version = "22" }
fil_actor_cron_state = { version = "22" }
fil_actor_datacap_state = { version = "22" }
fil_actor_eam_state = { version = "22" }
fil_actor_evm_state = { version = "22" }
fil_actor_init_state = { version = "22" }
fil_actor_market_state = { version = "22" }
fil_actor_miner_state = { version = "22" }
fil_actor_multisig_state = { version = "22" }
fil_actor_power_state = { version = "22" }
fil_actor_reward_state = { version = "22" }
fil_actor_system_state = { version = "22" }
fil_actor_verifreg_state = { version = "22" }
fil_actors_shared = { version = "22", features = ["json"] }
flate2 = "1"
flume = { workspace = true }
fs_extra = "1"
futures = { workspace = true }
fvm2 = { package = "fvm", version = "~2.10", default-features = false }
fvm3 = { package = "fvm", version = "~3.12", default-features = false }
fvm4 = { package = "fvm", version = "~4.6.1", default-features = false, features = ["verify-signature"] }
fvm2 = { package = "fvm", version = "~2.11", default-features = false }
fvm3 = { package = "fvm", version = "~3.13", default-features = false }
fvm4 = { package = "fvm", version = "~4.7", default-features = false, features = ["verify-signature"] }
fvm_ipld_blockstore = "0.3.1"
fvm_ipld_encoding = "0.5.3"
fvm_shared2 = { package = "fvm_shared", version = "~2.10" }
fvm_shared3 = { package = "fvm_shared", version = "~3.12", features = ["proofs"] }
fvm_shared4 = { package = "fvm_shared", version = "~4.6.1", features = ["proofs"] }
fvm_shared2 = { package = "fvm_shared", version = "~2.11" }
fvm_shared3 = { package = "fvm_shared", version = "~3.13", features = ["proofs"] }
fvm_shared4 = { package = "fvm_shared", version = "~4.7", features = ["proofs"] }
gethostname = "1"
git-version = "0.3"
group = "0.13"
Expand Down Expand Up @@ -242,8 +242,8 @@ criterion = { version = "0.5", features = ["async_tokio", "csv"] }
cs_serde_bytes = "0.12"
derive-quickcheck-arbitrary = "0.1"
fickle = "0.3"
fvm_shared3 = { package = "fvm_shared", version = "~3.12", features = ["arb", "proofs", "testing"] }
fvm_shared4 = { package = "fvm_shared", version = "~4.6", features = ["arb", "proofs", "testing"] }
fvm_shared3 = { package = "fvm_shared", version = "~3.13", features = ["arb", "proofs", "testing"] }
fvm_shared4 = { package = "fvm_shared", version = "~4.7", features = ["arb", "proofs", "testing"] }
glob = "0.3"
http-range-header = "0.4"
insta = { version = "1", features = ["yaml"] }
Expand Down
2 changes: 1 addition & 1 deletion src/eth/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl EthTx {
.expect("Incorrect signature length");
let pubkey =
fvm_shared_latest::crypto::signature::ops::recover_secp_public_key(&hash.0, &sig_data)?;
let eth_addr = EthAddress::eth_address_from_pub_key(&pubkey.serialize())?;
let eth_addr = EthAddress::eth_address_from_pub_key(&pubkey)?;
eth_addr.to_filecoin_address()
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/shim/actors/builtin/power/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ impl State {
from_filter_estimate_v3_to_v2(st.this_epoch_qa_power_smoothed.clone())
}
State::V12(st) => {
from_filter_estimate_v4_to_v2(st.this_epoch_qa_power_smoothed.clone())
from_filter_estimate_v3_to_v2(st.this_epoch_qa_power_smoothed.clone())
}
State::V13(st) => {
from_filter_estimate_v4_to_v2(st.this_epoch_qa_power_smoothed.clone())
from_filter_estimate_v3_to_v2(st.this_epoch_qa_power_smoothed.clone())
}
State::V14(st) => FilterEstimate {
position: st.this_epoch_qa_power_smoothed.clone().position,
Expand Down
8 changes: 4 additions & 4 deletions src/shim/actors/builtin/reward/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl State {
State::V12(st) => Ok(from_token_v4_to_v2(
&fil_actor_miner_state::v12::pre_commit_deposit_for_power(
&st.this_epoch_reward_smoothed,
&fvm_shared4::smooth::FilterEstimate {
&fvm_shared3::smooth::FilterEstimate {
position: network_qa_power.position,
velocity: network_qa_power.velocity,
},
Expand All @@ -113,7 +113,7 @@ impl State {
State::V13(st) => Ok(from_token_v4_to_v2(
&fil_actor_miner_state::v13::pre_commit_deposit_for_power(
&st.this_epoch_reward_smoothed,
&fvm_shared4::smooth::FilterEstimate {
&fvm_shared3::smooth::FilterEstimate {
position: network_qa_power.position,
velocity: network_qa_power.velocity,
},
Expand Down Expand Up @@ -306,7 +306,7 @@ impl State {
qa_power,
&st.this_epoch_baseline_power,
&st.this_epoch_reward_smoothed,
&fvm_shared4::smooth::FilterEstimate {
&fvm_shared3::smooth::FilterEstimate {
position: network_qa_power.position,
velocity: network_qa_power.velocity,
},
Expand All @@ -319,7 +319,7 @@ impl State {
qa_power,
&st.this_epoch_baseline_power,
&st.this_epoch_reward_smoothed,
&fvm_shared4::smooth::FilterEstimate {
&fvm_shared3::smooth::FilterEstimate {
position: network_qa_power.position,
velocity: network_qa_power.velocity,
},
Expand Down
8 changes: 0 additions & 8 deletions src/shim/actors/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use fvm_shared4::piece::PaddedPieceSize as PaddedPieceSizeV4;
use fvm_shared4::sector::RegisteredPoStProof as RegisteredPoStProofV4;
use fvm_shared4::sector::RegisteredSealProof as RegisteredSealProofV4;
use fvm_shared4::sector::SectorSize as SectorSizeV4;
use fvm_shared4::smooth::FilterEstimate as FilterEstimateV4;
use num_bigint::BigInt;
use num_traits::FromPrimitive;

Expand Down Expand Up @@ -152,13 +151,6 @@ pub fn from_filter_estimate_v3_to_v2(fe: FilterEstimateV3) -> FilterEstimateV2 {
}
}

pub fn from_filter_estimate_v4_to_v2(fe: FilterEstimateV4) -> FilterEstimateV2 {
FilterEstimateV2 {
position: fe.position,
velocity: fe.velocity,
}
}

pub fn from_policy_v13_to_v9(policy: &PolicyV13) -> PolicyV9 {
let valid_post_proof_type = policy
.valid_post_proof_type
Expand Down
6 changes: 3 additions & 3 deletions src/shim/clock.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2019-2025 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

pub use super::fvm_shared_latest::ALLOWABLE_CLOCK_DRIFT;
pub use super::fvm_shared_latest::BLOCKS_PER_EPOCH;
pub use super::fvm_shared_latest::clock::EPOCH_DURATION_SECONDS;
pub use fvm_shared3::ALLOWABLE_CLOCK_DRIFT;
pub use fvm_shared3::BLOCKS_PER_EPOCH;
pub use fvm_shared3::clock::EPOCH_DURATION_SECONDS;

pub const SECONDS_IN_DAY: i64 = 86400;
pub const EPOCHS_IN_DAY: i64 = SECONDS_IN_DAY / EPOCH_DURATION_SECONDS;
Expand Down
10 changes: 4 additions & 6 deletions src/shim/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Copyright 2019-2025 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
pub use super::fvm_shared_latest::{
IPLD_RAW, TICKET_RANDOMNESS_LOOKBACK, crypto::signature::SECP_SIG_LEN,
};
use super::{
fvm_shared_latest::{self, commcid::Commitment},
version::NetworkVersion,
self, IPLD_RAW, commcid::Commitment, crypto::signature::SECP_SIG_LEN,
};
use super::version::NetworkVersion;
use crate::eth::{EthChainId, EthTx};
use crate::message::{Message, SignedMessage};
use anyhow::{Context, ensure};
Expand All @@ -17,6 +14,7 @@ use fvm_ipld_encoding::{
repr::{Deserialize_repr, Serialize_repr},
ser, strict_bytes,
};
pub use fvm_shared3::TICKET_RANDOMNESS_LOOKBACK;
use num::FromPrimitive;
use num_derive::FromPrimitive;
use schemars::JsonSchema;
Expand Down Expand Up @@ -279,7 +277,7 @@ pub fn verify_delegated_sig(
let hash = keccak_256(data);
let pub_key = recover_secp_public_key(&hash, &sig)?;

let eth_addr = EthAddress::eth_address_from_pub_key(&pub_key.serialize())?;
let eth_addr = EthAddress::eth_address_from_pub_key(&pub_key)?;

let rec_addr = eth_addr.to_filecoin_address()?;

Expand Down
10 changes: 9 additions & 1 deletion src/shim/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use cid::Cid;
use fvm_ipld_encoding::{RawBytes, ipld_block::IpldBlock};
use fvm2::trace::ExecutionEvent as E2;
use fvm3::trace::ExecutionEvent as E3;
use fvm4::trace::ExecutionEvent as E4;
use fvm4::trace::{ExecutionEvent as E4, IpldOperation};
use itertools::Either;

#[derive(Debug, Clone)]
Expand All @@ -23,6 +23,12 @@ pub enum ExecutionEvent {
CallError(ShimSyscallError),
Log(String),
InvokeActor(Either<Cid, InvokeActor>),
#[allow(dead_code)]
Ipld {
op: IpldOperation,
cid: Cid,
size: usize,
},
Unknown(Either<E3, Either<E4, E2>>),
}

Expand Down Expand Up @@ -146,6 +152,8 @@ impl From<E4> for ExecutionEvent {
id,
state: state.into(),
})),
E4::Log(s) => EShim::Log(s),
E4::Ipld { op, cid, size } => EShim::Ipld { op, cid, size },
e => EShim::Unknown(Either::Right(Either::Left(e))),
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/state_manager/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ pub mod structured {
}
ExecutionEvent::Log(_ignored) => {}
ExecutionEvent::InvokeActor(_cid) => {}
ExecutionEvent::Ipld { .. } => {}
ExecutionEvent::Unknown(u) => {
return Err(BuildExecutionTraceError::UnrecognisedEvent(Box::new(u)));
}
Expand Down Expand Up @@ -413,6 +414,7 @@ pub mod structured {
};
None
}
ExecutionEvent::Ipld { .. } => None,
// RUST: This should be caught at compile time with #[deny(non_exhaustive_omitted_patterns)]
// So that BuildExecutionTraceError::UnrecognisedEvent is never constructed
// But that lint is not yet stabilised: https://github.com/rust-lang/rust/issues/89554
Expand Down
Loading