MIP-18: `CALLSTACKDEPTH` and `CALLERN` Call Stack Introspection Opcodes
From forum.monad.xyz, every post in full, each linked to its post. Open the thread on the forum ↗
- baltoliOP 2 likesOpen on the forum ↗
Monad Improvement Proposals

Monad Improvement Proposals
Monad Improvement Proposals (MIPs)
This MIP proposes two new opcodes that allow-fine grained introspection of the EVM call stack.
- portOpen on the forum ↗
This looks amazing, very well scoped!
Though I might have one question here: The authorization section has a warning against using CALLERN(n > 0) for auth, so would a similar warning for CALLSTACKDEPTH help here? Because require(CALLSTACKDEPTH == 0) is almost like a direct call only flag and if im getting this right, would prevent users that come through a smart wallet or a router or multicall3.
Here is how I would maybe add it under security considerations:
Contracts SHOULD NOT restrict functionality based on CALLSTACKDEPTH, as this breaks composability with smart accounts and batching contracts.This is definitely not something about the proposal itself but just something that I had in mind while reading the spec.