pendulum-chain / vortex

1 stars 0 forks source link

Bugfix: use proper gas limits for Nabla swap transaction #99

Closed TorstenStueber closed 1 month ago

TorstenStueber commented 1 month ago

Since PR https://github.com/pendulum-chain/vortex/pull/79 the Nabla swap transaction will be created and signed before the Nabla approve transaction will be executed.

Api-solang usually always simulates every contracts call via an RPC call in order to determine the proper gas limit that is then used for the actual extrinsics. This RPC simulation of the Nabla swap transaction failed because it cannot be executed successfully unless the approval happened.

For that reason the RPC call is now skipped and the hard coded gas limits are used. However, they are way too high and the Nabla swap extrinsic fails because it would exceed block limits.

TODO

Use more reasonable hard coded gas limits for the Nabla swap extrinsic that a) are sufficiently high for the execution and b) will not exceed weight limits: