-
Notifications
You must be signed in to change notification settings - Fork 15
Meta-tx propagation in a decentralized relay network (collision problem) #3
Comments
This is a perfect place to put this and the first thing everyone talks about when I get on the phone and start talking meta transactions! The current solution in my head is the first thing you listed. A node announces they are going to submit and they have some stake on the line that can be slashed if they fail. At first I wanted to look through the pending transaction pool but that isn't always going to be complete and it would require a lot of work/resources from the relayer. Which leads to my point against PoW... It would be great to run these relayers on very cheap hardware. So far the only requirement is basically an internet connection. If we start to put the need for hash crunching on these devices, costs could shoot up and our pool of miners would be smaller. Maybe that's still the solution and I'm all about finding the best answer. I would love to hear how others are solving this or are planning on solving this! |
And to directly contradict myself, what if we went with a PoW + batched meta transactions model? Relayers package up a bunch of meta transactions into a "block" and mine for a leading zeros nonce. Once they have it, they submit it as a single transaction to a relayer contract that verifies, splits, and relays meta transactions. |
@austintgriffith Will give it some more thought, but so far I like the PoW + blocks of meta transactions! One of the direct benefits of having a relayer contract, is that it wouldn't be necessary to modify identity proxies to verify PoW anymore. Regarding the refund, were you thinking it should stay as it is now? Relayer is refunded by the EIP-1077 contract at the end of Alternatively, the relayer contract could also deposits which would be used to refund the relayer. However this introduces the complexity that the deposit needs to be topped-up every once in a while. Another edge case would be, what happens if one transaction within the block doesn't have enough deposit to refund relayer? |
I think the answer to this is like many in the metatx space right now; it depends on the app. Let's try to come up with and a flexible standard that can effectively handle different use-cases. I think I will start a new issue for flexible rewards and we can use this thread to create a narrative behind relay collision prevention. Dynamic Gas Rewards: #4 |
We designed ours with staking and slashing in mind. Currently exploring the ability to stake various amounts so that Tx distribution is based off on how much is staked/risked. |
I would also like to rename this issue to "Meta-tx propagation", sybil isn't the right descriptor. It is not about spam attack but rather about how to select which service nodes gets which tx, what is determinate of it and how frequently. Was thinking that different service nodes could potentially have their own means of queing and meta-tx prioritisation as opposed to having the logic exist on the network layer. Since SNs stake, they must send out a message 'claiming' the meta-tx to be sent, this message is received by other participants and the meta-tx is flag to not be executed. This however brings up the issue of consensus for the claims themselves. +1 to batched POW txs |
Another aproach I was thinking about is to create some algorithm for allocation of the relayers to users. Simplest idea:
Challenges:
|
I feel like staking and slashing may be overkill and could disincentivize people to create relayers. Please correct me if I am wrong, but if multiple relayers attempt to issue the same transaction only 1 will be mined on-chain and the others will fail due to the nonce being out of sync. In this case, miners already lose the gas fees for issuing the transaction. I think an approach similar @radek1st's suggestion would be more economical. |
This thread has some ideas for the same problem, but a different context. To quote:
I include them here, so we can consider them in the discussion. |
@radek1st I think an approach like the one you suggested definitely works around some of the challenges quite elegantly. As you mentioned, making it trustless is a challenge however. Here are a few thoughts about difficulties we might face when designing such a system:
We can also combine this with batched txes: Randomly pick a relayer who submits all the txes that have been published to the relay network, but not submitted on-chain recently, in a batch (block). The reward system might get more complex as a consequence of this however. |
I had a DNS-like setup more in mind. Using a root contract with a list of available relayers (or relayer pools?), the client could come up with a random relayer to process their transaction. Clients are incentivized to choose whichever relayer can process their transaction cheapest / quickest, and choosing randomly would probably find the best relayer on average. |
|
I've thought about a fews ways which have different assumptions on how the meta-tx data gets passed to relayer services.
Thanks @PhABC :) Saw the tag go up live-- was literally typing this up when you posted. |
Few thoughts ;
2.1, 2.2 and2.3 are fundamental issues that need to be solved imo, while 2.4 should be kept in mind. However, all can be improved overtime. |
Yes I saw this link in https://medium.com/@pet3rpan/harbour-mvp-update-1-35ddbbb9e288 and came here to propose the same idea. Mind you, it doesn't need to be an RNG, but any publicly verififiable random function, such as RANDAO as used in Eth2 shasper beacon chain (which you could use as the source of randomness). Also, https://pokt.network are designing a blockchain that will be used to incentivize relays, and is intended to be compatible with other blockchains. |
@jamesray1 thanks for the comment. I will take a look at pokt. |
Things to think about include manipulability of the randomness e.g. by withholding a block in order to increase the likelihood of winning a block in future, and gradually being able to win more blocks, make more profit and gain more power over the network. Also collusion of proposers.
Ah I see that you have considered that in #13, but it looks like you haven't got a convincing solution, at best they need further consideration, but I think it would be simpler to use the beacon chain as the randomness source (while scrutinising it yourself to understand how it's more secure and could be made more secure e.g. to reduce the chance of a safety failure by increasing the number of validators in a committee.
https://github.com/ethereum/eth2.0-specs/blob/master/specs/beacon-chain.md
https://github.com/ethereum/eth2.0-specs/blob/master/specs/beacon-chain.md CTRL+F 111.
Also look up on ethresear.ch:
- Verifiable random delay function
- RANDAO manipulability analysis
|
@jamesray1 Yeah exactly, I'm also wondering if forgoing the block reward makes sense for miners, given that the reward they'd get from meta txes are probably much lower. |
What if the block reward reduces to near zero as is planned/proposed with a max supply cap? I don't think you understand. By foregoing the block reward they can manipulate the entropy in their favour to make it more likely that they will be selected in future, and they can increase their profits and power incrementally and potentially take over the whole network, bit by bit. https://ethresear.ch/t/verifiable-delay-functions-and-randao-manipulability/3777 A proposer could form a cartel whereby they may collude with the next proposer, and so on, in order to increase their chances of being drawn. FMI see https://ethresear.ch/t/rng-exploitability-analysis-assuming-pure-randao-based-main-chain/1825/2 and https://ethresear.ch/search?q=collusion%20randao. |
Hey everyone,
Note: I didn't know any other place to put this to discussion. If it doesn't belong in this repository please let me know and I'll delete it. The goal is to discuss some of the proposed solutions, put forth new ideas, etc.
Challenge
When a user publishes a meta transaction to a decentralized relay network, there'll be a competition among the relayers to submit the transaction first, and thus get the reward. As only the first submitter gets a reward, everyone else's transaction reverts and they lose gas, and this inefficiency would cause the relayers to demand a higher price.
Possible solutions
Stake by users and relayers
Considerations
There are however some edge cases to consider in this approach. For example, how to require a newly registered user to put a stake, and doesn't that affect UX? Can the user grief relayers by responding late so the relayers don't have enough time to submit the tx? Can user be caught when doing this? Generally, it seems to me somewhat difficult to distinguish between malicious act and network delays.
PoW
Considerations
This approach would probably need a dynamic PoW difficulty. Cost of energy needs to be factored in, which results in relayers asking a higher price. Requires on-chain validation of the proof, which means it requires modifications to the existing identity proxies.
Simplified PoS
Relayers register as such on-chain, and a psuedo-random number generator selects a relayer or a committee of relayers to submit transactions in a timeframe. I'm still doing research on this.
The text was updated successfully, but these errors were encountered: