Skip to content

Add Go API support to bootstrap node after it was state synced #884

Closed

Description

@adizere

Feature Request

Context

The SDK recently added support to allow node operators to restore app state from a local snapshot (and additionally manipulate app snapshots). For a more thorough context, see section "Application-implemented local state sync" from ADR 104 in #801.

As part of this work, the bootstrap-state command in the SDK handles the bootstrapping of a fresh comet-based node.

Problem

This SDK bootstrap-state command comprises initializing the block store and state store, as well as light client verification. All of these steps rely on internal interfaces of CometBFT.

Proposal

Ideally, the SDK should be provided with a simpler and direct API from Comet that handles this bootstrapping functionality. We should add a public Go API method for this purpose.

Activity

  1. added
    enhancement
    good first issue
    light-client
    P:tech-debt
    hygiene
    on May 24, 2023
  2. cason commented on May 30, 2023

    @cason

    This SDK bootstrap-state command comprises initializing the block store and state store, as well as light client verification

    For the sake of precision, light client is used to retrieve the state for a given height, in the standard case the application's last height, and the light-client obtained height is used to bootstrap the block store and the state store.

    This same procedure is performed for a fresh node after running State Sync, check here, with the difference that the node proceed with its bootstrap by switching to Block Sync (this step is mandatory from v0.38).

  3. tac0turtle commented on May 31, 2023

    @tac0turtle
    Contributor

    any chance the comet team can reopen this #803 and merge it? that would close this issue

  4. jmalicevic commented on May 31, 2023

    @jmalicevic
    Collaborator

    @tac0turtle , do you think having this merged into Comet would remove the need for the bootstrap command you have on your end and avoid having the state sync bootstrap code copied into the SDK?

  5. tac0turtle commented on May 31, 2023

    @tac0turtle
    Contributor

    yea! we would wrap your command and delete the code we have

  6. jmalicevic commented on May 31, 2023

    @jmalicevic
    Collaborator

    Ok, thanks for the info then, we'll reopen the PR and take another look!

  7. linked a pull request that will close this issuefeat: add bootstrap-state cmd #803on May 31, 2023
  8. added this to the 2023-Q2 milestone on May 31, 2023
  9. jmalicevic commented on Jun 30, 2023

    @jmalicevic
    Collaborator

    As stated here, we will indeed adopt the implementation from #803, but think it is safer to provide it as an API rather than a command for the cli. We'll take over the remaining work on transforming it and testing the API upon ourselves but it matches @yihuang 's original implementation with a few extra checks. As I can't edit the original branch, I had to create a new PR (#1505).

    Please let us know if you see any technical problems with the proposed API and if the API cannot support you for your use case.

    I am sorry it took so long to get back to you !

  10. modified the milestones: 2023-Q2, 2023-Q3 on Jul 5, 2023
  11. moved this from Todo to Ready for Review in CometBFT 2023on Jul 8, 2023
  12. self-assigned this
    on Jul 8, 2023
  13. moved this from Ready for Review to Done in CometBFT 2023on Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P:tech-debtenhancementgood first issuehygienelight-clientstate-sync

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions