EP3566397B1

Performing a change of primary node in a distributed system

Abstract

This record has no abstract on file.

EP3566397B1, drawing sheet 1
Sheet 1 of 17

Term

12.2 yearsleft in the term

Expires 13 December 2038.

  1. Priority and filed
  2. Granted
  3. Today
  4. Expires

15 claims: 4 independent, 11 dependent

  1. 1
    A computer-implemented method of performing a change of a primary node in a blockchain network (102) that comprises a plurality of network nodes, wherein the plurality of network nodes comprises the primary node (404) and one or more backup nodes (802), the method comprising:determining (806), by a backup node (802), that an epoch change needs to be performed, wherein the epoch change causes a change from a current epoch with a current primary node to a new epoch with a new primary node, wherein the current epoch comprises a consensus process for achieving consensus among the plurality of network nodes using the primary node, the consensus process comprising three phases, the three phases comprising a first phase (310) wherein the primary node (404) sends a first message to the backup node (802), the first message indicating that the primary node is initiating a consensus process, a second phase (320) wherein the backup node (802) receives the first message that is sent by the primary node, prepares a second message in response to the first message, and multicasts the second message to the other network nodes, wherein the second message indicates that the backup node (802) has received the first message from the primary node and is sending a reply in response to the first message, a third phase (330) wherein each of the network nodes multicasts a third message to the other network nodes, wherein the third message indicates that a network node has accepted a predetermined number of the second messages;determining (808), by the backup node, a respective weight of the backup node associated with each of the three phases of the consensus process in the current epoch, wherein the weight is a metric of a qualification of the backup node to be the new primary node;determining (810), by the backup node, a weight sum for the backup node based on the respective weight of the backup node associated with each of the three phases in the current epoch;in response to determining that the weight sum reaches a first predetermined threshold, sending (812), by the backup node, an EPOCH_CHANGE message to the plurality of network nodes, wherein the EPOCH_CHANGE message indicates a request for a change from the current epoch with the current primary node to the new epoch with the backup node being the new primary node, and the EPOCH_CHANGE message comprises the weight sum of the backup node;receiving (816), by the backup node, at least one NEW_EPOCH message from at least one of the plurality of network nodes other than the backup node, wherein the NEW_EPOCH message indicates an acknowledgement of the backup node to be the new primary node;verifying (818), by the backup node, whether the at least one NEW_EPOCH message is valid;determining (820), by the backup node, whether a number of valid NEW_EPOCH messages out of the at least one NEW_EPOCH message exceeds a second predetermined threshold;and in response to determining that the number of valid NEW_EPOCH messages exceeds the second predetermined threshold, determining, by the backup node, the backup node to be the new primary node in the new epoch.
  2. 2
    The method of Claim 1, wherein determining a respective weight of the backup node associated with each of the three phases of the consensus process in the current epoch comprises determining a weight of the backup node for a first phase of the consensus process to be a first value.
  3. 3
    The method of Claim 1, wherein determining (808) a respective weight of the backup node associated with each of the three phases of the consensus process in the current epoch comprises:in response to determining a failure of a quorum verification in a second phase of the consensus process in the current epoch, determining a weight of the backup node for the second phase of the consensus process to be a first value;and in response to determining a success of a quorum verification in the second phase of the consensus process in the current epoch, determining the weight of the backup node for the second phase of the consensus process to be a second value, wherein the first value is smaller than the second value, and optionally wherein the quorum verification in the second phase for the network node comprises receiving a predetermined number of ECHO messages from other network nodes.
  4. 4
    The method of Claim 1, wherein determining (808) a respective weight of the backup node associated with each of the three phases of the consensus process in the current epoch comprises:in response to determining a failure of a quorum verification in a third phase of the consensus process in the current epoch, determining a weight of the backup node for the third phase of the consensus process to be a third value;and in response to determining a success of a quorum verification in the third phase of the consensus process in the current epoch, determining the weight of the backup node for the third phase of the consensus process to be a fourth value, wherein the third value is smaller than the fourth value.
  5. 5
    The method of Claim 4, wherein the quorum verification in the third phase for the network node comprises receiving a pre-determined number of accept messages from other network nodes, wherein each of the accept messages from other network nodes indicates each of the other network nodes has accepted a predetermined number of ECHO messages.
  6. 6
    The method of Claim 1, wherein the EPOCH_CHANGE message further comprises a set of signatures associated with a set of network nodes out of the plurality of network nodes, and wherein the NEW_EPOCH message comprises a digest of the EPOCH_CHANGE message.
  7. 7
    The method of Claim 6, wherein verifying (818) whether the at least one valid NEW_EPOCH message is valid comprises verifying whether the digest of the EPOCH_CHANGE message in the at least one NEW_EPOCH message is valid, and wherein verifying whether the digest of the EPOCH_CHANGE message in the at least one NEW_EPOCH message is valid comprises verifying whether the set of signatures in the EPOCH_CHANGE message are valid.
  8. 8
    The method of Claim 1, wherein determining that an epoch change needs to be performed comprises determining that an epoch change needs to be performed in response to determining that the consensus has not been achieved in the old epoch within a predetermined time period.
  9. 9
    The method of Claim 1, further comprising operating in the new epoch with the new primary node, wherein the new epoch comprises a consensus process for achieving consensus among the plurality of network nodes using the new primary node.
  10. 10
    A computer-implemented method of performing a change of a primary node in a blockchain network that comprises a plurality of network nodes, wherein the plurality of network nodes comprises the primary node (404) and one or more backup nodes (802), the method comprising:receiving (812), by a network node (804), an EPCOH_CHANGE message from a backup node other than the network node, wherein the EPOCH_CHANGE message comprises an indication that an epoch change needs to be performed, wherein the epoch change causes an change from a current epoch with a current primary node to a new epoch with a new primary node, wherein the current epoch comprises a consensus process for achieving consensus among the plurality of network nodes using the primary node, the consensus process comprising three phases, the three phases comprising a first phase (310) wherein the primary node (404) sends a first message to the backup node (802), the first message indicating that the primary node is initiating a consensus process, a second phase (320) wherein the backup node (802) receives the first message that is sent by the primary node, prepares a second message in response to the first message, and multicasts the second message to the other network nodes, wherein the second message indicates that the backup node (802) has received the first message from the primary node and is sending a reply in response to the first message, a third phase (330) wherein each of the network nodes multicasts a third message to the other network nodes, wherein the third message indicates that a network node has accepted a predetermined number of the second messages;verifying (814), by the network node (804), whether the EPOCH_CHANGE message is valid;in response to verifying that the EPOCH_CHANGE message is valid, sending (816), by the network node (804), a NEW_EPOCH message to the other network nodes, wherein the NEW_EPOCH message comprises a digest of the EPOCH_CHANGE message;receiving, by the network node (804), at least one NEW_EPOCH message from at least one of the plurality of network nodes other than the network node;verifying, by the network node, whether the at least one NEW_EPOCH message is valid;determining (820), by the network node (804), whether a number of valid NEW_EPOCH messages out of the at least one NEW_EPOCH message exceeds a predetermined threshold;and in response to determining that the number of valid NEW_EPOCH messages exceeds the predetermined threshold, determining (822), by the network node (804), the backup node (802) to be the new primary node in the new epoch.
  11. 11
    The method of Claim 10, wherein the EPOCH_CHANGE message comprises a weight sum associated with the backup node and a set of signatures associated with a set of network nodes out of the plurality of network nodes.
  12. 12
    The method of Claim 11, wherein the verifying whether the EPOCH_CHANGE message is valid comprises verifying whether the weight sum in the EPOCH_CHANGE message is valid, wherein verifying whether the weight sum in the EPOCH_CHANGE message is valid comprises verifying whether the set of signatures are valid.
  13. 13
    The method of Claim 11, wherein verifying whether the at least one NEW_EPOCH message is valid comprises verifying whether the digest of the EPOCH_CHANGE message in the at least one NEW_EPOCH message is valid, and wherein verifying whether the digest of the EPOCH_CHANGE message in the at least one NEW_EPOCH message is valid comprises verifying whether the set of signatures in the EPOCH_CHANGE message are valid.
  14. 14
    A non-transitory computer-readable storage medium coupled to one or more computers and configured with instructions executable by the one or more computers to perform the method of any one of claims 1 to 13.
  15. 15
    A system, including:one or more computers;and one or more computer-readable memories coupled to the one or more computers and configured with instructions executable by the one or more computers to perform the method of any one of claims 1 to 13.