SLOTDURATION Opcode

Hello,

I’ve opened a PR for a new opcode, SLOTDURATION. It pushes the duration of the current slot, in milliseconds, onto the stack.

PR: Add EIP: SLOTDURATION Opcode by Amxx · Pull Request #12619 · ethereum/EIPs · GitHub

Open questions:

  1. Current duration or historical lookup? The draft returns the current duration. The Rationale describes an alternative where the opcode takes a slot number and returns the duration in effect at that slot, or 0 for future slots. That would let contracts like Lido’s compute correct timestamps across duration changes. The cost is that the execution layer would have to keep the duration schedule. Which is more useful?
  2. Milliseconds. I chose ms to match SLOT_DURATION_MS and to support L2s with 100–250 ms block times. Any objections?
  3. 0 for “no regular interval.” Is this the right sentinel for on-demand chains, and should L1 execution clients still reject 0?
  4. Execution-layer decoupling. EIP-8198 deliberately keeps the execution layer unaware of the slot duration. The draft keeps the EL config-free, but it does add a header field. Is that acceptable to the EIP-8198 authors and to client teams?