From 41bf2a0297cbc6b94dbe0395a2b0de56ddb6f8d4 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Wed, 16 Nov 2022 11:50:00 +0000 Subject: [PATCH] Load actor to resolve address --- node/impl/full/eth.go | 1 - node/modules/actorevent.go | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index e77e4ceb7..f069af28e 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -1252,7 +1252,6 @@ var ( func ethFilterResultFromEvents(evs []*filter.CollectedEvent) (*api.EthFilterResult, error) { res := &api.EthFilterResult{} - for _, ev := range evs { log := api.EthLog{ Removed: ev.Reverted, diff --git a/node/modules/actorevent.go b/node/modules/actorevent.go index 57dbd3e40..1eb58b4b1 100644 --- a/node/modules/actorevent.go +++ b/node/modules/actorevent.go @@ -79,19 +79,21 @@ func EthEventAPI(cfg config.ActorEventConfig) func(helpers.MetricsCtx, fx.Lifecy if err != nil { return address.Undef, false } - addr, err := sm.LookupRobustAddress(ctx, idAddr, ts) - if err != nil { + + actor, err := sm.LoadActor(ctx, idAddr, ts) + if err != nil || actor.Address == nil { return address.Undef, false } + // if robust address is not f4 then we won't match against it so bail early - if addr.Protocol() != address.Delegated { + if actor.Address.Protocol() != address.Delegated { return address.Undef, false } // we have an f4 address, make sure it's assigned by the EAM - if namespace, _, err := varint.FromUvarint(addr.Payload()); err != nil || namespace != builtintypes.EthereumAddressManagerActorID { + if namespace, _, err := varint.FromUvarint(actor.Address.Payload()); err != nil || namespace != builtintypes.EthereumAddressManagerActorID { return address.Undef, false } - return addr, true + return *actor.Address, true }, MaxFilterResults: cfg.MaxFilterResults,