-
Notifications
You must be signed in to change notification settings - Fork 91
perf(core): snapshots #3211
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
base: main
Are you sure you want to change the base?
perf(core): snapshots #3211
Changes from all commits
098369e
4c94c78
6346086
61f2a8e
47d2d42
6918fe4
427d9b6
de7da8d
245e2dd
7e4224e
f5790e7
30fae24
3e34382
e4dd995
d3d7f73
8d0eb7a
847fc0f
6d24b58
c8a727c
5e9fe65
c5dd336
4ca6a19
b7075eb
3c5ead5
3c18f72
33b4f5d
dc5d0bc
8a70c08
cc6d49c
25a5442
37f055b
67856b0
1ceb899
8e70278
180f768
7fb569a
fad160e
8e2d0e9
3f4d650
4be34a6
f0d0bcb
947dfd3
5258edb
3cd6690
bca0231
d9ba41e
8f44b09
fa38d5a
311f1a6
c92ade1
8fe3b87
651ee0d
fa93589
3e684a1
b677cdf
6c1deb5
345b102
079b8d5
faf63d3
b635586
e817511
a67f90a
f1dbc45
6a1f1ac
f92887f
a10c34f
bff316e
654a4b8
c995843
e18d09e
2efc16d
a6233c9
835e633
a734313
d0bad7b
201ec4e
40b8089
1a3e7d0
bc288ea
68b67d1
d7692b6
d0e3ae4
c47332f
8a0880f
a3a26a8
550dd3e
f9a64b8
e374a67
01a993c
f2a4a82
340782c
d0f990c
2d3249e
0a67694
77f35be
fe85651
e2e971b
3d8cfd6
e5702d6
6a959cd
47c228e
eeab456
7f46643
a4b4441
c9a8834
aad0d08
9bc0c45
d2bd73c
a26ea71
d92b3d8
7eb5b09
207205f
58501fa
dc14c45
75e3341
d0de977
dcac752
ae31621
b87792c
e5bbd92
a0c61bb
397c782
c59af67
811a59f
cd44051
53a8d48
39461be
3707d61
60e2aa4
aaaf230
7ef8801
cef4f99
c85ea2d
455fccf
e3e3dfa
b576df8
f4747ea
51a5e0e
814b777
4c4644d
dbf4f3a
fa996d9
3fb340f
e628e54
6b49f0e
258b723
d1c3a71
5ef0e46
c4c42a5
2ce8a3a
e05a243
063ad41
dbb41ff
20abfbc
ec2d432
d5095d9
5a7c8f5
9109d33
0da99b6
03c3239
d0498de
7fb4224
4240610
5040cda
9c8d09d
49243dd
ed00f2d
e5d6727
3146d5b
f42b979
ba59bb1
ab411ae
2df54b4
877b29f
1ecb543
513981b
6c3b42b
1cde3b1
f2c39d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,10 @@ pub enum StoreError { | |
#[error("Failed to lock database for writing")] | ||
LockError, | ||
} | ||
|
||
#[cfg(feature = "libmdbx")] | ||
impl From<anyhow::Error> for StoreError { | ||
fn from(err: anyhow::Error) -> Self { | ||
StoreError::LibmdbxError(err) | ||
} | ||
} | ||
Comment on lines
+56
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems convoluted and counterintuitive. anyhow:Error is very generic. How can we make sure it would always be a libmdbx error? why do we need this? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
use std::fmt::Debug; | ||
use std::marker::PhantomData; | ||
|
||
#[cfg(feature = "redb")] | ||
use crate::store_db::codec::{ | ||
account_info_log_entry::AccountInfoLogEntry, account_storage_log_entry::AccountStorageLogEntry, | ||
block_num_hash::BlockNumHash, | ||
}; | ||
use bytes::Bytes; | ||
#[cfg(feature = "redb")] | ||
use ethrex_common::{Address, U256, types::AccountInfo}; | ||
use ethrex_common::{ | ||
H256, | ||
types::{ | ||
|
@@ -24,6 +31,22 @@ pub type AccountHashRLP = Rlp<H256>; | |
pub type AccountStateRLP = Rlp<AccountState>; | ||
pub type TriePathsRLP = Rlp<Vec<Nibbles>>; | ||
|
||
// Snapshot state RLP types | ||
#[cfg(feature = "redb")] | ||
pub type AccountInfoLogEntryRLP = Rlp<AccountInfoLogEntry>; | ||
#[cfg(feature = "redb")] | ||
pub type AccountStorageLogEntryRLP = Rlp<AccountStorageLogEntry>; | ||
#[cfg(feature = "redb")] | ||
pub type BlockNumHashRLP = Rlp<BlockNumHash>; | ||
#[cfg(feature = "redb")] | ||
pub type AccountAddressRLP = Rlp<Address>; | ||
#[cfg(feature = "redb")] | ||
pub type AccountInfoRLP = Rlp<AccountInfo>; | ||
#[cfg(feature = "redb")] | ||
pub type AccountStorageKeyRLP = Rlp<H256>; | ||
#[cfg(feature = "redb")] | ||
pub type AccountStorageValueRLP = Rlp<U256>; | ||
Comment on lines
+35
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is redb specific, why do we need it in the storage rlp directory? Can we not have it in the redb file instead? |
||
|
||
// Block types | ||
pub type BlockHashRLP = Rlp<BlockHash>; | ||
pub type BlockHeaderRLP = Rlp<BlockHeader>; | ||
|
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: maybe clarify that the result is an option because there may be no current snapshot (if there is, there will always be an associated block hash).