rs-soroban-env
rs-soroban-env copied to clipboard
Make invoke/call contract require explicit flag to enable reentry
Contracts have access to calling other contracts but we haven't yet implemented things we discussed would help prevent unintentional re-entry.
The idea is that calling a contract should require setting a flag for whether re-entry is allowed. And in this way the possibility for re-entry will be explicitly visible to the developer.
The host side has disabled reentry. We still need to expose a flag to set it in the host functions and plumb it on the sdk side.
Reopened to follow up on: https://github.com/stellar/rs-soroban-env/pull/513#issuecomment-1267220021 cc @leighmcculloch
Reentrancy is needed to offer liquidity for flashloans. I like that reentrancy it's by default not allowed... and with a flag whether re-entry is wanted.
Hello @leighmcculloch @jayz22 @graydon Do you have any update on this?
It's better to leave the possibility wuth an explicit flag, than to not let do reentry at all in Soroban!
@esteblock We did not have chance to prioritize this. We may consider it in the next phase. This feature has just not been requested much and we felt it could create more footgun if used carelessly. I would like to understand first if there is any other ways to enable the flash loan feature without reentry. If you could provide more details (e.g. code snippet or WIP examples) that would be helpful!
Hello, we also need reentrancy feature for our smart-contracts