How to avoid duplicate messages in a mesh network of mcus
One approach is to put a TTL (time to live) field in the message. This is a small integer, and its value is decremented each time the message is forwarded. If the value reaches zero, the message is discarded.

The node creating the message sets the initial TTL to a number that's high enough to get it forwarded to the farthest node in the network. An 8-bit field should be more than enough for any reasonably-sized mesh.

No state information needs to be stored on any of the nodes.