Skip to content

Conversation

@MoeMahhouk
Copy link
Member

In this PR:
We fixed the issue with volatileGet precompile function upon calling it with key that doesnt exist.
It returns an err, however, it also reverts the whole execution with OutOfGas (gas_used =18158513697557840303)
To avoid such an issue and still be able to handle a non-existing key from the smart contract side:
1- Instead of reverting with an error, we return a status and a value. The status would mark if the key exists or not.
If the key exists, the value will be set accordingly. If not, it will return 0 bytes array with a failure status (false)
2- Added unit tests for existing and non-existing keys

@MoeMahhouk MoeMahhouk requested review from Ruteri and amiller March 19, 2024 15:44
@MoeMahhouk MoeMahhouk force-pushed the main branch 3 times, most recently from 8105e10 to 5e2ac5e Compare March 20, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants