Open hackfisher opened 2 years ago
Duplicate with https://github.com/darwinia-network/darwinia-messages-substrate/issues/107 for s2s
for evm to evm bridges, we might need to check we have same design.
@wuminzhe Will require SDK docs for this.
@wuminzhe Does SDK docs adopt the requires?
@wuminzhe Does SDK docs adopt the requires?
No.
Does this need oracle? @hackfisher
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