And Gamamaru’s Magic Ball, how it records everything that happened in any ERA?
The "Magic Ball" that the Third Hokage and Gamamaru use is the Telescope Technique.
A technique that uses a crystal ball to track a particular individual anywhere they are. There are a few restrictions about the person that is subjected to pursuit. The user must know that person's chakra pattern. If someone can be targeted for pursuit, they may be very far away, the crystal ball will be able to confirm their position. As this technique is infallible for intelligence purposes, the Third Hokage used it to maintain public order in the village.