-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
silkworm: add state snapshots #13766
Conversation
05c43e7
to
9e10d1d
Compare
9e10d1d
to
8b01de4
Compare
8b01de4
to
e4e12d8
Compare
e4e12d8
to
ce762ec
Compare
ce762ec
to
0d38d22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
} | ||
return DomainSnapshot{ | ||
Segment: memoryMappedFile(item.Segment()), | ||
ExistenceIndex: silkworm_go.MemoryMappedFile{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either HashMap index or bt+existence index exist. Maybe we should avoid creating memoryMappedFile always for existence/btree?
Can do this more generally by exposing AccessorList in state.FilesItem, and checking this AccessorList for deciding which indexes to set in DomainSnapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'm planning to do this in a follow up work to make this configurable. For now we've decided to workaround this by disabling passing Commitment files because it is the only domain that does it differently at the moment, and we don't support it fully on the silkworm side yet anyway.
Previously the Silkworm library was capable of reading Erigon 2 "blocks" snapshots (.seg and .idx). The code to provide them to Silkworm was a part of RoSnapshots. The old code is moved to be a part of silkworm.SnapshotsRepository, and migrated to the updated Silkworm C API.
The new code adds an ability to provide Erigon 3 "state" snapshots for reading by Silkworm during evmone execution mode (
--silkworm.exec
). It is based on the AggregatorRoTx.StaticFilesInRange method that was made public (with the related DTOs) to be accessible from the silkworm package.BtIndex.DataHandle() added to expose the memory mapped file pointer to Silkworm (in the same way as Decompressor and recsplit.Index). A bunch of public methods added to filesItem via FilesItem interface to expose the snapshot file objects to Silkworm.