-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Oracles] Memory pool and Transaction Broadcast Model #1276
Comments
@belane, it is not clear to me how to avoid spam on Oracles nodes. |
Could you please clarify how can the node link the OracleTx to the invocation that was producing this OrcaleTx? I mean VM starts to execute SC, meets Oracle call, stops executions, issues OracleTx and waits for the result. If there is no link to the parent Tx, how would other nodes executing the parent invocation Tx know that the OracleTx already exists in mempool and there is no need to issue on more? |
Do you think @vncoelho that Know Hashes is not enough? Like any transaction when it is in know hashes it will not be broadcasted anymore. During an oracle transaction, the only extra exchange that exists is the transfer of @realloc when an oracle transaction is received, it is dded into the mempool, but not verified. Normal nodes will not execute the transaction until it is verified and enters in a block, at that point they will have all the necessary data to run it. Only Oracle nodes will execute unverified Oracle transactions in order to generate |
@belane I mean not only the OracleTx, but both SC invocation Tx and resulting Oracle Tx. |
I think the transaction (invocation tx) will remain the same and will be included into a block. To run this transaction a node will need the transaction itself and the verified It is still not very clear to me how to store in the blockchain the |
We can store the result in the blocks. There's a https://github.com/neo-project/neo/blob/master/src/neo/Network/P2P/Payloads/ConsensusData.cs |
@erikzhang But result refers to a particular Oracle transaction, not the block. Transaction invoking a SC that call Oracles may have more then one Oracle invocation, hence many dependent Oracle Transactions that it would be waiting to enter the block. It means each Oracle Tx should hold the result, not the block. Otherwise it would be impossible to have both SC invocation Tx and depending Oracle TXs in one block or have enough Oracle Tx results there. |
You can put multiple results in a single block, there is no problem. |
@erikzhang You can, but it breaks the semantics. Logically Oracle call is a dependent transaction, the same as SC invocation, so there appears a logical link between transactions, not between the SC invocation and a block. |
This issue describes the behavior of the memory pool for Oracle transactions, their verification and its broadcast model.
Transaction Broadcast Model
(https://medium.com/neo-smart-economy/on-the-importance-of-oracles-neo-3-0-and-dbft-17c37ee35f32)
Transaction Delivery Process
Blue nodes represent common P2P nodes, red nodes represent Oracle nodes, and green nodes represent consensus nodes.
The user broadcasts an Oracle transaction transaction TxA into Neo network.
TxA will be broadcast to all nodes in network, and will be stored in their own memory pool by each node.
Oracle node will execute the network requests in TxA, and make a consensus of return value with other Oracle nodes. And then append it to the transaction as OracleAgreement, and broadcast to the network.
The consensus node will select the Oracle transaction in the memory pool that has been appended with OracleAgreement to add into block and broadcast the block to the network.
Transaction Receiving Process
When a node receives a transaction,it will determine whether the transaction is an Oracle transaction.
Oracle Node Process
When executing an interop service with Oracle, the node will check if the returned data already exists in the
OracleResult
dict.OracleResult
dict.The VM needs to limit the number of executions according to OracleFee when executing the Opcode. If the number of executions of the OracleFee representative is less than the actual number of executions, it directly returns fault.
Oracle TX Verification Process
The text was updated successfully, but these errors were encountered: