Skip to content

Commit ece04c7

Browse files
authored
Include actor name and ID in log prefix (#1027)
* Include actor name and ID in log prefix * Add name to EVM actors
1 parent f393b91 commit ece04c7

File tree

18 files changed

+93
-6
lines changed

18 files changed

+93
-6
lines changed

actors/account/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ impl Actor {
109109

110110
impl ActorCode for Actor {
111111
type Methods = Method;
112+
113+
fn name() -> &'static str {
114+
"Account"
115+
}
116+
112117
actor_dispatch! {
113118
Constructor => constructor,
114119
PubkeyAddress => pubkey_address,

actors/cron/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ impl Actor {
7878

7979
impl ActorCode for Actor {
8080
type Methods = Method;
81+
82+
fn name() -> &'static str {
83+
"Cron"
84+
}
85+
8186
actor_dispatch! {
8287
Constructor => constructor,
8388
EpochTick => epoch_tick,

actors/datacap/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ impl<T> AsActorResult<T> for Result<T, ReceiverHookError> {
499499

500500
impl ActorCode for Actor {
501501
type Methods = Method;
502+
503+
fn name() -> &'static str {
504+
"DataCap"
505+
}
506+
502507
actor_dispatch! {
503508
Constructor => constructor,
504509
MintExported => mint,

actors/eam/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ impl EamActor {
290290

291291
impl ActorCode for EamActor {
292292
type Methods = Method;
293+
294+
fn name() -> &'static str {
295+
"EVMAddressManager"
296+
}
297+
293298
actor_dispatch_unrestricted! {
294299
Constructor => constructor,
295300
Create => create,

actors/ethaccount/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ impl EthAccountActor {
6767

6868
impl ActorCode for EthAccountActor {
6969
type Methods = Method;
70+
71+
fn name() -> &'static str {
72+
"EVMAccount"
73+
}
74+
7075
actor_dispatch! {
7176
Constructor => constructor,
7277
_ => fallback [raw],

actors/evm/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@ fn handle_filecoin_method_output(output: &[u8]) -> Result<Option<IpldBlock>, Act
404404

405405
impl ActorCode for EvmContractActor {
406406
type Methods = Method;
407+
408+
fn name() -> &'static str {
409+
"EVMContract"
410+
}
411+
407412
actor_dispatch_unrestricted! {
408413
Constructor => constructor,
409414
InvokeContract => invoke_contract [default_params],

actors/init/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ impl Actor {
166166

167167
impl ActorCode for Actor {
168168
type Methods = Method;
169+
170+
fn name() -> &'static str {
171+
"Init"
172+
}
173+
169174
actor_dispatch! {
170175
Constructor => constructor,
171176
Exec => exec,

actors/market/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,11 @@ pub fn deal_id_key(k: DealID) -> BytesKey {
14221422

14231423
impl ActorCode for Actor {
14241424
type Methods = Method;
1425+
1426+
fn name() -> &'static str {
1427+
"StorageMarket"
1428+
}
1429+
14251430
actor_dispatch! {
14261431
Constructor => constructor,
14271432
AddBalance|AddBalanceExported => add_balance,

actors/miner/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4960,6 +4960,11 @@ fn balance_invariants_broken(e: Error) -> ActorError {
49604960

49614961
impl ActorCode for Actor {
49624962
type Methods = Method;
4963+
4964+
fn name() -> &'static str {
4965+
"StorageMiner"
4966+
}
4967+
49634968
actor_dispatch! {
49644969
Constructor => constructor,
49654970
ControlAddresses => control_addresses,

actors/multisig/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ pub fn compute_proposal_hash(txn: &Transaction, sys: &dyn Primitives) -> anyhow:
546546

547547
impl ActorCode for Actor {
548548
type Methods = Method;
549+
550+
fn name() -> &'static str {
551+
"Multisig"
552+
}
553+
549554
actor_dispatch! {
550555
Constructor => constructor,
551556
Propose => propose,

0 commit comments

Comments
 (0)