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

Snapshots of Bor events #7901

Merged
merged 179 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
ff3407f
Update to erigon-lib
Jul 14, 2023
c47fe34
Add extra stage for bor snapshots
AlexeyAkhunov Jul 15, 2023
b74831f
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Jul 15, 2023
da99593
More
Jul 16, 2023
c325351
Add stage for downloading data from heimdall
AlexeyAkhunov Jul 17, 2023
201f94a
Stage configs
AlexeyAkhunov Jul 17, 2023
7a02b63
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Jul 18, 2023
5119b8c
Intermediate
AlexeyAkhunov Jul 18, 2023
6c90f88
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Jul 18, 2023
7afa15f
Intermediate
AlexeyAkhunov Jul 18, 2023
587b624
Unwind logic for bor events
AlexeyAkhunov Jul 18, 2023
a7130b3
More boilerplate
AlexeyAkhunov Jul 21, 2023
f21a57a
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Jul 21, 2023
1bcd47e
More boilerplate
AlexeyAkhunov Jul 21, 2023
45ab263
More boilerplate
AlexeyAkhunov Jul 21, 2023
42aa04f
BorRoSnapshots
AlexeyAkhunov Jul 23, 2023
723d596
More boilerplate
AlexeyAkhunov Jul 23, 2023
ffb2ef1
Fix lint
AlexeyAkhunov Jul 25, 2023
7f676eb
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Jul 25, 2023
2f84a28
Fixup
AlexeyAkhunov Jul 25, 2023
822f2ae
Print on bor retire
AlexeyAkhunov Jul 25, 2023
17674bb
Prints
AlexeyAkhunov Jul 25, 2023
ddf70c3
Print
AlexeyAkhunov Jul 25, 2023
695e7cd
Print
AlexeyAkhunov Jul 25, 2023
93004d1
BorRetire
AlexeyAkhunov Jul 25, 2023
444647a
enable forward progress on bor snapshots
AlexeyAkhunov Jul 25, 2023
025690f
Remove print, add notifications
AlexeyAkhunov Jul 25, 2023
4a21770
Print
AlexeyAkhunov Jul 25, 2023
624325c
Print
AlexeyAkhunov Jul 25, 2023
3ded3a9
Print
AlexeyAkhunov Jul 25, 2023
74060a8
stage_bor_snapshots reset
AlexeyAkhunov Jul 26, 2023
613e4e5
borHashToBlockNum
AlexeyAkhunov Jul 27, 2023
13ab7af
Add merger
AlexeyAkhunov Jul 28, 2023
7cded4c
Remove print
AlexeyAkhunov Jul 28, 2023
8c6c7b3
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Jul 28, 2023
57658a4
Update erigon-lib
AlexeyAkhunov Jul 28, 2023
14251d6
Correct merge
AlexeyAkhunov Jul 28, 2023
a45d7b6
Change snapshot and index format
AlexeyAkhunov Jul 28, 2023
7a1ba61
Retire and merge all snapshots in the same goroutine
AlexeyAkhunov Jul 28, 2023
5ae2aba
Trying to fix snaps
AlexeyAkhunov Jul 28, 2023
390a660
Print
Jul 29, 2023
e98ec86
Print
Jul 29, 2023
3cdfce0
Print
Jul 29, 2023
2b985a8
Print
Jul 29, 2023
153e4b7
files
Jul 29, 2023
2cf824c
readSeg
Jul 30, 2023
ef0259a
Print
Jul 30, 2023
18413d1
Bor snapshots
Jul 30, 2023
267b994
Bor lookup
Jul 30, 2023
8defd6e
Clean up
Jul 30, 2023
2e073d2
Prints
Jul 31, 2023
b471063
Fix bor snapshot scanning
AlexeyAkhunov Aug 2, 2023
c2d027e
Merge branch 'bor-event-snap' of https://github.com/ledgerwatch/erigo…
AlexeyAkhunov Aug 2, 2023
0c9173b
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 2, 2023
c40b64d
Update erigon-lib
AlexeyAkhunov Aug 2, 2023
ad178f8
Fix test
AlexeyAkhunov Aug 2, 2023
7a484eb
Fix another test
AlexeyAkhunov Aug 2, 2023
5c01357
Fix test
AlexeyAkhunov Aug 2, 2023
853c477
Add downloader requests
AlexeyAkhunov Aug 2, 2023
6a79ec0
Merge bugfix
AlexeyAkhunov Aug 2, 2023
c69c884
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 2, 2023
cdac12e
Update to erigon-lib
AlexeyAkhunov Aug 3, 2023
268f9d2
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 3, 2023
7f787bd
Missing indices
AlexeyAkhunov Aug 3, 2023
742c298
Print
AlexeyAkhunov Aug 3, 2023
09c325c
Print
AlexeyAkhunov Aug 3, 2023
2269a83
Print
Aug 3, 2023
3f1bee4
indexWorkers
AlexeyAkhunov Aug 3, 2023
2fcf68a
Print
AlexeyAkhunov Aug 3, 2023
618e183
Print
AlexeyAkhunov Aug 3, 2023
6ebf5a2
Print
AlexeyAkhunov Aug 3, 2023
2a73b55
Remove prints
AlexeyAkhunov Aug 3, 2023
eea199b
borevents snapshots
AlexeyAkhunov Aug 3, 2023
a651a3e
Missing snapshots
AlexeyAkhunov Aug 3, 2023
6edaf2f
Print
AlexeyAkhunov Aug 3, 2023
eba2d30
Print
AlexeyAkhunov Aug 3, 2023
ba0a3df
Print
AlexeyAkhunov Aug 3, 2023
e54a231
No whitelist
AlexeyAkhunov Aug 3, 2023
4007f92
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 3, 2023
e273cfd
Update erigon-lib
AlexeyAkhunov Aug 3, 2023
f9abb07
Print
AlexeyAkhunov Aug 4, 2023
69d21a2
Print
AlexeyAkhunov Aug 4, 2023
637c636
Print
AlexeyAkhunov Aug 4, 2023
d7b7952
Print
AlexeyAkhunov Aug 4, 2023
d5835cf
Print
AlexeyAkhunov Aug 4, 2023
3c2d0a7
No snapshots
AlexeyAkhunov Aug 5, 2023
856b575
No drop
AlexeyAkhunov Aug 7, 2023
bbc91a5
Print
AlexeyAkhunov Aug 7, 2023
bc11153
Print
AlexeyAkhunov Aug 7, 2023
eb3c5cc
Print
AlexeyAkhunov Aug 7, 2023
556c156
Print
Aug 8, 2023
e1ccd73
Print
Aug 8, 2023
04cd8de
Print
Aug 8, 2023
918e36f
Print
Aug 8, 2023
abfd964
Print
Aug 8, 2023
b4d6472
Print
Aug 8, 2023
bd55921
Print
Aug 8, 2023
4a41fba
Print
Aug 8, 2023
09da8a7
Print
Aug 8, 2023
27008de
Print
AlexeyAkhunov Aug 8, 2023
e141779
Print
AlexeyAkhunov Aug 8, 2023
6ecc9a7
Print
AlexeyAkhunov Aug 8, 2023
9a0fe1b
Print
AlexeyAkhunov Aug 8, 2023
14285c1
Print
AlexeyAkhunov Aug 8, 2023
beed2c4
Print
AlexeyAkhunov Aug 8, 2023
fa365dd
Print
AlexeyAkhunov Aug 8, 2023
180f7a1
Print
AlexeyAkhunov Aug 8, 2023
f1d2f81
Print
AlexeyAkhunov Aug 8, 2023
99ac28d
Smaller number of snapshot files
AlexeyAkhunov Aug 9, 2023
eae7d56
Print
AlexeyAkhunov Aug 9, 2023
7d971dc
Print
AlexeyAkhunov Aug 9, 2023
1537b53
Print
AlexeyAkhunov Aug 9, 2023
9112028
Print
AlexeyAkhunov Aug 9, 2023
ca6b98a
Print
AlexeyAkhunov Aug 9, 2023
527567f
Print
AlexeyAkhunov Aug 9, 2023
01234fa
Print
AlexeyAkhunov Aug 9, 2023
6798d50
Print
AlexeyAkhunov Aug 9, 2023
8f60d6a
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 9, 2023
23bc855
Update erigon-lib
AlexeyAkhunov Aug 9, 2023
fbaa082
BorEvent function
Aug 9, 2023
f3c1681
EventsByBlock
AlexeyAkhunov Aug 10, 2023
0bfc791
EventsByBlock
AlexeyAkhunov Aug 10, 2023
b755729
Intermediate
AlexeyAkhunov Aug 10, 2023
03da05c
BorEvents pruning
AlexeyAkhunov Aug 10, 2023
cab7806
Fix lint
AlexeyAkhunov Aug 10, 2023
2d640e6
Fix BorEvents pruning
AlexeyAkhunov Aug 10, 2023
f7cfbb4
Add blockReader to bor consensus
AlexeyAkhunov Aug 10, 2023
28d4fb2
Introduce access to bor events into bor consensus
AlexeyAkhunov Aug 10, 2023
3c265c1
Extend bor events
AlexeyAkhunov Aug 11, 2023
00d7d89
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 11, 2023
74c6452
Fixup
AlexeyAkhunov Aug 11, 2023
f6dd029
Fixes for snapshot detection
AlexeyAkhunov Aug 11, 2023
e030e09
Fix retire, log prefix
AlexeyAkhunov Aug 11, 2023
2e2f0bf
Correction of bor isSync
AlexeyAkhunov Aug 11, 2023
22b7e33
Fix for the bor heimdall stage
AlexeyAkhunov Aug 11, 2023
6aa5a27
Fix empty files, use borEvents in Execution stage
AlexeyAkhunov Aug 11, 2023
f52ed0c
New snapshots hashes
AlexeyAkhunov Aug 11, 2023
cd0b3da
Revert
AlexeyAkhunov Aug 11, 2023
273d50b
Revert
AlexeyAkhunov Aug 11, 2023
1a1733a
Remove print
AlexeyAkhunov Aug 12, 2023
27eba00
Compare events
AlexeyAkhunov Aug 12, 2023
db19f01
Fix events
AlexeyAkhunov Aug 13, 2023
a333334
Fetch more than 1 event
Aug 13, 2023
db5721e
Fix indexing
Aug 13, 2023
010428a
Prepare to recreate borevents snapshots again
Aug 13, 2023
23aa189
Intermediate
Aug 13, 2023
f37c740
Fix
AlexeyAkhunov Aug 13, 2023
efe98cc
Snapshots
AlexeyAkhunov Aug 14, 2023
16d0269
Mumbai snapshots
AlexeyAkhunov Aug 14, 2023
1d84559
Use snapshot for state sync events
AlexeyAkhunov Aug 14, 2023
84fbcdc
cleanup
AlexeyAkhunov Aug 14, 2023
335e888
Add span snapshots
AlexeyAkhunov Aug 15, 2023
c739009
Fixes
AlexeyAkhunov Aug 15, 2023
d8e9e7d
Pruning of bor spans
AlexeyAkhunov Aug 16, 2023
1598480
Include span 0
AlexeyAkhunov Aug 16, 2023
5247ba1
borspans snapshots
AlexeyAkhunov Aug 16, 2023
195cea5
Print
AlexeyAkhunov Aug 17, 2023
c17940d
Print
AlexeyAkhunov Aug 17, 2023
007d5fd
Fix index gen
AlexeyAkhunov Aug 17, 2023
79fc203
Print
AlexeyAkhunov Aug 17, 2023
1fb1e78
Print
AlexeyAkhunov Aug 17, 2023
3272ea6
Add eventId to borevents snapshots
AlexeyAkhunov Aug 17, 2023
685dc4b
Print
AlexeyAkhunov Aug 17, 2023
2b23bef
Snapshots
AlexeyAkhunov Aug 17, 2023
c2758f8
Fix
AlexeyAkhunov Aug 17, 2023
b95b8a1
Print
AlexeyAkhunov Aug 17, 2023
49e6ce6
Print
AlexeyAkhunov Aug 17, 2023
2e84a66
Print
AlexeyAkhunov Aug 17, 2023
06a9704
Print
AlexeyAkhunov Aug 17, 2023
9d2c9f0
Fix
AlexeyAkhunov Aug 17, 2023
4c8e597
Cleanup
AlexeyAkhunov Aug 17, 2023
b6b6abd
Clean up
AlexeyAkhunov Aug 17, 2023
bf0b222
Fix
AlexeyAkhunov Aug 17, 2023
8bae2b7
Fix
AlexeyAkhunov Aug 18, 2023
d7cfec3
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 18, 2023
43cf165
Fix lint
AlexeyAkhunov Aug 18, 2023
b5465ef
Merge remote-tracking branch 'origin/devel' into bor-event-snap
AlexeyAkhunov Aug 18, 2023
fde4429
cleanup
AlexeyAkhunov Aug 18, 2023
ecef538
Update mods
AlexeyAkhunov Aug 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
AlexeyAkhunov committed Aug 15, 2023
commit c7390095833fcc85cfdbc9bc88be0ccd76467cc1
5 changes: 4 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1148,13 +1148,16 @@ func (s *Ethereum) Start() error {
var currentTD *big.Int
if err := s.chainDB.View(s.sentryCtx, func(tx kv.Tx) error {
h := rawdb.ReadCurrentHeader(tx)
if h == nil {
return nil
}
var err error
currentTD, err = rawdb.ReadTd(tx, h.Hash(), h.Number.Uint64())
return err
}); err != nil {
return err
}
if isChainPoS(s.chainConfig, currentTD) {
if currentTD != nil && isChainPoS(s.chainConfig, currentTD) {
go s.eth1ExecutionServer.Start(s.sentryCtx)
} else {
go stages2.StageLoop(s.sentryCtx, s.chainDB, s.stagedSync, s.sentriesClient.Hd, s.waitForStageLoopStop, s.config.Sync.LoopThrottle, s.logger, s.blockReader, hook)
Expand Down
17 changes: 15 additions & 2 deletions turbo/snapshotsync/freezeblocks/bor_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,12 @@ func BorSpansIdx(ctx context.Context, segmentFilePath string, blockFrom, blockTo
RETRY:
g.Reset(0)
var i, offset, nextPos uint64
var key [8]byte
for g.HasNext() {
nextPos, _ = g.Skip()
binary.BigEndian.PutUint64(key[:], uint64(i))
i++
if err = rs.AddOffset(offset); err != nil {
if err = rs.AddKey(key[:], offset); err != nil {
return err
}
select {
Expand Down Expand Up @@ -616,7 +618,7 @@ func BorSegments(dir string) (res []snaptype.FileInfo, missingSnapshots []Range,
var l []snaptype.FileInfo
var m []Range
for _, f := range list {
if f.T != snaptype.BorEvents && f.T != snaptype.BorSpans {
if f.T != snaptype.BorEvents {
continue
}
l = append(l, f)
Expand All @@ -625,6 +627,17 @@ func BorSegments(dir string) (res []snaptype.FileInfo, missingSnapshots []Range,
res = append(res, l...)
missingSnapshots = append(missingSnapshots, m...)
}
{
var l []snaptype.FileInfo
for _, f := range list {
if f.T != snaptype.BorSpans {
continue
}
l = append(l, f)
}
l, _ = noGaps(noOverlaps(borSegmentsMustExist(dir, l)))
res = append(res, l...)
}

return res, missingSnapshots, nil
}
Expand Down