Description
EIP-165 stipulate that supportsInterface
can use up to 30,000 gas.
But as you can see in openzeppelin implementation here, the call is executed without making sure 30,000 gas is indeed given to the call. Remember, the gas provided as part of the STATIC_CALL is just a maximum.
And because of EIP-150 behaviour, it is possible for supportsInterface
to get less gas than required for it to complete (and thus throw which is interpreted wrongly as non-implementation) while the rest of the transaction continue and complete.
I described the issue in more details here as the issue is also present in the example implementation described at EIP-165.
Various solution are presented here but the best option is EIP-1930 which also solve issue present in other use cases like meta-transactions.
Also find some test case regarding EIP-165 here