Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

seal_is_reentrant for contract-pallet #11082

Closed
xgreenx opened this issue Mar 21, 2022 · 2 comments
Closed

seal_is_reentrant for contract-pallet #11082

xgreenx opened this issue Mar 21, 2022 · 2 comments

Comments

@xgreenx
Copy link
Contributor

xgreenx commented Mar 21, 2022

seal_is_reentrant returns true if the contract presents in the call stack more than one time. More information about usage of that method in the comment.

How that method should work for the delegate_call case? I will expect that the delegate call doesn't change the reentry state.

@athei
Copy link
Member

athei commented Apr 1, 2022

I think we should implement it in a more general way: seal_reentrant_count. It returns how often the currently executing contract exists on the call stack in addition to the calling instance: So a value of 0 means no reentrancy.

How that method should work for the delegate_call case? I will expect that the delegate call doesn't change the reentry state.

I suppose so. Delegated calls should be counted as the same instance.

@achimcc

@athei
Copy link
Member

athei commented Nov 15, 2022

Resolved by #12695

@athei athei closed this as completed Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants