-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: always write receipts to static files on new nodes #19399
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
Conversation
012a482 to
0a784c1
Compare
d1a52cc to
8590a0f
Compare
0a784c1 to
4c15c75
Compare
1e3d5b8 to
309d1d2
Compare
e5d730d to
eea160a
Compare
309d1d2 to
894b411
Compare
894b411 to
cca09b0
Compare
eea160a to
6429250
Compare
cca09b0 to
57ba2fb
Compare
crates/storage/db-common/src/init.rs
Outdated
|
|
||
| // Behaviour reserved only for new nodes should be set here. | ||
| let storage_settings = StorageSettings::new(); | ||
| let storage_settings = StorageSettings::new().with_receipts_in_static_files(); |
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.
ensures that only new nodes will do it
think it needs more work to not write receipts only to delete them later
1d6d85d to
ffa9181
Compare
| /// - If the node should always write receipts to static files, but receipt log filter pruning | ||
| /// is enabled, write to the database. | ||
| /// - Otherwise, write to static files. | ||
| pub fn receipts_destination<P: DBProvider + StorageSettingsCache>( |
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.
taken from #19630
mattsse
left a comment
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.
pending @shekhirin
| // files yet. Once receipts exist in static files, we must continue writing to maintain | ||
| // continuity and have no gaps. |
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.
I see
| if self.receipts { | ||
| StorageSettings::new().with_receipts_in_static_files() | ||
| } else { | ||
| StorageSettings::legacy() | ||
| } |
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.
nit: think it's nicer to be able to do
| if self.receipts { | |
| StorageSettings::new().with_receipts_in_static_files() | |
| } else { | |
| StorageSettings::legacy() | |
| } | |
| StorageSettings::legacy().with_receipts_in_static_files(self.receipts) |
On top of #19384
On old nodes we are writing receipts to database if pruning is enabled, otherwise to static files.
Moving forward and using
StorageSettingsthe new logic should be:For now, only enabled through
--static-files.receiptswhen launching the node