Skip to content

Commit c412b3a

Browse files
authored
Add support for actor upgrades (#1866)
This PR adds support for actor upgrades through a new `sdk::actor::upgrade_actor` syscall. This allows actors to upgrade to a new version while still keeping the same address, balance, etc. Instead of introducing a separate syscall to fetch `get_old_code_cid` this PR implements the alternative where we pass a upgrade metadata to the upgrade endpoint as proposed [here](filecoin-project/FIPs#396 (comment)). fixes #171
1 parent 1c13285 commit c412b3a

File tree

37 files changed

+1100
-321
lines changed

37 files changed

+1100
-321
lines changed

Cargo.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fvm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ cuda-supraseal = ["filecoin-proofs-api/cuda-supraseal"]
6666
testing = []
6767
arb = ["arbitrary", "quickcheck", "fvm_shared/arb", "cid/arb"]
6868
m2-native = []
69+
upgrade-actor = []
6970
gas_calibration = []

fvm/src/call_manager/backtrace.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ use std::fmt::Display;
44

55
use fvm_shared::address::Address;
66
use fvm_shared::error::{ErrorNumber, ExitCode};
7-
use fvm_shared::{ActorID, MethodNum};
7+
use fvm_shared::ActorID;
88

99
use crate::kernel::SyscallError;
1010

11+
use super::Entrypoint;
12+
1113
/// A call backtrace records the actors an error was propagated through, from
1214
/// the moment it was emitted. The original error is the _cause_. Backtraces are
1315
/// useful for identifying the root cause of an error.
@@ -76,8 +78,8 @@ impl Backtrace {
7678
pub struct Frame {
7779
/// The actor that exited with this code.
7880
pub source: ActorID,
79-
/// The method that was invoked.
80-
pub method: MethodNum,
81+
/// The entrypoint that was invoked.
82+
pub entrypoint: Entrypoint,
8183
/// The exit code.
8284
pub code: ExitCode,
8385
/// The abort message.
@@ -90,7 +92,7 @@ impl Display for Frame {
9092
f,
9193
"{} (method {}) -- {} ({})",
9294
Address::new_id(self.source),
93-
self.method,
95+
self.entrypoint,
9496
&self.message,
9597
self.code,
9698
)

0 commit comments

Comments
 (0)