darwinia-network / research

Research related document and topics
MIT License
3 stars 2 forks source link

Fee market: Charge extra dispatch fee on target chain according to message.weight #30

Open hackfisher opened 2 years ago

hackfisher commented 2 years ago

In send message or in fee market,

The max usable balance from relayer for evm message should not be large before this fixed.

hackfisher commented 2 years ago

Related https://github.com/darwinia-network/darwinia-common/pull/1267

wuminzhe commented 2 years ago

the most call's weight can be calculated for users:

(bytes memory call, uint64 weight) = DarwiniaCalls.system_remarkWithEvent(hex"12345678");

https://github.com/darwinia-network/darwinia-messages-sol/blob/785b9fc3f365699eb8be26574dd7e11185e2151a/contracts/periphery/contracts/s2s/examples/RemarkDemo.sol#L23

but for message_transact call, we should limit the gas because the weight is from the gas limit inputted by the user. use MAX_GAS_PER_MESSAGE? https://github.com/darwinia-network/darwinia-messages-sol/issues/171