WO2024066005A1 - 重放区块链交易的方法及装置 - Google Patents

重放区块链交易的方法及装置 Download PDF

Info

Publication number
WO2024066005A1
WO2024066005A1 PCT/CN2022/135240 CN2022135240W WO2024066005A1 WO 2024066005 A1 WO2024066005 A1 WO 2024066005A1 CN 2022135240 W CN2022135240 W CN 2022135240W WO 2024066005 A1 WO2024066005 A1 WO 2024066005A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
blockchain
target
block
plug
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.)
Ceased
Application number
PCT/CN2022/135240
Other languages
English (en)
French (fr)
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
Publication of WO2024066005A1 publication Critical patent/WO2024066005A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance

Definitions

  • the embodiments of this specification belong to the field of blockchain technology, and more particularly, to a method and device for replaying blockchain transactions.
  • Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
  • data blocks are combined into a chain data structure in a sequential manner according to time order, and a distributed ledger that cannot be tampered with or forged is guaranteed by cryptography.
  • Users can communicate through blockchain nodes to participate in blockchain-related transactions. For example, multiple blockchain nodes corresponding to different users in the blockchain network can perform secure multi-party computation (SMPC) on the private data of a certain node based on privacy technologies such as homomorphic encryption and zero-knowledge proof.
  • SMPC secure multi-party computation
  • each blockchain node In a normally operating blockchain network, each blockchain node maintains the same blockchain ledger, that is, there is only one blockchain in the entire blockchain network. However, in abnormal situations such as errors in the code of blockchain transactions or smart contracts, or large differences in the computing performance of blockchain nodes, the execution of a blockchain transaction may cause the above blockchain to split into multiple blockchains starting from a certain block, that is, a blockchain fork occurs. At this time, the blocks maintained by each blockchain node are different, which affects the normal operation of the blockchain network and even brings security risks such as privacy leakage.
  • the operation and maintenance personnel of the blockchain network need to locate the transaction that caused the fork, and analyze the cause of the fork by viewing the transaction-related data of the transaction.
  • the operation and maintenance personnel of the blockchain network need to find the transaction-related data corresponding to the transaction that caused the fork in the log file generated during the transaction execution process, and then determine the cause of the fork by analyzing the above log. Since the number and types of log files generated by blockchain nodes during the transaction execution process are complex and the amount of data is often large, it often takes a lot of time and effort for the operation and maintenance personnel to find the above transaction-related data by themselves. The process of troubleshooting the cause of the fork is cumbersome, and the overall troubleshooting efficiency needs to be improved urgently.
  • the purpose of the present disclosure is to provide a method and device for replaying blockchain transactions.
  • a method for replaying blockchain transactions is proposed, which is applied to any blockchain node in a blockchain network, and the method includes: when it is determined that the blockchain ledger corresponding to the blockchain network is forked into multiple parallel blockchains, determining the target blockchain transaction that causes the fork, and the target blockchain transaction is respectively recorded in the first forked blocks of the multiple parallel blockchains; obtaining the target blockchain transaction from the first forked block and replaying the target blockchain transaction, and outputting transaction-related data involved in the replay process, and the transaction-related data is used to analyze the cause of the fork.
  • a device for replaying blockchain transactions which is applied to any blockchain node in a blockchain network, and the device includes: a transaction determination unit, which is used to determine the target blockchain transaction that causes the fork when it is determined that the blockchain ledger corresponding to the blockchain network is forked into multiple parallel blockchains, and the target blockchain transaction is recorded in the first forked blocks of the multiple parallel blockchains respectively; a transaction replay unit, which is used to obtain the target blockchain transaction from the first forked block and replay the target blockchain transaction, and output transaction-related data involved in the replay process, and the transaction-related data is used to analyze the cause of the fork.
  • an electronic device including: a processor;
  • a memory for storing processor-executable instructions; wherein the processor implements the method as described in any one of the first aspect and the second aspect by executing the executable instructions.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in any one of the first aspect and the second aspect are implemented.
  • any blockchain node in the blockchain network determines the target blockchain transaction that causes the fork when a fork occurs, then obtains the transaction and replays it, and then outputs the transaction-related data involved in the replay process to the user (such as the operation and maintenance personnel of the blockchain network). It can be seen that the embodiment of the first aspect realizes targeted replay for the target transaction that causes the fork, so that the transaction-related data of the transaction can be provided to the user.
  • the blockchain node automatically determines the target blockchain transaction that caused the fork and replays it, and directly outputs the transaction-related data corresponding to the target blockchain transaction to the user, without the user having to obtain the data by analyzing complicated log files.
  • This improves the automation level of the transaction-related data acquisition process, greatly reduces the user's workload, and simplifies the logic and steps of the fork cause troubleshooting process, which helps to improve the troubleshooting efficiency.
  • FIG. 1 is a flow chart of a method for replaying blockchain transactions provided by an exemplary embodiment.
  • FIG2 is a schematic diagram of a blockchain network and its forking process provided by an exemplary embodiment.
  • FIG3 is an interactive process of a method for replaying blockchain transactions provided by an exemplary embodiment.
  • FIG. 4 is a schematic diagram of the structure of a device provided by an exemplary embodiment.
  • FIG5 is a block diagram of an apparatus for replaying blockchain transactions provided by an exemplary embodiment.
  • Figure 1 is a flow chart of a method for replaying blockchain transactions provided by an exemplary embodiment. As shown in Figure 1, the method is applied to any blockchain node in the blockchain network and may include the following steps 102-104.
  • Step 102 when it is determined that the blockchain ledger corresponding to the blockchain network is forked into multiple parallel blockchains, determine the target blockchain transaction that causes the fork, and the target blockchain transaction is respectively recorded in the first forked blocks of the multiple parallel blockchains.
  • the blockchain network described in the embodiment of the present disclosure may have forks.
  • the fork situation of the blockchain network is exemplarily introduced in conjunction with Figure 2.
  • the blockchain network 201 includes multiple blockchain nodes, such as node A, node B, node C and node D.
  • the embodiment of the present disclosure does not limit the number of nodes in the blockchain network and the internal structure of the network.
  • each of the above-mentioned nodes maintains a blockchain account book of the blockchain network.
  • the node locally maintains each block that has been agreed upon during its participation in the operation of the blockchain network, and the chain structure formed by these blocks is the blockchain account book maintained by the node.
  • the blockchain ledger of the network is forked into multiple parallel blockchains.
  • the forked blockchain ledger 202 includes two parallel blockchains, namely Ledger1 and Ledger2.
  • the arrows between adjacent blocks are used to represent the generation order between the two blocks.
  • the arrow between block 1 and block 2 represents that block 1 is generated before block 2, and block 1 is the parent block of block 2.
  • the header of block 2 records the block hash (Hash) of block 1.
  • Other blocks are similar and will not be repeated.
  • each block in the blockchain ledger shown in Figure 2 The solid arrows between any two adjacent blocks are used to indicate that these two blocks are on-chain blocks that have been on-chain through the consensus process at the current moment, such as the normal block ⁇ 3, block 4.1 and block 4.2 in the figure are all on-chain blocks at the current moment; and the blocks connected by the starting point of the dotted arrow are the current blocks to be agreed upon at the current moment (not yet on-chain), such as block 5.1 and block 5.2 are both current blocks at the current moment.
  • Ledger1 contains normal blocks (i.e. normal blocks ⁇ 3) and forked blocks (i.e.
  • Ledger2 contains normal blocks (i.e. normal blocks ⁇ 3) and forked blocks (i.e. block 5.1).
  • the first forked block generated in the block sequence is the first forked block of the parallel blockchain, such as the first forked block of Ledger1 is block 4.1, and the first forked block of Ledger2 is block 4.2.
  • the transaction content contained in the first forked blocks of different parallel blockchains is usually the same, but the transaction data such as transaction receipts are not the same.
  • the last block on the chain is the latest block on the chain, which is hereby explained.
  • each parallel blockchain after forking will be maintained by different blockchain nodes in the blockchain network.
  • nodes A and B shown in Figure 2 respectively maintain Ledger1
  • nodes C and D respectively maintain Ledger2, etc.
  • the blockchain ledger in the blockchain network can also be forked into 3 or even more parallel blockchains, and any parallel blockchain can be maintained by at least one blockchain node in the blockchain network, which is not limited in the embodiments of the present disclosure.
  • the following embodiments are illustrative examples using the scenario shown in Figure 2 as an example.
  • any blockchain node may also receive a judgment result on whether the blockchain ledger has forked from a client or other blockchain node to which it is connected, thereby determining whether the blockchain ledger has forked into multiple parallel blockchains based on the judgment result.
  • the blockchain node may also find that the blockchain ledger is bifurcated when participating in the block consensus. For example, any blockchain node may obtain the parent hash of the current block provided by any other blockchain node during the consensus process for the current block (block 5.1 and block 5.2 as shown in FIG. 2); then compare the parent hash with the block hash of the latest block on the chain maintained by itself, and in the case of inconsistency between the two, it can be determined that the blockchain ledger corresponding to the blockchain network is bifurcated into multiple parallel blockchains. In fact, in the case of inconsistency between the two, it can be determined at the same time that any blockchain node and any other blockchain node respectively maintain blocks belonging to different parallel blockchains.
  • any other blockchain node can be any node in the blockchain network that is different from any blockchain node.
  • the block header of the current block generated by any other blockchain node records the hash of the latest block on the chain maintained by the node, that is, the hash of the latest block on the chain maintained by itself is used as the parent hash of the current block.
  • the parent hash of the current block provided by any other blockchain node is the hash of the latest block on the chain maintained by the node. Based on this, any blockchain node can extract the parent hash of the block from the received block header of the current block.
  • the parent hash is inconsistent with the block hash of the latest block on the chain maintained by any blockchain node itself, it means that the current latest block maintained by any blockchain node is different from the current latest block maintained by any other blockchain node, such as the execution results of at least some transactions in the block, so it can be determined that the blockchain ledger has a fork.
  • the parent hash is consistent with the block hash of the latest block on the chain maintained by any blockchain node, it can be determined that the blockchain ledger has not been forked.
  • the unknown failure may cause different execution results of at least one transaction (different transaction receipts), resulting in inconsistent block hashes of the block (called the latest block on the chain after completion of the chain) maintained by the two nodes, which leads to a fork in the blockchain ledger.
  • the latest block on the chain after completion of the chain maintained by the two nodes, which leads to a fork in the blockchain ledger.
  • the block hashes of the latest blocks on their respective chains are inconsistent, thus discovering a fork in the blockchain ledger.
  • any blockchain node may directly determine the latest block on the chain as the first forked block corresponding to the blockchain ledger.
  • a node that maintains a parallel blockchain different from the parallel blockchain maintained by itself may be requested to obtain the block hash of at least part of the blocks it maintains, such as the block hash of the latest block on the chain and a preset number of blocks before it, and then compare the above block hashes with the block hashes of the corresponding blocks maintained locally one by one in the order of blocks, and in the case where the two block hashes corresponding to any block are different, the block is determined as the first forked block.
  • any blockchain node may further determine the target blockchain transaction that causes the fork. For example, it is possible to first determine each first-class transaction receipt generated by each transaction in the first forked block of the first parallel blockchain executed by any blockchain node, and obtain each second-class transaction receipt generated by each transaction in the first forked block of the second parallel blockchain executed by any other blockchain node; then compare the first-class transaction receipt and the second-class transaction receipt corresponding to each transaction, and in the case that the first-class transaction receipt and the second-class transaction receipt of any transaction are inconsistent, determine the transaction as the target blockchain transaction that causes the fork.
  • the first-class transaction receipt of any transaction is generated by the execution of the transaction by any blockchain node
  • the second-class transaction receipt is generated by the execution of the transaction by any blockchain node. Therefore, if the first-class transaction receipt and the second-class transaction receipt of any transaction are different, it means that the results of the execution of the transaction by the two nodes are different, resulting in different first forked blocks containing the transaction, so it can be determined that the transaction caused the blockchain ledger to fork.
  • any transaction-related data such as transaction codes and transaction accounts can also be compared, and the embodiments of the present disclosure are not limited to this.
  • any blockchain node can correspondingly determine the block where the blockchain node causing the bifurcation is located, that is, the first bifurcation block maintained by itself.
  • any blockchain node can pre-replay the first bifurcation block maintained by itself to obtain the first type of transaction receipt for each transaction therein; in addition, other blockchain nodes can pre-replay the first bifurcation block maintained by themselves to obtain the second type of transaction receipt for each transaction therein, and then any blockchain node can obtain the above-mentioned second type of transaction receipt from other blockchain nodes.
  • the first type of transaction receipt and the second type of transaction receipt of each transaction can be compared: if the first type of transaction receipt and the second type of transaction receipt of any transaction are inconsistent, it means that the transaction is the target blockchain transaction that caused the bifurcation.
  • any blockchain node can record the transaction hash of the target blockchain transaction so that the target blockchain transaction can be replayed in a targeted manner through the transaction hash later.
  • any blockchain node will execute all transactions in the first forked transaction to obtain the transaction receipts of each transaction.
  • any blockchain node only needs to execute the target blockchain transaction to obtain the transaction-related data involved in the replay process (of course, if necessary, the predecessor transaction of the target blockchain transaction can also be executed and the corresponding transaction-related data can be obtained).
  • the above pre-replay process is a replay of multiple first forked blocks (all transactions in them), the purpose of which is to obtain the transaction receipts of each transaction, so as to determine the target blockchain transaction that caused the fork by comparing the transaction receipts.
  • the pre-replay process may be called block replay; and the subsequent targeted replay is only for the target blockchain transaction (and its predecessor transaction) determined in the previous process, the purpose of which is to obtain the transaction-related data of the transaction, and the replay may be called transaction replay.
  • any blockchain node After determining the target blockchain transaction in the above manner, any blockchain node can obtain the transaction hash of the target blockchain transaction.
  • the above manner may determine at least one target blockchain transaction, and the transaction hash of each target blockchain node can be used to uniquely identify the transaction.
  • Step 104 obtaining the target blockchain transaction from the first forked block and replaying the target blockchain transaction, and outputting transaction-related data involved in the replay process, wherein the transaction-related data is used to analyze the cause of the fork.
  • any blockchain node After determining the target blockchain transaction that causes the fork, any blockchain node can obtain the transaction from the first forked block and replay it. Since the target blockchain transaction is a transaction that has been completed on the chain, the transaction has been executed at least once before the current moment, so the replay of the target blockchain transaction (or replaying the target blockchain transaction) described in the present disclosure can be understood as re-executing the target blockchain transaction.
  • any blockchain node in the blockchain network determines the target blockchain transaction that causes the fork when a fork occurs, then obtains the transaction and replays it, and then outputs the transaction-related data involved in the replay process to the user (such as the operation and maintenance personnel of the blockchain network). It can be seen that the embodiment of the first aspect realizes targeted replay for the target transaction that causes the fork, so that the transaction-related data of the transaction can be provided to the user.
  • this solution provides a simple and easy-to-operate solution for collecting blockchain node fork information, without the need for users to obtain the data by analyzing complicated log files. It improves the automation level of the transaction-related data acquisition process, greatly reduces the user's workload, and simplifies the logic and steps of the fork cause troubleshooting process, which helps to improve the troubleshooting efficiency.
  • any of the blockchain nodes can replay the target blockchain transaction locally.
  • any of the blockchain nodes can obtain the target blockchain transaction from the first forked block of the first parallel blockchain maintained locally, and execute the obtained target blockchain transaction.
  • the node can query and obtain the target blockchain transaction according to the transaction hash in the first forked block maintained locally, and specifically, can obtain data such as the transaction content of the transaction.
  • node A can obtain the target blockchain transaction from the locally maintained block 4.1, and then execute the transaction locally. In this way, any of the blockchain nodes can re-execute the target blockchain transaction locally, that is, realize the local replay of the target blockchain transaction.
  • any blockchain node may also remotely replay (or replay in a different place) the target blockchain transaction.
  • any blockchain node may provide the target blockchain transaction to other blockchain nodes so that the target blockchain transaction is executed by the other blockchain nodes; accordingly, the transaction-related data returned by the other blockchain nodes may be received.
  • the other blockchain nodes are nodes other than any blockchain node in the blockchain network, and any blockchain node may provide the target blockchain transaction to at least one other blockchain node for replay, such as providing the target blockchain transaction to any other blockchain node mentioned in the aforementioned embodiment, or providing the target blockchain transaction to the management node in the blockchain network (when any J is not a management node), etc., which will not be described in detail.
  • node A may provide the target blockchain transaction to node C and/or D so that node C and/or D may execute the transaction locally.
  • any blockchain node may re-execute the target blockchain transaction at other blockchain nodes, i.e., remote replay of the target blockchain transaction is achieved.
  • the parallel blockchain maintained by the other blockchain nodes may be the same as or different from the parallel blockchain maintained by any of the blockchain nodes.
  • the second parallel blockchain to which the on-chain blocks maintained by the other blockchain nodes belong may be different from the first parallel blockchain to which the on-chain blocks maintained by any of the blockchain nodes belong.
  • the other blockchain nodes maintain parallel blockchains different from those of the any of the blockchain nodes.
  • the second parallel blockchain to which the on-chain blocks maintained by the other blockchain nodes belong may also be the same as the first parallel blockchain to which the on-chain blocks maintained by any of the blockchain nodes belong.
  • the other blockchain nodes maintain the same parallel blockchain as those of the any of the blockchain nodes.
  • node A when any one of the blockchain nodes is node A (the Ledger1 maintained by it is the first parallel blockchain), node A can use node B (which maintains Ledger1) as the other blockchain node. At this time, any one of the blockchain nodes and the other blockchain nodes both maintain the first parallel blockchain; and/or, node A can also use node C and/or D (respectively maintaining Ledger2 as the second parallel blockchain) as the other blockchain nodes. At this time, any one of the blockchain nodes and the other blockchain nodes both maintain the second parallel blockchain.
  • the multiple other blockchain nodes may include nodes that maintain the first parallel blockchain (the same as any one of the blockchain nodes), and may also include nodes that maintain the second parallel blockchain (different from any one of the blockchain nodes).
  • any other blockchain node that obtains the target blockchain transaction provided by any one of the blockchain nodes
  • any one of the blockchain nodes can achieve remote replay of the target blockchain transaction through a variety of different types of blockchain nodes, thereby satisfying more diverse replay scenarios.
  • any blockchain node can provide the target blockchain transaction to the other blockchain nodes in a variety of ways.
  • the target blockchain transaction obtained locally can be sent to other blockchain nodes, and the target blockchain transaction locally saved by any blockchain node can be directly executed by other blockchain nodes, which helps to ensure that the executed transaction is indeed the target blockchain transaction, thereby ensuring the accuracy of replay.
  • any blockchain node can also send the transaction hash of the target blockchain transaction to other blockchain nodes, so that the other blockchain nodes can query the target blockchain transaction in the first forked block of the parallel blockchain maintained locally according to the transaction hash.
  • the other nodes can query and obtain the target blockchain transaction according to the transaction hash in the first forked block maintained locally, and specifically, the transaction content and other data of the transaction can be obtained.
  • any blockchain node can be replayed locally or remotely, and obtain transaction-related data corresponding to the corresponding replay process.
  • the transaction-related data may include at least one of the following.
  • the account address associated with the target blockchain transaction For example, if the target blockchain transaction is a transfer transaction, the transaction can be associated with the account address of the payer account and the account address of the recipient account; if the target blockchain transaction is a transaction to create an account, the transaction can be associated with the account address of the newly created account; if the target blockchain transaction is a transaction to call a smart contract (or contract transaction), the transaction can be associated with the account address of the contract account of the called contract.
  • the method name and method parameters of the method called by the target blockchain transaction can be associated with the method name of the method and the method parameters involved in the calling process (i.e., the input parameters of the method).
  • the original code, execution results, etc. of the method can also be associated.
  • the above-mentioned target blockchain transaction can call at least one method, and in the case of calling multiple methods, any blockchain node can obtain the method name, method parameters, original code and/or execution results of each of the above methods, which will not be repeated.
  • the above-mentioned method called can be included in a smart contract, that is, the blockchain node needs to call a smart contract to execute the target blockchain transaction.
  • the target blockchain transaction calls the contract address, contract method, input parameter and/or contract code file information of the smart contract.
  • the transaction can be associated with the contract address, contract method, input parameter and/or contract code file information of the smart contract.
  • the above-mentioned target blockchain transaction can call at least one smart contract, and in the case of calling multiple smart contracts, any blockchain node can obtain the contract address, contract method, input parameter and/or contract code file information of each smart contract called, and will not be repeated. It can be understood that for platform contracts that do not call smart contracts, the transaction-related data involved in the replay process does not include any of the contract address, contract method, input parameter and contract code file information of the smart contract.
  • the read/write set generated by any blockchain node executing the read/write operation related to the target blockchain transaction may involve read/write operations, such as reading the world state before the transaction is executed, writing the transaction execution result, etc.
  • the set consisting of the data corresponding to the above read/write operations i.e., the data read and/or written
  • any blockchain node or the other blockchain nodes can determine and obtain the above read/write set by querying the world state before and after executing the target blockchain transaction.
  • each transaction in the first forked block is executed in sequence by the corresponding blockchain nodes in a certain order (i.e., the execution order), and the target blockchain transaction may not be the first to be executed.
  • the first forked block i.e., the block to which the target blockchain transaction belongs
  • the first forked block may contain at least one preceding transaction whose execution order is before the target blockchain transaction, and at this time, any blockchain node may execute the at least one preceding transaction and the target blockchain transaction in sequence according to the execution order.
  • the preceding transaction may be at least part of the transaction that is before the target blockchain transaction according to the execution order (i.e., at least part of the transaction that is contained in the first forked block and executed before the target blockchain transaction).
  • the target blockchain transaction depends on (such as the execution of the target blockchain transaction requires calling a smart contract created by a contract creation transaction), and there may also be transactions that the target blockchain transaction does not depend on (irrelevant to the target blockchain transaction).
  • the above-mentioned transactions that the target blockchain transaction depends on can be used as its predecessor transactions to reduce the number of predecessor transactions that need to be executed, reduce the workload of replay, and improve the replay efficiency for the target blockchain transaction.
  • any blockchain node may also replay the block, that is, re-execute all transactions in the block in sequence.
  • the block replay scheme can be found in the embodiment corresponding to FIG. 4 below, which will not be described here.
  • any blockchain node can first determine the previous block of the first forked block and the world state corresponding to the block in the blockchain ledger, and then execute the target blockchain transaction based on the world state.
  • Any blockchain node in the blockchain node disclosed in the present disclosure may include multiple plug-ins, and any plug-in is a functional module for implementing a specific function.
  • any plug-in is a functional module for implementing a specific function.
  • any blockchain node may include a service plug-in (service_plugin), a pre-verification plug-in (pre_verity_plugin), a chain plug-in (chain_plugin) and an execution plug-in (exec_plugin), wherein the chain plug-in can be used to manage the historical transactions executed by the execution plug-in.
  • the pre-verification plug-in can first obtain the target blockchain transaction managed by the chain plug-in, and send the target blockchain transaction to the execution plug-in for execution.
  • any blockchain node also includes a storage plug-in (storage_plugin)
  • the plug-in can be used to store each chain block in the current parallel blockchain, and the chain plug-in can call the storage plug-in to obtain the target blockchain transaction.
  • the pre-verification plug-in can determine the transaction-related data involved in the replay process, and output the transaction-related data through the service plug-in. At this time, the replay of the target blockchain transaction is completed through the cooperation of the above-mentioned plug-ins.
  • the execution plug-in can directly complete the execution of the transaction based on the data contained in the transaction.
  • the target blockchain transaction is a contract transaction that requires calling a smart contract
  • the execution plug-in can call the virtual machine plug-in to execute the above-mentioned contract transaction.
  • the execution plug-in can call and execute the smart contract through the virtual machine plug-in; and, receive the contract execution data generated by the execution of the smart contract returned by the virtual machine plug-in, and forward the data to the pre-verification plug-in as the transaction-related data.
  • any blockchain node can replay the contract transaction with more complex execution logic through the internally set virtual machine plug-in, avoiding execution errors while improving transaction execution efficiency to a certain extent.
  • the specific process of the above-mentioned plug-ins cooperating with each other to realize the replay of the target blockchain transaction can be referred to the detailed record of the embodiment corresponding to Figure 3 below, which will not be repeated here.
  • the above-mentioned plug-ins can also be deployed in other blockchain nodes for replaying the target blockchain transaction, and the above-mentioned plug-ins obtain the target blockchain transaction provided by any of the blockchain nodes and execute the transaction.
  • the specific process is no different from the process of the various plug-ins in any of the blockchain nodes cooperating with each other to execute the target blockchain transaction, and will not be repeated here.
  • any blockchain node can output the data to the user.
  • the transaction-related data may also include data corresponding to the at least one preceding transaction, which will not be repeated.
  • the transaction-related data may be sent to a client or management device corresponding to any blockchain node, so that the client or the management device can display the transaction-related data to the user.
  • the client or the management device may be connected to any blockchain node.
  • the user is the user of the client or the management device, such as the operation and maintenance personnel of the blockchain network or the ordinary user corresponding to any blockchain node.
  • FIG3 is an interactive flow of a method for replaying blockchain transactions provided by an exemplary embodiment.
  • any blockchain node may include a service plug-in, a pre-verification plug-in, a chain plug-in, an execution plug-in, and a virtual machine plug-in, etc.
  • the replay process of the target blockchain transaction is implemented by the above plug-ins cooperating with each other. Specifically, the process includes the following steps 301-314.
  • Step 301 The client initiates a replay request to the service plug-in.
  • Step 302 The service plug-in determines a target blockchain transaction (referred to as target transaction in FIG. 3 ) in response to the replay request.
  • target transaction a target blockchain transaction
  • the operation and maintenance personnel may include the transaction hash of the transaction in the replay request and send it to the service plug-in, that is, initiate a replay request for the target blockchain transaction to the service plug-in.
  • the service plug-in may directly extract the transaction hash from the replay to determine the target blockchain transaction, and then proceed to step 303.
  • any blockchain node may also determine the transaction hash of the target blockchain transaction while determining the occurrence of a fork. For example, any blockchain node may execute each transaction in the latest block on the chain maintained by itself to obtain the first type of transaction receipt corresponding to each transaction, and obtain the second type of transaction receipt corresponding to each transaction obtained by the node executing each transaction in the latest block on the chain maintained by itself from other nodes, and then by comparing the first type of transaction receipt and the second type of transaction of each transaction, the transaction with the inconsistent first transaction receipt and the second transaction receipt is determined as the target blockchain transaction causing the fork, and the transaction hash of the transaction is recorded at the same time.
  • the transaction hash may be included in the fork notification message and sent to the client; accordingly, the operation and maintenance personnel may trigger (such as implementing a replay confirmation operation) the client to send a replay request containing the transaction hash to the service plug-in after viewing the message.
  • Step 303 The service plug-in initiates a replay instruction for the target blockchain transaction to the pre-verification plug-in.
  • the service plug-in can include the acquired transaction hash of the target blockchain transaction in the replay instruction and send it to the pre-verification plug-in, triggering the pre-verification plug-in to start acquiring and executing the target blockchain transaction.
  • Step 304 The pre-verification plug-in requests the chain plug-in to obtain the target blockchain transaction.
  • Step 305 The chain plug-in searches for the target blockchain transaction.
  • Step 306 The chain plug-in returns the target blockchain transaction to the pre-verification plug-in.
  • the chain plug-in can be used to manage historical transactions executed by the execution plug-in.
  • the chain plug-in can find the target blockchain transaction and return it to the pre-verification plug-in.
  • the chain plug-in can also find the corresponding previous transaction and return it to the pre-verification plug-in.
  • any of the blockchain nodes also includes a storage plug-in (storage_plugin)
  • the plug-in can be used to store each on-chain block in the current parallel blockchain.
  • the chain plug-in can call the storage plug-in to obtain the target blockchain transaction, such as sending the aforementioned transaction hash to the storage plug-in, so that the storage plug-in can search for the corresponding target blockchain transaction in each transaction stored in itself according to the hash.
  • Step 307 The pre-verification plug-in obtains the world state corresponding to the previous block.
  • the pre-verification plug-in can also obtain the world state corresponding to the previous block of the first forked block where the target blockchain transaction is located (after the execution of each transaction in the block).
  • the above-mentioned world state can be maintained by the aforementioned chain plug-in or storage plug-in, so the chain plug-in can return the above-mentioned world state and the target blockchain transaction to the pre-verification plug-in.
  • the world state can also be maintained by the service plug-in.
  • the pre-verification plug-in can request and obtain the above-mentioned world state from the service plug-in, which will not be repeated. It should be noted that there is no necessary order between the aforementioned step 307 and steps 304-306.
  • Step 308 The pre-verification plug-in sends the target blockchain transaction to the execution plug-in.
  • the pre-verification plug-in can send the acquired target blockchain transaction to the execution plug-in to trigger the execution of the transaction.
  • Step 309a when the target blockchain transaction is a platform transaction, execute the plug-in to execute the platform transaction.
  • Step 310a the execution plug-in returns the account address to the pre-verification plug-in.
  • the execution plug-in can directly complete the execution of the transaction based on the data contained in the transaction. After the execution is completed, the execution plug-in can return the account address involved to the pre-verification plug-in.
  • the above-mentioned account address can be the account address of the payment account, the account address of the collection account, the account address of the newly created operation and maintenance personnel account or the contract account, etc., and the embodiments of the present disclosure do not limit this.
  • Step 309b when the target blockchain transaction is a contract transaction, the execution plug-in sends the contract transaction to the virtual machine plug-in.
  • Step 310b The virtual machine plug-in executes the contract transaction.
  • Step 311b the virtual machine plug-in returns the account address, the called method name and method parameters to the pre-verification plug-in through the execution plug-in.
  • the execution plug-in can call the virtual machine plug-in to execute the above contract transaction.
  • the virtual machine plug-in can call and execute the smart contract. Specifically, it can call at least one method in the smart contract through the corresponding method name, method parameters, etc.
  • the virtual machine plug-in can return the account address (such as the account address of the contract account of the called smart contract), method name, method parameters, etc. to the pre-verification plug-in.
  • the execution module and the virtual machine module may involve updates to the world state, and the above updates can be implemented by the pre-verification plug-in for the world state obtained in step 307.
  • Step 312 The pre-verification plug-in obtains the corresponding read-write set according to the account address.
  • the execution plug-in may generate a read-write set when executing read/write operations related to the target blockchain transaction.
  • the process of a node executing a target blockchain transaction may involve read/write operations, such as reading the world state before the transaction is executed, writing the transaction execution result, etc.
  • the set of data corresponding to the above read/write operations i.e., the data read and/or written
  • any blockchain node or the other blockchain nodes can determine and obtain the above read-write set by querying the world state before and after executing the target blockchain transaction.
  • Step 313 The pre-verification plug-in returns transaction-related data to the client via the service plug-in.
  • Step 314 The client displays the transaction-related data.
  • the pre-verification plug-in can return the above transaction-related data to the client for display to the operation and maintenance personnel.
  • the transaction-related data corresponding to different types of target blockchain exchanges may be different.
  • the transaction-related data may include the account address returned by the execution plug-in and the read-write set data obtained according to the account address.
  • the transaction-related data may include the account address, method name and method parameters returned by the virtual machine plug-in, and the read-write set data obtained according to the account address.
  • the user can analyze the transaction-related data to find the cause of the fork. It can be seen that this solution helps users to quickly locate and troubleshoot the cause of the fork.
  • FIG4 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG4.
  • the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services.
  • One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it.
  • one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or logic devices.
  • FIG5 is a block diagram of a device for replaying blockchain transactions provided by this specification according to an exemplary embodiment, and the device can be applied to the device shown in FIG4 to implement the technical solution of this specification.
  • the device can be applied to any blockchain node in a blockchain network, and the device includes: a transaction determination unit 501, which is used to determine the target blockchain transaction causing the fork when it is determined that the blockchain ledger corresponding to the blockchain network is forked into multiple parallel blockchains, and the target blockchain transaction is recorded in the first forked blocks of the multiple parallel blockchains respectively; a transaction replay unit 502, which is used to obtain the target blockchain transaction from the first forked block and replay the target blockchain transaction, and output the transaction-related data involved in the replay process, and the transaction-related data is used to analyze the cause of the fork.
  • a transaction determination unit 501 which is used to determine the target blockchain transaction causing the fork when it is determined that the blockchain ledger corresponding to the blockchain network is forked into multiple parallel blockchains, and the target blockchain transaction is recorded in the
  • the transaction determination unit 501 is also used to: during the consensus process for the current block, obtain the parent hash of the current block provided by any other blockchain node; when the parent hash is inconsistent with the block hash of the latest block on the chain maintained by any blockchain node, determine that the blockchain ledger corresponding to the blockchain network is forked into multiple parallel blockchains.
  • any one of the blockchain nodes maintains a block of the first parallel blockchain
  • the transaction determination unit 501 is further used to: determine each first-type transaction receipt generated by each transaction in the first forked block of the first parallel blockchain executed by any one of the blockchain nodes, and obtain each second-type transaction receipt generated by each transaction in the first forked block of the second parallel blockchain executed by any other blockchain node; when the first-type transaction receipt and the second-type transaction receipt of any transaction are inconsistent, determine any one of the transactions as the target blockchain transaction that caused the fork.
  • the transaction replay unit 502 is further used to: obtain the target blockchain transaction from the first forked block of the first parallel blockchain maintained locally, and execute the obtained target blockchain transaction.
  • the transaction replay unit 502 is also used to: provide the target blockchain transaction to other blockchain nodes so that the other blockchain nodes execute the target blockchain transaction; the device also includes a remote data receiving unit 503, which is used to receive the transaction-related data returned by the other blockchain nodes.
  • the transaction replay unit 502 is also used to: send the target blockchain transaction obtained locally to other blockchain nodes; or, send the transaction hash of the target blockchain transaction to other blockchain nodes, so that the other blockchain nodes can query the target blockchain transaction in the first forked block of the parallel blockchain maintained locally according to the transaction hash.
  • the second parallel blockchain to which the on-chain blocks maintained by the other blockchain nodes belong is different from the first parallel blockchain to which the on-chain blocks maintained by any of the blockchain nodes belong.
  • the first forked block includes at least one preceding transaction whose execution order is before the target blockchain transaction
  • the transaction replay unit 502 is further used to: execute the at least one preceding transaction and the target blockchain transaction in sequence according to the execution order.
  • the transaction replay unit 502 is further used to: determine the previous block of the first forked block and the world state corresponding to the block in the blockchain ledger, and execute the target blockchain transaction based on the world state.
  • any blockchain node includes a service plug-in, a pre-verification plug-in, a chain plug-in and an execution plug-in
  • the chain plug-in is used to manage historical transactions executed by the execution plug-in
  • the transaction replay unit 502 is also used to: obtain the target blockchain transaction managed by the chain plug-in by the pre-verification plug-in, and send the target blockchain transaction to the execution plug-in for execution; determine the transaction-related data involved in the replay process by the pre-verification plug-in, and output the transaction-related data through the service plug-in.
  • any blockchain node also includes a virtual machine plug-in
  • the transaction replay unit 502 is also used to: when the target blockchain transaction calls a smart contract, call and execute the smart contract through the virtual machine plug-in; and receive the contract execution data generated by executing the smart contract returned by the virtual machine plug-in, and forward the contract execution data as the transaction-related data to the pre-verification plug-in.
  • the transaction replay unit 502 is also used to: send the transaction-related data to a client or a management device corresponding to any blockchain node, so that the client or the management device displays the transaction-related data to the user.
  • the transaction-related data includes at least one of the following: the account address associated with the target blockchain transaction; the method name and method parameters of the method called by the target blockchain exchange; the contract address, contract method, input parameters and/or contract code file information of the smart contract called by the target blockchain exchange; the read-write set generated by any blockchain node executing a read/write operation related to the target blockchain transaction.
  • a programmable logic device such as a field programmable gate array (FPGA)
  • FPGA field programmable gate array
  • HDL Hardware Description Language
  • HDL Very-High-Speed Integrated Circuit Hardware Description Language
  • ABEL Advanced Boolean Expression Language
  • AHDL Altera Hardware Description Language
  • HDCal Joint CHDL
  • JHDL Java Hardware Description Language
  • Lava Lava
  • Lola MyHDL
  • PALASM RHDL
  • VHDL Very-High-Speed Integrated Circuit Hardware Description Language
  • Verilog Verilog
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer readable medium storing a computer readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, 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, and the memory controller may also be implemented as part of the control logic of the memory.
  • a computer readable program code e.g., software or firmware
  • the controller may be implemented in the form of a logic gate, a switch, an application specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the means for implementing various functions included therein may also be considered as a structure within the hardware component. Or even, the means for implementing various functions may be considered as both a software module for implementing the method and a structure within the hardware component.
  • the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that implements the functions of the above 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.
  • one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means.
  • the order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order.
  • the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment).
  • each module can be implemented in the same or more software and/or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division. There may be other division methods in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
  • a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • processors CPU
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in a computer-readable medium, in the form of 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.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information.
  • Information can be computer readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
  • one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network.
  • program modules may be located in local and remote computer storage media, including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本说明书提供一种重放区块链交易的方法及装置。所述方法应用于区块链网络中的任一区块链节点,所述方法包括:在确定所述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在所述多条平行区块链的首个分叉区块中;从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。

Description

重放区块链交易的方法及装置 技术领域
本说明书实施例属于区块链技术领域,尤其涉及一种重放区块链交易的方法及装置。
背景技术
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。用户可以沟通过区块链节点参与实现区块链的相关事务,例如,区块链网络中分别对应不同用户的多个区块链节点,可以基于同态加密、零知识证明等隐私技术针对某一节点的私有数据进行安全多方计算(Secure Multi-Party Computation,SMPC)。
在正常运行的区块链网络中,各个区块链节点分别维护相同的区块链账本,即整个区块链网络存在一条区块链。但在区块链交易或智能合约的代码出错、区块链节点的运算性能差异过大等异常情况下,执行某一区块链交易可能导致上述区块链从某一区块开始分裂成多条区块链,即出现区块链分叉。此时,各个区块链节点分别维护的区块有所不同,从而影响区块链网络的正常运行,甚至带来隐私泄露等安全风险。
区块链网络的运维人员需要定位引起分叉的交易,并通过查看该交易的交易相关数据分析分叉原因。在相关技术中,当发现区块链出现分叉时,需要由区块链网络的运维人员在交易执行过程产生的日志文件中找到引起分叉的交易对应的交易相关数据,进而通过分析上述日志确定分叉原因。由于区块链节点在交易执行过程中产生的日志文件数目、种类繁杂且往往数据量较大,因此运维人员自行查找上述交易相关数据往往需要耗费较多时间和精力,分叉原因排查过程步骤繁琐,整体排查效率亟待提升。
发明内容
本公开的目的在于提供一种重放区块链交易的方法及装置。
根据本说明书一个或多个实施例的第一方面,提出了一种重放区块链交易的方法,应用于区块链网络中的任一区块链节点,所述方法包括:在确定所述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在所述多条平行区块链的首个分叉区块中;从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。
根据本说明书一个或多个实施例的第二方面,提出了一种重放区块链交易的装置,应用于区块链网络中的任一区块链节点,所述装置包括:交易确定单元,用于在确定所 述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在所述多条平行区块链的首个分叉区块中;交易重放单元,用于从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:处理器;
用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如第一方面和第二方面中任一项所述的方法。
根据本说明书一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面和第二方面中任一项所述方法的步骤。
在本说明书第一方面的实施例中,由区块链网络中的任一区块链节点在出现分叉的情况下确定引起分叉的目标区块链交易,然后获取该交易并对其进行重放,进而向用户(如区块链网络的运维人员)输出重放过程涉及的交易相关数据。可见,第一方面的实施例针对引起分叉的目标交易实现了针对性重放,从而能够向用户提供该交易的交易相关数据。
可以理解的是,本方案由区块链节点自动确定引起分叉的目标区块链交易并对其进行重放,并直接向用户输出目标区块链交易对应的交易相关数据,而无需用户通过分析繁杂的日志文件获得该数据。提升了交易相关数据获取过程的自动化程度,大幅减少了用户的工作量,从而简化了分叉原因排查过程的逻辑和步骤,有助于提升故障排查效率。
附图说明
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是一示例性实施例提供的一种重放区块链交易的方法的流程。
图2是一示例性实施例提供的一种区块链网络及其分叉过程的示意图。
图3是一示例性实施例提供的一种重放区块链交易的方法的交互流程。
图4是一示例性实施例提供的一种设备的结构示意图。
图5是一示例性实施例提供的一种重放区块链交易的装置的框图。
具体实施方式
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
为了解决相关技术中存在的问题,本说明书提出一种重放区块链交易的方法。具体的,提出了针对引起分叉的目标交易的交易重放方案。请参见图1,图1是一示例性实施例提供的一种重放区块链交易的方法的流程。如图1所示,该方法应用于区块链网络中的任一区块链节点,可以包括下述步骤102-104。
步骤102,在确定所述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在所述多条平行区块链的首个分叉区块中。
本公开实施例所述的区块链网络会出现分叉,首先结合图2对区块链网络的分叉情况进行示例性介绍。如图2所示,区块链网络201中包含多个区块链节点,如节点A、节点B、节点C和节点D等。当然,本公开实施例对于所述区块链网络中的节点数量以及网络的内部结构并不进行限定。其中,上述各个节点分别维护有所述区块链网络的区块链账本。如对于任一节点而言,该节点在本地维护有自身参与区块链网络运行的过程中共识通过的各个区块,这些区块所构成的链式结构即为该节点所维护的区块链账本。
如前所述,可能存在某些未知原因导致所述区块链网络出现区块链分叉现象,即该网络的区块链账本分叉为多条平行区块链。如图2所示,分叉后的区块链账本202包括两条平行区块链,即Ledger1和Ledger2。其中,相邻区块之间的箭头用于表征两区块之间的产生顺序,如区块1和区块2之间的箭头表征区块1先于区块2产生,且区块1是区块2的父区块,区块2的头部记录有区块1的区块哈希(Hash),其他区块类似,不再赘述。
下面对图2所示区块链账本中的各个区块进行说明:任意两相邻区块之间的实线箭头用于表征这两个区块均为当前时刻已经通过共识过程完成上链的链上区块,如图中正常区块~3、区块4.1和区块4.2均为当前时刻的链上区块;而虚线箭头的起点连接的区块为当前时刻待共识的当前区块(尚未上链),如区块5.1和区块5.2均为当前时刻的当前区块。如图2所示,当前时刻Ledger1包含正常区块(即正常区块~3)和分叉区块(即区块4.1),当前时刻Ledger2包含正常区块(即正常区块~3)和分叉区块(即区块5.1)。对于任一平行区块链所包含的分叉区块,在成块顺序中最先生成的那个分叉区块即为该平行区块链的首个分叉区块,如Ledger1的首个分叉区块为区块4.1,Ledger2的首个分叉区块为区块4.2。其中,不同平行区块链的首个分叉区块中所包含的交易内 容通常相同,而交易回执(Receipt)等交易数据并不相同。对于任一平行区块链在当前时刻所包含的链上区块而言,最后上链的那个区块即为链上最新区块,特此说明。
另外,分叉后的各个平行区块链,会分别被区块链网络中的不同区块链节点所维护。例如,图2所示的节点A和B分别维护有Ledger1,节点C和D分别维护有Ledger2等。当然,区块链网络中的区块链账本也可以分叉为3条甚至更多条平行区块链,任一平行区块链可以被该区块链网络中的至少一个区块链节点所维护,本公开实施例并不对此进行限定。下文实施例以图2所示场景为例进行示例性说明。
在一实施例中,任一区块链节点也可以从自身连接的客户端或者其他区块链节点处接收针对所述区块链账本是否发生分叉的判断结果,从而根据该判断结果确定区块链账本是否分叉为多条平行区块链。
在另一实施例中,区块链节点也可以在参与区块共识时发现区块链账本出现分叉。例如,所述任一区块链节点可以在针对当前区块(如图2所示的区块5.1和区块5.2)的共识过程中,获取任一其他区块链节点提供的所述当前区块的父哈希;然后对所述父哈希与自身维护的链上最新区块的区块哈希进行比较,在二者不一致的情况下,即可确定所述区块链网络对应的区块链账本分叉为多条平行区块链。实际上,在二者不一致的情况下,可以同时确定所述任一区块链节点和所述任一其他区块链节点分别维护有属于不同平行区块链的区块。其中,所述任一其他区块链节点可以为所述区块链网络中区别于所述任一区块链节点的任一节点。所述任一其他区块链节点所生成的当前区块的区块头部记录有该节点所维护的链上最新区块的哈希,即将自身维护的链上最新区块的哈希作为当前区块的父哈希,换言之,所述任一其他区块链节点提供的当前区块的父哈希即为该节点维护的链上最新区块的哈希。基于此,所述任一区块链节点可以从接收到的所述当前区块的区块头部中提取该区块的父哈希。
通过上述父哈希可以理解的是,若所述父哈希与所述任一区块链节点自身维护的链上最新区块的区块哈希不一致,则表明所述任一区块链节点维护的当前最新区块和所述任一其他区块链节点维护的当前最新区块并不相同,如区块中至少部分交易的回执等执行结果不同,所以此时可以确定所述区块链账本出现分叉。反之,若上述父哈希与所述任一区块链节点维护的链上最新区块的区块哈希一致,则可以确定所述区块链账本并未发生分叉。
可见,不同的区块链节点在按照相同的顺序分别执行某一区块中的各个交易时,由于未知故障可能导致至少一个交易的执行结果不同(交易回执不同),从而导致两节点分别维护的该区块(在完成上链后即称为链上最新区块)的区块哈希不一致,即导致区块链账本出现分叉。而在两节点分别参与共识下一区块的过程中,即可发现各自的链上最新区块的区块哈希不一致,从而发现区块链账本出现分叉。
在确定所述区块链账本发生分叉的情况下,所述任一区块链节点可以直接将所述链 上最新区块确定为所述区块链账本对应的首个分叉区块。或者,也可以向维护有与自身所维护平行区块链不同的平行区块链的节点(如所述任一其他区块链节点)请求获取其所维护至少部分区块的区块哈希,如所述链上最新区块及其之前预设数量个区块的区块哈希,然后按照区块顺序将上述区块哈希与本地所维护的相应区块的区块哈希逐一比较,并在任一区块对应的两区块哈希不同的情况下,将该区块确定为所述首个分叉区块。
在确定区块链账本出现分叉的情况下,所述任一区块链节点可以进一步确定引起所述分叉的目标区块链交易。例如,可以先确定所述任一区块链节点执行第一平行区块链的首个分叉区块中的各个交易所产生的各个第一类交易回执,并获取任一其他区块链节点执行第二平行区块链的首个分叉区块中的各个交易产生的各个第二类交易回执;然后对各个交易对应的第一类交易回执和第二类交易回执进行比较,并在任一交易的第一类交易回执和第二类交易回执不一致的情况下,将该交易确定为引起所述分叉的目标区块链交易。可以理解的是,任一交易的第一类交易回执由所述任一区块链节点执行该交易产生,第二类交易回执由所述任一区块链节点执行该交易产生。因此,若任一交易的第一类交易回执和第二类交易回执不同,即表明两节点执行该交易的结果不同,从而导致包含该交易的两个首个分叉区块不同,因此可以确定是该交易引起了区块链账本分叉。实际上,除了比较各个交易的交易回执之外,也可以比较交易代码、交易账户等任一交易相关数据,本公开实施例并不对此进行限定。
需要说明的是,在确定区块链账本分叉为多个平行区块链的情况下,所述任一区块链节点即可相应的确定引起分叉的区块链节点所在的区块,即自身维护的首个分叉区块。此时,所述任一区块链节点可以对自身维护的首个分叉区块进行预重放,以得到其中各个交易的第一类交易回执;另外,可以由其他区块链节点对自身维护的首个分叉区块进行预重放,以得到其中各个交易的第二类交易回执,然后所述任一区块链节点可以从其他区块链节点处获取上述第二类交易回执。由于所述任一区块链节点和所述其他区块链节点分别维护的首个分叉交易中的交易及其执行顺序相同,所以可以对各个交易的第一类交易回执和第二类交易回执进行比较:若任一交易的第一类交易回执和第二类交易回执不一致,即表明该交易即为引起所述分叉的目标区块链交易。另外,所述任一区块链节点可以记录所述目标区块链交易的交易哈希,以便后续通过该交易哈希对所述目标区块链交易进行针对性重放。
可以理解的是,上述过程实际上涉及到两次重放:在预重放过程中,所述任一区块链节点(和其他区块链节点)会执行首个分叉交易中的全部交易,以获取各个交易的交易回执。而在后续针对性重放过程中,所述任一区块链节点仅需要执行目标区块链交易,以获取该重放过程涉及的交易相关数据(当然,必要时也可以执行目标区块链交易的前序交易并获取相应的交易相关数据)。显然,上述预重放过程是针对多个首个分叉区块(中的全部交易)进行的重放,目的是获取各个交易的交易回执,以便通过对比交易回执确定引起分叉的目标区块链交易,不妨将所述预重放过程称为区块重放;而后续的针 对性重放则仅针对前一过程中确定出的目标区块链交易(及其前序交易),目的是获取该交易的交易相关数据,不妨将该重放称为交易重放。
在通过上述方式确定所述目标区块链交易后,所述任一区块链节点即可获知目标区块链交易的交易哈希。其中,由于上述方式可能确定出至少一个目标区块链交易,且各个目标区块链节点的交易哈希可以用于唯一标识该交易。
步骤104,从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。
在确定出引起分叉的目标区块链交易之后,所述任一区块链节点可以从所述首个分叉区块中获取该交易并对其进行重放。由于所述目标区块链交易是已经完成上链的交易,所以该交易在当前时刻之前已经被执行过至少一次,所以本公开所述的对目标区块链交易进行重放(或称重放目标区块链交易),可以被理解为重新执行目标区块链交易。
在本方案的实施例中,由区块链网络中的任一区块链节点在出现分叉的情况下确定引起分叉的目标区块链交易,然后获取该交易并对其进行重放,进而向用户(如区块链网络的运维人员)输出重放过程涉及的交易相关数据。可见,第一方面的实施例针对引起分叉的目标交易实现了针对性重放,从而能够向用户提供该交易的交易相关数据。
可以理解的是,本方案提供简便操作的区块链节点分叉信息收集方案,无需用户通过分析繁杂的日志文件获得该数据。提升了交易相关数据获取过程的自动化程度,大幅减少了用户的工作量,从而简化了分叉原因排查过程的逻辑和步骤,有助于提升故障排查效率。
在一实施例中,所述任一区块链节点可以对所述目标区块链交易进行本地重放。例如,所述任一区块链节点可以从本地维护的第一平行区块链的首个分叉区块中获取所述目标区块链交易,并执行获取到的所述目标区块链交易。其中,该节点可以在本地维护的所述首个分叉区块中按照所述交易哈希查询并获取目标区块链交易,具体的,可以获取该交易的交易内容等数据。例如,在所述任一区块链节点为图2所示的节点A的情况下,节点A可以从本地维护的区块4.1中获取目标区块链交易,进而在本地执行该交易。通过该方式,所述任一区块链节点可以在本地重新执行所述目标区块链交易,即实现对目标区块链交易的本地重放。
在另一实施例中,所述任一区块链节点也可以对所述目标区块链交易进行远程重放(或称异地重放)。例如,所述任一区块链节点可以向其他区块链节点提供所述目标区块链交易,以由所述其他区块链节点执行所述目标区块链交易;相应的,可以接收所述其他区块链节点返回的所述交易相关数据。所述其他区块链节点即为所述区块链网络中除所述任一区块链节点之外的节点,而所述任一区块链节点可以向至少一个其他区块链节点提供所述目标区块链交易进行重放,如可以向前述实施例提及的所述任一其他区块 链节点提供所述目标区块链交易,也可以向区块链网络中的管理节点(在所述任一J并非管理节点的情况下)提供所述目标区块链交易等,不再赘述。例如,在所述任一区块链节点为图2所示的节点A的情况下,节点A可以将目标区块链交易提供至节点C和/或D,以由节点C和/或D在本地执行该交易。通过该方式,所述任一区块链节点可以在其他区块链节点处重新执行所述目标区块链交易,即实现对目标区块链交易的远程重放。
其中,作为获取所述任一区块链节点提供的目标区块链交易的节点,所述其他区块链节点所维护的平行区块链可以与所述任一区块链节点所维护的平行区块链相同或不同。例如,所述其他区块链节点维护的链上区块所属的第二平行区块链,可以与所述任一区块链节点维护的链上区块所属的第一平行区块链不同,此时,所述其他区块链节点维护有与所述任一区块链节点不同的平行区块链。或者,所述其他区块链节点维护的链上区块所属的第二平行区块链,也可以与所述任一区块链节点维护的链上区块所属的第一平行区块链相同,此时,所述其他区块链节点维护有与所述任一区块链节点相同的平行区块链。
承接于图2场景所对应的前述实施例,在所述任一区块链节点为节点A(其维护的Ledger1为第一平行区块链)的情况下,节点A可以将节点B(其有维护Ledger1)作为所述其他区块链节点,此时所述任一区块链节点与所述其他区块链节点均维护有第一平行区块链;和/或,节点A也可以将节点C和/或D(分别维护的Ledger2为第二平行区块链)作为所述其他区块链节点,此时所述任一区块链节点与所述其他区块链节点均维护有第二平行区块链。
当然,在所述其他区块链节点的数量为多个(即所述任一区块链节点向多个节点提供目标区块链交易)的情况下,上述多个其他区块链节点可以既包括维护有上述第一平行区块链的节点(与所述任一区块链节点相同),也可以包括维护有上述第二平行区块链的节点(与所述任一区块链节点不同)。另外,所述区块链账本的分叉后的平行区块链也可能多于两条,此时(获取所述任一区块链节点提供的目标区块链交易的)任一其他区块链节点也可以维护第三平行区块链、第四平行区块链等,不再赘述。通过上述方式,所述任一区块链节点可以通过多种不同类型的区块链节点实现对目标区块链交易的远程重放,从而能够满足更多样化的重放场景。
另外,所述任一区块链节点可以通过多种方式向所述其他区块链节点提供目标区块链交易。例如,可以将从本地获取的所述目标区块链交易发送至其他区块链节点,此时可以由其他区块链节点直接执行所述任一区块链节点本地保存的所述目标区块链交易,有助于确保被执行的交易确实为所述目标区块链交易,从而确保重放的准确性。再例如,考虑到所述区块链网络中的各个节点当前时刻可能还在处理其他区块链事务(如交易转发、交易共识、消息传递等),所以为了减少所述任一区块链节点与所述其他区块链节点之间的数据传输可能随上述区块链事务带来的不利影响,所述任一区块链节点也可以 将所述目标区块链交易的交易哈希发送至其他区块链节点,以由所述其他区块链节点根据所述交易哈希在本地维护的平行区块链的首个分叉区块中查询所述目标区块链交易。其中,所述其他节点可以在本地维护的所述首个分叉区块中按照所述交易哈希查询并获取目标区块链交易,具体的,可以获取该交易的交易内容等数据。通过该方式,所述任一区块链节点与所述其他区块链节点之间只需要传递数据量较小的交易哈希即可,有效减少了对P2P(Peer-to-Peer,点对点)网络带宽的占用,从而有助于减少或避免对正常区块链事务可能造成的不利影响。
通过前述实施,所述任一区块链节点可以得到在本地或远程重放,并获取到相应重放过程对应的交易相关数据。在本公开实施例中,所述交易相关数据可以包括下述至少之一。
所述目标区块链交易关联的账户地址。例如,伛目标区块链交易为转账交易,则该交易可以关联付款账户的账户地址和收款账户的账户地址;若目标区块链交易为创建账户的交易,则该交易可以关联被创建的新账户的账户地址;若目标区块链交易为调用智能合约的交易(或称合约交易),则该交易可以关联被调用合约的合约账户的账户地址。
所述目标区块链交易所调用方法的方法名和方法参数。在目标区块链交易调用方法的情况下,该交易可以关联该方法的方法名和调用过程中涉及的方法参数(即方法的入参)。当然,也可以关联该方法的原始代码、执行结果等。另外,上述目标区块链交易可以调用至少一个方法,而在调用多个方法的情况下,所述任一区块链节点可以获取上述各个方法的方法名、方法参数、原始代码和/或执行结果等数据,不再赘述。当然,被调用的上述方法可以包含在智能合约中,即区块链节点需要调用智能合约执行所述目标区块链交易。
所述目标区块链交易所调用智能合约的合约地址、合约方法、输入参数和/或合约代码文件信息。在目标区块链交易调用智能合约的情况下,该交易可以关联该智能合约的合约地址、合约方法、输入参数和/或合约代码文件信息。上述目标区块链交易可以调用至少一个智能合约,而在调用多个智能合约的情况下,所述任一区块链节点可以获取被调用的各个智能合约的合约地址、合约方法、输入参数和/或合约代码文件信息等数据,不再赘述。可以理解的是,对于并不调用智能合约的平台合约,其重放过程涉及的交易相关数据并不包含智能合约的合约地址、合约方法、输入参数和合约代码文件信息中的任一项。
所述任一区块链节点执行与所述目标区块链交易相关的读/写操作产生的读写集。节点执行目标区块链交易的过程中可能涉及读/写操作,如读取交易执行前的世界状态,写入交易执行结果等。上述读/写操作所对应数据(即被读取和/或写入的数据)构成的集合,即可视为前述读写集。对此,所述任一区块链节点或所述其他区块链节点可以通过查询执行目标区块链交易前后的世界状态确定并获取上述读写集。
在一实施例中,所述首个分叉区块(即目标区块链交易所属的区块)中的各个交易被相应的区块链节点按照一定顺序(即所述执行顺序)依次执行,而目标区块链交易可能并非被第一个执行。基于此,所述首个分叉区块(即目标区块链交易所在的区块)中可能包含执行顺序位于所述目标区块链交易之前的至少一个前序交易,此时所述任一区块链节点可以按照所述执行顺序依次执行所述至少一个前序交易和所述目标区块链交易。其中,所述前序交易可以是按照所述执行顺序处于目标区块链交易之前的至少部分交易(即首个分叉区块中包含的在目标区块链交易之前执行的至少部分交易)。
可以理解的是,首个分叉区块中包含的在目标区块链交易之前执行的全部交易中,可能存在某些交易是目标区块链交易所依赖的交易(如执行目标区块链交易需要调用某一合约创建交易创建的智能合约),也可能存在目标区块链交易并不依赖的交易(与目标区块链交易无关)。对此,可以目标区块链交易所依赖的上述交易作为其前序交易,以减少需要执行的前序交易的数量,减轻重放工作量,提升针对目标区块链交易的重放效率。或者,考虑到区块O中执行顺序位于目标区块链交易之前的任一交易是否被目标区块链交易所依赖,可能需要根据所述任一交易的执行结果加以判断,因此也可以将首个分叉区块中执行顺序位于目标区块链交易之前的全部交易作为目标区块链交易的前序交易(此时并不区分各个交易是否被目标区块链交易所依赖),以避免目标区块链交易所依赖的部分交易未被执行可能导致的目标区块链交易执行结果出错甚至执行失败,提升针对目标区块链交易的重放准确度。
或者,在确定出前述首个分叉区块之后,所述任一区块链节点也可以重放该区块,即依次重新执行该区块中的全部交易。该区块重放方案可以参见下文图4所对应实施例的记载,此处暂不赘述。
由于区块链账本中的各个区块在生成时间上存在先后顺序,相应的,不同区块所包含的区块链交易在执行时间上也存在先后顺序。因此不同区块中的交易分别对应的世界状态存在延续性,对于任一平行区块链中的相邻区块而言,为保证在后区块中的交易执行结果的准确性,可以将前一区块中各个交易执行完毕后的世界状态,作为后一区块中各个交易执行的基础数据。基于此,在另一实施例中,所述任一区块链节点可以先在所述区块链账本中确定所述首个分叉区块的前一区块以及该区块对应的世界状态,然后基于所述世界状态执行所述目标区块链交易。
本公开所述区块链节点中的任一区块链节点可以包含多个插件(Plugin),任一插件即为用于实现特定功能的功能模块。通过在区块链节点中创建功能插件,可以将区块链节点需要实现的不同功能进行解耦,有助于避免不同功能实现过程中的互相干扰,从而提升功能实现效率以及区块链节点对区块链事务的处理效率。
基于此,任一区块链节点执行目标区块链交易的过程可以由该节点包含的多个插件相互配合完成。在一实施例中,所述任一区块链节点可以包含服务插件(service_plugin)、 预验证插件(pre_verity_plugin)、链插件(chain_plugin)和执行插件(exec_plugin),其中,所述链插件可以用于管理所述执行插件执行的历史交易。此时,所述预验证插件可以先获取所述链插件管理的所述目标区块链交易,并将所述目标区块链交易发送至所述执行插件执行。其中,在所述任一区块链节点还包含存储插件(storage_plugin)的情况下,该插件可以用于存储当前平行区块链中的各个链上区块,此时所述链插件可以调用存储插件获取所述目标区块链交易。而所述预验证插件可以确定重放过程涉及的交易相关数据,并通过所述服务插件输出所述交易相关数据。此时,通过上述各个插件的相互配合完成了对目标区块链交易的重放。
其中,在所述目标区块链交易为无需调用智能合约的平台交易(如账户创建交易、转账交易等)时,所述执行插件可以直接根据交易中包含的数据完成交易的执行。而在所述目标区块链交易为需要调用智能合约的合约交易时,若所述任一区块链节点还可以包含虚拟机插件(vm_plugin),则执行插件可以调用虚拟机插件执行上述合约交易。例如,在所述目标区块链交易调用智能合约的情况下,所述执行插件可以通过所述虚拟机插件调用并执行所述智能合约;以及,接收所述虚拟机插件返回的执行所述智能合约产生的合约执行数据,并将该数据作为所述交易相关数据转发至所述预验证插件。通过该方式,所述任一区块链节点可以通过内部设置的虚拟机插件重放执行逻辑较为复杂的合约交易,避免执行出错的同时一定程度上提升交易执行效率。
上述各个插件相互配合实现目标区块链交易重放的具体过程,可以参见下文图3所对应实施例的详细记载,此处暂不赘述。需要说明的是,在前述远程重放的场景下,用于重放目标区块链交易的其他区块链节点中也可以部署上述插件,并由上述插件获取所述任一区块链节点提供的目标区块链交易并执行该交易,具体过程与所述任一区块链节点中各个插件相互配合执行目标区块链交易的过程并无本质区别,不再赘述。
在通过前述方案重放目标区块链交易并获取到相应的交易相关数据后,所述任一区块链节点可以向用户输出该数据。其中,在被执行的对象还包括目标区块链交易的至少一个前序交易的情况下,所述交易相关数据也可以包含所述至少一个前序交易对应的数据,不再赘述。例如,可以将交易相关数据发送至任一区块链节点对应的客户端或者管理设备,以由所述客户端或者所述管理设备向用户展示所述交易相关数据。其中,所述客户端或管理设备可以连接至所述任一区块链节点。所述用户即为所述客户端或管理设备的使用者,如可以为所述区块链网络的运维人员或所述任一区块链节点对应的普通用户等。通过查看上述方式展示出的交易相关数据,所述用户可以分析所述交易相关数据,从而找到引起所述分叉的故障原因。可见该方案有助于协助用户实现对分叉原因的快速定位和排查。
图3是一示例性实施例提供的一种重放区块链交易的方法的交互流程。参见图3,所述任一区块链节点可以包含服务插件、预验证插件、链插件、执行插件和虚拟机插件等,所述目标区块链交易的重放过程由上述各个插件相互配合实现。具体的,该过程包 含下述步骤301-314。
步骤301,客户端向服务插件发起重放请求。
步骤302,服务插件响应于所述重放请求确定目标区块链交易(图3中简称目标交易)。
在一实施例中,运维人员可以在确定引起分叉的目标区块链交易后,将该交易的交易哈希包含在所述重放请求中发送至所述服务插件,即向服务插件发起针对目标区块链交易的重放请求。此时,服务插件可以直接从所述重放中提取所述交易哈希以确定目标区块链交易,然后转入步骤303。
其中,所述任一区块链节点也可以在确定出现分叉的同时,确定所述目标区块链交易的交易哈希。例如,所述任一区块链节点可以执行自身所维护链上最新区块中的各个交易以得到各个交易对应的第一类交易回执,并从其他节点处获取该节点执行自身所维护链上最新区块中的各个交易得到的各个交易对应的第二类交易回执,然后通过比较各个交易的第一类交易回执和第二类交易,将第一交易回执与第二交易回执不一致的交易确定为引起分叉的目标区块链交易,同时记录该交易的交易哈希。然后可以将该交易哈希包含在分叉通知消息中发送至所述客户端;相应的,所述运维人员可以在查看到该消息后触发(如实施重放确认操作)客户端向所述服务插件发送包含所述交易哈希的重放请求。
步骤303,服务插件向预验证插件发起针对目标区块链交易的重放指令。
此时,服务插件可以将获取到的目标区块链交易的交易哈希包含在重放指令中发送至预验证插件,已触发预验证插件开始获取并执行目标区块链交易。
步骤304,预验证插件向链插件请求获取目标区块链交易。
步骤305,链插件查找目标区块链交易。
步骤306,链插件将目标区块链交易返回至预验证插件。
所述链插件可以用于管理所述执行插件执行的历史交易。响应于预验证插件的请求,链插件可以查找目标区块链交易并将其返回至预验证插件。另外,在所述目标区块链交易存在前序交易的情况下,所述链插件还可以查找相应的前序交易并将其返回至预验证插件。
具体的,在所述任一区块链节点还包含存储插件(storage_plugin)的情况下,该插件可以用于存储当前平行区块链中的各个链上区块,此时所述链插件可以调用存储插件获取所述目标区块链交易,如将前述交易哈希发送至存储插件,以由存储插件根据该哈希在自身存储的各个交易中查找相应的目标区块链交易。
步骤307,预验证插件获取上一区块对应的世界状态。
与获取所述目标区块链交易对应的,预验证插件还可以获取目标区块链交易所在的首个分叉区块的前一区块对应的(该区块中各个交易执行完毕后的)世界状态。例如,上述世界状态可以由前述链插件或存储插件维护,所以链插件可以将上述世界状态与所述目标区块链交易一并返回至预验证插件。再例如,所述世界状态也可以由所述服务插件所维护,此时预验证插件可以向服务插件请求并获取上述世界状态,不再赘述。需要说明的是,前述步骤307与步骤304-306之间并不存在必然的先后顺序。
步骤308,预验证插件向执行插件发送目标区块链交易。
此时,预验证插件可以将获取到的目标区块链交易发送至执行插件,以触发执行该交易。
步骤309a,在目标区块链交易为平台交易的情况下,执行插件执行所述平台交易。
步骤310a,执行插件向预验证插件返回账户地址。
在所述目标区块链交易为无需调用智能合约的平台交易(如账户创建交易、转账交易等)时,所述执行插件可以直接根据交易中包含的数据完成交易的执行。在执行完毕后,执行插件可以将涉及的账户地址返回至预验证插件。其中,上述账户地址可以为付款账户的账户地址、收款账户的账户地址、新创建的运维人员账户或合约账户的账户地址等,本公开实施例对此并不进行限定。
步骤309b,在目标区块链交易为合约交易的情况下,执行插件向虚拟机插件发送所述合约交易。
步骤310b,虚拟机插件执行所述合约交易。
步骤311b,虚拟机插件通过执行插件向预验证插件返回账户地址、被调用的方法名和方法参数。
在所述目标区块链交易为需要调用智能合约的合约交易时,若所述任一区块链节点还可以包含虚拟机插件(vm_plugin),则执行插件可以调用虚拟机插件执行上述合约交易。所述虚拟机插件可以调用并执行智能合约,具体的,其可以通过相应的方法名、方法参数等调用智能合约中的至少一个方法。在所述合约交易执行完毕后,虚拟机插件可以将账户地址(如被调用智能合约的合约账户的账户地址)、方法名、方法参数等返回至预验证插件。
需要说明的是,无论是步骤309a-310a执行平台交易的过程中,还是步骤309b-311b执行合约交易的过程中,执行模块和虚拟机模块都可能涉及针对世界状态的更新,上述更新均可以由预验证插件针对步骤307中获取到的世界状态实现。
至此,完成针对目标区块链交易的重放过程。
步骤312,预验证插件根据账户地址获取相应的读写集。
所述执行插件在执行与所述目标区块链交易相关的读/写操作时可能产生读写集。如节点执行目标区块链交易的过程中可能涉及读/写操作,如读取交易执行前的世界状态,写入交易执行结果等。上述读/写操作所对应数据(即被读取和/或写入的数据)构成的集合,即可视为前述读写集。对此,所述任一区块链节点或所述其他区块链节点可以通过查询执行目标区块链交易前后的世界状态确定并获取上述读写集。
步骤313,预验证插件通过服务插件向客户端返回交易相关数据。
步骤314,客户端展示所述交易相关数据。
此时,预验证插件可以将上述交易相关数据返回至客户端,以用于向运维人员展示。其中,不同类型的目标区块链交易所对应的交易相关数据可能不同。例如,对应于步骤309a-310a,所述交易相关数据可以包括执行插件返回的账户地址以及根据账户地址获取到的读写集等数据。对应于步骤309b-311b,所述交易相关数据可以包括所述虚拟机插件返回的账户地址、方法名和方法参数,以及根据该账户地址获取到的读写集等数据。
通过查看客户端展示出的上述交易相关数据,所述用户可以分析所述交易相关数据,从而找到引起所述分叉的障原因。可见该方案有助于协助用户实现对分叉原因的快速定位和排查。
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他业务所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
如图5所示,图5是本说明书根据一示例性实施例提供的一种重放区块链交易的装置的框图,该装置可以应用于如图4所示的设备中,以实现本说明书的技术方案。该装置可以应用于区块链网络中的任一区块链节点,所述装置包括:交易确定单元501,用于在确定所述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在所述多条平行区块链的首个分叉区块中;交易重放单元502,用于从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。
可选的,所述交易确定单元501还用于:在针对当前区块的共识过程中,获取任一其他区块链节点提供的所述当前区块的父哈希;在所述父哈希与所述任一区块链节点维护的链上最新区块的区块哈希不一致的情况下,确定所述区块链网络对应的区块链账本分叉为多条平行区块链。
可选的,所述任一区块链节点维护有第一平行区块链的区块,所述交易确定单元501还用于:确定所述任一区块链节点执行第一平行区块链的首个分叉区块中的各个交易所产生的各个第一类交易回执,并获取任一其他区块链节点执行第二平行区块链的首个分叉区块中的各个交易产生的各个第二类交易回执;在任一交易的第一类交易回执和第二类交易回执不一致的情况下,将所述任一交易确定为引起所述分叉的目标区块链交易。
可选的,所述交易重放单元502还用于:从本地维护的第一平行区块链的首个分叉区块中获取所述目标区块链交易,并执行获取到的所述目标区块链交易。
可选的,所述交易重放单元502还用于:向其他区块链节点提供所述目标区块链交易,以由所述其他区块链节点执行所述目标区块链交易;所述装置还包括远程数据接收单元503,用于接收所述其他区块链节点返回的所述交易相关数据。
可选的,所述交易重放单元502还用于:将从本地获取的所述目标区块链交易发送至其他区块链节点;或者,将所述目标区块链交易的交易哈希发送至其他区块链节点,以由所述其他区块链节点根据所述交易哈希在本地维护的平行区块链的首个分叉区块中查询所述目标区块链交易。
可选的,所述其他区块链节点维护的链上区块所属的第二平行区块链,与所述任一区块链节点维护的链上区块所属的第一平行区块链不同。
可选的,所述首个分叉区块中包含执行顺序位于所述目标区块链交易之前的至少一个前序交易,所述交易重放单元502还用于:按照所述执行顺序依次执行所述至少一个前序交易和所述目标区块链交易。
可选的,所述交易重放单元502还用于:在所述区块链账本中确定所述首个分叉区块的前一区块以及该区块对应的世界状态,并基于所述世界状态执行所述目标区块链交易。
可选的,所述任一区块链节点包含服务插件、预验证插件、链插件和执行插件,所述链插件用于管理所述执行插件执行的历史交易,所述交易重放单元502还用于:由所述预验证插件获取所述链插件管理的所述目标区块链交易,并将所述目标区块链交易发送至所述执行插件执行;由所述预验证插件确定重放过程涉及的交易相关数据,并通过所述服务插件输出所述交易相关数据。
可选的,任一区块链节点还包含虚拟机插件,所述交易重放单元502还用于:在所述目标区块链交易调用智能合约的情况下,通过所述虚拟机插件调用并执行所述智能合约;以及,接收所述虚拟机插件返回的执行所述智能合约产生的合约执行数据,并将所述合约执行数据作为所述交易相关数据转发至所述预验证插件。
可选的,所述交易重放单元502还用于:将所述交易相关数据发送至任一区块链节点对应的客户端或者管理设备,以由所述客户端或者所述管理设备向用户展示所述 交易相关数据。
可选的,所述交易相关数据,包括下述至少之一:所述目标区块链交易关联的账户地址;所述目标区块链交易所调用方法的方法名和方法参数;所述目标区块链交易所调用智能合约的合约地址、合约方法、输入参数和/或合约代码文件信息;所述任一区块链节点执行与所述目标区块链交易相关的读/写操作产生的读写集。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的 结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本公开不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
本公开是参照根据本公开实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括 指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见 方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。

Claims (16)

  1. 一种重放区块链交易的方法,应用于区块链网络中的任一区块链节点,所述方法包括:
    在确定所述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在所述多条平行区块链的首个分叉区块中;
    从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。
  2. 根据权利要求1所述的方法,所述确定所述区块链网络对应的区块链账本分叉为多条平行区块链,包括:
    在针对当前区块的共识过程中,获取任一其他区块链节点提供的所述当前区块的父哈希;
    在所述父哈希与所述任一区块链节点维护的链上最新区块的区块哈希不一致的情况下,确定所述区块链网络对应的区块链账本分叉为多条平行区块链。
  3. 根据权利要求1所述的方法,所述任一区块链节点维护有第一平行区块链的区块,所述确定引起所述分叉的目标区块链交易,包括:
    确定所述任一区块链节点执行第一平行区块链的首个分叉区块中的各个交易所产生的各个第一类交易回执,并获取任一其他区块链节点执行第二平行区块链的首个分叉区块中的各个交易产生的各个第二类交易回执;
    在任一交易的第一类交易回执和第二类交易回执不一致的情况下,将所述任一交易确定为引起所述分叉的目标区块链交易。
  4. 根据权利要求1所述的方法,所述从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,包括:
    从本地维护的第一平行区块链的首个分叉区块中获取所述目标区块链交易,并执行获取到的所述目标区块链交易。
  5. 根据权利要求1所述的方法,
    所述从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,包括:向其他区块链节点提供所述目标区块链交易,以由所述其他区块链节点执行所述目标区块链交易;
    所述方法还包括:接收所述其他区块链节点返回的所述交易相关数据。
  6. 根据权利要求5所述的方法,所述向其他区块链节点提供所述目标区块链交易,包括:
    将从本地获取的所述目标区块链交易发送至其他区块链节点;或者,
    将所述目标区块链交易的交易哈希发送至其他区块链节点,以由所述其他区块链节点根据所述交易哈希在本地维护的平行区块链的首个分叉区块中查询所述目标区块链 交易。
  7. 根据权利要求5所述的方法,所述其他区块链节点维护的链上区块所属的第二平行区块链,与所述任一区块链节点维护的链上区块所属的第一平行区块链不同。
  8. 根据权利要求1所述的方法,所述首个分叉区块中包含执行顺序位于所述目标区块链交易之前的至少一个前序交易,所述对所述目标区块链交易进行重放,包括:
    按照所述执行顺序依次执行所述至少一个前序交易和所述目标区块链交易。
  9. 根据权利要求1所述的方法,所述对所述目标区块链交易进行重放,包括:
    在所述区块链账本中确定所述首个分叉区块的前一区块以及该区块对应的世界状态,并基于所述世界状态执行所述目标区块链交易。
  10. 根据权利要求1所述的方法,所述任一区块链节点包含服务插件、预验证插件、链插件和执行插件,所述链插件用于管理所述执行插件执行的历史交易,所述从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,包括:
    所述预验证插件获取所述链插件管理的所述目标区块链交易,并将所述目标区块链交易发送至所述执行插件执行;
    所述预验证插件确定重放过程涉及的交易相关数据,并通过所述服务插件输出所述交易相关数据。
  11. 根据权利要求10所述的方法,任一区块链节点还包含虚拟机插件,所述执行插件执行所述目标区块链交易,包括:
    在所述目标区块链交易调用智能合约的情况下,通过所述虚拟机插件调用并执行所述智能合约;以及,
    接收所述虚拟机插件返回的执行所述智能合约产生的合约执行数据,并将所述合约执行数据作为所述交易相关数据转发至所述预验证插件。
  12. 根据权利要求1所述的方法,所述输出执行过程产生的交易相关数据,包括:
    将所述交易相关数据发送至任一区块链节点对应的客户端或者管理设备,以由所述客户端或者所述管理设备向用户展示所述交易相关数据。
  13. 根据权利要求1所述的方法,所述交易相关数据,包括下述至少之一:
    所述目标区块链交易关联的账户地址;
    所述目标区块链交易所调用方法的方法名和方法参数;
    所述目标区块链交易所调用智能合约的合约地址、合约方法、输入参数和/或合约代码文件信息;
    所述任一区块链节点执行与所述目标区块链交易相关的读/写操作产生的读写集。
  14. 一种重放区块链交易的装置,应用于区块链网络中的任一区块链节点,所述装置包括:
    交易确定单元,用于在确定所述区块链网络对应的区块链账本分叉为多条平行区块链的情况下,确定引起所述分叉的目标区块链交易,所述目标区块链交易被分别记录在 所述多条平行区块链的首个分叉区块中;
    交易重放单元,用于从所述首个分叉区块中获取所述目标区块链交易并对所述目标区块链交易进行重放,且输出重放过程涉及的交易相关数据,所述交易相关数据被用于分析产生所述分叉的原因。
  15. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-13中任一项所述的方法。
  16. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-13中任一项所述方法的步骤。
PCT/CN2022/135240 2022-09-30 2022-11-30 重放区块链交易的方法及装置 Ceased WO2024066005A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211212088.4 2022-09-30
CN202211212088.4A CN115658357A (zh) 2022-09-30 2022-09-30 重放区块链交易的方法及装置

Publications (1)

Publication Number Publication Date
WO2024066005A1 true WO2024066005A1 (zh) 2024-04-04

Family

ID=84985838

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135240 Ceased WO2024066005A1 (zh) 2022-09-30 2022-11-30 重放区块链交易的方法及装置

Country Status (2)

Country Link
CN (1) CN115658357A (zh)
WO (1) WO2024066005A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117743305A (zh) * 2023-12-29 2024-03-22 蚂蚁区块链科技(上海)有限公司 区块链指标系统、指标修正方法及装置
CN117670330B (zh) * 2024-02-01 2024-05-24 中国信息通信研究院 基于区块链的交易处理方法和装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180114218A1 (en) * 2016-10-26 2018-04-26 International Business Machines Corporation Blockchain: automatic fork protection
US20200167779A1 (en) * 2018-11-27 2020-05-28 Akamai Technologies, Inc. High performance distributed system of record with confidence-based consensus
CN112347184A (zh) * 2019-08-07 2021-02-09 华为技术有限公司 分叉处理方法以及区块链节点
CN113347033A (zh) * 2021-05-31 2021-09-03 中国工商银行股份有限公司 基于区块链的根因定位方法、系统及验证节点
CN114661231A (zh) * 2022-02-18 2022-06-24 南京南瑞继保电气有限公司 电网监控主站系统参数变更记录的存储同步方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3285248B1 (en) * 2016-08-16 2019-07-03 Alcatel Lucent Blockchain-based security threat detection method and system
CN108647963B (zh) * 2018-05-02 2020-05-12 百度在线网络技术(北京)有限公司 区块链主链的确定方法、装置、服务器和存储介质
CN111190831B (zh) * 2020-01-02 2022-09-20 南京邮电大学 区块链共识算法的鲁棒性分析方法及区块链系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180114218A1 (en) * 2016-10-26 2018-04-26 International Business Machines Corporation Blockchain: automatic fork protection
US20200167779A1 (en) * 2018-11-27 2020-05-28 Akamai Technologies, Inc. High performance distributed system of record with confidence-based consensus
CN112347184A (zh) * 2019-08-07 2021-02-09 华为技术有限公司 分叉处理方法以及区块链节点
CN113347033A (zh) * 2021-05-31 2021-09-03 中国工商银行股份有限公司 基于区块链的根因定位方法、系统及验证节点
CN114661231A (zh) * 2022-02-18 2022-06-24 南京南瑞继保电气有限公司 电网监控主站系统参数变更记录的存储同步方法及装置

Also Published As

Publication number Publication date
CN115658357A (zh) 2023-01-31

Similar Documents

Publication Publication Date Title
CN113076253A (zh) 一种测试方法和测试装置
US20160048703A1 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
CN112087530B (zh) 一种将数据上传至区块链系统的方法、装置、设备及介质
CN110046523A (zh) 智能合约校验方法及装置和电子设备
WO2024092932A1 (zh) 交易执行方法和区块链节点
US20250342143A1 (en) Transaction execution methods and blockchain nodes in blockchain systems
CN112291321A (zh) 业务处理方法、装置及系统
WO2024001025A1 (zh) 一种预执行缓存数据清理方法和区块链节点
CN115658357A (zh) 重放区块链交易的方法及装置
CN115017167A (zh) 区块链系统和信息更新方法及装置
CN114996057A (zh) 数据备份方法及装置、电子设备和计算机可读存储介质
WO2025000878A1 (zh) 交易的执行方法、节点和区块链系统
CN112527519A (zh) 一种高性能本地缓存方法、系统、设备及介质
CN109389271B (zh) 应用性能管理方法及系统
CN116308372A (zh) 针对区块链交易的检测方法及装置
CN114692185A (zh) 数据处理方法及装置
CN114741736A (zh) 一种数据处理方法、装置、电子设备和存储介质
US20250077543A1 (en) Systems and methods for automatic ingestion of data using a rate-limited application programming interface
WO2025043923A1 (zh) 交易的执行方法及装置
WO2024244342A1 (zh) 区块链中的交易处理方法和区块链节点
CN118740596A (zh) 一种业务流量依赖关系确定方法、装置及设备
CN114726537B (zh) 数据处理方法及装置
CN117764728B (zh) 一种区块链跨合约调用方法、装置、设备及存储介质
CN110992039A (zh) 交易处理方法、装置及设备
CN117273924A (zh) 交易执行方法及装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22960601

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22960601

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 22960601

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.09.2025)