This MIP proposes two new opcodes that allow-fine grained introspection of the EVM call stack.
2 Likes
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.