Feat/message broadcaster without simulation - #226
Conversation
aarmoa
commented
Aug 18, 2023
- Added logic to allow the transaction broadcaster to calculate gas limit without simulating the transaction
…roadcaster based on the messages (without running the transaction simulation)
There was a problem hiding this comment.
The example as is fails with an out of gas error as per this tx.
It looks like DEFAULT_GAS_LIMIT is not being added and we send the tx simply with DEFAULT_EXCHANGE_GAS_LIMIT (100k). We should not calculate gas per "message" but per "object". Clients send a single message i.e. MsgBatchUpdateOrders but that includes multiple order placements and cancellations.
I also strongly recommend we have more in-depth gas calculation for exchange objects. Order placement with order cancellation have a lot of difference in terms of gas and MMs already pay a lot in gas daily, they'd need to have a more curated calculation instead of paying 100K gas for every exchange interaction.
|
Effectively the calculation should include:
|
…sider the cost of each included element for batch messages
…into feat/message_broadcaster_without_simulation
There was a problem hiding this comment.
Thank you @aarmoa.
- Could we allow
AVERAGE_CANCEL_ALL_AFFECTED_ORDERSto be modifiable by clients separately for spot and derivative orders? I think users should ideally be able to set the number of spot and derivative orders to cancel separately and then we calculate gas based on the constants we have. We could also consider adding a buffer here that can be also overridden by clients to account for transient orders. - There's no need to have support for MsgBatchCancel, MsgBatchCreate on spot/derivatives. We should only have support for MsgBatchUpdateOrders in the future. This message allows them to perform any action on the exchange. The chain team is also making improvements only on this specific message (i.e. error flags on the chain show only for MsgBatchUpdateOrders). We can also remove the examples in the SDK and also API docs. Effectively these are obsolete messages upon introducing MsgBatchUpdateOrders.
|
@achilleas-kal let me see what I can do for point 1. |
Add NBLA denom to peggy
Update denoms_mainnet.ini
Add NBLA denom to peggy
…roadcaster based on the messages (without running the transaction simulation)
…sider the cost of each included element for batch messages
…/github.com/InjectiveLabs/sdk-python into feat/message_broadcaster_without_simulation