You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the *usedGas will be acquired by wasmvm/libwasmvm/src/querier.rs/query_raw, as follow
&self,
request: &[u8],
gas_limit: u64,
) -> BackendResult<SystemResult<ContractResult<Binary>>> {
let mut output = UnmanagedVector::default();
let mut error_msg = UnmanagedVector::default();
let mut used_gas = 0_u64;
let go_result: GoError = (self.vtable.query_external)(
self.state,
gas_limit,
&mut used_gas as *mut u64,
U8SliceView::new(Some(request)),
&mut output as *mut UnmanagedVector,
&mut error_msg as *mut UnmanagedVector,
)
.into();
// We destruct the UnmanagedVector here, no matter if we need the data.
let output = output.consume();
let gas_info = GasInfo::with_externally_used(used_gas);
.........
}
the gas_info will return to the cosmwasm, the process in process_gas_info
Is this GasConsumed() correct or not ? @alpe Thanks
The text was updated successfully, but these errors were encountered:
lyh169
changed the title
[Bug] The querier GasConsumed() maybe not correct, maybe cause an attack。
[Bug] The wasmd querier GasConsumed() is not adaptive wasmvm, maybe cause an attack。
Aug 2, 2023
Thanks for bringing this up! 🙏 I am not confident on giving an answer about this. @alpe is on holidays at the moment but he can probably help on this when he is back!
when Execute, need generate the querier.
the newQueryHandler generate a object QueryHandler that implement the Querier interface as follow
the QueryHandler Gasconsumed is as follow.
the *usedGas will be acquired by wasmvm/libwasmvm/src/querier.rs/query_raw, as follow
the gas_info will return to the cosmwasm, the process in process_gas_info
because of this gasUsed is calculate in the sdk gas mode but not WasmVMGas, so it maybe influence the exec。
the store used GasMeter it GasConsumed() function as follow。
Is this GasConsumed() correct or not ? @alpe Thanks
The text was updated successfully, but these errors were encountered: