New function keyword `locked` after transient storage added

After EIP-1153: Transient storage opcodes is implemented,

Could Solidity add a locked function keyword, that acts as a reentrancy lock?

The locked function keyword would guarantee the function is locked during execution, by transiently storing a bool and then checking that bool before it runs. It would act like the reentrancy_lock modifiers.

The transient storage key could be hash("locked" + function_index_in_AST)) to avoid collisions.

Your suggestion to introduce a new locked function keyword for reentrancy protection is interesting. However, it’s important to consider factors like compatibility, complexity, and existing best practices. Formalizing this as an Ethereum Improvement Proposal (EIP) and engaging with the Solidity community for feedback could help refine the idea. It’s also worth exploring established reentrancy protection methods before introducing new language features.