Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize signature verification when bootstrapping #3255

Merged
merged 6 commits into from
Aug 2, 2024

Commits on Aug 1, 2024

  1. Minimize signature verification when bootstrapping

    When bootstrapping blocks of the P-chain, the node verifies blocks when it replicates them from remote nodes,
    and afterwards it executes them.
    
    When executing them, it verifies the blocks once again via parsing them.
    This is redundant, as it has already parsed them before while replicating them.
    
    This change introduces an interface called Appraiser, which similar to the parser
    found in snow/engine/snowman/block/vm.go, converts the bytes of a block to a snowman.Block.
    
    However, unlike the Parser, it is only implemented at the proposerVM, and doesn't verify the signature
    of the block, reducing the CPU cycles it costs to execute the blocks when bootstrapping.
    
    When testing a chunk of 1000 blocks, parsing the blocks without verifying the signature shaves off 93% of the runtime
    in comparison to just appraising them.
    
    Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
    yacovm committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    61ee240 View commit details
    Browse the repository at this point in the history
  2. Remove comparison test

    Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
    yacovm committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    1d863b0 View commit details
    Browse the repository at this point in the history
  3. Address code review comments

    Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
    yacovm committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    dd8c58f View commit details
    Browse the repository at this point in the history
  4. Address code review comments

    Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
    yacovm committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    1307e25 View commit details
    Browse the repository at this point in the history
  5. Address code review comments

    Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
    yacovm committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    f1f99c3 View commit details
    Browse the repository at this point in the history
  6. Rebase on top of latest master

    Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
    yacovm committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    750f0fd View commit details
    Browse the repository at this point in the history