Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth_getLogs produces lots of WARN log output for non-FEVM events #11718

Closed
rvagg opened this issue Mar 14, 2024 · 0 comments · Fixed by #11742
Closed

eth_getLogs produces lots of WARN log output for non-FEVM events #11718

rvagg opened this issue Mar 14, 2024 · 0 comments · Fixed by #11742
Assignees
Milestone

Comments

@rvagg
Copy link
Member

rvagg commented Mar 14, 2024

This bit of code worked fine when there were only FEVM events:

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
}
// Check if the key is t1..t4
if len(entry.Key) == 2 && "t1" <= entry.Key && entry.Key <= "t4" {
// '1' - '1' == 0, etc.
idx := int(entry.Key[1] - '1')
// Drop events with mis-sized topics.
if len(entry.Value) != 32 {
log.Warnw("got an EVM event topic with an invalid size", "key", entry.Key, "size", len(entry.Value))
return nil, nil, false
}
// Drop events with duplicate topics.
if topicsFound[idx] {
log.Warnw("got a duplicate EVM event topic", "key", entry.Key)
return nil, nil, false
}
topicsFound[idx] = true
topicsFoundCount++
// Extend the topics array
for len(topics) <= idx {
topics = append(topics, ethtypes.EthHash{})
}
copy(topics[idx][:], entry.Value)
} else if entry.Key == "d" {
// Drop events with duplicate data fields.
if dataFound {
log.Warnw("got duplicate EVM event data")
return nil, nil, false
}
dataFound = true
data = entry.Value
} else {
// Skip entries we don't understand (makes it easier to extend things).
// But we warn for now because we don't expect them.
log.Warnw("unexpected event entry", "key", entry.Key)
}

But post nv22, anyone not filtering events down to specifically FEVM events, such as block explorers or anyone else capturing general logs, will trigger a lot of logs because our builtin actor events don't match these criteria, starting with the Codec not being Raw.

{"level":"warn","ts":"2024-03-14T11:08:41.661+1100","logger":"fullnode","caller":"full/eth_events.go:44","msg":"did not expect an event entry with a non-raw codec","codec":81,"key":"$type"}
{"level":"warn","ts":"2024-03-14T11:08:41.661+1100","logger":"fullnode","caller":"full/eth_events.go:44","msg":"did not expect an event entry with a non-raw codec","codec":81,"key":"$type"}
{"level":"warn","ts":"2024-03-14T11:08:41.661+1100","logger":"fullnode","caller":"full/eth_events.go:44","msg":"did not expect an event entry with a non-raw codec","codec":81,"key":"$type"}
{"level":"warn","ts":"2024-03-14T11:08:41.661+1100","logger":"fullnode","caller":"full/eth_events.go:44","msg":"did not expect an event entry with a non-raw codec","codec":81,"key":"$type"}
{"level":"warn","ts":"2024-03-14T11:08:41.661+1100","logger":"fullnode","caller":"full/eth_events.go:44","msg":"did not expect an event entry with a non-raw codec","codec":81,"key":"$type"}
{"level":"warn","ts":"2024-03-14T11:08:41.661+1100","logger":"fullnode","caller":"full/eth_events.go:44","msg":"did not expect an event entry with a non-raw codec","codec":81,"key":"$type"}

I think that we probably don't need to log these at all, or just drop down to DEBUG.

@rvagg rvagg added this to the Network v22 milestone Mar 14, 2024
@rvagg rvagg self-assigned this Mar 14, 2024
rvagg added a commit that referenced this issue Mar 19, 2024
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: #11718
rjan90 pushed a commit that referenced this issue Mar 19, 2024
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: #11718
rjan90 pushed a commit that referenced this issue Mar 20, 2024
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: #11718
rjan90 pushed a commit that referenced this issue Mar 21, 2024
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: #11718
rjan90 pushed a commit that referenced this issue Mar 21, 2024
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: #11718
rjan90 pushed a commit that referenced this issue Mar 22, 2024
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: #11718
LexLuthr pushed a commit that referenced this issue Mar 26, 2024
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: #11718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant