pub struct ReadWriteSetAnalysis<'a, R: ModuleResolver> { /* private fields */ }
Implementations
sourceimpl<'a, R: MoveResolverExt> ReadWriteSetAnalysis<'a, R>
impl<'a, R: MoveResolverExt> ReadWriteSetAnalysis<'a, R>
sourcepub fn new(
rw: &'a NormalizedReadWriteSetAnalysis,
blockchain_view: &'a R
) -> Self
pub fn new(
rw: &'a NormalizedReadWriteSetAnalysis,
blockchain_view: &'a R
) -> Self
Create a Aptos transaction read/write set analysis from a generic Move module read/write set analysis and a view of the current blockchain for module fetching and access concretization.
sourcepub fn get_keys_written(
&self,
tx: &SignedTransaction
) -> Result<Vec<ResourceKey>>
pub fn get_keys_written(
&self,
tx: &SignedTransaction
) -> Result<Vec<ResourceKey>>
Returns an overapproximation of the ResourceKey
’s in global storage that will be written
by tx
sourcepub fn get_keys_read(&self, tx: &SignedTransaction) -> Result<Vec<ResourceKey>>
pub fn get_keys_read(&self, tx: &SignedTransaction) -> Result<Vec<ResourceKey>>
Returns an overapproximation of the ResourceKey
’s in global storage that will be read
by tx
sourcepub fn get_keys_user_transaction(
&self,
tx: &SignedTransaction
) -> Result<(Vec<ResourceKey>, Vec<ResourceKey>)>
pub fn get_keys_user_transaction(
&self,
tx: &SignedTransaction
) -> Result<(Vec<ResourceKey>, Vec<ResourceKey>)>
Returns an overapproximation of the ResourceKey
’s in global storage that will be read
by tx
. Secondary indexes will be fully resolved by using the global state at
self.blockchain_view
.
Return value will be a tuple where the first item is the read set and the second item is the write set of this transaction.
Note: this will return both writes performed by the transaction prologue/epilogue and by its embedded payload.
sourcepub fn get_partial_keys_user_transaction(
&self,
tx: &SignedTransaction
) -> Result<(Vec<ResourceKey>, Vec<ResourceKey>)>
pub fn get_partial_keys_user_transaction(
&self,
tx: &SignedTransaction
) -> Result<(Vec<ResourceKey>, Vec<ResourceKey>)>
Returns an overapproximation of the ResourceKey
’s in global storage that will be read
by tx
. Only formals and type arguments will be binded and secondary indexes will remain to
be unresolved for better speed performance.
Note: this will return both writes performed by the transaction prologue/epilogue and by its embedded payload.
Methods from Deref<Target = NormalizedReadWriteSetAnalysis>
pub fn trim(&self) -> NormalizedReadWriteSetAnalysis
pub fn trim(&self) -> NormalizedReadWriteSetAnalysis
Trim the analysis result by dropping all the results in the trie. This should not affect the correctness for those non secondary index access as all relevant info should be stored in the root node already. Trimming the result will yield a higher inference speed at runtime.
pub fn get_keys_written(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver
) -> Result<Vec<ResourceKey, Global>, Error>
pub fn get_keys_written(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver
) -> Result<Vec<ResourceKey, Global>, Error>
Returns an overapproximation of the ResourceKey
’s in global storage that will be written
by module::fun
if called with arguments signers
, actuals
, type_actuals
in state
blockchain_view
.
pub fn get_keys_read(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver
) -> Result<Vec<ResourceKey, Global>, Error>
pub fn get_keys_read(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver
) -> Result<Vec<ResourceKey, Global>, Error>
Returns an overapproximation of the ResourceKey
’s in global storage that will be read by
module::fun
if called with arguments signers
, actuals
, type_actuals
in state
blockchain_view
.
pub fn get_concretized_keys(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver,
is_write: bool
) -> Result<Vec<ResourceKey, Global>, Error>
pub fn get_concretized_keys(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver,
is_write: bool
) -> Result<Vec<ResourceKey, Global>, Error>
Returns an overapproximation of the ResourceKey
’s in global storage that will be accesses
by module::funif called with arguments
signers,
actuals,
type_actualsin state
blockchain_view. If
is_write` is true, only ResourceKey’s written will be returned; otherwise, only
ResourceKey’s read will be returned.
pub fn get_concretized_summary(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver
) -> Result<ConcretizedSecondaryIndexes, Error>
pub fn get_concretized_summary(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
blockchain_view: &impl MoveResolver
) -> Result<ConcretizedSecondaryIndexes, Error>
Returns an overapproximation of the access paths in global storage that will be read/written
by module::fun
if called with arguments signers
, actuals
, type_actuals
in state
blockchain_view
.
pub fn get_canonical_summary(
&self,
module: &ModuleId,
fun: &IdentStr
) -> Option<ReadWriteSet>
pub fn get_partially_concretized_summary<R>(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
module_cache: &R
) -> Result<ConcretizedFormals, Error> where
R: GetModule,
pub fn get_partially_concretized_summary<R>(
&self,
module: &ModuleId,
fun: &IdentStr,
signers: &[AccountAddress],
actuals: &[Vec<u8, Global>],
type_actuals: &[TypeTag],
module_cache: &R
) -> Result<ConcretizedFormals, Error> where
R: GetModule,
Returns the access paths in global storage that will be read/written by module::fun
if called with arguments signers
, actuals
, type_actuals
. This will be an overapproximation if module::fun
contains no secondary indexes; otherwise it is neither an overapproximation nor an underapproximation
by module::fun
if called with arguments signers
, actuals
, type_actuals
.
We say “partially concretized” because the summary may contain secondary indexes that require reads from the current blockchain state to be concretized. If desired, the caller can concretized them using
pub fn may_have_secondary_indexes(
&self,
module: &ModuleId,
fun: &IdentStr
) -> Result<bool, Error>
pub fn may_have_secondary_indexes(
&self,
module: &ModuleId,
fun: &IdentStr
) -> Result<bool, Error>
Return true
if module
::fun
may read an address from the blockchain state and
subsequently read/write a resource stored at that address. Return false
if the function
will not do this in any possible concrete execution. Return an error if module
::fun
does
not exist.
Trait Implementations
sourceimpl<'a, R: MoveResolverExt> Deref for ReadWriteSetAnalysis<'a, R>
impl<'a, R: MoveResolverExt> Deref for ReadWriteSetAnalysis<'a, R>
Auto Trait Implementations
impl<'a, R> RefUnwindSafe for ReadWriteSetAnalysis<'a, R> where
R: RefUnwindSafe,
impl<'a, R> Send for ReadWriteSetAnalysis<'a, R> where
R: Sync,
impl<'a, R> Sync for ReadWriteSetAnalysis<'a, R> where
R: Sync,
impl<'a, R> Unpin for ReadWriteSetAnalysis<'a, R>
impl<'a, R> UnwindSafe for ReadWriteSetAnalysis<'a, R> where
R: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more