Skip to content

node/state:bootstrap state api (backport #1057)#1311

Merged
jmalicevic merged 5 commits intov0.38.xfrom
mergify/bp/v0.38.x/pr-1057
Sep 11, 2023
Merged

node/state:bootstrap state api (backport #1057)#1311
jmalicevic merged 5 commits intov0.38.xfrom
mergify/bp/v0.38.x/pr-1057

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Sep 8, 2023

This is an automatic backport of pull request #1057 done by Mergify.
Cherry-pick of 49127d2 has failed:

On branch mergify/bp/v0.38.x/pr-1057
Your branch is up to date with 'origin/v0.38.x'.

You are currently cherry-picking commit 49127d27e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .changelog/unreleased/breaking-changes/1057-bootstrap-state-api.md
	new file:   .changelog/unreleased/features/1057-bootstrap-state-api.md
	modified:   blocksync/reactor.go
	modified:   blocksync/reactor_test.go
	modified:   consensus/state.go
	modified:   node/node.go
	modified:   node/setup.go
	modified:   state/export_test.go
	modified:   state/store.go
	modified:   state/store_test.go
	modified:   store/store.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   state/mocks/store.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* add bootstrap state cmd

* add a missing line

* Initial API impl

* Added error message for missing appHash

* Added changelog, removed cli

* Added PR number

* Unified hex encoding with rest of the code

* Applied PR review comments

* Proper blockstore initialization in case of offline statesync

* Reverted forcing blocksync, not needed for correct operation

* Added changelog and comments

* Removed printfs, added check for empty state store

* Fixed linter

* Apply minor suggestions from code review

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Moved the appHash check up

* Apply minor suggestions from code review

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Apply suggestions from code review

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Fixed linter

* Do not look for VE when starting up after offline statesync

* Extracted  check for offline statesync outside load commit

* Reconstruct seen commit after offline statesync

* Call reconstructSeenCommit from reconstructLastCommit

* Reading offline statesync height only once and passing it as a parameter

* Moved up option initialization to make sure offline statesync is enabled

* Added error to panic message

* Update consensus/state.go

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Apply suggestions from code review

Co-authored-by: Sergio Mena <sergio@informal.systems>

* Adjusted new lines

* Added unit test to test int conversion and fixed linter

* Apply suggestions from code review

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Replaced closing ifs with defer, added errors to error messages

* linter fix

* Adapted bootstrap code to use proper genesis file functions

* Reverted genesis doc changes

* Moved deferred closing before checking for whether the store is empty

* Moved deferred close before error check

---------

Co-authored-by: HuangYi <huang@crypto.com>
Co-authored-by: yihuang <yi.codeplayer@gmail.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Sergio Mena <sergio@informal.systems>
(cherry picked from commit 49127d2)

# Conflicts:
#	state/mocks/store.go
@mergify mergify bot requested a review from a team as a code owner September 8, 2023 17:47
@mergify mergify bot added the conflicts label Sep 8, 2023
@jmalicevic jmalicevic self-assigned this Sep 11, 2023
@jmalicevic
Copy link
Collaborator

@Mergifyio refresh

@mergify
Copy link
Contributor Author

mergify bot commented Sep 11, 2023

refresh

✅ Pull request refreshed

Copy link
Collaborator

@sergio-mena sergio-mena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-checked (diff of diffs) and LGTM 👍

@jmalicevic jmalicevic merged commit 2e36881 into v0.38.x Sep 11, 2023
@jmalicevic jmalicevic deleted the mergify/bp/v0.38.x/pr-1057 branch September 11, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants