-
Notifications
You must be signed in to change notification settings - Fork 15
Conditional execution #11
Comments
In addition to this -- I have seen a contract add a execute by date so that a relayer cannot execute a transaction after a certain date. https://github.com/dreamteam-gg/smart-contracts/blob/master/contracts/token/DreamTeamToken.sol#L175 |
TL;DR We discuss adding Note: Conditional execution is costlier in terms of gas, but this shouldn't add much overhead to non-conditional txes. Modifications to executable signed messagesAs there are multiple ways to make transactions conditional, including by time, by checking state or by occurence of events, in addition to the data necessary for specifying the condition, we could add a condition type, which specifies how to parse the condition data. Condition type
Condition dataFor EventLogs, the condition could be the RLP-encoded concatenation of RelayerRelayers would store conditional meta txes, and when the event specified by one of the meta txes is emitted, they compute a proof for the receipt that contains the event log, and send it along with the block header and index of log in receipt to the smart contract. On-chain verificationFor an incoming meta transaction which has a
Example for verifying proof. ChallengesMeta transactions pre-specify the Ideally, users (or dapps) should be able to specify conditions on the event values, and use them in the transaction. E.g. whenever a This could be solved by expecting the callback function to accept |
In Rust you can use asynchronous futures with the Futures and Tokio crates. Tokio uses the futures crate and has documentation for both here: https://tokio.rs/. Because conditional execution is costlier, DDOS attacks come to mind, however it could conversely be used to prevent DDOS attacks. For instance, if a relay reward is below some limit that will be acceptable by a relayer, the relayer can choose not to execute that transaction and not relay it, and only do so for txs above this limit. And DDOS attacks on relayers are a poignant problem since meta-txs can be submitted at no cost, so many could be submitted. If a relayer is pseudorandomly assigned to a meta-tx at a given rate, this problem is compounded. An alternative solution to this problem is to make sure that a random beacon conditionally assigns a relayer to a meta-tx, iff the reward is >= the relayer's threshold reward amount. The implementation for the latter should be simpler, although conditional execution still seems generally useful. |
Hey everyone,
Meta txes are supposed to be submitted to the network immediately by relayers. It'd be however possible to delay their execution, and make it conditional, e.g. on time, state or events. This could allow "automating" actions like revealing votes and bids, or claiming rewards, etc.
There are two main questions however:
The text was updated successfully, but these errors were encountered: