Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime: Don't convert syscall errors #1024

Merged
merged 1 commit into from
Jan 13, 2023
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
50 changes: 25 additions & 25 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/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
frc42_dispatch = "3.0.0"
fvm_actor_utils = "3.0.0"
serde = { version = "1.0.136", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion actors/cron/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
num-traits = "0.2.14"
num-derive = "0.3.3"
log = "0.4.14"
Expand Down
2 changes: 1 addition & 1 deletion actors/datacap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fvm_actor_utils = "3.0.0"
fvm_ipld_blockstore = "0.1.1"
fvm_ipld_encoding = "0.3.2"
fvm_ipld_hamt = "0.6.1"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
lazy_static = "1.4.0"
num-derive = "0.3.3"
num-traits = "0.2.14"
Expand Down
4 changes: 2 additions & 2 deletions actors/datacap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use frc46_token::token::types::{
TransferFromParams, TransferFromReturn, TransferParams, TransferReturn,
};
use frc46_token::token::{Token, TokenError, TOKEN_PRECISION};
use fvm_actor_utils::messaging::{Messaging, MessagingError, Response};
use fvm_actor_utils::messaging::{Messaging, MessagingError};
use fvm_actor_utils::receiver::ReceiverHookError;
use fvm_ipld_encoding::RawBytes;
use fvm_shared::address::Address;
use fvm_shared::bigint::BigInt;
use fvm_shared::econ::TokenAmount;
use fvm_shared::error::{ErrorNumber, ExitCode};
use fvm_shared::{ActorID, MethodNum, METHOD_CONSTRUCTOR, METHOD_SEND};
use fvm_shared::{ActorID, MethodNum, Response, METHOD_CONSTRUCTOR, METHOD_SEND};
use lazy_static::lazy_static;
use log::info;
use num_derive::FromPrimitive;
Expand Down
2 changes: 1 addition & 1 deletion actors/eam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fvm_ipld_blockstore = "0.1.1"
fvm_ipld_encoding = "0.3.2"
multihash = { version = "0.16.1", default-features = false }
cid = "0.8.6"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
num-traits = "0.2.15"
num-derive = "0.3.3"
hex-literal = "0.3.4"
Expand Down
2 changes: 1 addition & 1 deletion actors/ethaccount/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ crate-type = ["cdylib", "lib"]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
serde = { version = "1.0.136", features = ["derive"] }
fvm_ipld_encoding = "0.3.2"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
num-traits = "0.2.15"
num-derive = "0.3.3"
hex-literal = "0.3.4"
Expand Down
2 changes: 1 addition & 1 deletion actors/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
fvm_ipld_kamt = { version = "0.1.0" }
serde = { version = "1.0.136", features = ["derive"] }
serde_tuple = "0.5"
Expand Down
14 changes: 12 additions & 2 deletions actors/evm/src/interpreter/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,21 @@ impl<'r, RT: Runtime> System<'r, RT> {
send_flags: SendFlags,
) -> Result<Option<IpldBlock>, ActorError> {
self.flush()?;
let result = self.rt.send_generalized(to, method, params, value, gas_limit, send_flags)?;
let result = self
.rt
.send_generalized(to, method, params, value, gas_limit, send_flags)
.map_err(|err| actor_error!(unspecified; "send syscall failed: {}", err))?;
if !send_flags.read_only() {
self.reload()?;
}
Ok(result)
match result.exit_code {
ExitCode::OK => Ok(result.return_data),
e => Err(ActorError::unchecked_with_data(
e,
"send failed".to_string(),
result.return_data,
)),
}
}

/// Flush the actor state (bytecode, nonce, and slots).
Expand Down
2 changes: 1 addition & 1 deletion actors/init/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
fvm_ipld_hamt = "0.6.1"
frc42_dispatch = "3.0.0"
serde = { version = "1.0.136", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion actors/market/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fvm_ipld_bitfield = "0.5.2"
fvm_ipld_blockstore = "0.1.1"
fvm_ipld_encoding = "0.3.2"
fvm_ipld_hamt = "0.6.1"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
integer-encoding = { version = "3.0.3", default-features = false }
libipld-core = { version = "0.13.1", features = ["serde-codec"] }
log = "0.4.14"
Expand Down
2 changes: 1 addition & 1 deletion actors/miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crate-type = ["cdylib", "lib"]
[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
frc42_dispatch = "3.0.0"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
fvm_ipld_bitfield = "0.5.4"
fvm_ipld_amt = { version = "0.5.0", features = ["go-interop"] }
fvm_ipld_hamt = "0.6.1"
Expand Down
2 changes: 1 addition & 1 deletion actors/multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fvm_actor_utils = "3.0.0"
fvm_ipld_blockstore = "0.1.1"
fvm_ipld_encoding = "0.3.2"
fvm_ipld_hamt = "0.6.1"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
indexmap = { version = "1.8.0", features = ["serde-1"] }
integer-encoding = { version = "3.0.3", default-features = false }
num-derive = "0.3.3"
Expand Down
2 changes: 1 addition & 1 deletion actors/paych/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
frc42_dispatch = "3.0.0"
num-traits = "0.2.14"
num-derive = "0.3.3"
Expand Down
4 changes: 2 additions & 2 deletions actors/placeholder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ keywords = ["filecoin", "web3", "wasm"]
crate-type = ["cdylib", "lib"]

[dependencies]
fvm_sdk = { version = "3.0.0-alpha.21", optional = true }
fvm_shared = { version = "3.0.0-alpha.15", optional = true }
fvm_sdk = { version = "3.0.0-alpha.22", optional = true }
fvm_shared = { version = "3.0.0-alpha.16", optional = true }

[features]
fil-actor = ["fvm_sdk", "fvm_shared"]
2 changes: 1 addition & 1 deletion actors/power/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
frc42_dispatch = "3.0.0"
fvm_ipld_hamt = "0.6.1"
num-traits = "0.2.14"
Expand Down
4 changes: 2 additions & 2 deletions actors/power/tests/power_actor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ fn create_miner_given_send_to_init_actor_fails_should_fail() {
IpldBlock::serialize_cbor(&message_params).unwrap(),
TokenAmount::from_atto(10),
None,
ExitCode::SYS_INSUFFICIENT_FUNDS,
ExitCode::USR_INSUFFICIENT_FUNDS,
);

expect_abort(
ExitCode::SYS_INSUFFICIENT_FUNDS,
ExitCode::USR_INSUFFICIENT_FUNDS,
rt.call::<PowerActor>(
Method::CreateMiner as u64,
IpldBlock::serialize_cbor(&create_miner_params).unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion actors/reward/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
num-traits = "0.2.14"
num-derive = "0.3.3"
log = "0.4.14"
Expand Down
2 changes: 1 addition & 1 deletion actors/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ crate-type = ["cdylib", "lib"]

[dependencies]
fil_actors_runtime = { version = "10.0.0-alpha.1", path = "../../runtime" }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
fvm_ipld_encoding = "0.3.2"
fvm_ipld_blockstore = "0.1.1"
num-traits = "0.2.14"
Expand Down
2 changes: 1 addition & 1 deletion actors/verifreg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fvm_actor_utils = "3.0.0"
fvm_ipld_blockstore = "0.1.1"
fvm_ipld_encoding = "0.3.2"
fvm_ipld_hamt = "0.6.1"
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
lazy_static = "1.4.0"
log = "0.4.14"
num-derive = "0.3.3"
Expand Down
6 changes: 3 additions & 3 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/filecoin-project/builtin-actors"
[dependencies]
fvm_ipld_hamt = "0.6.1"
fvm_ipld_amt = { version = "0.5.0", features = ["go-interop"] }
fvm_shared = { version = "3.0.0-alpha.15", default-features = false }
fvm_shared = { version = "3.0.0-alpha.16", default-features = false }
num = { version = "0.4", features = ["serde"] }
num-traits = "0.2.14"
num-derive = "0.3.3"
Expand All @@ -37,7 +37,7 @@ castaway = "0.2.2"
sha2 = "0.10"

# fil-actor
fvm_sdk = { version = "3.0.0-alpha.21", optional = true }
fvm_sdk = { version = "3.0.0-alpha.22", optional = true }

# test_util
rand = { version = "0.8.5", default-features = false, optional = true }
Expand Down Expand Up @@ -90,4 +90,4 @@ no-provider-deal-collateral = []
# fake proofs (for testing)
fake-proofs = []

test_utils = ["hex", "multihash/sha2", "libsecp256k1", "blake2b_simd", "rand", "rand/std_rng", "lazy_static", "pretty_env_logger"]
test_utils = ["hex", "multihash/sha2", "libsecp256k1", "blake2b_simd", "rand", "rand/std_rng", "lazy_static", "pretty_env_logger"]
Loading