Network transactions #606
Replies: 3 comments 18 replies
-
Design attempt 1
This elides error handling etc, but I think is fairly simple. What can occur is that the network transaction conflicts with another transaction submitted before the network transaction completes. This could be prevented around by marking the appropriate state inputs in some way, but that seems more complex for no good reason aka no reason to prefer the network transaction over the other. This does raise the question of transaction selection/acceptance strategies, but in this case probably the operator could design a more general system where the mempool can evict transactions if an incoming conflicting transaction is deemed more valauable. Transaction execution and proving can of course be delegated etc, and that design is orthogonal to this. |
Beta Was this translation helpful? Give feedback.
-
|
I'll doodle my ideas for design here, pending some feedback in the above thread. Network accountsI'm currently only designing wrt querying whether a specific account exists and is a network account. Add a flag column identifying an account as a network account. If we care about more than just the boolean true/false, then we could also consider an enum via bits. I assume here that there is a pre-execution validation query. The alternative is that we have something like Performance of the above query can be improved in several cumulative ways.
Network notesSimple flag, as above? So we can re-assemble the list of network notes for sending out for execution. Unclear who should be responsible for this - probably whoever is in charge of posting them in the first place. ValidationDo we reject origin transactions which generate an invalid network note? We probably don't want to do this, since we cannot fully validate the note without executing iiuc? But we could reject them if the note's target account is invalid. ExecutionI would like to keep execution completely separate from the block-producer. The upside is that its decoupled and doesn't interfere with mempool logic etc. The downside is that doing some sort of advanced scheduling with the mempool becomes harder/impossible though we could still connect them somehow. We could send the note off for execution at several points during the origin transaction's lifecycle:
This does imply the mempool is responsible for identifying these notes and sending them off for execution. I'm undecided if I like this. One alternative is to drop the responsibility back to Boils down to: do we want to cater for network notes acting on in flight data? This would include multiple sequential inflight network notes - is this a valid and desired use case? I can't really answer that. Another alternative is to add a network note scanner to the block builder, which could emit them once the block is safely committed. A further issue with out-of-band execution is that the target account's current state might be in the mempool still. So while the generated transaction would be valid, the state isn't trivially available to the out-of-band executer without mempool IO. The simplest solution here is to avoid all this, and say that network transactions are executed wrt chain tip and not inflight state. This let's us simply post the note for execution without any validation - the executor does everything based on the store data via the conventional RPC entry-point. This would imply the note sending should occur at block committal by the block-builder, or having the executors scan for such notes themselves via the store. |
Beta Was this translation helpful? Give feedback.
-
|
Tracking issue #692. We can re-open if there are any major requirement changes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Network transactions are a major unsupported feature where users may submit a public transaction which the network should execute when some user-defined conditions are met. The transactions must be public since they'll be executed and proven by the node operator.
There are some open questions regarding this feature, which we should discuss and then iterate on a design.
I'll enumerate my initial questions here, but will initialize discussion threads for them below.
Beta Was this translation helpful? Give feedback.
All reactions