aurora-is-near / aurora-engine

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

Fix balance and gas overflows in CrossContractCall #889

Closed guidovranken closed 5 months ago

guidovranken commented 5 months ago

Description

Specific bytecode inputs to the EVM could lead to overflowing additions in gas and balance variables. This PR makes turns those additions into saturating_add so that balance/gas requirements will always exceed the capacity of the caller to incur those costs, and the call will fail.

Performance / NEAR gas cost considerations

Testing

Fuzzing.

How should this be reviewed

Additional information

0xfocu5 commented 5 months ago

@guidovranken hi I would also like to verify the correctness of gas consumption. Could you please provide a testing method? Thank you very much for your help.