Skip to content

Commit

Permalink
chore: update FVM to v4.1.2 and v3.9.0 (#447)
Browse files Browse the repository at this point in the history
* chore: update FVM to v4.1.2

chore: update FVM to v4.1.2

* chore: update fvm v3

This brings back the InvokeActor event to the v3 trace, but with all the new information we get in v4.

Co-authored-by: Steven Allen <steven@stebalien.com>
  • Loading branch information
rjan90 and Stebalien authored Jan 31, 2024
1 parent 880602e commit b715c94
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
20 changes: 10 additions & 10 deletions rust/Cargo.lock

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

6 changes: 3 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ rayon = "1.2.1"
anyhow = "1.0.23"
serde_json = "1.0.46"
rust-gpu-tools = { version = "0.7", optional = true, default-features = false }
fvm4 = { package = "fvm", version = "~4.1.1", default-features = false }
fvm4_shared = { package = "fvm_shared", version = "~4.1.1" }
fvm3 = { package = "fvm", version = "~3.8.0", default-features = false }
fvm4 = { package = "fvm", version = "~4.1.2", default-features = false }
fvm4_shared = { package = "fvm_shared", version = "~4.1.2" }
fvm3 = { package = "fvm", version = "~3.9.0", default-features = false }
fvm3_shared = { package = "fvm_shared", version = "~3.6.0" }
fvm2 = { package = "fvm", version = "~2.7", default-features = false }
fvm2_shared = { package = "fvm_shared", version = "~2.6" }
Expand Down
20 changes: 19 additions & 1 deletion rust/src/fvm/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod v3 {
use fvm4::trace::ExecutionEvent;
use fvm4_shared::{
address::Address, econ::TokenAmount, error::ErrorNumber, error::ExitCode, message::Message,
receipt::Receipt,
receipt::Receipt, state::ActorState,
};

use crate::fvm::engine::{
Expand Down Expand Up @@ -427,6 +427,24 @@ mod v3 {
.unwrap_or(ErrorNumber::AssertionFailed),
)))
}
ExecutionEvent3::InvokeActor { id, state } => {
Some(ExecutionEvent::InvokeActor {
id,
state: ActorState {
code: state.code,
state: state.state,
sequence: state.sequence,
balance: TokenAmount::from_atto(
state.balance.atto().clone(),
),
delegated_address: state
.delegated_address
// Do our best to convert the address, or drop it if
// that's impossible for some reason.
.and_then(|a| Address::from_bytes(&a.to_bytes()).ok()),
},
})
}
_ => None,
})
.collect(),
Expand Down

0 comments on commit b715c94

Please sign in to comment.