aurora-is-near / aurora-engine

⚙️ Aurora Engine implements an Ethereum Virtual Machine (EVM) on the NEAR Protocol.
https://doc.aurora.dev/develop/compat/evm
330 stars 82 forks source link

replace wee_alloc to lol_alloc #695

Closed hskang9 closed 1 year ago

hskang9 commented 1 year ago

Description

This PR replaces wee_alloc cargo that is not currently being maintained from dependabot.

Performance / NEAR gas cost considerations

Changing allocator increased the near gas cost by 1~5

Testing

All existing tests should pass on the new global allocator

How should this be reviewed

See if there are other options on setting global allocator through lol_alloc for optimization on allocating memory and decreasing near gas cost.

Additional information

aleksuss commented 1 year ago

As I can see, gas cost increases after replacing wee_alloc with lol_alloc. It's not good. Does it make sense to replace wee_alloc?

hskang9 commented 1 year ago

I agree that increasing near gas cost is not good. However, wee_alloc is not maintained. Maybe there will be an improvement in lol_alloc? If one cares about the security, it may be better to switch to the cargo that is in active development. But still, if we could predict what wee_alloc will do and confirm no trouble, I think we can stay with wee_alloc.

joshuajbouw commented 1 year ago

wee_alloc was deprecated and no longer maintained. To ensure highest quality, we should strive to seek better alternatives. However, that being said, NEAR SDK does still use wee_alloc. See: near/near-sdk/src/lib.rs#L55

aleksuss commented 1 year ago

And one more. wee_alloc has more than a million downloads, and lol_alloc has more than one thousand.

joshuajbouw commented 1 year ago

Closing, as this kind of issue isn't one we are concerned about and will remain with whatever NEAR SDK uses.