Skip to content

PBTS: Introduce consensus param to enable PBTS, along with all validation to update it #2197

Closed

Description

@sergio-mena

Definition of Done

  • Define the (full) name for the introduced consensus parameter
  • Define the expected behaviour for the introduced parameter
    • Namely, given its value X and current height H, whether BFT Time or PBTS is enabled at height H.
  • Define the rules to updating the introduced parameter
    • Namely, given its current value is X , the current height is H, whether the new value X* is accepted

Activity

  1. moved this from Todo to In Progress in CometBFTon Jan 30, 2024
  2. added this to the 2024-Q1 milestone on Jan 30, 2024
  3. changed the title [-]Introduce consensus param to enable PBTS (in genesis, in updates, etc), along with all validation to update it[/-] [+]PBTS: Introduce consensus param to enable PBTS (in genesis, in updates, etc), along with all validation to update it[/+] on Jan 31, 2024
  4. cason commented on Feb 5, 2024

    @cason

    So, general question here: what is the expected behaviour for this parameter, meaning which value to use when:

    1. A chain starts from genesis, PBTS is enabled from scratch
    2. A chain starts from genesis, PBTS is disabled (possibly forever)
    3. A chain starts from genesis, PBTS should be enabled from a given height H
    4. An existing chain (i.e., behaviour when default values is adopted)
    5. An existing chain that wants to adopt PBTS immediately after the upgrade
    6. An existing chain that wants to adopt PBTS from a given height H
    7. An existing chain that does not want to adopt PBTS (possibly forever)
  5. sergio-mena commented on Feb 6, 2024

    @sergio-mena
    CollaboratorAuthor

    @cason take a look at all the test cases inside TestConsensusParamsUpdate_VoteExtensionsEnableHeight.
    Let me know if any of your questions above is not answered by that unit test.

  6. cason commented on Feb 7, 2024

    @cason

    So, correct me if I am wrong:

    1. A chain starts from genesis, PBTS is enabled from scratch:enable_height = 1 (is this the default?)
    2. A chain starts from genesis, PBTS is disabled (possibly forever): enable_height = 0 (is this the default?)
    3. A chain starts from genesis, PBTS should be enabled from a given height H: enable_height = H, provided H > current height
    4. An existing chain (i.e., behaviour when default values is adopted): if enable_height = 0 is the default, the existing chain does not (immediately) adopts PBTS
    5. An existing chain that wants to adopt PBTS immediately after the upgrade: enable_height = H+1, where H is the upgrade height?
    6. An existing chain that wants to adopt PBTS from a given height H: enable_height = H, provided H > current height
    7. An existing chain that does not want to adopt PBTS (possibly forever): enable_height = 0 (is this the default?)

    I think the pending to define here is the default value for existing chains and chains starting from genesis.

  7. cason commented on Feb 7, 2024

    @cason

    @cason take a look at all the test cases inside TestConsensusParamsUpdate_VoteExtensionsEnableHeight.
    Let me know if any of your questions above is not answered by that unit test.

    Yes, this defines the rules for upgrading the enable_height parameter. It does not define the behaviour.

  8. lasarojc commented on Feb 7, 2024

    @lasarojc
    Contributor

    🟥 A chain starts from genesis, PBTS is enabled from scratch:enable_height = 1 (is this the default?)
    🟩 A chain starts from genesis, PBTS is disabled (possibly forever): enable_height = 0 (is this the default?)

    The default right now is 0.

    🟩 A chain starts from genesis, PBTS should be enabled from a given height H: enable_height = H, provided H > current height

    It will be the case, since current height is 0. Otherwise we fall into the following case.

    🟩 An existing chain (i.e., behaviour when default values is adopted): if enable_height = 0 is the default, the existing chain does not (immediately) adopts PBTS
    🟨 An existing chain that wants to adopt PBTS immediately after the upgrade: enable_height = H+1, where H is the upgrade height?

    If the chain is already running v1 and we are talking about a different upgrade that is independent from PBTS, then on.
    If the upgrade is to v1, then the upgrade must happen first so the parameter is available to be set.

    🟩 An existing chain that wants to adopt PBTS from a given height H: enable_height = H, provided H > current height

    Same as the 4th case

    🟩 An existing chain that does not want to adopt PBTS (possibly forever): enable_height = 0 (is this the default?)

    Yes

  9. sergio-mena commented on Feb 8, 2024

    @sergio-mena
    CollaboratorAuthor

    It does not define the behaviour.

    The behavior is defined easily:

    • if enable_height is currently 0 --> BFT Time
    • if enable_height is currently H and H is bigger than the current height --> BFT Time
    • otherwise PBTS
  10. changed the title [-]PBTS: Introduce consensus param to enable PBTS (in genesis, in updates, etc), along with all validation to update it[/-] [+]PBTS: Introduce consensus param to enable PBTS, along with all validation to update it[/+] on Feb 12, 2024
  11. added a commit that references this issue on Feb 12, 2024
    0fc21e1
  12. cason commented on Feb 22, 2024

    @cason

    I think this is done, isn't it?

  13. lasarojc commented on Feb 23, 2024

    @lasarojc
    Contributor

    Closing. Pls reopen if it was hasty.

  14. moved this from In Progress to Done in CometBFTon Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions