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

[Merged by Bors] - support existing multiple bootstrap files #4875

Closed

Conversation

countvonzero
Copy link
Contributor

Motivation

#4858 was not a backward compatible fix.

explorer's node running with latest in develop crashed with

{"L":"INFO","T":"2023-08-18T16:28:53.473Z","N":"ff765.bootstrap","M":"loaded bootstrap file","node_id":"ff76543be7a1919e65ac9eac4739aa467b0e0baa202825a77b223fc9c791dc70","module":"bootstrap","persisted":"/root/data/node/bootstrap/2/epoch-2-update-bs-2023-08-10T06-00-08","epoch":"2","beacon":"0xe3e3389e","activeset_size":2367,"name":"bootstrap"}
1
{"L":"FATAL","T":"2023-08-18T16:28:53.473Z","N":"ff765.bootstrap","M":"unexpected suffix for fallback files","node_id":"ff76543be7a1919e65ac9eac4739aa467b0e0baa202825a77b223fc9c791dc70","module":"bootstrap","suffix":"08","name":"bootstrap"}

changes

  • rename legacy files with timestamp to the correct one ("epoch-2-update-bs-2023-08-10T06-00-08" -> "epoch-2-update-bs")
  • delete extra files

testing

  • unit test
  • manually test with mainnet. sync a node with mainnet and restart multiple times so that there are multiple boostrap files for epoch 2. run new code and saw that only 1 file left "epoch-2-update-bs"

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #4875 (f3e1f89) into develop (c8ad829) will decrease coverage by 0.1%.
Report is 2 commits behind head on develop.
The diff coverage is 84.6%.

@@            Coverage Diff            @@
##           develop   #4875     +/-   ##
=========================================
- Coverage     76.9%   76.8%   -0.1%     
=========================================
  Files          261     261             
  Lines        30107   30119     +12     
=========================================
- Hits         23163   23158      -5     
- Misses        5459    5470     +11     
- Partials      1485    1491      +6     
Files Changed Coverage Δ
bootstrap/updater.go 77.9% <84.6%> (+0.6%) ⬆️

... and 5 files with indirect coverage changes

}
newPath := path[:idx+suffixLen+1]
if exists, _ := afero.Exists(fs, newPath); exists {
_ = fs.Remove(path)
Copy link
Member

Choose a reason for hiding this comment

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

Could this cause issues? Removing an existing file to make space for the old file to be renamed with new name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you start a node repeatedly, you will see the following.

$ ls -l data/bootstrap/2
total 1404
-r-------- 1 k k 158713 Aug 15 22:12 epoch-2-update-bs-2023-08-15T20-12-53
-r-------- 1 k k 158713 Aug 15 22:53 epoch-2-update-bs-2023-08-15T20-53-20
-r-------- 1 k k 158713 Aug 15 23:23 epoch-2-update-bs-2023-08-15T21-23-44
-r-------- 1 k k 158713 Aug 16 02:39 epoch-2-update-bs-2023-08-16T00-39-21
-r-------- 1 k k 158713 Aug 16 02:47 epoch-2-update-bs-2023-08-16T00-47-43
-r-------- 1 k k 158713 Aug 16 03:01 epoch-2-update-bs-2023-08-16T01-01-58
-r-------- 1 k k 158713 Aug 16 19:26 epoch-2-update-bs-2023-08-16T17-26-07
-r-------- 1 k k 158713 Aug 16 20:15 epoch-2-update-bs-2023-08-16T18-15-46
-r-------- 1 k k 158713 Aug 16 20:16 epoch-2-update-bs-2023-08-16T18-16-00

those files are all identical. we just need one, and newPath already exists (because it renamed the first one to newPath on line 444. so it's safe to delete here.

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 19, 2023
## Motivation
#4858 was not a backward compatible fix.

explorer's node running with latest in develop crashed with

```
{"L":"INFO","T":"2023-08-18T16:28:53.473Z","N":"ff765.bootstrap","M":"loaded bootstrap file","node_id":"ff76543be7a1919e65ac9eac4739aa467b0e0baa202825a77b223fc9c791dc70","module":"bootstrap","persisted":"/root/data/node/bootstrap/2/epoch-2-update-bs-2023-08-10T06-00-08","epoch":"2","beacon":"0xe3e3389e","activeset_size":2367,"name":"bootstrap"}
1
{"L":"FATAL","T":"2023-08-18T16:28:53.473Z","N":"ff765.bootstrap","M":"unexpected suffix for fallback files","node_id":"ff76543be7a1919e65ac9eac4739aa467b0e0baa202825a77b223fc9c791dc70","module":"bootstrap","suffix":"08","name":"bootstrap"}
```

## changes
- rename legacy files with timestamp to the correct one ("epoch-2-update-bs-2023-08-10T06-00-08" -> "epoch-2-update-bs")
- delete extra files

## testing
- unit test
- manually test with mainnet. sync a node with mainnet and restart multiple times so that there are multiple boostrap files for epoch 2. run new code and saw that only 1 file left "epoch-2-update-bs"
@bors
Copy link

bors bot commented Aug 19, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title support existing multiple bootstrap files [Merged by Bors] - support existing multiple bootstrap files Aug 19, 2023
@bors bors bot closed this Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants