You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To open the message service to smart contracts, the message user will be able to customize the target dispatch contract call, and the source callback call etc.
And all the messages in one lane must be delivered in order, so if some dispatch/callback call consume too much gas and exceed the block max limit, then the block producers on target/source chain might refuse to include those relay transactions, and relayers can do nothing in this situation, following messages will be blocked by this message(nonce) too.
To avoid this potential attack, the dispatch/callback call must give an MESSAGE_MAX_DISPATCH_GAS/ MESSAGE_MAX_CALLBACK_GAS to limit the dispatch_gas_limit/callback_gas_limit encoded in the message.
The dispatch_gas_limit/callback_gas_limit encoded in the message has two functions:
To limit the largest consumable gas for the smart contract(programmable + context_dynamic), and will be set as the gas limit in evm transactions. With the gas limited settings, these two value can be used to limit the gas, and for system level MESSAGE_MAX_DISPATCH_GAS/ MESSAGE_MAX_CALLBACK_GAS comparison.
To give an extra message fee estimation prepaid by the user in addition to the relayer market fee, this is different compared to current, but is better because it simply the fee model for the relayers, they do not to consider the gas.
But there are extra factors need to detail and research further for 2, because, the fee prepaid are in source chain's token, but the dispatch_gas_limit might be in target chain's token, to calculate the prepaid fee, there might require an extra conversion between source token and target token here, and simple way will require introduce price feed by oracle.
To open the message service to smart contracts, the message user will be able to customize the target dispatch contract call, and the source callback call etc.
And all the messages in one lane must be delivered in order, so if some dispatch/callback call consume too much gas and exceed the block max limit, then the block producers on target/source chain might refuse to include those relay transactions, and relayers can do nothing in this situation, following messages will be blocked by this message(nonce) too.
To avoid this potential attack, the dispatch/callback call must give an MESSAGE_MAX_DISPATCH_GAS/ MESSAGE_MAX_CALLBACK_GAS to limit the dispatch_gas_limit/callback_gas_limit encoded in the message.
The dispatch_gas_limit/callback_gas_limit encoded in the message has two functions:
MESSAGE_MAX_DISPATCH_GAS/ MESSAGE_MAX_CALLBACK_GAS
comparison.But there are extra factors need to detail and research further for 2, because, the fee prepaid are in source chain's token, but the dispatch_gas_limit might be in target chain's token, to calculate the prepaid fee, there might require an extra conversion between source token and target token here, and simple way will require introduce price feed by oracle.
cc @xiaoch05
The text was updated successfully, but these errors were encountered: