You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Go API support to bootstrap node after it was state synced #884
P:tech-debtPriority: Technical debt that needs to be paid off to enable us to move faster, reliablyenhancementNew feature or requestgood first issueGood for newcomershygieneAny work relating to code legibility/hygiene to make it easier to readlight-clientLight client-relatedstate-sync
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.
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).
@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?
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.
P:tech-debtPriority: Technical debt that needs to be paid off to enable us to move faster, reliablyenhancementNew feature or requestgood first issueGood for newcomershygieneAny work relating to code legibility/hygiene to make it easier to readlight-clientLight client-relatedstate-sync
Activity
cason commentedon May 30, 2023
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).
tac0turtle commentedon May 31, 2023
any chance the comet team can reopen this #803 and merge it? that would close this issue
jmalicevic commentedon May 31, 2023
@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?
tac0turtle commentedon May 31, 2023
yea! we would wrap your command and delete the code we have
jmalicevic commentedon May 31, 2023
Ok, thanks for the info then, we'll reopen the PR and take another look!
jmalicevic commentedon Jun 30, 2023
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 !