fix(events): don't log.Warn for EVM events with non-Raw codec (#11742)

Codec != Raw likely means built-in actor events, which we can safely skip, so
avoid filling up logs with warnings for every built-in actor event that comes
past this point.

Fixes: https://github.com/filecoin-project/lotus/issues/11718
This commit is contained in:
Rod Vagg 2024-03-19 20:10:37 +11:00 committed by Phi-rjan
parent f4b4cd3633
commit 02a2095c26

View File

@ -39,9 +39,9 @@ func ethLogFromEvent(entries []types.EventEntry) (data []byte, topics []ethtypes
// Topics must be non-nil, even if empty. So we might as well pre-allocate for 4 (the max). // Topics must be non-nil, even if empty. So we might as well pre-allocate for 4 (the max).
topics = make([]ethtypes.EthHash, 0, 4) topics = make([]ethtypes.EthHash, 0, 4)
for _, entry := range entries { for _, entry := range entries {
// Drop events with non-raw topics to avoid mistakes. // Drop events with non-raw topics. Built-in actors emit CBOR, and anything else would be
// invalid anyway.
if entry.Codec != cid.Raw { if entry.Codec != cid.Raw {
log.Warnw("did not expect an event entry with a non-raw codec", "codec", entry.Codec, "key", entry.Key)
return nil, nil, false return nil, nil, false
} }
// Check if the key is t1..t4 // Check if the key is t1..t4