Skip to content

Commit

Permalink
populate historic state
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Aug 30, 2024
1 parent 1191cbd commit b1562e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions libdevcore/DBFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ std::unique_ptr< DatabaseFace > DBFactory::createHistoric(
DatabaseKind _kind, fs::path const& _path ) {
switch ( _kind ) {
case DatabaseKind::LevelDB:
return std::unique_ptr< DatabaseFace >( new LevelDB( _path, LevelDB::defaultReadOptions(),
LevelDB::defaultWriteOptions(), LevelDB::defaultDBOptions(), s_reopenPeriodMs ) );
return std::unique_ptr< DatabaseFace >(
new LevelDB( _path, LevelDB::defaultSnapshotReadOptions(),
LevelDB::defaultWriteOptions(), LevelDB::defaultDBOptions(), s_reopenPeriodMs ) );
break;
default:
assert( false );
Expand Down
1 change: 1 addition & 0 deletions libethereum/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ void Client::initStateFromDiskOrGenesis() {
m_state.mutableHistoricState().db().setCommitOnEveryInsert( true );
m_state.populateHistoricStateFromSkaleState();
m_state.mutableHistoricState().db().setCommitOnEveryInsert( false );
exit( 0 );
}
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion libskale/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ skale::OverlayDB State::openDB(

fs::path state_path = path / fs::path( "state" );
try {
m_orig_db.reset( new db::DBImpl( state_path ) );
m_orig_db.reset( new db::DBImpl( state_path, dev::db::LevelDB::defaultSnapshotReadOptions(),
dev::db::LevelDB::defaultWriteOptions(), dev::db::LevelDB::defaultDBOptions() ) );
std::unique_ptr< batched_io::batched_db > bdb = make_unique< batched_io::batched_db >();
bdb->open( m_orig_db );
assert( bdb->is_open() );
Expand Down

0 comments on commit b1562e1

Please sign in to comment.