How to get Layer 1 block.number on Layer 2

You can use layer2 block timestamp to calculate the interests. The layer1 script verifies the l2 block timestamp to ensure it is reliable.