CN115714652A - Transaction execution method and block link point - Google Patents

Transaction execution method and block link point Download PDF

Info

Publication number
CN115714652A
CN115714652A CN202211346010.1A CN202211346010A CN115714652A CN 115714652 A CN115714652 A CN 115714652A CN 202211346010 A CN202211346010 A CN 202211346010A CN 115714652 A CN115714652 A CN 115714652A
Authority
CN
China
Prior art keywords
transaction
target
read
transactions
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211346010.1A
Other languages
Chinese (zh)
Inventor
刘晓建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202211346010.1A priority Critical patent/CN115714652A/en
Priority to PCT/CN2022/135423 priority patent/WO2024092932A1/en
Publication of CN115714652A publication Critical patent/CN115714652A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the specification provides a transaction execution method and a block link point. One embodiment of the method comprises: grouping the transactions based on read-write sets of the transactions to obtain a plurality of first transaction groups, wherein the first transaction groups access different variables; acquiring a target reading set and a target writing set generated by a second node executing a target first transaction group through a trusted execution environment; verifying the target reading set based on the world state; and in the case of passing the verification, taking the target write set as the execution result of the target first transaction group.

Description

Transaction execution method and block link point
Technical Field
The embodiment of the specification belongs to the technical field of block chains, and particularly relates to a transaction execution method and a block link point.
Background
The Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. In the block chain system, data blocks are combined into a chain data structure in a sequential connection mode according to a time sequence, and a distributed account book which is not falsifiable and counterfeitable is ensured in a cryptographic mode. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
In the current blockchain technology, each participating node of the blockchain system needs to perform one transaction independently, that is, the same transaction needs to be performed once on each participating node in the blockchain system, which results in a waste of computing resources.
Disclosure of Invention
Embodiments of the present disclosure provide a transaction execution method and a blockchain node, which can reduce redundancy of transaction execution in a blockchain system and reduce waste of computing resources in the blockchain system.
According to a first aspect, there is provided a transaction execution method applied to a first node of a blockchain, the method comprising: grouping the transactions based on read-write sets of the transactions to obtain a plurality of first transaction groups, wherein the first transaction groups access different variables; acquiring a target reading set and a target writing set generated by a second node executing a target first transaction group through a trusted execution environment; verifying the target reading set based on the world state; and in the case of passing the verification, taking the target write set as the execution result of the target first transaction group.
According to a second aspect, there is provided a block link point comprising: the grouping unit is configured to group the transactions to obtain a plurality of first transaction groups based on the read-write sets of the transactions, and the first transaction groups access different variables; the acquisition unit is configured to acquire a target reading set and a target writing set generated by the second node executing the target first transaction group through the trusted execution environment; the verification unit is configured to verify the target reading set based on the world state; and the result determining unit is configured to take the target write set as an execution result of the target first transaction group in the case of passing the verification.
According to a third aspect, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method as described in any one of the implementations of the first aspect.
According to a fourth aspect, there is provided a block link point, comprising a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method as described in any one of the implementation manners of the first aspect.
According to the transaction execution method and the block link point provided by the embodiments of the present specification, first, based on the read-write sets of multiple transactions, multiple transactions are grouped to obtain multiple first transaction groups, and the multiple first transaction groups access different variables, so that the multiple first transaction groups can be executed in parallel. Based on the above, the first node may acquire a target reading set and a target writing set generated by the second node executing the target first transaction packet through the trusted execution environment, and verify the target reading set based on the world state, and in a case that the target reading set passes the verification, take the target writing set as an execution result of the target first transaction packet. Since the target write set is generated by the trusted execution environment of the second node, the trusted execution environment can guarantee the security, the authentication and the integrity of the internal code thereof. Therefore, in the case of input determination, the expected execution result may be obtained by the trusted execution environment. Thus, in the event that the target read set validation passes, the target write set obtained by the trusted execution environment is trusted. The first node may store the target write set locally as a result of execution of the target first transaction packet without locally executing the transaction in the target first transaction packet. Therefore, the redundancy of transaction execution in the blockchain system can be reduced, and the waste of computing resources in the blockchain system is reduced. And a plurality of first transaction groups can be executed in parallel, so that the efficiency of transaction execution is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments in the present specification, the drawings required to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present specification, and it is obvious for those skilled in the art that other drawings may be obtained according to these drawings without inventive labor.
FIG. 1 illustrates a block chain architecture diagram in one embodiment;
FIG. 2 shows a schematic diagram of one application scenario in which embodiments of the present specification may be applied;
FIG. 3 shows a flow diagram of a transaction execution method according to one embodiment;
fig. 4 shows a schematic structural diagram of a blockchain node according to an embodiment.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without making any creative effort shall fall within the protection scope of the present specification.
FIG. 1 illustrates a block chain architecture diagram in one embodiment. In the block chain architecture diagram shown in fig. 1, the block chain 100 includes, for example, 8 nodes. The lines between nodes schematically represent P2P (Peer to Peer) connections. The nodes may have a full ledger stored on them, i.e. the status of all blocks and all accounts. Wherein each node in the blockchain can generate the same state in the blockchain by performing the same transaction, and each node in the blockchain can store the same state database. It is to be understood that although fig. 1 illustrates 8 nodes included in the blockchain, embodiments of the present specification are not limited thereto and may include other numbers of nodes.
A transaction in the blockchain domain may refer to a unit of task that is performed in the blockchain and recorded in the blockchain. The transaction typically includes a send field (From), a receive field (To), and a Data field (Data). Where the transaction is a transfer transaction, the From field indicates the address of the account From which the transaction was initiated (i.e., from which a transfer task To another account was initiated), the To field indicates the address of the account From which the transaction was received (i.e., from which a transfer was received), and the Data field includes the transfer amount. In the case of a transaction calling an intelligent contract in a blockchain, the From field represents the account address From which the transaction was initiated, the To field represents the account address of the contract called by the transaction, and the Data field includes the name of the function in the calling contract, and Data such as incoming parameters To the function, for use in retrieving the code of the function From the blockchain and executing the code of the function when the transaction is executed.
The function of the intelligent contract can be provided in the block chain. An intelligent contract on a blockchain is a contract that can be executed by a transaction trigger on the blockchain system. An intelligent contract may be defined in the form of code. The intelligent contract is called in the Ethernet workshop, and a transaction pointing to the intelligent contract address is initiated, so that each node in the Ethernet workshop network runs the intelligent contract code in a distributed mode. It should be noted that, in addition to the creation of the smart contracts by the users, the smart contracts may also be set by the system in the creation block. This type of contract is generally referred to as a startup contract. In general, the data structure, parameters, attributes and methods of some blockchains may be set in the startup contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply referred to as a system contract). Wherein the system contract is usable to add data structures for data of different services in a blockchain.
In the scenario of contract deployment, for example, bob sends a transaction containing information to create an intelligent contract (i.e., a deployment contract) into the blockchain as shown in fig. 1, the data field of the transaction includes the code (e.g., bytecode or machine code) of the contract to be created, and the to field of the transaction is null to indicate that the transaction is for contract deployment. After the agreement is achieved among the nodes through a consensus mechanism, a contract address 0x6f8ae93 \ 8230of a contract is determined, each node adds a contract account corresponding to the contract address of the intelligent contract in a state database, allocates state storage corresponding to the contract account, and stores a contract code in the state storage of the contract, so that the contract is successfully created.
In the scenario of invoking a contract, for example, bob sends a transaction for invoking a smart contract into the blockchain as shown in fig. 1, where the from field of the transaction is the address of the account of the transaction initiator (i.e., bob), "0x6f8ae93 \8230inthe to field, which represents the address of the invoked smart contract, and the data field of the transaction includes the method and parameters for invoking the smart contract. After the transaction is identified in the blockchain, each node in the blockchain can execute the transaction respectively, so that the contract is executed respectively, and the state database is updated based on the execution of the contract.
As mentioned above, in the current blockchain technology, each participating node of the blockchain system needs to perform one transaction independently, that is, the same transaction needs to be performed once on each participating node in the blockchain system, which results in a waste of computing resources.
To this end, embodiments of the present disclosure provide a transaction execution method, so as to reduce redundancy of transaction execution in a blockchain system and reduce waste of computing resources in the blockchain system. As an example, fig. 2 shows a schematic diagram of one application scenario in which embodiments of the present specification may be applied. As shown in fig. 2, in the present application scenario, a node a may obtain a plurality of transactions Tx1, tx2, tx3, tx4, tx5 \ 8230 \8230;, txN, which are commonly identified, and a read-write set of the plurality of transactions, where the read-write set may include variables that need to be read and variables that need to be written during the execution of the transactions. Node a may group the transactions based on the read-write sets of the transactions to obtain first transaction groups, { Tx1, tx3, tx4, tx8}, { Tx2, tx5, tx11}, { Tx6, tx11, tx12}, \\8230 \8230, and the like, where the first transaction groups access different variables. That is, there is no read-write conflict for the access variables of the first transaction packets, and a change in the world state caused by execution of one packet does not affect execution of another packet. Thus, multiple first transaction packets may be executed in parallel.
Node a may obtain a target read set and a target write set resulting from node B executing the target first transaction packet { Tx2, tx5, tx11} by the trusted execution environment. The target read set may include variables to be read and variable information (e.g., variable values, hash of variable values, etc.), and the target write set may include variables to be written and variable values. Node a may verify the target read set based on the locally stored world state, and in case of passing the verification, node a may take the target read set as the execution result of the target first transaction packet { Tx2, tx5, tx11} and update the local world state according to the execution result. Thus, node a does not need to execute the transaction in the target first transaction packet { Tx2, tx5, tx11}, to obtain an execution result. Therefore, the transaction in the same transaction group does not need to be executed by all nodes, the redundancy of transaction execution in the blockchain system can be reduced, and the waste of computing resources in the blockchain system is reduced. And a plurality of first transaction groups can be executed in parallel, so that the efficiency of transaction execution can be improved.
With continued reference to FIG. 3, FIG. 3 illustrates a flow diagram of a transaction execution method according to one embodiment. The method may be performed by a first node and a second node of a blockchain system, it being understood that each node in the blockchain may perform a transaction as either the first node or the second node. As shown in fig. 3, the transaction execution method may include the following steps:
step S301, the first node groups the multiple transactions to obtain multiple first transaction groups based on the read-write sets of the multiple transactions.
In this embodiment, the first node may acquire a plurality of transactions after consensus and determine a read-write set of the plurality of transactions. The read-write set may include a read set (Rset) and a write set (Wset), the read set may include variables that need to be read during the transaction, and the write set may include variables that need to be written during the transaction. In practice, if the access variables of two transactions do not have read-write conflicts, the change in world state resulting from the execution of one of the transactions does not affect the execution of the other transaction, and therefore, the two transactions can be executed in parallel. If the access variables of the two transactions have read-write conflict, the two transactions can be executed in series. Based on the first transaction group, the first node can group the transactions based on the read-write sets of the transactions to obtain a plurality of first transaction groups. Wherein the plurality of first transaction groups access different variables. That is, there is no read-write conflict between multiple first transaction groups, and the execution of one first transaction group causes a change in the world state without affecting the execution of other first transaction groups. Multiple first transaction packets may be executed in parallel.
It will be appreciated that the read and write sets used in grouping transactions may include only the variable names of the variables, and not the specific variable values. For example, the variable name and the variable Value may be recorded in the form of a Key-Value pair. The read-write set used when the transaction is grouped may include only keys and not values. As one example, each transaction may be statically analyzed to analyze the transaction body of the transaction and the contract code of the contract invoked in the transaction to determine the account and/or variable names, i.e., keys, that each transaction needs to read and write when executed. For example, if the transaction is a transfer transaction, the read-write parameters in the transaction can be obtained according to data analysis in the transaction. If the transaction is a contract invoking transaction, the read and write parameters in the transaction can be obtained according to code analysis of the contract. As another example, it may also be that the consensus proposal node determines, by way of pre-execution, account and/or variable names that need to be read and written to at execution time for each transaction.
It can be understood that each node in the blockchain system may store the same grouping algorithm in advance, so as to ensure that the grouping result in each node is the same, that is, the transactions included in each group and the transaction sequence are the same. For a received plaintext transaction, the node may directly perform the grouping. For a received private transaction, the node first needs to decrypt in the private computing environment and then perform transaction grouping.
Step S302, the second node executes the target first transaction group through the trusted execution environment, generates a target reading set and a target writing set, and sends the target reading set and the target writing set.
In step S303, the first node obtains a target read set and a target write set generated when the second node executes the target first transaction packet through the trusted execution environment.
In this embodiment, the intelligent contract of the blockchain may be deployed in a Trusted Execution Environment (TEE) of each blockchain node, and the transaction may be executed in the Trusted Execution Environment. The first node may obtain a target read set and a target write set resulting from the second node executing respective transactions in the target first transaction group via the trusted execution environment. Here, the target read set and the target write set may contain variable names and variable values, i.e., contain keys and values. For example, the target read set may include KV pairs of variables read for the first time by multiple transactions in the target first transaction packet. The target write set may include KV pairs that will eventually be written to the database after the plurality of transactions in the target first transaction group are written. As one example, the second node may send (e.g., in a broadcast manner) the target read set and the target write set directly to the first node, i.e., the first node may obtain the target read set and the target write set directly from the second node. As another example, the second node may store the target read set and the target write set to a predetermined storage location known to each node, such that the first node may retrieve the target read set and the target write set from the storage location.
The trusted execution environment is a security area which is constructed in the central processing unit by a software and hardware method, and guarantees that programs and data loaded in the trusted execution environment are protected on confidentiality and integrity. In practice, the hardware and software resources of the system may be divided into trusted execution environments and common execution environments. The two execution environments are securely isolated, with independent internal data paths and memory space required for computation. Applications of the ordinary execution environment cannot access the TEE, and even inside the TEE, the running of a plurality of applications is independent of each other and cannot be accessed without authorization. Thus, with the input determination, the expected execution result may be obtained by the trusted execution environment. That is, the trusted execution environment has the characteristic that the input is trusted and certain credibility is output, and the correctness of the execution result of the transaction executed by the trusted execution environment can be trusted as long as the correctness of the input data of the transaction can be confirmed.
In some optional implementations, the transaction execution method may further include:
(1) and acquiring the verification information of the target reading set and the verification information of the target writing set generated by the target first transaction group.
In this implementation manner, the second node may further generate check information of the target read set, where the check information may be used to check the integrity of the target read set. For example, assuming that the target read set includes a plurality of Key-Value pairs, the second node may connect a plurality of values included in the plurality of Key-values to calculate a hash Value, and use the hash Value as the check information. Similarly, the second node may also generate verification information for the target write set, which may be used to verify the integrity of the target write set. The second node may then send the target read set and its check information together, and the target write set and its check information together. In this way, the first node acquires the target read set and the target write set and also acquires the corresponding check information.
(2) And checking the integrity of the target read set and the target write set according to the checking information.
In this implementation, after receiving the target read set and the check information thereof, the first node may check the integrity of the target read set. Specifically, a plurality of values included in a plurality of keys-values in the target reading set are connected to calculate a hash Value, the calculated hash Value is compared with the verification information of the target reading set, and if the calculated hash Value is consistent with the verification information of the target reading set, the target reading set is determined to be complete. Similarly, the first node may check the integrity of the target write set after receiving the target write set and its check information. If the integrity check of the target reading set and the target writing set is passed, the obtained target reading set and the target writing set are complete, and the problems of data loss, value tampering and the like do not exist in the data transmission process. Subsequent verification of the target read set may be performed after the integrity of the target read set and target write set is confirmed.
And step S304, the first node verifies the target reading set based on the world state.
In this embodiment, the first node may verify the acquired target reading set. Specifically, the first node may determine whether the variable value in the target read set is consistent with the variable value in the locally stored world state, and if so, the first node indicates that the verification is passed; if not, the verification is not passed. If the verification is not passed, the target read set is not trusted, and the target read set and the target write set can be discarded.
In step S305, in case of passing the verification, the first node takes the target write set as the execution result of the target first transaction packet.
In this embodiment, in the event that the target read set is validated, the first node may take the target write set as a result of execution of the target first transaction packet for updating the locally stored world state. Thus, the first node does not need to perform any more transactions in the targeted first transaction packet.
In some alternative implementations, the status of the transaction packet with the execution result may be set to executed, and the status of the transaction packet without the execution result may be set to not executed. Based on this, the transaction execution method may further include the steps of:
step one, selecting one first transaction group from the first transaction groups with the non-execution state as a first transaction group to be executed, and executing the transaction in the first transaction group to be executed in the trusted execution environment.
In this implementation, the first node may select one first transaction packet from the first transaction packets whose states are not executed as the first transaction packet to be executed in various manners, for example, a random selection manner. Thereafter, the first node may execute respective transactions in the first transaction group to be executed in the trusted execution environment.
And step two, sending the reading set and the writing set generated when the first transaction to be executed is grouped and executed.
In this implementation, the first node may send the read set and the write set generated when the first transaction to be executed is grouped and executed, so as to be verified and stored by other nodes in the blockchain system. As an example, the first node may send the read set and write set generated when the first transaction packet is to be executed directly to other nodes, e.g., in a broadcast manner. As another example, the first node may also send the read set and the write set generated when the first transaction packet is to be executed to a predetermined storage location. In this way, other nodes may pull to the storage location the read and write sets generated when the transaction packet was executed.
Through the implementation manner, the first node can select (for example, randomly select) the unexecuted first transaction group for execution, and send the read-write set generated during execution for verification and storage by other nodes. Thus, the number of unexecuted first transaction packets is reduced until the transaction packets are completely executed. In addition, a first transaction packet may be executed by multiple nodes, which may not cause the entire blockchain to stop working even if a node in the blockchain fails or acts badly.
In some alternative implementations, the plurality of transactions obtained by the first node are ordered in a sequence. Based on this, the grouping of the multiple transactions to obtain multiple first transaction groups based on the read-write sets of the multiple transactions may be implemented as follows:
1) And for a plurality of first transactions which are arranged in the front and have a preset proportion, grouping the plurality of first transactions according to the read-write sets of the plurality of first transactions to obtain a plurality of first transaction groups.
2) The remaining transactions are divided into a second transaction group.
For example, the first N% (e.g., 90%) transactions may be used as the first transactions, and the first transactions may be grouped according to the read-write sets of the first transactions, so as to obtain a plurality of first transaction groups. And the plurality of first transaction groups obtained by grouping have no read-write conflict, and can be executed in parallel.
Thereafter, the remaining transactions, i.e., the transactions arranged in the last (100-N)%, are divided into the same group, which is taken as the second transaction group. There may be read and write collisions between the second transaction packet and the first transaction packet, and therefore, the first transaction packet and the second transaction packet are executed serially. Specifically, after all of the plurality of first transaction groups are executed, the second transaction group is executed. It can be appreciated that after grouping, the precedence relationship of the transactions within each transaction group is the same as before grouping. For example, assume that transaction TxA precedes transaction TxB before the packet, and after the packet, transaction TxA and transaction TxB are grouped into the same transaction packet in which transaction TxA still precedes transaction TxB. With the present implementation, the plurality of transactions may be divided into a first transaction group and a second transaction group.
Optionally, the transaction execution method may further include the following steps:
a) In response to determining that the states of the plurality of first transaction packets are all executed, the first node may further determine whether a read set and a write set generated by other nodes executing the second transaction packet through the trusted execution environment are obtained.
b) If the read set and the write set generated by the other nodes executing the second transaction group through the trusted execution environment are acquired, the first node may verify the acquired read set of the second transaction group based on the locally stored world state, and if the verification passes, take the acquired write set of the second transaction group as an execution result of the second transaction group to update the locally stored world state. Thus, the first node does not need to perform the second transaction packet any more.
c) If the read set and the write set generated by the other nodes executing the second transaction packet through the trusted execution environment are not acquired, the first node may execute the transaction in the second transaction packet in the trusted execution environment.
d) The first node may transmit the read set and the write set generated when the second transaction packet is executed. For example, the information is sent to other nodes in a broadcast manner, or sent to a preset storage position for other nodes to obtain.
Referring back to the above process, in the embodiment of the present specification, first, based on the read-write sets of multiple transactions, multiple transactions are grouped to obtain multiple first transaction groups, and the multiple first transaction groups access different variables, so that the multiple first transaction groups can be executed in parallel. Based on the above, the first node may obtain a target read set and a target write set generated by the second node executing the target first transaction packet through the trusted execution environment, and verify the target read set based on the world state, and in a case that the verification is passed, take the target write set as an execution result of the target first transaction packet. Since the target write set is generated by the trusted execution environment of the second node, the trusted execution environment can guarantee the security, the authentication and the integrity of the internal code thereof. Therefore, in the case of input determination, the expected execution result may be obtained by the trusted execution environment. Thus, in the event that the target read set validation passes, the target write set obtained by the trusted execution environment is trusted. The first node may store the target write set locally as a result of execution of the target first transaction packet without locally executing the transaction in the target first transaction packet. Therefore, the redundancy of transaction execution in the blockchain system can be reduced, and the waste of computing resources in the blockchain system is reduced. And a plurality of first transaction groups can be executed in parallel, so that the transaction execution efficiency is improved.
According to an embodiment of another aspect, a block link point is provided. Fig. 4 shows a block chain node according to an embodiment. As shown in fig. 4, the block link point 400 includes: a grouping unit 401 configured to group the transactions to obtain a plurality of first transaction groups based on read-write sets of the transactions, where the first transaction groups access different variables; an obtaining unit 402, configured to obtain a target read set and a target write set generated by a second node executing a target first transaction packet through a trusted execution environment; a verification unit 403 configured to verify the target reading set based on the world state; and a result determining unit 404 configured to take the target write set as an execution result of the target first transaction group if the verification passes.
In some optional implementations of this embodiment, the transaction packet with the execution result is in an executed state, the transaction packet without the execution result is in an unexecuted state, and the blockchain node 400 further includes: an execution unit (not shown in the figure), configured to select one first transaction packet from the first transaction packets whose states are not executed as a first transaction packet to be executed, and execute the transaction in the first transaction packet to be executed in the trusted execution environment; and a sending unit (not shown in the figure) configured to send the read set and the write set generated when the first transaction packet to be executed is executed.
In some optional implementations of this embodiment, the sending unit is further configured to: and sending the read set and the write set generated when the first transaction group to be executed is executed to other nodes or a preset storage position.
In some optional implementations of this embodiment, the obtaining unit 402 is further configured to: and acquiring a target reading set and a target writing set generated by the second node executing the target first transaction group through the trusted execution environment from the second node or a preset storage position.
In some optional implementations of this embodiment, the block link point 400 further includes: an information obtaining unit (not shown in the figure) configured to obtain the verification information of the target read set and the verification information of the target write set generated by the target first transaction packet; a checking unit (not shown in the figure) configured to check the integrity of the target read set and the target write set according to the checking information.
In some optional implementations of this embodiment, the transactions are arranged in sequence, and the grouping unit 401 is further configured to: for a plurality of first transactions which are arranged in the front and have a preset proportion, grouping the plurality of first transactions according to the read-write sets of the plurality of first transactions to obtain a plurality of first transaction groups; the remaining transactions are divided into a second transaction group.
In some optional implementations of this embodiment, the block link point 400 further includes: a determining unit (not shown in the figure), configured to determine, in response to determining that the states of the plurality of first transaction packets are executed, whether a read set and a write set generated by other nodes executing the second transaction packet through a trusted execution environment are acquired; a verification and determination unit (not shown in the figure) configured to verify the read set of the second transaction group based on the world state if the read set is obtained, and if the read set passes the verification, take the write set of the second transaction group as the execution result of the second transaction group; a second transaction group execution unit (not shown in the figure), configured to execute the transactions in the second transaction group in the trusted execution environment if the transactions are not acquired; and a read/write set sending unit (not shown in the figure) configured to send the read set and the write set generated when the second transaction packet is executed.
According to an embodiment of another aspect, there is also provided a computer-readable storage medium having stored thereon a computer program, which, when executed in a computer, causes the computer to perform the method described in fig. 3.
According to an embodiment of still another aspect, there is also provided a computing device including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in fig. 3.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a server system. Of course, this application does not exclude that with future developments in computer technology, the computer implementing the functionality of the above described embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device or a combination of any of these devices.
Although one or more embodiments of the present description provide method operational steps as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive approaches. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When implemented in an actual device or end product, can be executed sequentially or in parallel according to the methods shown in the embodiments or figures (e.g., parallel processor or multi-thread processing environments, even distributed data processing environments). The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in processes, methods, articles, or apparatus that include the recited elements is not excluded. For example, if the terms first, second, etc. are used to denote names, they do not denote any particular order.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, when implementing one or more of the present description, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, etc. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
One skilled in the art will appreciate that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points. In the description of the specification, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the specification. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
The above description is merely exemplary of one or more embodiments of the present disclosure and is not intended to limit the scope of one or more embodiments of the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement made within the spirit and principle of the present specification shall be included in the scope of the claims.

Claims (10)

1. A transaction execution method applied to a first node of a blockchain, the method comprising:
grouping the transactions based on the read-write sets of the transactions to obtain a plurality of first transaction groups, wherein the first transaction groups access different variables;
acquiring a target reading set and a target writing set generated by a second node executing a target first transaction group through a trusted execution environment;
verifying the target reading set based on the world state;
and in the case of passing the verification, taking the target write set as the execution result of the target first transaction group.
2. The method of claim 1, wherein the status of a transaction packet with an execution result is executed and the status of a transaction packet without an execution result is not executed, and further comprising:
selecting one first transaction group from the first transaction groups in the state of non-execution as a first transaction group to be executed, and executing the transaction in the first transaction group to be executed in the trusted execution environment;
and sending the read set and the write set generated when the first transaction group to be executed is executed.
3. The method of claim 2, wherein transmitting the read set and the write set generated upon execution of the first transaction group to be executed comprises:
and sending the read set and the write set generated during the execution of the first transaction group to be executed to other nodes or sending the read set and the write set to a preset storage position.
4. The method of claim 1, wherein the obtaining of the target read set and the target write set generated by the second node executing the target first transaction packet via the trusted execution environment comprises:
and acquiring a target reading set and a target writing set generated by the second node executing the target first transaction group through the trusted execution environment from the second node or a preset storage position.
5. The method of claim 1, wherein the method further comprises:
acquiring the verification information of the target reading set and the verification information of the target writing set generated by the target first transaction group;
and checking the integrality of the target reading set and the target writing set according to the checking information.
6. The method of claim 1, wherein the plurality of transactions are arranged in a sequence, and wherein the grouping the plurality of transactions into a plurality of first transaction groups based on the read-write sets of the plurality of transactions comprises:
for a plurality of first transactions which are arranged at the front and have a preset proportion, grouping the plurality of first transactions according to the read-write sets of the plurality of first transactions to obtain a plurality of first transaction groups;
the remaining transactions are divided into a second transaction group.
7. The method of claim 6, wherein the method further comprises:
in response to determining that the states of the plurality of first transaction packets are executed, determining whether a read set and a write set generated by other nodes executing the second transaction packet through a trusted execution environment are acquired;
if the transaction group is acquired, verifying the acquired read set of the second transaction group based on the world state, and taking the acquired write set of the second transaction group as an execution result of the second transaction group under the condition that the verification is passed;
if not, executing the transaction in the second transaction group in a trusted execution environment;
and transmitting the reading set and the writing set generated when the second transaction group is executed.
8. A block link point, comprising:
the grouping unit is configured to group the transactions to obtain a plurality of first transaction groups based on the read-write sets of the transactions, and the first transaction groups access different variables;
the acquisition unit is configured to acquire a target reading set and a target writing set generated by the second node executing the target first transaction group through the trusted execution environment;
a verification unit configured to verify the target readset based on a world state;
and the result determining unit is configured to take the target write set as the execution result of the target first transaction group when the verification is passed.
9. A computer-readable storage medium, on which a computer program is stored which, when executed in a computer, causes the computer to carry out the method of any one of claims 1-7.
10. A block link point comprising a memory and a processor, wherein the memory has stored therein executable code, and wherein the processor, when executing the executable code, implements the method of any one of claims 1-7.
CN202211346010.1A 2022-10-31 2022-10-31 Transaction execution method and block link point Pending CN115714652A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211346010.1A CN115714652A (en) 2022-10-31 2022-10-31 Transaction execution method and block link point
PCT/CN2022/135423 WO2024092932A1 (en) 2022-10-31 2022-11-30 Transaction execution method and blockchain node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211346010.1A CN115714652A (en) 2022-10-31 2022-10-31 Transaction execution method and block link point

Publications (1)

Publication Number Publication Date
CN115714652A true CN115714652A (en) 2023-02-24

Family

ID=85231791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211346010.1A Pending CN115714652A (en) 2022-10-31 2022-10-31 Transaction execution method and block link point

Country Status (2)

Country Link
CN (1) CN115714652A (en)
WO (1) WO2024092932A1 (en)

Also Published As

Publication number Publication date
WO2024092932A1 (en) 2024-05-10

Similar Documents

Publication Publication Date Title
CN113743941B (en) Method for executing transaction in block chain, block chain and main node
CN110245942B (en) Receipt storage method and node combining user type and judgment condition
CN113743940B (en) Method for executing transaction in block chain, main node and slave node
CN113743950B (en) Method, node and blockchain system for performing transactions in blockchain system
CN110704438B (en) Method and device for generating bloom filter in blockchain
CN114827165B (en) Method and block link point for grouping multiple transactions
WO2024001024A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
WO2023160083A1 (en) Method for executing transactions, blockchain, master node, and slave node
WO2023231335A1 (en) Method for executing transaction in blockchain, and master node of blockchain
CN114547203A (en) Method for executing transaction, block chain, main node and slave node
WO2023231337A1 (en) Method for executing transaction in blockchain, and master node and slave node of blockchain
CN113744063B (en) Method and device for executing transaction in block chain
CN109376988B (en) Service data processing method and device
CN113935737A (en) Random number generation method and device based on block chain
CN116933886B (en) Quantum computing execution method, quantum computing execution system, electronic equipment and storage medium
WO2024001032A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
CN114785800A (en) Cross-link communication method and device
CN116032756A (en) Method for updating configuration information of application program based on block chain and block chain link point
CN115714652A (en) Transaction execution method and block link point
CN115658357A (en) Method and apparatus for replaying blockchain transactions
CN114968422A (en) Method and device for automatically executing contracts based on variable state
CN115129728A (en) File checking method and device
CN115098114A (en) Block chain-based distributed application deployment method and device
CN114612238A (en) Method and device for returning block chain transaction execution result
CN117808476A (en) Transaction processing method in block chain system and block chain link point

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination