Skip to content

Commit

Permalink
[starcoin vm] Fix some pr problem
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Jun 21, 2023
1 parent a3012b3 commit 48065ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion vm/vm-runtime/src/data_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<'a, S: StateView> ResourceResolver for RemoteStorage<'a, S> {
self.get(&ap).map_err(|e| e.finish(Location::Undefined))
}
}

// TODO Note for Conflicting: conflicting implementation in crate `starcoin_vm_types`: - impl<V> ConfigStorage for V where V: StateView;
// impl<'a, S: StateView> ConfigStorage for RemoteStorage<'a, S> {
// fn fetch_config(&self, access_path: AccessPath) -> Option<Vec<u8>> {
// self.get(&access_path).ok()?
Expand Down Expand Up @@ -219,6 +219,7 @@ impl<S: StateView> TableResolver for RemoteStorageOwned<S> {
}
}

// TODO Note for Conflicting: conflicting implementation in crate `starcoin_vm_types`: - impl<V> ConfigStorage for V where V: StateView;
// impl<S: StateView> ConfigStorage for RemoteStorageOwned<S> {
// fn fetch_config(&self, access_path: AccessPath) -> Option<Vec<u8>> {
// self.as_move_resolver().fetch_config(access_path)
Expand Down
9 changes: 4 additions & 5 deletions vm/vm-runtime/src/starcoin_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,6 @@ impl StarcoinVM {
MoveValue::U8(chain_id.id()),
MoveValue::U64(parent_gas_used),
]);
//let data_cache = remote_cache.as_move_resolver();
let mut session: SessionAdapter<_> = self.move_vm.new_session(storage, session_id).into();
session
.as_mut()
Expand Down Expand Up @@ -1000,7 +999,7 @@ impl StarcoinVM {
storage: &S,
txn: DryRunTransaction,
) -> Result<(VMStatus, TransactionOutput)> {
// load config by config change event.
// TODO load config by config change event.
self.load_configs(&storage)?;

let gas_params = match self.get_gas_parameters() {
Expand Down Expand Up @@ -1076,7 +1075,8 @@ impl StarcoinVM {
) -> Result<Vec<(VMStatus, TransactionOutput)>> {
let mut data_cache = StateViewCache::new(storage);
let mut result = vec![];
// load config by config change event

// TODO load config by config change event
self.load_configs(&data_cache)?;

let mut gas_left = block_gas_limit.unwrap_or(u64::MAX);
Expand Down Expand Up @@ -1115,7 +1115,7 @@ impl StarcoinVM {
// Push write set to write set
data_cache.push_write_set(output.write_set())
}
// load config by config change event
// TODO load config by config change event
self.check_reconfigure(&data_cache, &output)?;

#[cfg(feature = "metrics")]
Expand Down Expand Up @@ -1307,7 +1307,6 @@ impl StarcoinVM {
storage: &S,
) -> (VMStatus, TransactionOutput) {
gas_meter.set_metering(false);
//let data_cache = remote_cache.as_move_resolver();
let mut session: SessionAdapter<_> = self
.move_vm
.new_session(storage, SessionId::txn_meta(txn_data))
Expand Down

0 comments on commit 48065ba

Please sign in to comment.