Transaction data processing method and device, electronic equipment and computer program product
By grouping and simulated transactions of received MEV transaction packets in the MEV scenario, the priority of transaction packets is determined, and the transaction packet with higher priority is sent to the block construction node, the inefficient transaction data processing in the MEV scenario is solved. The problem of this paper improves resource utilization and transaction package chain efficiency, while ensuring fairness.
Patent Information
- Application Number
- CN202510002991.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the MEV scenario, block builders are unable to effectively screen transaction packages due to high failure rates and resource waste caused by current limiting strategies, resulting in redundant transactions being rejected, which damages the efficiency of the entire MEV ecosystem.
When receiving the MEV transaction packet sent by the MEV search node, it is stored in the corresponding transaction packet packet, and simulated transactions are performed on each transaction packet to determine the priority ranking information of the transaction packet, and then the higher priority is The target transaction package is sent to the block build node.
Improve the resource utilization rate between user nodes, MEV search nodes, and block builder nodes in the MEV scenario, reduce the process of block builder manually screening transaction packets, improve the efficiency of transaction packets on the chain, and ensure different privacy Fairness of transactions.
Smart Images

Figure CN119415601A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of blockchain technology, and in particular, relate to transaction data processing methods, devices, electronic devices, and computer program products. Background Art
[0002] In some data management systems for block data, transaction requests from users can be received and sent to block builders. Since block builders usually implement flow limiting strategies to control their own load, data management systems face high failure rates and resource waste when forwarding transactions. Especially in the MEV (Maximal Extractable Value) scenario, multiple block searchers submit similar transaction packages, further exacerbating the problem of sending duplicate data and occupying limited bandwidth resources.
[0003] In the current MEV scenario, the data management system does not screen transaction packages and directly forwards them to block builders. This indiscriminate forwarding can easily lead to a large number of redundant transactions being rejected by block builders, damaging the efficiency of the entire MEV ecosystem.
[0004] Therefore, there is an urgent need for a transaction data processing method to improve the efficiency of block builders in processing user transaction requests. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a transaction data processing method, device, electronic device and computer program product to improve the resource utilization between user nodes, MEV search nodes and block builder nodes in the MEV scenario, while ensuring fairness for transactions with different privacy.
[0006] A first aspect of an embodiment of the present application provides a transaction data processing method, including: When receiving a MEV transaction package sent by a MEV search node, the MEV transaction package is stored in a transaction package group corresponding to the MEV transaction package; the transaction package group is constructed based on the privacy transaction package sent by the user node; the transaction package group includes at least the privacy transaction package; Performing simulated transactions on each of the transaction package groups to determine transaction package priority sorting information of each of the transaction package groups; For each of the transaction package groups, determine a target transaction package according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; The target transaction package is sent to the block construction node.
[0007] In some implementations of the first aspect, each transaction package in the transaction package group is provided with a transaction package identifier; and storing the MEV transaction package in the transaction package group corresponding thereto includes: Determining the association identifier contained in the MEV transaction package; Determine the transaction package group corresponding to the transaction package identifier consistent with the association identifier as the target transaction package group; The MEV transaction package is stored in the target transaction package group.
[0008] In some implementations of the first aspect, storing the MEV transaction package in the target transaction package group includes: Determine an associated transaction package; the transaction package identifier of the associated transaction package is consistent with the associated identifier; The MEV transaction package is taken as a child node of the associated transaction package and stored in the target transaction package group.
[0009] In some implementations of the first aspect, the performing simulated transactions on each of the transaction package groups to determine the transaction package priority of each of the transaction package groups includes: For each of the transaction package groups, simulate transactions for each transaction package to determine the node fee and node value of each transaction package; If the transaction package does not have a parent node, the MEV value of the transaction package is determined based on the node fee and the node value of the transaction package; If the transaction package has a parent node, the MEV value of the transaction package is determined based on the node fee and node value of the transaction package and the node fee and node value of the parent node of the transaction package; Sort the MEV values of each transaction package in the same transaction package group to obtain the transaction package priority; The transaction package includes the MEV transaction package and the privacy transaction package.
[0010] In some implementations of the first aspect, after sending the target transaction package to the block construction node, the method further includes: For the transaction package that failed to be uploaded to the chain, the target transaction package is eliminated according to the transaction package priority sorting information corresponding to the transaction package that failed to be uploaded to the chain, and the process returns to the step of determining the target transaction package according to the transaction package priority sorting information; For the successful transaction package on the chain, delete the transaction package group where the successful transaction package on the chain is located; The on-chain failure transaction package is a target transaction package whose on-chain status is failed to be on-chain; the on-chain success transaction package is a target transaction package whose on-chain status is successful to be on-chain.
[0011] In some implementations of the first aspect, the method further includes: Receive the privacy transaction package sent by the user node; Generating a transaction package identifier of the private transaction package according to the private transaction data included in the private transaction package; A transaction package grouping with a tree structure is constructed for the private transaction package, and the private transaction package is set as the root node of the transaction package grouping.
[0012] In some implementations of the first aspect, the privacy transaction package and the MEV transaction package are provided with a transaction package identifier, and the transaction package group is provided with a group identifier; the method further includes: Construct mapping information with constant time complexity; The mapping information is used to store the transaction package identifier, the group identifier, and the mapping relationship between the transaction package identifier and the group identifier; The transaction package identifier is used to identify the privacy transaction package or to identify the MEV transaction package, and the group identifier is used to identify the transaction package group.
[0013] A second aspect of an embodiment of the present application provides a transaction data processing device, including: A MEV transaction package storage module is used to store the MEV transaction package in a transaction package group corresponding to the MEV transaction package sent by the MEV search node when the MEV transaction package is received; the transaction package group is constructed based on the privacy transaction package sent by the user node; the transaction package group includes at least the privacy transaction package; A transaction simulation module, used to simulate transactions on each of the transaction package groups to determine transaction package priority sorting information of each of the transaction package groups; A target transaction package determination module, configured to determine a target transaction package for each of the transaction package groups according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; The target transaction package sending module is used to send the target transaction package to the block construction node.
[0014] A third aspect of an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the transaction data processing method as described in the first aspect above.
[0015] A fourth aspect of an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is run, the transaction data processing method described in the first aspect above is executed.
[0016] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the transaction data processing method as described in the first aspect above is implemented.
[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: In the embodiment of the present application, upon receiving a MEV transaction package sent by a MEV search node, the MEV transaction package is stored in a transaction package group corresponding to the MEV transaction package; the transaction package group is constructed based on a privacy transaction package sent by a user node; the transaction package group includes at least the privacy transaction package; simulated transactions are performed on each of the transaction package groups to determine the transaction package priority sorting information of each of the transaction package groups; for each of the transaction package groups, a target transaction package is determined according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; the target transaction package is sent to a block construction node, and the same number of target transaction packages to be sent to the block construction node are determined based on the simulated value sorting in the transaction package groups corresponding to each privacy transaction data, thereby reducing the process of manual screening of transaction packages by the block construction node while ensuring the fairness of each privacy transaction data, thereby improving the efficiency of transaction package on-chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a schematic diagram of a transaction data processing method provided in an embodiment of the present application; Figure 2 It is a schematic diagram of the process of determining and sending a target transaction package; Figure 3a This is one of the transaction grouping structure diagrams provided in the embodiment of the present application; Figure 3b This is the second schematic diagram of a transaction grouping structure provided in an embodiment of the present application; Figure 4 This is a schematic diagram of mapping information provided in an embodiment of the present application; Figure 5 It is a schematic diagram of the transaction data processing flow; Figure 6is a schematic diagram of a transaction data processing device provided in an embodiment of the present application; Figure 7 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0021] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0022] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0023] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0024] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0025] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0026] In some related MEV scenarios, it is usually necessary to set up a service node to receive transaction data sent by users and MEV searchers. The service node is used to send these transaction data directly to the block builders, which requires the block builders to manually screen these transaction data and then perform on-chain processing on the screened transaction data, resulting in low efficiency in transaction data processing in the entire MEV scenario.
[0027] The embodiment of the present application provides a new service node in the EVM scenario - MEV Protect RPC node (Maximal Extractable Value Protect Remote Procedure Call) maximum extractable value protection remote procedure call node (hereinafter referred to as RPC node). The RPC node communicates with the user node (the node that sends private transactions to RPC), the MEV search node (the node that searches and mines extractable value), and the block builder node (the node that builds blocks for transaction data). After filtering the transaction data received from the user node and the MEV search node according to the value, the transaction data with higher value is sent to the block builder node first, thereby reducing the amount of redundant transaction data sent to the block builder node, improving the efficiency of the block builder in processing transaction data, effectively alleviating the flow limiting pressure of the block builder node, ensuring the priority of high-value transaction data, and improving the resource utilization between each node in the MEV scenario. At the same time, for different privacy transactions received, the priority is determined and the filtered transaction data is sent to the block builder, ensuring fairness for different privacy transactions. The transaction data is a batch of transactions and an atomic transaction sequence.
[0028] The above-mentioned RPC nodes, user nodes, MEV search nodes, and block builder nodes can be devices with computing power, such as computer devices and smart terminals. In some examples, the RPC node can also be a server or a server cluster.
[0029] The technical solution of the present application is described below through specific embodiments.
[0030] Reference Figure 1 , shows a schematic diagram of a transaction data processing method provided by an embodiment of the present application. The embodiment of the present application can apply the above-mentioned RPC node. The method can specifically include the following steps: Step 101, upon receiving a MEV transaction package sent by a MEV search node, storing the MEV transaction package in a transaction package group corresponding to the MEV transaction package; the transaction package group is constructed based on the privacy transaction package sent by the user node; the transaction package group includes at least the privacy transaction package; The RPC node can construct a transaction package group based on the privacy transaction package received from the user node. Each transaction package group contains a privacy transaction package, and the privacy transaction packages in different transaction package groups are different. The privacy transaction package includes privacy transaction data.
[0031] Before receiving the MEV transaction package sent by the MEV search node, the RPC node can determine the initial transaction feature data of the privacy transaction package based on the privacy information set by the user node, and send the initial transaction feature data to one or more MEVMEV search nodes. The MEV node is used to mine arbitrage opportunities based on the initial transaction feature data, generate a MEV transaction package based on the initial transaction feature data, and send the MEV transaction package to the RPC node. The RPC node has confirmed that the MEV transaction package corresponds to the initial transaction feature data. The RPC node can determine the transaction package grouping corresponding to the initial transaction feature data corresponding to the MEV transaction package, and store the MEV transaction package in the transaction package grouping.
[0032] The MEV transaction package contains several MEV transaction data, and the MEV transaction data is determined by the MEV search node that generates the MEV transaction package. After the MEV transaction package is stored in the transaction package group, the RPC node can generate MEV transaction feature data for the MEV transaction data contained in the stored MEV transaction package, and send the MEV transaction feature data to the MEV search node, so that the MEV search node can mine arbitrage opportunities for the MEV transaction feature data and generate another MEV transaction package based on the MEV transaction feature data.
[0033] As an example, the initial transaction feature data is obtained based on the private transaction data, for example: the initial transaction feature data is the secondary hash value of the hash value of the private transaction data. For the MEV transaction feature data of the MEV transaction package, it can be the secondary hash value of the hash value of the MEV transaction data contained in the MEV transaction package.
[0034] Step 102, performing simulated transactions on each of the transaction package groups to determine transaction package priority ranking information of each of the transaction package groups; The RPC node can simulate transactions for transaction packages in each transaction package group. For a transaction package group, if there is only a privacy transaction package, a simulated transaction is performed on the privacy transaction package. If there is a privacy transaction package and one or more MEV transaction packages, a simulated transaction is performed on both the privacy transaction package and the MEV transaction package.
[0035] Before conducting a simulated transaction, you can obtain the current world state of the blockchain, which refers to the state of all accounts and data on the blockchain at the current point in time. Based on this world state, simulated transactions are performed on each transaction package (including privacy transaction packages and MEV transaction packages) to ensure the correctness of the simulated transaction logic and the reliability of the simulated transaction results.
[0036] The transaction package priority sorting information includes the sorting of the values corresponding to the various transaction packages in the same transaction package group from large to small, and the values corresponding to the transaction packages are obtained based on simulated transactions.
[0037] When an RPC node receives a MEV transaction package, it can determine the transaction package associated with the received MEV transaction package in the stored transaction packages. When simulating a transaction on a MEV transaction package, in addition to simulating a transaction on the MEV transaction data contained in the MEV transaction package, it is also necessary to simulate a transaction on the private transaction data or MEV transaction data contained in the transaction package associated with the MEV transaction package. It is understandable that each MEV transaction package is directly or indirectly associated with a private transaction package.
[0038] Step 103: for each of the transaction package groups, determine a target transaction package according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; For each transaction package grouping, determine the transaction package with the highest priority as the target transaction package, which can be a privacy transaction package or a MEV transaction package.
[0039] Since each transaction group corresponds to different private transaction data, and the MEV transaction packages in the same transaction group are directly or indirectly associated with the private transaction packages in the transaction group, that is, the target transaction packages determined in the same transaction group correspond to the private transaction data in the same group.
[0040] In a specific implementation, the RPC node can build a transaction package pool, in which each transaction package group is stored. By building a transaction package pool to store each transaction package group, the management efficiency of each transaction package group by the RPC node can be improved. For example, each transaction package group can be processed uniformly, and the processing of each transaction package group uniformly can include but is not limited to the simulation of transactions uniformly for each transaction package group.
[0041] It should be noted that even though each group can be processed uniformly through the transaction package pool, the processing results can still maintain the relative independence of each group. For example, the result of performing simulated transactions on each transaction package group is the same as the result of performing simulated transactions on each transaction package group separately.
[0042] Step 104: Send the target transaction package to the block construction node.
[0043] The RPC node can send the target transaction package of each transaction group to the block construction node, and the block construction node can independently determine whether to process the received target transaction package on the chain.
[0044] When the RPC node sends the target transaction packages of each transaction package group to the block builder, it is equivalent to sending the target transaction packages corresponding to each privacy transaction data to the blockchain builder. When the number of target transaction packages in each transaction group is the same, it is guaranteed that the RPC node transmits the same number of target transaction packages for different privacy transaction data to the block building node, ensuring the fairness of the processing of each privacy transaction data. At the same time, since the target transaction package is sorted by the value obtained through simulated transactions, it is also possible to send the transaction package with the highest value in each transaction package group to the block building node, reducing the process of manual screening of transaction packages by the block building node and improving the efficiency of transaction package on-chain.
[0045] In an embodiment of the present application, upon receiving a MEV transaction package sent by a MEV search node, the MEV transaction package is stored in a transaction package group corresponding to the MEV transaction package; the transaction package group is constructed based on a privacy transaction package sent by a user node; the transaction package group includes at least the privacy transaction package; simulated transactions are performed on each of the transaction package groups to determine the transaction package priority sorting information of each of the transaction package groups; for each of the transaction package groups, a target transaction package is determined according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; the target transaction package is sent to a block construction node, and the same number of target transaction packages sent to the block construction node are determined based on the simulated value sorting in the transaction package groups corresponding to each privacy transaction data, thereby reducing the process of manual screening of transaction packages by the block construction node while ensuring the fairness of each privacy transaction data, thereby improving the efficiency of transaction package on-chain.
[0046] Reference Figure 2 , showing a schematic diagram of the process of determining and sending a target transaction package; in a certain transaction package group, the privacy transaction package (Bundle-Raw) submitted by the user node has a transaction package identifier: "0xe2dfbf2f...c6dda25c778ca", and multiple search nodes have discovered MEV opportunities based on the privacy transaction package, and respectively constructed and sent MEV transaction packages (Bundle-MEV1, Bundle-MEV2, Bundle-MEV3) to the RPC node, and the searcher sets the associated transaction package identifier in the MEV transaction package through the field "parent="0x45a142053478e...0738bf3845a"", that is, "0x45a142053478e...0738bf3845a". The transaction packages Bundle-MEV0, Bundle-MEV1, and Bundle-MEV2 can be stored in the transaction package group where the privacy transaction package (Bundle-Raw) is located. When the simulation calculation is performed on the transaction package group, the transaction packages contained in the transaction package group are Bundle-Raw, Bundle-MEV1, Bundle-MEV2, and Bundle-MEV3. It can be understood that the value of Bundle-Raw is 0 unit value, and the values of Bundle-MEV0, Bundle-MEV1, and Bundle-MEV2 are 0.02 unit value, 0.015 unit value, and 0.024 unit value respectively. Therefore, Bundle-MEV3 is used as the target transaction package, and Bundle-MEV3 is sent to one or more block builders.
[0047] The embodiment of the present application does not limit the selection of unit value, and the unit value can be any kind of digital resource, that is, the value of the transaction package can be represented by the amount of a certain digital resource.
[0048] In some implementations of the embodiments of the present application, each transaction package in the transaction package group is provided with a transaction package identifier; and storing the MEV transaction package in the transaction package group corresponding thereto includes: Determine the association identifier contained in the MEV transaction package; determine the transaction package group corresponding to the transaction package identifier consistent with the association identifier as the target transaction package group; and store the MEV transaction package in the target transaction package group.
[0049] In the RPC node, the transaction identifiers of each transaction package contained in each transaction group can be recorded. After receiving the MEV transaction package, the association identifier contained in the MEV transaction package is determined, and then the transaction identifier consistent with the association identifier is identified in the transaction identifiers of each transaction package contained in each recorded transaction group, and the transaction package group containing the transaction identifier consistent with the association identifier is determined as the target transaction package group, and the MEV transaction package is stored in the target transaction package group.
[0050] In the embodiment of the present application, a tree structure is used to implement hierarchical control of transaction package grouping. Each transaction package is a tree node, which contains its own unique identifier and a pointer identifier pointing to the parent node. The root node (privacy transaction package) is recorded, and the MEV transaction package submitted by the MEV search node is stored in an array.
[0051] In some implementations of the embodiments of the present application, before step 101, the method further includes: receiving a privacy transaction package sent by a user node; generating a transaction package identifier of the privacy transaction package based on the privacy transaction data contained in the privacy transaction package; constructing a transaction package grouping with a tree structure for the privacy transaction package, and setting the privacy transaction package as the root node of the transaction package grouping.
[0052] The private transaction data contained in the private transaction package generated by the user node is determined, and the transaction package identifier of the private transaction package is generated based on the private transaction data. The private transaction package is used as the root node to construct a tree-structured transaction package grouping.
[0053] Corresponding to the MEV transaction package, it can be determined that the MEV transaction package contains MEV transaction data, and the transaction package identifier of the MEV transaction package is generated based on the MEV transaction data.
[0054] As an example, the transaction package identifier of a privacy transaction package is a secondary hash value of a hash value of privacy transaction data; the transaction package identifier of an MEV transaction package can be a secondary hash value of a hash value of MEV transaction data.
[0055] In some implementations of the embodiments of the present application, storing the MEV transaction package in the target transaction package group includes: determining an associated transaction package; the transaction package identifier of the associated transaction package is consistent with the associated identifier; and storing the MEV transaction package as a child node of the associated transaction package in the target transaction package group.
[0056] When the RPC node receives the MEV transaction package Bundle-3 sent by the MEV search node, it determines the association identifier as (0x01) according to the recorded association field "parent=0x01" and determines that the transaction package identifier of one of the transaction packages in the transaction package group Group-1 is 0x01, then the transaction package group Group-1 is the target transaction group.
[0057] Reference Figure 3a , shows one of the schematic diagrams of a transaction grouping structure provided by an embodiment of the present application. At a certain moment, the structure of the target transaction grouping is as follows Figure 3a As shown, it contains transaction packages RawTx / Bundle, Bundle-1, and Bundle-2. According to the recorded association field "parent=0x01", the association identifier is determined to be (0x01), and the transaction package whose transaction identifier is consistent with the association identifier is determined to be transaction package Bundle-1 (according to Bundle-1's "id=0x01", the transaction package identifier of Bundle-1 is determined to be 0x01). Therefore, transaction package Bundle-1 is used as an associated transaction package of transaction package Bundle-3, and transaction package Bundle-3 is stored in the target transaction group as a child node of transaction package Bundle-1. Refer to Figure 3b , shows a schematic diagram of a transaction group structure provided by an embodiment of the present application. After storing the transaction package Bundle-3 as a child node of the transaction package Bundle-1 in the target transaction package group Group-1, the structure of the target transaction package group Group-1 is as follows: Figure 3b The structure shown.
[0058] In some implementations of the embodiments of the present application, the simulating transactions on each of the transaction package groups to determine the transaction package priority of each of the transaction package groups includes: For each of the transaction package groups, simulate transactions for each transaction package to determine the node fee and node value of each transaction package; If the transaction package does not have a parent node, the MEV value of the transaction package is determined based on the node fee and the node value of the transaction package; If the transaction package has a parent node, the MEV value of the transaction package is determined based on the node fee and node value of the transaction package and the node fee and node value of the parent node of the transaction package; Sort the MEV values of each transaction package in the same transaction package group to obtain the transaction package priority; The transaction package includes the MEV transaction package and the privacy transaction package.
[0059] In the specific implementation, in order to prioritize all transaction packages within each transaction package group, the RPC node needs to have a custom simulation calculation component to calculate the priority of the transaction package. Since the tree structure is used to maintain the hierarchical relationship between transaction packages, a recursive algorithm needs to be used during the simulation, as follows: 1) Traverse all transaction packages in the transaction package group and execute the following logic in sequence: a. If the parent node exists, simulate the parent node first. If it does not exist, execute step b.
[0060] b. Execute the transaction data in the transaction package in sequence, and calculate the transaction fee as the node fee of the transaction package.
[0061] c. Calculate the value (node value) given by the search node (if any), combine the node fee, the node fee of the parent node and the node value of the parent node to derive the value of the current transaction package (EM value).
[0062] 2) According to the simulation calculation results of each transaction package, the priority within the transaction package group is sorted.
[0063] In some implementations of the embodiments of the present application, after sending the target transaction package to the block construction node, the method further includes: For the transaction package that failed to be uploaded to the chain, the target transaction package is eliminated according to the transaction package priority sorting information corresponding to the transaction package that failed to be uploaded to the chain, and the process returns to the step of determining the target transaction package according to the transaction package priority sorting information; For the successful transaction package on the chain, delete the transaction package group where the successful transaction package on the chain is located; The on-chain failure transaction package is a target transaction package whose on-chain status is failed to be on-chain; the on-chain success transaction package is a target transaction package whose on-chain status is successful to be on-chain.
[0064] After the RPC node can send the target transaction package to the block building node, the on-chain status of the target transaction package can be determined by a preset method, and the on-chain status of the target transaction package includes successful on-chain or failed on-chain. The embodiment of the present application does not limit the preset method for determining the on-chain status of the target transaction package. The preset method may include but is not limited to one of the following methods, receiving the response result of the block builder to the target transaction package (the response includes the on-chain status of the target transaction package), detecting whether there is a block corresponding to the target transaction package (if there is a corresponding block, the on-chain status is successful on-chain, if there is a corresponding block, the on-chain status is failed on-chain), and querying whether the transaction corresponding to the target transaction package has been executed (if the corresponding transaction has been queried to be executed, the on-chain status is successful on-chain, if the corresponding transaction has not been queried to be executed, the on-chain status is failed on-chain).
[0065] If the transaction package with the highest priority (i.e. the target transaction package) fails to be uploaded to the chain, the transaction package with the second priority will be selected and forwarded to the block construction node, and so on; if the upload is successful, the transaction package that has been successfully uploaded to the chain will be grouped into the entire group.
[0066] In some implementations of the embodiments of the present application, the privacy transaction package and the MEV transaction package are provided with a transaction package identifier, and the transaction package group is provided with a group identifier; the method includes: Construct mapping information with constant time complexity; The mapping information is used to store the transaction package identifier, the group identifier, and the mapping relationship between the transaction package identifier and the group identifier; The transaction package identifier is used to identify the privacy transaction package or to identify the MEV transaction package, and the group identifier is used to identify the transaction package group.
[0067] The above-mentioned transaction package identifier can be used to identify a privacy transaction package or a MEV transaction package. In order to quickly find the transaction package group to which a transaction package belongs, a group identifier for identifying the transaction package group can be generated, and a mapping information can be constructed with a constant time complexity (for example, the time complexity is O(1)). The mapping information includes a transaction package identifier, a group identifier, and a mapping relationship between the transaction package identifier and the group identifier.
[0068] Reference Figure 4 , shows a schematic diagram of mapping information provided by an embodiment of the present application, Figure 4 For example, transaction package identifiers include "0x00", "0x11", "0x89", and "0x33", and group identifiers include "0xAAA" and "0xBBB". Figure 4 The arrow in the figure represents the mapping relationship. In practical applications, the mapping relationship between the transaction package identifier and the group identifier can be recorded in the mapping information in the form of characters.
[0069] Based on the mapping relationship, the group where a transaction package identifier is located can be quickly found, and a transaction package group (including the transaction packages in the transaction package group) can also be quickly deleted according to the mapping information.
[0070] The following is an example to further illustrate the embodiment of the present application. Figure 5 , shows a schematic diagram of a transaction data processing flow, including the following steps: 1. Send a transaction. The user sends a private transaction to MEVProtectRPC.
[0071] 2. Build transaction package groups and add them to the transaction package pool. RPC assigns a unique identifier to the received user privacy transaction (the identifier is often the secondary hash of the transaction hash), creates a new transaction package group, adds the privacy transaction to the group, and puts the group into the transaction package pool.
[0072] 3. Push transaction flow. According to the user's privacy settings, some data of transactions in the group will be pushed to MEV searchers.
[0073] 4. Send MEV transaction package. After the searcher finds a MEV opportunity, he constructs a transaction package and sends it to RPC.
[0074] 5. Match transaction package groups and add them to the transaction package pool. RPC assigns a unique identifier to the received transaction package (the identifier is often the secondary hash of all transaction hashes in the transaction package) and adds it to the group corresponding to the corresponding user transaction in the form of a child node.
[0075] 6. Group simulation and prioritize. RPC groups all transaction packages in the transaction package pool and transmits them to the transaction package Simulator for simulation execution. According to the sorting rules, the transaction packages are prioritized in each group.
[0076] 7. Group and filter by priority. Select the transaction package with the highest priority in each group from the transaction package pool.
[0077] 8. Forward. Forward the selected transaction package with the highest priority to the block builder.
[0078] If the transaction package with the highest priority fails to be uploaded to the chain, the bundle with the second priority will be selected for forwarding, and so on; if the upload is successful, the entire group will be deleted from the Bundle Pool.
[0079] Through the above group management mechanism, for the MEV scenario, when the RPC node processes the Bundle Pool, it will only select the bundle with the highest priority in each group and forward it to the block builder, avoiding the waste of traffic resources and effectively alleviating the pressure of flow limitation. At the same time, the Bundle Simulator performs simulation and priority sorting in groups, so there is no impact between groups, and there is no competition between user transactions, which ensures the fairness of the RPC service to users.
[0080] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0081] The transaction package data involved in this application have been obtained with full consent and authorization, and the collection, use and processing of relevant information must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0082] Reference Figure 6 , shows a schematic diagram of a transaction data processing device provided in an embodiment of the present application, which may specifically include a MEV transaction package storage module 601, a transaction simulation module 602, a target transaction package determination module 603, and a target transaction package sending module 604, wherein: The MEV transaction package storage module 601 is used to store the MEV transaction package into a corresponding transaction package group when receiving the MEV transaction package sent by the MEV search node; the transaction package group is constructed based on the privacy transaction package sent by the user node; the transaction package group at least includes the privacy transaction package; A transaction simulation module 602, configured to simulate transactions on each of the transaction package groups to determine transaction package priority ranking information of each of the transaction package groups; A target transaction package determination module 603 is used to determine a target transaction package for each of the transaction package groups according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; The target transaction package sending module 604 is used to send the target transaction package to the block construction node.
[0083] In some implementations of the embodiments of the present application, each transaction package in the transaction package group is provided with a transaction package identifier; the MEV transaction package storage module 601 includes: An association identifier determination submodule, used to determine the association identifier contained in the MEV transaction package; A target transaction package group determination submodule, used to determine the transaction package group corresponding to the transaction package identifier consistent with the association identifier as the target transaction package group; The MEV transaction package storage submodule is used to store the MEV transaction package into the target transaction package group.
[0084] In some implementations of the embodiments of the present application, the MEV transaction package storage submodule includes: an associated transaction package determining unit, configured to determine an associated transaction package; the transaction package identifier of the associated transaction package being consistent with the associated identifier; The MEV transaction package storage unit is used to store the MEV transaction package as a child node of the associated transaction package into the target transaction package group.
[0085] In some implementations of the embodiments of the present application, the transaction simulation module 602 includes: A simulation unit, for grouping each of the transaction packages, performing simulated transactions on each of the transaction packages, and determining a node fee and a node value of each of the transaction packages; A first MEV value determining unit, configured to determine the MEV value of the transaction package according to the node fee and the node value of the transaction package if the transaction package does not have a parent node; A second MEV value determination unit, configured to determine the MEV value of the transaction package according to the node fee and the node value of the transaction package and the node fee and the node value of the parent node of the transaction package if the transaction package has a parent node; A sorting unit, used to sort the MEV values of each transaction package in the same transaction package group to obtain the priority of the transaction package; The transaction package includes the MEV transaction package and the privacy transaction package.
[0086] In some implementations of the embodiments of the present application, after sending the target transaction package to the block construction node, the device further includes: The on-chain failure processing module is used to remove the target transaction package according to the transaction package priority sorting information corresponding to the on-chain failed transaction package, and call the target transaction package determination module 603 and the target transaction package sending module 604; A successful on-chain processing module is used to delete the transaction package group to which the successful on-chain transaction package belongs for the successful on-chain transaction package; The on-chain failure transaction package is a target transaction package whose on-chain status is failed to be on-chain; the on-chain success transaction package is a target transaction package whose on-chain status is successful to be on-chain.
[0087] In some implementations of the embodiments of the present application, the device further includes: The privacy transaction package receiving module is used to receive the privacy transaction package sent by the user node; A transaction package identifier generation module, configured to generate a transaction package identifier of the private transaction package according to the private transaction data contained in the private transaction package; The transaction package grouping construction module is used to construct a transaction package grouping with a tree structure for the privacy transaction package, and set the privacy transaction package as the root node of the transaction package grouping.
[0088] In some implementations of the embodiments of the present application, the privacy transaction package and the MEV transaction package are provided with a transaction package identifier, and the transaction package group is provided with a group identifier; the device further includes: A mapping information building module, used to build mapping information with a time complexity as a constant; The mapping information is used to store the transaction package identifier, the group identifier, and the mapping relationship between the transaction package identifier and the group identifier; The transaction package identifier is used to identify the privacy transaction package or to identify the MEV transaction package, and the group identifier is used to identify the transaction package group.
[0089] An embodiment of the present application provides a transaction data processing device, and by using the device, each step in the aforementioned method embodiments can be implemented.
[0090] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0091] Reference Figure 7 , shows a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 7 As shown, the electronic device 700 in the embodiment of the present application includes: a processor 710, a memory 720, and a computer program 721 stored in the memory 720 and executable on the processor 710. When the processor 710 executes the computer program 721, the steps in each embodiment of the transaction data transmission method described above are implemented, such as Figure 1 Alternatively, when the processor 710 executes the computer program 721, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 Functions of modules 601 to 604 are shown.
[0092] Exemplarily, the computer program 721 may be divided into one or more modules / units, which are stored in the memory 720 and executed by the processor 710 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 721 in the electronic device 700. For example, the computer program 721 may be divided into a MEV transaction package storage module, a transaction simulation module, a target transaction package determination module, and a target transaction package sending module, and the specific functions of each module are as follows: A MEV transaction package storage module is used to store the MEV transaction package in a transaction package group corresponding to the MEV transaction package sent by the MEV search node when the MEV transaction package is received; the transaction package group is constructed based on the privacy transaction package sent by the user node; the transaction package group includes at least the privacy transaction package; A transaction simulation module, used to simulate transactions on each of the transaction package groups to determine transaction package priority sorting information of each of the transaction package groups; A target transaction package determination module, configured to determine a target transaction package for each of the transaction package groups according to the transaction package priority sorting information; the target transaction package is the privacy transaction package or the MEV transaction package; The target transaction package sending module is used to send the target transaction package to the block construction node.
[0093] The electronic device 700 may include, but is not limited to, a processor 710 and a memory 720. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 700 and does not constitute a limitation of the electronic device 700. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 700 may also include input and output devices, network access devices, buses, etc.
[0094] The processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0095] The memory 720 may be an internal storage unit of the electronic device 700, such as a hard disk or memory of the electronic device 700. The memory 720 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 700. Further, the memory 720 may also include both an internal storage unit of the electronic device 700 and an external storage device. The memory 720 is used to store the computer program 721 and other programs and data required by the electronic device 700. The memory 720 may also be used to temporarily store data that has been output or is to be output.
[0096] The embodiments of the present application further disclose a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the transaction data processing method as described in the above embodiments is implemented.
[0097] An embodiment of the present application further discloses a computer program product, including a computer program. When the computer program is run, the transaction data processing method described in the above embodiments is executed.
[0098] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A transaction data processing method, characterized in that: include: When receiving a MEV transaction package sent by a MEV search node, the MEV transaction package is stored in a transaction package group corresponding to the MEV transaction package; the transaction package group is constructed based on the privacy transaction package sent by the user node; The transaction package group includes at least the privacy transaction package; Performing simulated transactions on each of the transaction package groups to determine transaction package priority sorting information of each of the transaction package groups; For each of the transaction package groups, determining a target transaction package according to the transaction package priority sorting information; The target transaction package is the privacy transaction package or the MEV transaction package; The target transaction package is sent to the block construction node.
2. The method according to claim 1, characterized in that Each transaction package in the transaction package group is provided with a transaction package identifier; and storing the MEV transaction package in the transaction package group corresponding thereto includes: Determining the association identifier contained in the MEV transaction package; Determine the transaction package group corresponding to the transaction package identifier consistent with the association identifier as the target transaction package group; The MEV transaction package is stored in the target transaction package group.
3. The method according to claim 2, characterized in that The storing the MEV transaction package into the target transaction package group includes: Determine an associated transaction package; the transaction package identifier of the associated transaction package is consistent with the associated identifier; The MEV transaction package is taken as a child node of the associated transaction package and stored in the target transaction package group.
4. The method according to claim 3, characterized in that The simulating transactions for each of the transaction package groups to determine the transaction package priority of each of the transaction package groups includes: For each of the transaction package groups, simulate transactions for each transaction package to determine the node fee and node value of each transaction package; If the transaction package does not have a parent node, the MEV value of the transaction package is determined based on the node fee and the node value of the transaction package; If the transaction package has a parent node, the MEV value of the transaction package is determined based on the node fee and node value of the transaction package and the node fee and node value of the parent node of the transaction package; Sort the MEV values of each transaction package in the same transaction package group to obtain the transaction package priority; The transaction package includes the MEV transaction package and the privacy transaction package.
5. The method according to claim 1, characterized in that After sending the target transaction package to the block construction node, the method further includes: For the transaction package that failed to be uploaded to the chain, the target transaction package is eliminated according to the transaction package priority sorting information corresponding to the transaction package that failed to be uploaded to the chain, and the process returns to the step of determining the target transaction package according to the transaction package priority sorting information; For the successful transaction package on the chain, delete the transaction package group where the successful transaction package on the chain is located; The on-chain failure transaction package is a target transaction package whose on-chain status is failed to be on-chain; the on-chain success transaction package is a target transaction package whose on-chain status is successful to be on-chain.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Receive the privacy transaction package sent by the user node; Generating a transaction package identifier of the private transaction package according to the private transaction data included in the private transaction package; A transaction package grouping with a tree structure is constructed for the private transaction package, and the private transaction package is set as the root node of the transaction package grouping.
7. The method according to any one of claims 1 to 5, characterized in that: The privacy transaction package and the MEV transaction package are provided with a transaction package identifier, and the transaction package group is provided with a group identifier; the method further includes: Construct mapping information with constant time complexity; The mapping information is used to store the transaction package identifier, the group identifier, and the mapping relationship between the transaction package identifier and the group identifier; The transaction package identifier is used to identify the privacy transaction package or to identify the MEV transaction package, and the group identifier is used to identify the transaction package group.
8. A transaction data processing device, characterized in that: include: The MEV transaction package storage module is used to store the MEV transaction package into a transaction package group corresponding to the MEV transaction package sent by the MEV search node when the MEV transaction package is received; the transaction package group is constructed based on the privacy transaction package sent by the user node; The transaction package group includes at least the privacy transaction package; A transaction simulation module, used to simulate transactions on each of the transaction package groups to determine transaction package priority sorting information of each of the transaction package groups; a target transaction package determination module, configured to determine a target transaction package for each of the transaction package groups according to the transaction package priority sorting information; The target transaction package is the privacy transaction package or the MEV transaction package; The target transaction package sending module is used to send the target transaction package to the block construction node.
9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 7 to be performed.
Citation Information
Patent Citations
Asset exchange method and system based on block chain, terminal and storage medium
CN109767212A
Transaction processing method based on block chain, electronic equipment and storage medium
CN110838063A
List data acquisition method and device, computer equipment and storage medium
CN112182107A
Trusted authentication method, network equipment, system and storage medium
CN112311735A
Transaction data processing method, device, equipment, system and storage medium
CN114338673A