Skip to content
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

Assumptions about storage usage increasing during escrow are broken #127

Closed
sisyphusSmiling opened this issue Oct 3, 2024 · 0 comments · Fixed by #129
Closed

Assumptions about storage usage increasing during escrow are broken #127

sisyphusSmiling opened this issue Oct 3, 2024 · 0 comments · Fixed by #129
Assignees
Labels
Bug Something isn't working Feedback

Comments

@sisyphusSmiling
Copy link
Contributor

Description

A transaction was reported where underflow was encountered in FlowEVMBridgeNFTEscrow.lockNFT. This method operates on the assumption that storage usage will increase after locking an NFT in escrow. The reported transaction attempts to bridge a TopShot NFT which given the amount of metadata one would assume certainly increases storage consumption. While there may be instances where withdrawing an object from storage increases storage consumption (see #125), this does not appear to be related as TopShot in this particular instance does not exhibit contract logic that would indicate similar, unintuitive behavior.

After discussing with @janezpodhostnik and @ramtinms, there is a possibility that atree inlining rebalances storage blocks in such a manner that results in a perceived decrease in the storage consumed by an account. Further discovery is required to determine if this is to be expected. Regardless, the practical implication here is that the line where overflow is encountered should be guarded and the lockNFT method should return 0 if underflow would otherwise be encountered.

@sisyphusSmiling sisyphusSmiling added Feedback Bug Something isn't working labels Oct 3, 2024
@sisyphusSmiling sisyphusSmiling self-assigned this Oct 3, 2024
@sisyphusSmiling sisyphusSmiling moved this to 🔖 Ready for Pickup in 🌊 Flow 4D Oct 3, 2024
@sisyphusSmiling sisyphusSmiling changed the title Assumptions about storage usage increasing during escrow create are broken Assumptions about storage usage increasing during escrow are broken Oct 3, 2024
@github-project-automation github-project-automation bot moved this from 🔖 Ready for Pickup to ✅ Done in 🌊 Flow 4D Oct 17, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in FlowEVM Bridge Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feedback
Projects
Status: Done
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant