Conversation
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
| @@ -0,0 +1,175 @@ | |||
| use reth_db_api::{table::Table, DatabaseError}; | |||
There was a problem hiding this comment.
This file seems stale because we are not using any content of this file anywhere
| @@ -0,0 +1,222 @@ | |||
| use metrics::{Counter, Gauge, Histogram}; | |||
| /// Write options | ||
| write_opts: WriteOptions, | ||
| /// Marker for transaction type | ||
| _marker: PhantomData<bool>, |
| } | ||
|
|
||
| /// Get the column family handle for a table | ||
| fn get_cf<T: Table>(&self) -> Result<CFPtr, DatabaseError> { |
There was a problem hiding this comment.
Why does this function returns raw pointer of cf, instead we can also reference
There was a problem hiding this comment.
I don't remember why I did that... but is was related to internal impl of ColumnFamily which prevents mutable references ig (not remember exactly). Initially I was using references... but later on had to revert to this..
There was a problem hiding this comment.
As this function in used in that places where the reference of cf is created from raw pointer, so I think we can simply replace raw pointer with reference.
| RocksTrieCursorFactory::new(Box::leak(tx)) | ||
| } | ||
|
|
||
| pub fn hashed_cursor_factory(&self) -> RocksHashedCursorFactory<'_> |
There was a problem hiding this comment.
As this function is only expect to be invoked for read modded RocksTransaction so it's would be good to only implement this function for true value of WRITE
| // Convert the raw pointer back to a reference safely | ||
| // This is safe as long as the DB is alive, which it is in this context | ||
| let cf_ptr = self.get_cf::<T>()?; | ||
| let cf = unsafe { &*cf_ptr }; |
There was a problem hiding this comment.
I think this unsafe code can be easily replaced with safe code.
There was a problem hiding this comment.
Is there any safe way to deal with Raw-pointers? Aren't they come other unsafe section of Rust?
There was a problem hiding this comment.
Instead of using raw pointer we can use simple reference
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
|
@vpanchal-supra |
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
|
@vpanchal-supra I have started some review regarding the error. Please have a look at it. Thank You |
This PR is related to
experiment-2inMulti-VM-Experiment