Open foufrix opened 2 days ago
The issue is deeper than that. The RoutingTable object is actually undefined
here which is likely a race condition somewhere since I've seen similar issues with race conditions within ultralight
code before. From the stack trace, it looks like the issue is actually at the discv5
level and not within the ultralight
code.
@wemeetagain have you ever seen anything like this with discv5 in other contexts (lodestar/etc)? I believe this is happening on a Mac. I've never seen this precise issue in our Ultralight nodes running on Ubuntu.
Error :
This error pops randomly, most of the time around 10 minutes after starting a node on devnet
I think this line is where the error pop https://github.com/ethereumjs/ultralight/blob/3af6fbd83099b336cfbc24e6a57fd383ee2ea44d/packages/portalnetwork/src/client/routingTable.ts#L72
KademliaRoutingTable.getValue cannot locate a node and stop everything hanging. Adding a try-catch will avoid the crash and let it go if it does not find the appropriate node.
I suppose this is because 2 nodes spot that a node should be evicted: node1 evicts badNode, and when node2 tries to evict it, it will not find it because it's already evicted and crash?
EDIT: I'm on mac M1, node 20.18.0