-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about the array handling. #11
Comments
I agree. Using an array will lead to DOS attack. |
@swtrse position of item inside array is not fixed. When item is deleted, the last element is swapped with item to be deleted index and the last element is removed/pop. |
Thanks, that clears it up for this specific implementation. That helps too but what I wanted to know is if there is something possible like a queue where you push new elements on the end and pop old elements of the front. I do not have an concrete implementation in mind but I want to get a feeling for the underlying concepts. |
Main issue is when someone wants to removeStake(). Instead of swapping, we can just make the value as 0. |
I see that the array will be searched every time-
Is the position of the items inside the array different every time the contract get loaded into an client?
If the position is fixed then maybe a more processor time friendly logic could be implemented.
The text was updated successfully, but these errors were encountered: